From 6d2ac3ae5ea90263c9a1cdba14273c96da38d2bc Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Mon, 25 Oct 2021 16:35:23 -0700 Subject: [PATCH 001/307] situation multipliers for bike --- src/main/resources/beam-template.conf | 4 + .../beam/agentsim/agents/PersonAgent.scala | 7 +- .../mode/ModeChoiceDriveIfAvailable.scala | 4 +- .../agents/choice/mode/ModeChoiceLCCM.scala | 6 +- .../mode/ModeChoiceMultinomialLogit.scala | 120 +++++++++++------- .../mode/ModeChoiceRideHailIfAvailable.scala | 4 +- .../mode/ModeChoiceTransitIfAvailable.scala | 4 +- .../choice/mode/ModeChoiceUniformRandom.scala | 4 +- .../agents/modalbehaviors/ChoosesMode.scala | 1 + .../modalbehaviors/ModeChoiceCalculator.scala | 45 ++++--- .../scoring/BeamScoringFunctionFactory.scala | 6 +- .../scala/beam/sim/config/BeamConfig.scala | 60 +++++++++ .../sim/population/PopulationAttributes.scala | 76 ++++++++--- 13 files changed, 249 insertions(+), 92 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 22f025e8e52..86b50e8045c 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -64,6 +64,10 @@ beam.agentsim.agents.modalBehaviors.poolingMultiplier.Level5 = "double | 1.0" beam.agentsim.agents.modalBehaviors.poolingMultiplier.Level4 = "double | 1.0" beam.agentsim.agents.modalBehaviors.poolingMultiplier.Level3 = "double | 1.0" beam.agentsim.agents.modalBehaviors.poolingMultiplier.LevelLE2 = "double | 1.0" +beam.agentsim.agents.modalBehaviors.bikeMultiplier.commute.ageGT50 = "double | 1.0" +beam.agentsim.agents.modalBehaviors.bikeMultiplier.noncommute.ageGT50 = "double | 1.0" +beam.agentsim.agents.modalBehaviors.bikeMultiplier.commute.ageLE50 = "double | 1.0" +beam.agentsim.agents.modalBehaviors.bikeMultiplier.noncommute.ageLE50 = "double | 1.0" beam.agentsim.agents.modalBehaviors.highTimeSensitivity.highCongestion.highwayFactor.Level5 = "double | 1.0" beam.agentsim.agents.modalBehaviors.highTimeSensitivity.highCongestion.nonHighwayFactor.Level5 = "double | 1.0" beam.agentsim.agents.modalBehaviors.highTimeSensitivity.lowCongestion.highwayFactor.Level5 = "double | 1.0" diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 96a42d0687a..37568c8c2a7 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1041,7 +1041,12 @@ class PersonAgent( ) val correctedTrip = correctTripEndTime(data.currentTrip.get, tick, body.id, body.beamVehicleType.id) val generalizedTime = - modeChoiceCalculator.getGeneralizedTimeOfTrip(correctedTrip, Some(attributes), nextActivity(data)) + modeChoiceCalculator.getGeneralizedTimeOfTrip( + correctedTrip, + Some(attributes), + nextActivity(data), + Some(currentActivity(data)) + ) val generalizedCost = modeChoiceCalculator.getNonTimeCost(correctedTrip) + attributes .getVOT(generalizedTime) // Correct the trip to deal with ride hail / disruptions and then register to skimmer diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceDriveIfAvailable.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceDriveIfAvailable.scala index 385d4678fbf..46ea6d4a90c 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceDriveIfAvailable.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceDriveIfAvailable.scala @@ -22,6 +22,7 @@ class ModeChoiceDriveIfAvailable(val beamServices: BeamServices) extends ModeCho alternatives: IndexedSeq[EmbodiedBeamTrip], attributesOfIndividual: AttributesOfIndividual, destinationActivity: Option[Activity], + originActivity: Option[Activity], person: Option[Person] = None ): Option[EmbodiedBeamTrip] = { val containsDriveAlt = alternatives.zipWithIndex.collect { @@ -39,7 +40,8 @@ class ModeChoiceDriveIfAvailable(val beamServices: BeamServices) extends ModeCho override def utilityOf( alternative: EmbodiedBeamTrip, attributesOfIndividual: AttributesOfIndividual, - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] ): Double = 0.0 override def utilityOf( diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceLCCM.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceLCCM.scala index feee6cc493a..697f466a79d 100644 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceLCCM.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceLCCM.scala @@ -55,6 +55,7 @@ class ModeChoiceLCCM( alternatives: IndexedSeq[EmbodiedBeamTrip], attributesOfIndividual: AttributesOfIndividual, destinationActivity: Option[Activity], + originActivity: Option[Activity], person: Option[Person] = None ): Option[EmbodiedBeamTrip] = { choose(alternatives, attributesOfIndividual, Mandatory) @@ -284,7 +285,8 @@ class ModeChoiceLCCM( override def utilityOf( alternative: EmbodiedBeamTrip, attributesOfIndividual: AttributesOfIndividual, - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] ): Double = 0.0 override def computeAllDayUtility( @@ -303,7 +305,7 @@ class ModeChoiceLCCM( } .toMap .mapValues(modeChoiceCalculatorForStyle => - trips.map(trip => modeChoiceCalculatorForStyle.utilityOf(trip, attributesOfIndividual, None)).sum + trips.map(trip => modeChoiceCalculatorForStyle.utilityOf(trip, attributesOfIndividual, None, None)).sum ) .toArray .toMap // to force computation DO NOT TOUCH IT, because here is call-by-name and it's lazy which will hold a lot of memory !!! :) diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala index 901a743c2b9..dd21c6a5532 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala @@ -1,6 +1,5 @@ package beam.agentsim.agents.choice.mode -import scala.collection.mutable import scala.collection.mutable.ListBuffer import beam.agentsim.agents.choice.logit import beam.agentsim.agents.choice.logit._ @@ -48,12 +47,14 @@ class ModeChoiceMultinomialLogit( alternatives: IndexedSeq[EmbodiedBeamTrip], attributesOfIndividual: AttributesOfIndividual, destinationActivity: Option[Activity], + originActivity: Option[Activity], person: Option[Person] = None ): Option[EmbodiedBeamTrip] = { if (alternatives.isEmpty) { None } else { - val modeCostTimeTransfers = altsToModeCostTimeTransfers(alternatives, attributesOfIndividual, destinationActivity) + val modeCostTimeTransfers = + altsToModeCostTimeTransfers(alternatives, attributesOfIndividual, destinationActivity, originActivity) val bestInGroup = modeCostTimeTransfers groupBy (_.embodiedBeamTrip.tripClassifier) map { case (_, group) => findBestIn(group) @@ -192,18 +193,21 @@ class ModeChoiceMultinomialLogit( override def getGeneralizedTimeOfTrip( embodiedBeamTrip: EmbodiedBeamTrip, attributesOfIndividual: Option[AttributesOfIndividual], - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] = None ): Double = { - getGeneralizedTimeOfTripInHours(embodiedBeamTrip, attributesOfIndividual, destinationActivity) + getGeneralizedTimeOfTripInHours(embodiedBeamTrip, attributesOfIndividual, destinationActivity, originActivity) } private def getGeneralizedTimeOfTripInHours( embodiedBeamTrip: EmbodiedBeamTrip, attributesOfIndividual: Option[AttributesOfIndividual], destinationActivity: Option[Activity], + originActivity: Option[Activity], adjustSpecialBikeLines: Boolean = false ): Double = { val adjustedTripDuration = if (adjustSpecialBikeLines && embodiedBeamTrip.tripClassifier == BIKE) { + // TODO: Use situation multipliers for this calculateBeamTripTimeInSecsWithSpecialBikeLanesAdjustment(embodiedBeamTrip, bikeLanesAdjustment) } else { embodiedBeamTrip.legs.map(_.beamLeg.duration).sum @@ -215,14 +219,15 @@ class ModeChoiceMultinomialLogit( } else { 1d } - getGeneralizedTimeOfLeg(x, attributesOfIndividual, destinationActivity) * factor + getGeneralizedTimeOfLeg(x, attributesOfIndividual, destinationActivity, originActivity) * factor }.sum + getGeneralizedTime(waitingTime, None, None) } override def getGeneralizedTimeOfLeg( embodiedBeamLeg: EmbodiedBeamLeg, attributesOfIndividual: Option[AttributesOfIndividual], - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] = None ): Double = { attributesOfIndividual match { case Some(attributes) => @@ -230,7 +235,8 @@ class ModeChoiceMultinomialLogit( embodiedBeamLeg, this, beamServices, - destinationActivity + destinationActivity, + originActivity ) case None => embodiedBeamLeg.beamLeg.duration * modeMultipliers.getOrElse(Some(embodiedBeamLeg.beamLeg.mode), 1.0) / 3600 @@ -248,7 +254,8 @@ class ModeChoiceMultinomialLogit( private def altsToModeCostTimeTransfers( alternatives: IndexedSeq[EmbodiedBeamTrip], attributesOfIndividual: AttributesOfIndividual, - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] ): IndexedSeq[ModeCostTimeTransfer] = { alternatives.zipWithIndex.map { altAndIdx => val mode = altAndIdx._1.tripClassifier @@ -285,6 +292,7 @@ class ModeChoiceMultinomialLogit( altAndIdx._1, Some(attributesOfIndividual), destinationActivity, + originActivity, adjustSpecialBikeLines = true ) ) @@ -304,8 +312,8 @@ class ModeChoiceMultinomialLogit( } } - lazy val modeMultipliers: mutable.Map[Option[BeamMode], Double] = - mutable.Map[Option[BeamMode], Double]( + lazy val modeMultipliers: Map[Option[BeamMode], Double] = + Map[Option[BeamMode], Double]( Some(TRANSIT) -> modalBehaviors.modeVotMultiplier.transit, Some(RIDE_HAIL) -> modalBehaviors.modeVotMultiplier.rideHail, Some(RIDE_HAIL_POOLED) -> modalBehaviors.modeVotMultiplier.rideHailPooled, @@ -318,217 +326,231 @@ class ModeChoiceMultinomialLogit( None -> modalBehaviors.modeVotMultiplier.waiting ) - lazy val poolingMultipliers: mutable.Map[automationLevel, Double] = - mutable.Map[automationLevel, Double]( + lazy val poolingMultipliers: Map[AutomationLevel, Double] = + Map[AutomationLevel, Double]( levelLE2 -> modalBehaviors.poolingMultiplier.LevelLE2, level3 -> modalBehaviors.poolingMultiplier.Level3, level4 -> modalBehaviors.poolingMultiplier.Level4, level5 -> modalBehaviors.poolingMultiplier.Level5 ) - lazy val situationMultipliers: mutable.Map[(timeSensitivity, congestionLevel, roadwayType, automationLevel), Double] = - mutable.Map[(timeSensitivity, congestionLevel, roadwayType, automationLevel), Double]( - ( + lazy val situationMultipliers: Map[BeamMode, Map[Set[SituationMultiplier], Double]] = { + val carMap = Map[Set[SituationMultiplier], Double]( + Set( highSensitivity, highCongestion, highway, levelLE2 ) -> modalBehaviors.highTimeSensitivity.highCongestion.highwayFactor.LevelLE2, - ( + Set( highSensitivity, highCongestion, nonHighway, levelLE2 ) -> modalBehaviors.highTimeSensitivity.highCongestion.nonHighwayFactor.LevelLE2, - ( + Set( highSensitivity, lowCongestion, highway, levelLE2 ) -> modalBehaviors.highTimeSensitivity.lowCongestion.highwayFactor.LevelLE2, - ( + Set( highSensitivity, lowCongestion, nonHighway, levelLE2 ) -> modalBehaviors.highTimeSensitivity.lowCongestion.nonHighwayFactor.LevelLE2, - ( + Set( lowSensitivity, highCongestion, highway, levelLE2 ) -> modalBehaviors.lowTimeSensitivity.highCongestion.highwayFactor.LevelLE2, - ( + Set( lowSensitivity, highCongestion, nonHighway, levelLE2 ) -> modalBehaviors.lowTimeSensitivity.highCongestion.nonHighwayFactor.LevelLE2, - ( + Set( lowSensitivity, lowCongestion, highway, levelLE2 ) -> modalBehaviors.lowTimeSensitivity.lowCongestion.highwayFactor.LevelLE2, - ( + Set( lowSensitivity, lowCongestion, nonHighway, levelLE2 ) -> modalBehaviors.lowTimeSensitivity.lowCongestion.nonHighwayFactor.LevelLE2, - ( + Set( highSensitivity, highCongestion, highway, level3 ) -> modalBehaviors.highTimeSensitivity.highCongestion.highwayFactor.Level3, - ( + Set( highSensitivity, highCongestion, nonHighway, level3 ) -> modalBehaviors.highTimeSensitivity.highCongestion.nonHighwayFactor.Level3, - ( + Set( highSensitivity, lowCongestion, highway, level3 ) -> modalBehaviors.highTimeSensitivity.lowCongestion.highwayFactor.Level3, - ( + Set( highSensitivity, lowCongestion, nonHighway, level3 ) -> modalBehaviors.highTimeSensitivity.lowCongestion.nonHighwayFactor.Level3, - ( + Set( lowSensitivity, highCongestion, highway, level3 ) -> modalBehaviors.lowTimeSensitivity.highCongestion.highwayFactor.Level3, - ( + Set( lowSensitivity, highCongestion, nonHighway, level3 ) -> modalBehaviors.lowTimeSensitivity.highCongestion.nonHighwayFactor.Level3, - ( + Set( lowSensitivity, lowCongestion, highway, level3 ) -> modalBehaviors.lowTimeSensitivity.lowCongestion.highwayFactor.Level3, - ( + Set( lowSensitivity, lowCongestion, nonHighway, level3 ) -> modalBehaviors.lowTimeSensitivity.lowCongestion.nonHighwayFactor.Level3, - ( + Set( highSensitivity, highCongestion, highway, level4 ) -> modalBehaviors.highTimeSensitivity.highCongestion.highwayFactor.Level4, - ( + Set( highSensitivity, highCongestion, nonHighway, level4 ) -> modalBehaviors.highTimeSensitivity.highCongestion.nonHighwayFactor.Level4, - ( + Set( highSensitivity, lowCongestion, highway, level4 ) -> modalBehaviors.highTimeSensitivity.lowCongestion.highwayFactor.Level4, - ( + Set( highSensitivity, lowCongestion, nonHighway, level4 ) -> modalBehaviors.highTimeSensitivity.lowCongestion.nonHighwayFactor.Level4, - ( + Set( lowSensitivity, highCongestion, highway, level4 ) -> modalBehaviors.lowTimeSensitivity.highCongestion.highwayFactor.Level4, - ( + Set( lowSensitivity, highCongestion, nonHighway, level4 ) -> modalBehaviors.lowTimeSensitivity.highCongestion.nonHighwayFactor.Level4, - ( + Set( lowSensitivity, lowCongestion, highway, level4 ) -> modalBehaviors.lowTimeSensitivity.lowCongestion.highwayFactor.Level4, - ( + Set( lowSensitivity, lowCongestion, nonHighway, level4 ) -> modalBehaviors.lowTimeSensitivity.lowCongestion.nonHighwayFactor.Level4, - ( + Set( highSensitivity, highCongestion, highway, level5 ) -> modalBehaviors.highTimeSensitivity.highCongestion.highwayFactor.Level5, - ( + Set( highSensitivity, highCongestion, nonHighway, level5 ) -> modalBehaviors.highTimeSensitivity.highCongestion.nonHighwayFactor.Level5, - ( + Set( highSensitivity, lowCongestion, highway, level5 ) -> modalBehaviors.highTimeSensitivity.lowCongestion.highwayFactor.Level5, - ( + Set( highSensitivity, lowCongestion, nonHighway, level5 ) -> modalBehaviors.highTimeSensitivity.lowCongestion.nonHighwayFactor.Level5, - ( + Set( lowSensitivity, highCongestion, highway, level5 ) -> modalBehaviors.lowTimeSensitivity.highCongestion.highwayFactor.Level5, - ( + Set( lowSensitivity, highCongestion, nonHighway, level5 ) -> modalBehaviors.lowTimeSensitivity.highCongestion.nonHighwayFactor.Level5, - ( + Set( lowSensitivity, lowCongestion, highway, level5 ) -> modalBehaviors.lowTimeSensitivity.lowCongestion.highwayFactor.Level5, - ( + Set( lowSensitivity, lowCongestion, nonHighway, level5 ) -> modalBehaviors.lowTimeSensitivity.lowCongestion.nonHighwayFactor.Level5 ) + val bikeMap = Map[Set[SituationMultiplier], Double]( + Set(commuteTrip, ageLE50) -> modalBehaviors.bikeMultiplier.commute.ageLE50, + Set(commuteTrip, ageGT50) -> modalBehaviors.bikeMultiplier.commute.ageGT50, + Set(nonCommuteTrip, ageLE50) -> modalBehaviors.bikeMultiplier.noncommute.ageLE50, + Set(nonCommuteTrip, ageGT50) -> modalBehaviors.bikeMultiplier.noncommute.ageLE50 + ) + Map(BIKE -> bikeMap, CAR -> carMap) + } override def utilityOf( alternative: EmbodiedBeamTrip, attributesOfIndividual: AttributesOfIndividual, - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] ): Double = { val modeCostTimeTransfer = - altsToModeCostTimeTransfers(IndexedSeq(alternative), attributesOfIndividual, destinationActivity).head + altsToModeCostTimeTransfers( + IndexedSeq(alternative), + attributesOfIndividual, + destinationActivity, + originActivity + ).head utilityOf(modeCostTimeTransfer) } @@ -560,7 +582,7 @@ class ModeChoiceMultinomialLogit( trips: ListBuffer[EmbodiedBeamTrip], person: Person, attributesOfIndividual: AttributesOfIndividual - ): Double = trips.map(utilityOf(_, attributesOfIndividual, None)).sum // TODO: Update with destination activity + ): Double = trips.map(utilityOf(_, attributesOfIndividual, None, None)).sum // TODO: Update with destination activity } object ModeChoiceMultinomialLogit { diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceRideHailIfAvailable.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceRideHailIfAvailable.scala index 447cd848803..5cb7aa10785 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceRideHailIfAvailable.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceRideHailIfAvailable.scala @@ -23,6 +23,7 @@ class ModeChoiceRideHailIfAvailable(val beamServices: BeamServices) extends Mode alternatives: IndexedSeq[EmbodiedBeamTrip], attributesOfIndividual: AttributesOfIndividual, destinationActivity: Option[Activity], + originActivity: Option[Activity], person: Option[Person] = None ): Option[EmbodiedBeamTrip] = { val containsRideHailAlt = alternatives.zipWithIndex.collect { @@ -40,7 +41,8 @@ class ModeChoiceRideHailIfAvailable(val beamServices: BeamServices) extends Mode override def utilityOf( alternative: EmbodiedBeamTrip, attributesOfIndividual: AttributesOfIndividual, - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] ): Double = 0.0 override def utilityOf( diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceTransitIfAvailable.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceTransitIfAvailable.scala index 39dd3760a7c..2bf8b7438bf 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceTransitIfAvailable.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceTransitIfAvailable.scala @@ -25,6 +25,7 @@ class ModeChoiceTransitIfAvailable(val beamServices: BeamServices) extends ModeC alternatives: IndexedSeq[EmbodiedBeamTrip], attributesOfIndividual: AttributesOfIndividual, destinationActivity: Option[Activity], + originActivity: Option[Activity], person: Option[Person] = None ): Option[EmbodiedBeamTrip] = { val containsTransitAlt = alternatives.zipWithIndex.collect { @@ -42,7 +43,8 @@ class ModeChoiceTransitIfAvailable(val beamServices: BeamServices) extends ModeC override def utilityOf( alternative: EmbodiedBeamTrip, attributesOfIndividual: AttributesOfIndividual, - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] ): Double = 0.0 override def utilityOf( diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceUniformRandom.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceUniformRandom.scala index 2b8fac5184a..71ce672db60 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceUniformRandom.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceUniformRandom.scala @@ -18,6 +18,7 @@ class ModeChoiceUniformRandom(val beamConfig: BeamConfig) extends ModeChoiceCalc alternatives: IndexedSeq[EmbodiedBeamTrip], attributesOfIndividual: AttributesOfIndividual, destinationActivity: Option[Activity], + originActivity: Option[Activity], person: Option[Person] = None ): Option[EmbodiedBeamTrip] = { if (alternatives.nonEmpty) { @@ -30,7 +31,8 @@ class ModeChoiceUniformRandom(val beamConfig: BeamConfig) extends ModeChoiceCalc override def utilityOf( alternative: EmbodiedBeamTrip, attributesOfIndividual: AttributesOfIndividual, - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] ): Double = 0.0 override def utilityOf( diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index 3591513304f..bdd89e73533 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -1228,6 +1228,7 @@ trait ChoosesMode { filteredItinerariesForChoice, attributesOfIndividual, nextActivity(choosesModeData.personData), + Some(currentActivity(choosesModeData.personData)), Some(matsimPlan.getPerson) ) match { case Some(chosenTrip) => diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala index bf42fd151f4..79bc4741c7e 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala @@ -30,7 +30,8 @@ trait ModeChoiceCalculator { def getGeneralizedTimeOfTrip( embodiedBeamTrip: EmbodiedBeamTrip, attributesOfIndividual: Option[AttributesOfIndividual] = None, - destinationActivity: Option[Activity] = None + destinationActivity: Option[Activity] = None, + originActivity: Option[Activity] = None ): Double = { embodiedBeamTrip.totalTravelTimeInSecs / 3600 } @@ -38,7 +39,8 @@ trait ModeChoiceCalculator { def getGeneralizedTimeOfLeg( embodiedBeamLeg: EmbodiedBeamLeg, attributesOfIndividual: Option[AttributesOfIndividual], - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] = None ): Double = { embodiedBeamLeg.beamLeg.duration / 3600 } @@ -55,13 +57,15 @@ trait ModeChoiceCalculator { alternatives: IndexedSeq[EmbodiedBeamTrip], attributesOfIndividual: AttributesOfIndividual, destinationActivity: Option[Activity], + originActivity: Option[Activity], person: Option[Person] = None ): Option[EmbodiedBeamTrip] def utilityOf( alternative: EmbodiedBeamTrip, attributesOfIndividual: AttributesOfIndividual, - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] ): Double def utilityOf( @@ -174,18 +178,25 @@ object ModeChoiceCalculator { case object DriveToTransit extends ModeVotMultiplier case object RideHail extends ModeVotMultiplier // No separate ride hail to transit VOT case object Bike extends ModeVotMultiplier - sealed trait timeSensitivity - case object highSensitivity extends timeSensitivity - case object lowSensitivity extends timeSensitivity - sealed trait congestionLevel - case object highCongestion extends congestionLevel - case object lowCongestion extends congestionLevel - sealed trait roadwayType - case object highway extends roadwayType - case object nonHighway extends roadwayType - sealed trait automationLevel - case object levelLE2 extends automationLevel - case object level3 extends automationLevel - case object level4 extends automationLevel - case object level5 extends automationLevel + sealed trait SituationMultiplier extends Product with Serializable + sealed trait TripType extends SituationMultiplier + case object commuteTrip extends TripType + case object nonCommuteTrip extends TripType + sealed trait AgeGroup extends SituationMultiplier + case object ageGT50 extends AgeGroup + case object ageLE50 extends AgeGroup + sealed trait TimeSensitivity extends SituationMultiplier + case object highSensitivity extends TimeSensitivity + case object lowSensitivity extends TimeSensitivity + sealed trait CongestionLevel extends SituationMultiplier + case object highCongestion extends CongestionLevel + case object lowCongestion extends CongestionLevel + sealed trait RoadwayType extends SituationMultiplier + case object highway extends RoadwayType + case object nonHighway extends RoadwayType + sealed trait AutomationLevel extends SituationMultiplier + case object levelLE2 extends AutomationLevel + case object level3 extends AutomationLevel + case object level4 extends AutomationLevel + case object level5 extends AutomationLevel } diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index f68a0b83a78..56bb34a164a 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -189,10 +189,14 @@ class BeamScoringFunctionFactory @Inject() ( .filter(_.isInstanceOf[Activity]) .map(_.asInstanceOf[Activity]) .lift(tripIndex + 1) + val tripOrigin = person.getSelectedPlan.getPlanElements.asScala + .filter(_.isInstanceOf[Activity]) + .map(_.asInstanceOf[Activity]) + .lift(tripIndex) val departureTime = trip.legs.headOption.map(_.beamLeg.startTime.toString).getOrElse("") val totalTravelTimeInSecs = trip.totalTravelTimeInSecs val mode = trip.tripClassifier - val score = modeChoiceCalculator.utilityOf(trip, attributes, tripPurpose) + val score = modeChoiceCalculator.utilityOf(trip, attributes, tripPurpose, tripOrigin) val cost = trip.costEstimate s"$personId,$tripIndex,$departureTime,$totalTravelTimeInSecs,$mode,$cost,$score" } mkString "\n" diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 9607b468c81..7ea2cb17fac 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -150,6 +150,7 @@ object BeamConfig { } case class ModalBehaviors( + bikeMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier, defaultValueOfTime: scala.Double, highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, @@ -166,6 +167,61 @@ object BeamConfig { object ModalBehaviors { + case class BikeMultiplier( + commute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute, + noncommute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute + ) + + object BikeMultiplier { + + case class Commute( + ageGT50: scala.Double, + ageLE50: scala.Double + ) + + object Commute { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute = { + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( + ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ) + } + } + + case class Noncommute( + ageGT50: scala.Double, + ageLE50: scala.Double + ) + + object Noncommute { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute = { + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( + ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ) + } + } + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier = { + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( + commute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( + if (c.hasPathOrNull("commute")) c.getConfig("commute") + else com.typesafe.config.ConfigFactory.parseString("commute{}") + ), + noncommute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( + if (c.hasPathOrNull("noncommute")) c.getConfig("noncommute") + else com.typesafe.config.ConfigFactory.parseString("noncommute{}") + ) + ) + } + } + case class HighTimeSensitivity( highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion @@ -618,6 +674,10 @@ object BeamConfig { def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( + bikeMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( + if (c.hasPathOrNull("bikeMultiplier")) c.getConfig("bikeMultiplier") + else com.typesafe.config.ConfigFactory.parseString("bikeMultiplier{}") + ), defaultValueOfTime = if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index 019459e91e8..af089581ecc 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -14,7 +14,6 @@ import org.matsim.households.Income.IncomePeriod import org.matsim.households.{Household, IncomeImpl} import scala.collection.JavaConverters._ -import scala.collection.mutable sealed trait PopulationAttributes @@ -55,23 +54,23 @@ case class AttributesOfIndividual( val vehicleAutomationLevel = getAutomationLevel(beamVehicleTypeId, beamServices) if (isRideHail) { if (isPooledTrip) { - getModeVotMultiplier(Option(RIDE_HAIL_POOLED), modeChoiceModel.modeMultipliers) * + getModeVotMultiplier(Option(RIDE_HAIL_POOLED), modeChoiceModel) * getPooledFactor(vehicleAutomationLevel, modeChoiceModel.poolingMultipliers) } else { - getModeVotMultiplier(Option(RIDE_HAIL), modeChoiceModel.modeMultipliers) + getModeVotMultiplier(Option(RIDE_HAIL), modeChoiceModel) } } else { getSituationMultiplier( IdAndTT._1, IdAndTT._2, isWorkTrip, - modeChoiceModel.situationMultipliers, + modeChoiceModel.situationMultipliers(beamMode), vehicleAutomationLevel, beamServices - ) * getModeVotMultiplier(Option(CAR), modeChoiceModel.modeMultipliers) + ) * getModeVotMultiplier(Option(CAR), modeChoiceModel) } case _ => - getModeVotMultiplier(Option(beamMode), modeChoiceModel.modeMultipliers) + getModeVotMultiplier(Option(beamMode), modeChoiceModel) } multiplier * IdAndTT._2 / 3600 } @@ -80,7 +79,8 @@ case class AttributesOfIndividual( embodiedBeamLeg: EmbodiedBeamLeg, modeChoiceModel: ModeChoiceMultinomialLogit, beamServices: BeamServices, - destinationActivity: Option[Activity] + destinationActivity: Option[Activity], + originActivity: Option[Activity] ): Double = { //NOTE: This gives answers in hours embodiedBeamLeg.beamLeg.mode match { @@ -100,8 +100,12 @@ case class AttributesOfIndividual( embodiedBeamLeg.isPooledTrip ) ) + case BIKE => + val situation = getSituationForVOT(destinationActivity, originActivity) + getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel, Some(situation)) * + embodiedBeamLeg.beamLeg.duration / 3600 case _ => - getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel.modeMultipliers) * + getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel) * embodiedBeamLeg.beamLeg.duration / 3600 } } @@ -110,10 +114,37 @@ case class AttributesOfIndividual( valueOfTime * generalizedTime } + private def getSituationForVOT( + destinationActivity: Option[Activity], + originActivity: Option[Activity] + ): Set[SituationMultiplier] = { + (destinationActivity, originActivity, age) match { + case (Some(origin), Some(destination), Some(travelerAge)) => + val ageBin = + if (travelerAge > 50) { ageGT50 } + else { ageLE50 } + if (isCommute(destination, origin)) { + Set[SituationMultiplier](commuteTrip, ageBin) + } else { + Set[SituationMultiplier](nonCommuteTrip, ageBin) + } + case _ => + Set[SituationMultiplier]() + } + } + + def isCommute(destinationActivity: Activity, originActivity: Activity): Boolean = { + val homeToWork = + originActivity.getType.equalsIgnoreCase("home") && destinationActivity.getType.equalsIgnoreCase("work") + val workToHome = + originActivity.getType.equalsIgnoreCase("work") && destinationActivity.getType.equalsIgnoreCase("home") + homeToWork || workToHome + } + private def getAutomationLevel( beamVehicleTypeId: Id[BeamVehicleType], beamServices: BeamServices - ): automationLevel = { + ): AutomationLevel = { val automationInt = if (beamServices.beamConfig.beam.agentsim.agents.modalBehaviors.overrideAutomationForVOTT) { beamServices.beamConfig.beam.agentsim.agents.modalBehaviors.overrideAutomationLevel } else { @@ -136,14 +167,23 @@ case class AttributesOfIndividual( def getModeVotMultiplier( beamMode: Option[BeamMode], - modeMultipliers: mutable.Map[Option[BeamMode], Double] + modeChoiceModel: ModeChoiceMultinomialLogit, + situation: Option[Set[SituationMultiplier]] = None ): Double = { - modeMultipliers.getOrElse(beamMode, 1.0) + val situationMultiplier = beamMode match { + case Some(mode) => + situation match { + case Some(situation) => modeChoiceModel.situationMultipliers.getOrElse(mode, Map()).getOrElse(situation, 1.0) + case None => 1.0 + } + case None => 1.0 + } + situationMultiplier * modeChoiceModel.modeMultipliers.getOrElse(beamMode, 1.0) } private def getPooledFactor( - vehicleAutomationLevel: automationLevel, - poolingMultipliers: mutable.Map[automationLevel, Double] + vehicleAutomationLevel: AutomationLevel, + poolingMultipliers: Map[AutomationLevel, Double] ): Double = { poolingMultipliers.getOrElse(vehicleAutomationLevel, 1.0) } @@ -152,7 +192,7 @@ case class AttributesOfIndividual( linkID: Int, travelTime: Double, beamServices: BeamServices - ): (congestionLevel, roadwayType) = { + ): (CongestionLevel, RoadwayType) = { // Note: cutoffs for congested (2/3 free flow speed) and highway (ff speed > 20 m/s) are arbitrary and could be inputs val currentLink = beamServices.networkHelper.getLink(linkID).get val freeSpeed: Double = currentLink.getFreespeed() @@ -177,17 +217,17 @@ case class AttributesOfIndividual( linkID: Int, travelTime: Double, isWorkTrip: Boolean = true, - situationMultipliers: mutable.Map[(timeSensitivity, congestionLevel, roadwayType, automationLevel), Double], - vehicleAutomationLevel: automationLevel, + situationMultipliers: Map[Set[SituationMultiplier], Double], + vehicleAutomationLevel: AutomationLevel, beamServices: BeamServices ): Double = { - val sensitivity: timeSensitivity = if (isWorkTrip) { + val sensitivity: TimeSensitivity = if (isWorkTrip) { highSensitivity } else { lowSensitivity } val (congestion, roadway) = getLinkCharacteristics(linkID, travelTime, beamServices) - situationMultipliers.getOrElse((sensitivity, congestion, roadway, vehicleAutomationLevel), 1.0) + situationMultipliers.getOrElse(Set(sensitivity, congestion, roadway, vehicleAutomationLevel), 1.0) } } From bfaf3eba02ea913dc04ae4833e27334e99825df3 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 16 Nov 2021 22:11:41 -0800 Subject: [PATCH 002/307] merging from production gemini develop --- .gitignore | 2 + .gitmodules | 16 - AMI_Cleanup.py | 2 +- aws/build.gradle | 8 +- .../python/beam_lambda/lambda_function.py | 90 +-- .../main/python/runPilates/lambda_function.py | 22 +- build.gradle | 8 +- docs/developers.rst | 67 +-- gradle.deploy.properties | 29 +- gradle.deployPILATES.properties | 3 +- gradle.properties | 3 + nersc/build.gradle | 4 +- nersc/src/main/bash/run_beam_on_nersc.sh | 4 - nersc/src/main/docker/entrypoint.sh | 12 - prepare_for_pack/prepare_archive.sh | 13 + src/main/R/freight/freight-processing.R | 209 +++++++ src/main/R/gemini/gemini-main.R | 113 +++- src/main/R/gemini/gemini-processing.R | 345 ++++++++++-- src/main/R/gemini/gemini-utils.R | 63 ++- .../events/handling/BeamEventsLogger.java | 3 + src/main/python/gemini/beam_pydss_broker.py | 2 +- .../python/gemini/beam_pydss_processing.py | 4 +- .../python/gemini/beam_to_pydss_federate.py | 47 +- src/main/python/gemini/events_processing.py | 14 +- .../unlimited_charging_infrastructure.py | 25 +- .../simulation_health_analysis.py | 12 +- .../nhts_analysis/get-NHTS-mode_choice.py | 279 +++++++++ src/main/resources/beam-template.conf | 14 +- .../beam/agentsim/agents/PersonAgent.scala | 208 +++++-- .../beam/agentsim/agents/Population.scala | 5 +- .../mode/ModeChoiceMultinomialLogit.scala | 20 +- .../agents/household/HouseholdActor.scala | 129 ++++- .../household/HouseholdFleetManager.scala | 104 +++- .../agents/modalbehaviors/ChoosesMode.scala | 370 +++++++++--- .../agents/modalbehaviors/DrivesVehicle.scala | 72 ++- .../modalbehaviors/ModeChoiceCalculator.scala | 1 - .../agents/parking/ChoosesParking.scala | 24 +- .../agents/ridehail/RideHailAgent.scala | 23 +- .../RideHailIterationsStatsCollector.scala | 3 +- ...rseSquareDistanceRepositioningFactor.scala | 1 - .../agents/vehicles/BeamVehicle.scala | 14 +- .../agentsim/events/PathTraversalEvent.scala | 10 +- .../agentsim/events/RefuelSessionEvent.scala | 5 +- .../agentsim/events/TeleportationEvent.scala | 61 ++ .../infrastructure/ChargingFunctions.scala | 2 +- .../infrastructure/ChargingNetwork.scala | 28 +- .../ChargingNetworkManager.scala | 340 +++-------- .../ChargingNetworkManagerHelper.scala | 251 +++++++++ .../InfrastructureFunctions.scala | 2 +- .../infrastructure/InfrastructureUtils.scala | 158 +++--- .../infrastructure/ParkingFunctions.scala | 6 +- .../infrastructure/ParkingInquiry.scala | 32 +- .../infrastructure/ScaleUpCharging.scala | 349 ++++++++++++ .../parking/ParkingZoneFileUtils.scala | 16 +- .../power/PowerController.scala | 105 ++-- .../power/SitePowerManager.scala | 75 +-- .../agentsim/infrastructure/taz/TAZ.scala | 2 - .../beam/analysis/DelayMetricAnalysis.scala | 7 +- .../beam/analysis/ParkingStatsCollector.scala | 32 +- src/main/scala/beam/router/Modes.scala | 43 +- .../scala/beam/router/RoutingWorker.scala | 10 +- .../scala/beam/router/cch/CchWrapper.scala | 12 +- .../graphhopper/GraphHopperWrapper.scala | 5 +- .../beam/router/model/EmbodiedBeamLeg.scala | 2 +- .../beam/router/model/EmbodiedBeamTrip.scala | 17 +- .../scala/beam/router/r5/R5Parameters.scala | 2 +- src/main/scala/beam/router/r5/R5Wrapper.scala | 14 +- .../beam/router/r5/WorkerParameters.scala | 2 +- .../router/skim/ActivitySimPathType.scala | 7 +- .../scala/beam/router/skim/SkimsUtils.scala | 5 +- src/main/scala/beam/sim/BeamHelper.scala | 6 +- .../scala/beam/sim/config/BeamConfig.scala | 56 ++ .../PercentagePopulationAdjustment.scala | 7 +- .../sim/population/PopulationAttributes.scala | 2 +- .../sim/vehicles/VehiclesAdjustment.scala | 3 +- .../FixedNonReservingFleetManager.scala | 2 +- .../InexhaustibleReservingFleetManager.scala | 2 +- .../scala/beam/utils/BeamVehicleUtils.scala | 27 - src/main/scala/beam/utils/IdGenerator.scala | 8 + .../scala/beam/utils/Network2ShapeFile.scala | 189 ------- .../beam/utils/TravelTimeGoogleApp.scala | 8 +- .../csv/readers/BeamCsvScenarioReader.scala | 2 +- .../utils/csv/writers/PlansCsvWriter.scala | 4 +- .../data/synthpop/IndustryAssigner.scala | 3 +- .../beam/utils/data/synthpop/ODSampler.scala | 2 - .../synthpop/PumaLevelScenarioGenerator.scala | 20 +- .../data/synthpop/ScenarioGenerator.scala | 33 +- .../beam/utils/map/ActivitiesClustering.scala | 2 +- .../utils/map/RepositioningAnalyzer.scala | 2 +- .../utils/plan/sampling/PlansSamplerApp.scala | 6 +- .../utils/scenario/BeamScenarioLoader.scala | 4 +- .../scala/beam/utils/scenario/Models.scala | 17 +- .../scenario/PreviousRunPlanMerger.scala | 7 +- .../scenario/UrbanSimScenarioLoader.scala | 18 +- .../generic/GenericScenarioSource.scala | 2 +- .../generic/readers/PlanElementReader.scala | 6 +- .../urbansim/HOVModeTransformer.scala | 419 ++++++++++++++ .../urbansim/UrbanSimScenarioSource.scala | 2 +- .../censusblock/EntityTransformer.scala | 24 +- .../censusblock/ScenarioAdjuster.scala | 16 +- .../censusblock/UrbansimReaderV2.scala | 4 +- .../censusblock/entities/InputHousehold.scala | 4 +- .../censusblock/merger/PlanMerger.scala | 2 +- .../agentsim/agents/PersonAgentSpec.scala | 12 +- .../agents/PersonAndTransitDriverSpec.scala | 6 +- .../PersonWithPersonalVehiclePlanSpec.scala | 130 ++++- .../agents/PersonWithVehicleSharingSpec.scala | 12 +- .../agentsim/agents/TeleportationSpec.scala | 112 ++++ .../ChargingNetworkManagerSpec.scala | 34 +- .../ParallelParkingManagerSpec.scala | 3 +- .../ZonalParkingManagerSpec.scala | 2 +- .../power/PowerControllerSpec.scala | 29 +- .../power/SitePowerManagerSpec.scala | 34 +- .../SimpleRideHailUtilizationTest.scala | 1 + .../StudyAreaTripFilterTest.scala | 1 + .../scala/beam/integration/ChargingSpec.scala | 76 ++- .../skim/ActivitySimSkimmerEventTest.scala | 2 + .../beam/utils/Network2ShapeFileTest.scala | 51 -- .../scenario/PreviousRunPlanMergerTest.scala | 35 +- .../urbansim/HOVModeTransformerTest.scala | 531 ++++++++++++++++++ test/input/beamville/beam.conf | 26 + test/input/beamville/vehicleTypes.csv | 4 +- 122 files changed, 4407 insertions(+), 1590 deletions(-) delete mode 100644 .gitmodules create mode 100644 prepare_for_pack/prepare_archive.sh create mode 100644 src/main/R/freight/freight-processing.R create mode 100644 src/main/python/nhts_analysis/get-NHTS-mode_choice.py create mode 100644 src/main/scala/beam/agentsim/events/TeleportationEvent.scala create mode 100644 src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala create mode 100644 src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala delete mode 100644 src/main/scala/beam/utils/Network2ShapeFile.scala create mode 100644 src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala create mode 100644 src/test/scala/beam/agentsim/agents/TeleportationSpec.scala delete mode 100644 src/test/scala/beam/utils/Network2ShapeFileTest.scala create mode 100644 src/test/scala/beam/utils/scenario/urbansim/HOVModeTransformerTest.scala diff --git a/.gitignore b/.gitignore index 2655be93f77..2ad8204ab42 100755 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,5 @@ src/main/scala/beam/sandbox test/scala/beam/sandbox log-path_IS_UNDEFINED/ .Rproj.user +/prepare_for_pack/production/sfbay/gemini/ +/prepare_for_pack/production.zip diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index a34cbc61d00..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,16 +0,0 @@ -[submodule "production/austin"] - path = production/austin - url = git@github.com:LBNL-UCB-STI/beam-data-austin.git - branch = develop -[submodule "production/sfbay"] - path = production/sfbay - url = git@github.com:LBNL-UCB-STI/beam-data-sfbay.git - branch = develop -[submodule "production/detroit"] - path = production/detroit - url = git@github.com:LBNL-UCB-STI/beam-data-detroit.git - branch = develop -[submodule "production/newyork"] - path = production/newyork - url = git@github.com:LBNL-UCB-STI/beam-data-newyork.git - branch = develop diff --git a/AMI_Cleanup.py b/AMI_Cleanup.py index b55cd609379..242cb872ba9 100644 --- a/AMI_Cleanup.py +++ b/AMI_Cleanup.py @@ -40,7 +40,7 @@ def backup_and_retrieve_config_and_delete_old_backup(): def get_tagged_amis_along_with_most_recent(region): ec2 = get_ec2_for(region) - amis = ec2.describe_images(Owners=['self'],Filters=[{'Name':'name','Values':['beam-automation-*']}]) + amis = ec2.describe_images(Owners=['self']) allAMIs = [] newestAMI = None for ami in amis['Images']: diff --git a/aws/build.gradle b/aws/build.gradle index aebb918f27d..2e732be7aa9 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -79,14 +79,12 @@ task deploy(type: AWSLambdaInvokeTask) { def tempInstanceType = "${ext.getParameterValue('instanceType') ?: (project.hasProperty('defaultInstanceType') ? defaultInstanceType : '')}" def finalInstanceType = tempInstanceType != "" ? tempInstanceType : null - def dataBranch = "${ext.getParameterValue('dataBranch') ?: 'develop'}" def pload = """{ "title": "${ext.getParameterValue('runName') + '_' + getCurrentGitUserEmail()}", "git_user_email": "${getCurrentGitUserEmail()}", "deploy_type_tag": "${ext.getParameterValue('deployTypeTag')}", "branch": "${ext.getParameterValue('beamBranch') ?: getCurrentGitBranch()}", - "dataBranch": "$dataBranch", "commit": "${ext.getParameterValue('beamCommit') ?: 'HEAD'}", "deploy_mode": "${ext.getParameterValue('deployMode')}", "configs": "${ext.getParameterValue('beamConfigs') ?: ext.getParameterValue(getCurrentGitBranch() + '.configs')}", @@ -112,7 +110,6 @@ task deploy(type: AWSLambdaInvokeTask) { "max_memory": ${ext.getParameterValue('maxMemory') ?: 0} }""" payload = pload - println "Using data branch $dataBranch" println payload println "Please note that if you set isSpot to true then it could take an excessive time period. In fact it could time out at 15 minutes and still complete later on. ALSO! volumes using spot instances must be MANUALLY deleted. This is done so you do not lose data in the case of a premature shutdown." functionName = "simulateBeam" @@ -147,14 +144,13 @@ task deployPilates(type: AWSLambdaInvokeTask) { defaultParamVals['region'] = defRegion defaultParamVals['dataRegion'] = defRegion defaultParamVals['beamBranch'] = getCurrentGitBranch() - defaultParamVals['dataBranch'] = 'develop' def paramMap = [:] def missing = [] // all possible parameters ['runName', 'pilatesScenarioName', - 'beamBranch', 'dataBranch', 'beamCommit', + 'beamBranch', 'beamCommit', 'beamConfig', 'startYear', 'countOfYears', 'beamItLen', 'urbansimItLen', 'initialS3UrbansimInput', 'initialS3UrbansimOutput', 'initialSkimPath', @@ -177,8 +173,6 @@ task deployPilates(type: AWSLambdaInvokeTask) { println("parameters wasn't specified: " + missing.join(', ')) - println "Using data branch ${paramMap['dataBranch']}" - // create a string with json object which contains all parameters def pload = "{\n" + paramMap.collect { key, val -> " \"$key\": \"$val\"" }.join(",\n") + "\n}" diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 18a2e19a6a2..cf9de560d94 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -7,27 +7,6 @@ import base64 from botocore.errorfactory import ClientError -HELICS_RUN = '''sudo /home/ubuntu/install-and-run-helics-scripts.sh - - cd /home/ubuntu/git/beam - - ''' - -HELICS_OUTPUT_MOVE_TO_BEAM_OUTPUT = ''' - - opth="output" - - echo $opth - - finalPath="" - - for file in $opth/*; do - - for path2 in $file/*; do - - finalPath="$path2"; - - done; - - done; - - finalPath="${finalPath}/helics_output" - - mkdir "$finalPath" - - sudo mv /home/ubuntu/git/beam/src/main/python/gemini/*.log "$finalPath" - - sudo mv /home/ubuntu/git/beam/src/main/python/gemini/recording_output.txt "$finalPath" - - cd "$finalPath" - - sudo gzip -9 * - - cd - ''' - CONFIG_SCRIPT = '''./gradlew --stacktrace :run -PappArgs="['--config', '$cf']" -PmaxRAM=$MAX_RAM -Pprofiler_type=$PROFILER''' CONFIG_SCRIPT_WITH_GRAFANA = '''sudo ./gradlew --stacktrace grafanaStart @@ -37,6 +16,8 @@ EXPERIMENT_SCRIPT = '''./bin/experiment.sh $cf cloud''' +HEALTH_ANALYSIS_SCRIPT = 'python3 src/main/python/general_analysis/simulation_health_analysis.py' + S3_PUBLISH_SCRIPT = ''' - sleep 10s - opth="output" @@ -61,8 +42,6 @@ BRANCH_DEFAULT = 'master' -DATA_BRANCH_DEFAULT = 'develop' - COMMIT_DEFAULT = 'HEAD' MAXRAM_DEFAULT = '2g' @@ -91,28 +70,6 @@ - content: | 0 * * * * curl -X POST -H "Content-type: application/json" --data '"'"'{"$(ec2metadata --instance-type) instance $(ec2metadata --instance-id) running... \\n Batch [$UID] completed and instance of type $(ec2metadata --instance-type) is still running in $REGION since last $(($(($(date +%s) - $(cat /tmp/.starttime))) / 3600)) Hour $(($(($(date +%s) - $(cat /tmp/.starttime))) / 60)) Minute."}'"'" path: /tmp/slack_notification - - content: | - #!/bin/bash - pip install helics==2.7.1 - pip install helics-apps==2.7.1 - cd /home/ubuntu/git/beam/src/main/python - sudo chown ubuntu:ubuntu -R gemini - cd - - cd /home/ubuntu/git/beam/src/main/python/gemini - now="$(date +"%Y_%m_%d_%I_%M_%p")" - python beam_pydss_broker.py > output_${now}_broker.log & - echo "broker started" - sleep 5s - python beam_to_pydss_federate.py > output_${now}_federate.log & - echo "federate started" - sleep 5s - helics_recorder beam_recorder.txt --output=recording_output.txt > output_${now}_recorder.log & - echo "recorder started" - sleep 5s - cd - - path: /home/ubuntu/install-and-run-helics-scripts.sh - - runcmd: - ln -sf /var/log/cloud-init-output.log /home/ubuntu/git/beam/cloud-init-output.log - echo "-------------------Starting Beam Sim----------------------" @@ -132,7 +89,6 @@ \\"host_name\\":\\"%s\\", \\"browser\\":\\"http://%s:8000\\", \\"branch\\":\\"$BRANCH\\", - \\"data_branch\\":\\"$DATA_BRANCH\\", \\"region\\":\\"$REGION\\", \\"batch\\":\\"$UID\\", \\"commit\\":\\"$COMMIT\\", @@ -146,7 +102,6 @@ }" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname)) - echo $start_json - chmod +x /tmp/slack.sh - - chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - echo "notification sent..." - echo "notification saved..." - crontab /tmp/slack_notification @@ -160,20 +115,6 @@ - echo "git checkout -qf ..." - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout -qf $COMMIT - - production_data_submodules=$(git submodule | awk '{ print $2 }') - - for i in $production_data_submodules - - do - - for cf in $CONFIG - - do - - case $cf in - - '*$i*)' - - echo "Loading remote production data for $i" - - git config submodule.$i.branch $DATA_BRANCH - - git submodule update --init --remote $i - - esac - - done - - done - - 'echo "gradlew assemble: $(date)"' - ./gradlew assemble - echo "looping config ..." @@ -192,13 +133,11 @@ - $RUN_SCRIPT - done - echo "-------------------running Health Analysis Script----------------------" - - python3 src/main/python/general_analysis/simulation_health_analysis.py + - $HEALTH_ANALYSIS_SCRIPT - while IFS="," read -r metric count - do - export $metric=$count - done < RunHealthAnalysis.txt - - - curl -H "Authorization:Bearer $SLACK_TOKEN" -F file=@RunHealthAnalysis.txt -F initial_comment="Beam Health Analysis" -F channels="$SLACK_CHANNEL" "https://slack.com/api/files.upload" - s3glip="" - if [ "$S3_PUBLISH" = "True" ] - then @@ -218,7 +157,6 @@ \\"host_name\\":\\"%s\\", \\"browser\\":\\"http://%s:8000\\", \\"branch\\":\\"$BRANCH\\", - \\"data_branch\\":\\"$DATA_BRANCH\\", \\"region\\":\\"$REGION\\", \\"batch\\":\\"$UID\\", \\"commit\\":\\"$COMMIT\\", @@ -263,7 +201,7 @@ 'r5d.large', 'r5d.xlarge', 'r5d.2xlarge', 'r5d.4xlarge', 'r5d.12xlarge', 'r5d.24xlarge', 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', 'z1d.large', 'z1d.xlarge', 'z1d.2xlarge', 'z1d.3xlarge', 'z1d.6xlarge', 'z1d.12xlarge', - 'x2gd.metal', 'x2gd.16xlarge'] + 'x2gd.16xlarge', 'x2gd.metal'] regions = ['us-east-1', 'us-east-2', 'us-west-2'] shutdown_behaviours = ['stop', 'terminate'] @@ -621,7 +559,6 @@ def get_param(param_name): return param_value branch = event.get('branch', BRANCH_DEFAULT) - data_branch = event.get('data_branch', DATA_BRANCH_DEFAULT) commit_id = event.get('commit', COMMIT_DEFAULT) deploy_mode = event.get('deploy_mode', 'config') configs = event.get('configs', CONFIG_DEFAULT) @@ -638,7 +575,6 @@ def get_param(param_name): google_api_key = event.get('google_api_key', os.environ['GOOGLE_API_KEY']) end_script = event.get('end_script', END_SCRIPT_DEFAULT) run_grafana = event.get('run_grafana', False) - run_helics = event.get('run_helics', False) profiler_type = event.get('profiler_type', 'null') git_user_email = get_param('git_user_email') @@ -667,12 +603,11 @@ def get_param(param_name): if volume_size < 64 or volume_size > 256: volume_size = 64 - selected_script = CONFIG_SCRIPT + selected_script = "" if run_grafana: selected_script = CONFIG_SCRIPT_WITH_GRAFANA - - if run_helics: - selected_script = HELICS_RUN + selected_script + HELICS_OUTPUT_MOVE_TO_BEAM_OUTPUT + else: + selected_script = CONFIG_SCRIPT params = configs if s3_publish: @@ -706,7 +641,7 @@ def get_param(param_name): if len(params) > 1: runName += "-" + `runNum` script = initscript.replace('$RUN_SCRIPT',selected_script).replace('$REGION',region).replace('$S3_REGION', os.environ['REGION']) \ - .replace('$BRANCH', branch).replace('$DATA_BRANCH', data_branch).replace('$COMMIT', commit_id).replace('$CONFIG', arg) \ + .replace('$BRANCH',branch).replace('$COMMIT', commit_id).replace('$CONFIG', arg) \ .replace('$MAIN_CLASS', execute_class).replace('$UID', uid).replace('$SHUTDOWN_WAIT', shutdown_wait) \ .replace('$TITLED', runName).replace('$MAX_RAM', max_ram).replace('$S3_PUBLISH', str(s3_publish)) \ .replace('$SIGOPT_CLIENT_ID', sigopt_client_id).replace('$SIGOPT_DEV_ID', sigopt_dev_id) \ @@ -714,8 +649,6 @@ def get_param(param_name): .replace('$PROFILER', profiler_type) \ .replace('$END_SCRIPT', end_script) \ .replace('$SLACK_HOOK_WITH_TOKEN', os.environ['SLACK_HOOK_WITH_TOKEN']) \ - .replace('$SLACK_TOKEN', os.environ['SLACK_TOKEN']) \ - .replace('$SLACK_CHANNEL', os.environ['SLACK_CHANNEL']) \ .replace('$SHEET_ID', os.environ['SHEET_ID']) if is_spot: min_cores = event.get('min_cores', 0) @@ -726,13 +659,10 @@ def get_param(param_name): else: instance_id = deploy(script, instance_type, region.replace("-", "_")+'_', shutdown_behaviour, runName, volume_size, git_user_email, deploy_type_tag) host = get_dns(instance_id) - txt += 'Started batch: {batch} with run name: {titled} for branch/commit {branch}/{commit} at host {dns} (InstanceID: {instance_id}). '.format(branch=branch, titled=runName, commit=commit_id, dns=host, batch=uid, instance_id=instance_id) + txt = txt + 'Started batch: {batch} with run name: {titled} for branch/commit {branch}/{commit} at host {dns} (InstanceID: {instance_id}). '.format(branch=branch, titled=runName, commit=commit_id, dns=host, batch=uid, instance_id=instance_id) if run_grafana: - txt += ' Grafana will be available at http://{dns}:3003/d/dvib8mbWz/beam-simulation-global-view.'.format(dns=host) - - if run_helics: - txt += ' Helics scripts with recorder will be run in parallel with BEAM.' + txt = txt + 'Grafana will be available at http://{dns}:3003/d/dvib8mbWz/beam-simulation-global-view'.format(dns=host) runNum += 1 else: diff --git a/aws/src/main/python/runPilates/lambda_function.py b/aws/src/main/python/runPilates/lambda_function.py index 4719d6c7139..92580c58511 100644 --- a/aws/src/main/python/runPilates/lambda_function.py +++ b/aws/src/main/python/runPilates/lambda_function.py @@ -37,7 +37,6 @@ # "data_region": s3 data region which is used when copying from s3 and writing to s3 buckets; # "branch": git branch; # "commit": git commit; -# "data_branch": data branch; # "s3_path": s3 path to output folder started with double slash; # "title": used as instance name only; # "start_year": pilates simulation start year; @@ -94,7 +93,6 @@ \\"data_region\\":\\"$S3_DATA_REGION\\", \\"branch\\":\\"$BRANCH\\", \\"commit\\":\\"$COMMIT\\", - \\"data_branch\\":\\"$DATA_BRANCH\\", \\"title\\":\\"$TITLED\\", \\"start_year\\":\\"$START_YEAR\\", \\"count_of_years\\":\\"$COUNT_OF_YEARS\\", @@ -145,21 +143,6 @@ - git fetch - echo "git checkout for branch $BRANCH ..." - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH - - - production_data_submodules=$(git submodule | awk '{ print $2 }') - - for i in $production_data_submodules - - do - - for cf in $CONFIG - - do - - case $cf in - - '*$i*)' - - echo "Loading remote production data for $i" - - git config submodule.$i.branch $DATA_BRANCH - - git submodule update --init --remote $i - - esac - - done - - done - - sudo git pull - sudo git lfs pull - echo "git checkout -qf for commit $COMMIT ..." @@ -242,7 +225,8 @@ 'r5.large', 'r5.xlarge', 'r5.2xlarge', 'r5.4xlarge', 'r5.12xlarge', 'r5.24xlarge', 'r5d.large', 'r5d.xlarge', 'r5d.2xlarge', 'r5d.4xlarge', 'r5d.12xlarge', 'r5d.24xlarge', 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', - 'z1d.large', 'z1d.xlarge', 'z1d.2xlarge', 'z1d.3xlarge', 'z1d.6xlarge', 'z1d.12xlarge'] + 'z1d.large', 'z1d.xlarge', 'z1d.2xlarge', 'z1d.3xlarge', 'z1d.6xlarge', 'z1d.12xlarge', + 'x2gd.16xlarge', 'x2gd.metal'] regions = ['us-east-1', 'us-east-2', 'us-west-2'] shutdown_behaviours = ['stop', 'terminate'] @@ -335,7 +319,6 @@ def get_param(param_name): initial_urbansim_input = get_param('initialS3UrbansimInput') branch = get_param('beamBranch') commit_id = get_param('beamCommit') - data_branch = get_param('dataBranch') start_year = get_param('startYear') count_of_years = get_param('countOfYears') @@ -423,7 +406,6 @@ def get_param(param_name): .replace('$IN_YEAR_OUTPUT', in_year_output) \ .replace('$PILATES_IMAGE_NAME', pilates_image_name) \ .replace('$BRANCH', branch).replace('$COMMIT', commit_id).replace('$CONFIG', config) \ - .replace('$DATA_BRANCH', data_branch) \ .replace('$SHUTDOWN_WAIT', shutdown_wait) \ .replace('$SHUTDOWN_BEHAVIOUR', shutdown_behaviour) \ .replace('$STORAGE_SIZE', str(volume_size)) \ diff --git a/build.gradle b/build.gradle index 1e461143ec3..af7218c00d4 100755 --- a/build.gradle +++ b/build.gradle @@ -175,7 +175,7 @@ dependencies { implementation('com.github.LBNL-UCB-STI:or-tools-wrapper:7.5-0') { exclude group: 'com.google.protobuf', module: 'protobuf-java' } - implementation 'com.github.LBNL-UCB-STI:helics-wrapper:v2.6.2' + implementation 'com.github.LBNL-UCB-STI:helics-wrapper:v2.6.1' // GPLv3 implementation group: 'org.matsim.contrib', name: 'multimodal', version: '0.10.0' @@ -663,6 +663,7 @@ task createDockerfile(type: Dockerfile, dependsOn: dockerSyncBuildContext) { copyFile("resources", "resources") copyFile("classes", "classes") // Test scenarios + copyFile("production", "production") copyFile("test/input/common", "test/input/common") copyFile("test/input/dtd", "test/input/dtd") copyFile("test/input/beamville", "test/input/beamville") @@ -678,7 +679,7 @@ task buildImageWithoutTags(type: DockerBuildImage, dependsOn: createDockerfile) task buildImage(type: DockerTagImage, dependsOn: buildImageWithoutTags) { repository = "beammodel/beam" - tag = version + tag = 'production-gemini-develop-4' targetImageId buildImageWithoutTags.getImageId() } @@ -686,6 +687,9 @@ dockerSyncBuildContext { from('src/main/python') { into('src/main/python') } + from('production') { + into('production') + } from('test/input/common') { into('test/input/common') } diff --git a/docs/developers.rst b/docs/developers.rst index 140c61ed6b2..6701b462009 100755 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -103,71 +103,46 @@ Sometimes it is possible to face a timeout issue when trying to push huge files. #. Just push the files as usual -Production Data And Git Submodules +Keeping Production Data out of Master Branch ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Production data is located in separate git repositories each scenario in its own repo. +Production versus test data. Any branch beginning with "production" or "application" will contain data in the "production/" subfolder. This data should stay in that branch and not be merged into master. To keep the data out, the easiest practice is to simply keep merges one-way from master into the production branch and not vice versa. -Separation of production data and code is needed for: +However, sometimes troubleshooting / debugging / development happens on a production branch. The cleanest way to get changes to source code or other non-production files back into master is the following. -1. Reducing the git repository size for developers -2. Easier addition or changing production data without merging back into develop code changes -3. Ability to use any production data with any code branch/commit without creation of yet another git production branch +Checkout your production branch:: + git checkout production-branch -These repositories have `beam-data-` prefix, e.g `beam-data-sfbay` +Bring branch even with master:: -They are linked back to the parent repo by `git submodules `_. For example sfbay is mapped to `production/sfbay`. + git merge master -When you clone a parent project, by default you get the production data directories that contain submodules, but none of the files within them. -To fetch production data manually type:: +Resolve conflicts if needed - git submodule update --init --remote production/sfbay +Capture the files that are different now between production and master:: -(replace `sfbay` with other scenario if needed) + git diff --name-only HEAD master > diff-with-master.txt -If you don't need the production data anymore and want to remove it locally you can run:: +You have created a file "diff-with-master.txt" containing a listing of every file that is different. - git submodule deinit production/sfbay +IMPORTANT!!!! -- Edit the file diff-with-master.txt and remove all production-related data (this typically will be all files underneath "production" sub-directory. -or:: +Checkout master:: - git submodule deinit --all + git checkout master -to remove all production data. +Create a new branch off of master, this is where you will stage the files to then merge back into master:: -Note that if you locally fetch the submodule then it will update the submodule pointer to the latest submodule commit. -That will result in a git change. + git checkout -b new-branch-with-changes-4ci -for example, the output of `git status` will be something like that:: +Do a file by file checkout of all differing files from production branch onto master:: - Changes not staged for commit: - (use "git add ..." to update what will be committed) - (use "git restore ..." to discard changes in working directory) - modified: production/sfbay (new commits) + cat diff-with-master.txt | xargs git checkout production-branch -- -It is safe to either add this change with `git add` and commit it or drop it with `git reset`. It doesn't matter since we -always fetch the latest commit in submodule. +Note, if any of our diffs include the deletion of a file on your production branch, then you will need to remove (i.e. with "git remove" these before you do the above "checkout" step and you should also remove them from the diff-with-master.txt"). If you don't do this, you will see an error message ("did not match any file(s) known to git.") and the checkout command will not be completed. -Using old production data -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Old production data is still available at branches `production-gemini-develop`, `inm/merge-urbansim-with-detroit` etc. - -If for some reason you need to merge latest changes to these branches please note that there could be a conflict with the -same directory name for example `production/sfbay`. In that case you will need to rename this directory in production branch -to some other name before merging, commit this change and then merge the latest changes from develop. - -Adding new production scenario -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -First create a new repository for the data with beam-data- prefix. - -Then in the main repo type:: - - git submodule add -b develop git@github.com:LBNL-UCB-STI/beam-data-city.git production/city - -replacing `city` with a new scenario name, assuming that repo uses `develop` branch as default one. +Finally, commit the files that were checked out of the production branch, push, and go create your pull request! Automated Cloud Deployment @@ -190,7 +165,6 @@ The command will start an ec2 instance based on the provided configurations and * **runName**: to specify instance name. * **beamBranch**: To specify the branch for simulation, current source branch will be used as default branch. * **beamCommit**: The commit SHA to run simulation. use `HEAD` if you want to run with latest commit, default is `HEAD`. -* **dataBranch**: To specify the data branch (branch on production data repository) for simulation, 'develop' branch will be used as default data branch. * **deployMode**: to specify what type of deploy it will be: config | experiment | execute * **beamConfigs**: A comma `,` separated list of `beam.conf` files. It should be relative path under the project home. You can create branch level defaults by specifying the branch name with `.configs` suffix like `master.configs`. Branch level default will be used if `beamConfigs` is not present. * **beamExperiments**: A comma `,` separated list of `experiment.yml` files. It should be relative path under the project home.You can create branch level defaults same as configs by specifying the branch name with `.experiments` suffix like `master.experiments`. Branch level default will be used if `beamExperiments` is not present. `beamConfigs` has priority over this, in other words, if both are provided then `beamConfigs` will be used. @@ -233,7 +207,6 @@ You need to define the deploy properties that are similar to the ones for AWS de * **runName**: to specify instance name. * **beamBranch**: To specify the branch for simulation, current source branch will be used as default branch. * **beamCommit**: The commit SHA to run simulation. use `HEAD` if you want to run with latest commit, default is `HEAD`. -* **dataBranch**: To specify the branch for production data, 'develop' branch will be used as default branch. * **beamConfigs**: The `beam.conf` file. It should be relative path under the project home. * **s3Backup**: to specify if copying results to s3 bucket is needed, default is `true`. * **region**: Use this parameter to select the AWS region for the run, all instances would be created in specified region. Default `region` is `us-east-2`. diff --git a/gradle.deploy.properties b/gradle.deploy.properties index 9fa4832ab1d..598e77b847f 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -1,17 +1,24 @@ -runName=inm/sflight-low-cpu-usage-in-PBRSim-debugging -beamBranch=develop -beamCommit=dc4b0b05a3885357c7b5b65fb91181c8163aa9b6 -dataBranch=develop -beamConfigs=test/input/sf-light/sf-light-1k-with-PTE-duplicates-1.conf,test/input/sf-light/sf-light-1k-with-PTE-duplicates-2.conf -instanceType=r5.8xlarge +runName=gemini-scenario-4-unconstrained +beamBranch=production-gemini-develop +beamCommit=73d395d52fda28b60308ad07abbb40aa5bcd7b9e + +beamConfigs=production/sfbay/gemini/gemini-2035-18k-FREIGHT.conf + +instanceType=r5d.24xlarge +#instanceType=m5.24xlarge + +maxRAM=740g # shutdownBehaviour = stop | terminate shutdownBehaviour=terminate s3Backup=true -maxRAM=240g -#storageSize (in GiB) = any number between 64 and 256 -storageSize=128 +runHelics=false +# storageSize (in GiB) = any number between 64 and 256 +storageSize=256 + +#c5.18xlarge (72/144) -> 5 -> $3.06 per Hour +#m5.24xlarge (96/384) -> 2 -> $4.608 per Hour #r5.8xlarge (32/256) #c5.9xlarge (36/72) -> 5 instances -> $1.53 per Hour #m4.10xlarge (40/160) -> 5 -> $2.00 per Hour @@ -20,12 +27,10 @@ storageSize=128 #m4.16xlarge (64/256) -> 20 -> $3.20 per Hour #r5.12xlarge (48/384) -> 3 -> $3.024 per Hour -#c5.18xlarge (72/144) -> 5 -> $3.06 per Hour #c5d.18xlarge (72/144) -> 5 -> $3.456 per Hour #r5d.12xlarge (48/384) -> 3 -> $3.456 per Hour #h1.16xlarge (64/256) -> 1 -> $3.744 per Hour -#m5.24xlarge (96/384) -> 2 -> $4.608 per Hour #i3.16xlarge (64/488) -> 1 -> $4.992 per Hour #i3.metal (72/512) -> 5 -> $4.992 per Hour @@ -47,7 +52,7 @@ deployMode=config executeClass=beam.sim.RunBeam #executeArgs=['--config', 'production/application-sfbay/experimentsFall2018/fall18-calib-run1.conf'] beamBatch=false -shutdownWait=15 +shutdownWait=5 systemProp.org.gradle.internal.http.connectionTimeout=180000 systemProp.org.gradle.internal.http.socketTimeout=180000 diff --git a/gradle.deployPILATES.properties b/gradle.deployPILATES.properties index 67bb11052bb..31c13315c5c 100644 --- a/gradle.deployPILATES.properties +++ b/gradle.deployPILATES.properties @@ -15,9 +15,8 @@ beamConfig=production/sfbay/smart/smart-baseline-pilates-small-test.conf # git parameters # if branch not specified, then current branch be used -beamBranch=develop +beamBranch=production-sfbay-develop beamCommit=HEAD -dataBranch=develop instanceType=t2.small diff --git a/gradle.properties b/gradle.properties index 36a242ae78a..66a9815f542 100755 --- a/gradle.properties +++ b/gradle.properties @@ -14,3 +14,6 @@ defaultBranch=master defaultConfigs=test/input/beamville/beam.conf,test/input/sf-light/sf-light.conf defaultExperiments=test/input/beamville/example-calibration/experiment.yml defaultInstanceType=t2.small + + +org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=1g \ No newline at end of file diff --git a/nersc/build.gradle b/nersc/build.gradle index d59596862e4..2579677494b 100644 --- a/nersc/build.gradle +++ b/nersc/build.gradle @@ -49,7 +49,6 @@ task deployToNersc { def runName = "${ext.getParameterValue('runName')}" def git_user_email = "${getCurrentGitUserEmail()}" def branch = "${ext.getParameterValue('beamBranch') ?: getCurrentGitBranch()}" - def dataBranch = "${ext.getParameterValue('dataBranch') ?: 'develop'}" def commit = "${ext.getParameterValue('beamCommit') ?: 'HEAD'}" def configs = "${ext.getParameterValue('beamConfigs') ?: ext.getParameterValue(getCurrentGitBranch() + '.configs')}" def max_ram = '100g' @@ -69,7 +68,7 @@ task deployToNersc { } doLast { - println "Using data branch ${dataBranch}" + ssh.run { session(remotes.nerscLoginNode) { put from: "${project.rootDir}/nersc/src/main/bash/run_beam_on_nersc.sh", into: "run_beam.sh" @@ -77,7 +76,6 @@ task deployToNersc { execute "chmod +x run_beam.sh shifter_job.sh" execute "./run_beam.sh \ --branch='$branch' \ - --data_branch='$dataBranch' \ --revision='$commit' \ --config='$configs' \ --max_ram=$max_ram \ diff --git a/nersc/src/main/bash/run_beam_on_nersc.sh b/nersc/src/main/bash/run_beam_on_nersc.sh index e9d2216a63f..1ac71ee836d 100644 --- a/nersc/src/main/bash/run_beam_on_nersc.sh +++ b/nersc/src/main/bash/run_beam_on_nersc.sh @@ -7,9 +7,6 @@ while [ $# -gt 0 ]; do --branch=*) beam_branch_name="${1#*=}" ;; - --data_branch=*) - beam_data_branch_name="${1#*=}" - ;; --revision=*) beam_revision="${1#*=}" ;; @@ -42,7 +39,6 @@ while [ $# -gt 0 ]; do done export BEAM_BRANCH_NAME=$beam_branch_name \ -export BEAM_DATA_BRANCH_NAME=$beam_data_branch_name \ export BEAM_COMMIT_SHA=$beam_revision \ export BEAM_CONFIG=$beam_config \ export MAXRAM=$max_ram \ diff --git a/nersc/src/main/docker/entrypoint.sh b/nersc/src/main/docker/entrypoint.sh index 41257346b22..bea7aaeae52 100644 --- a/nersc/src/main/docker/entrypoint.sh +++ b/nersc/src/main/docker/entrypoint.sh @@ -4,18 +4,6 @@ cd /app/sources git clone --single-branch --branch $BEAM_BRANCH_NAME https://github.com/LBNL-UCB-STI/beam.git cd ./beam git reset --hard $BEAM_COMMIT_SHA - -production_data_submodules=$(git submodule | awk '{ print $2 }') -for i in $production_data_submodules - do - case $BEAM_CONFIG in - '*$i*)' - echo "Loading remote production data for $i" - git config submodule.$i.branch $BEAM_DATA_BRANCH_NAME - git submodule update --init --remote $i - esac - done - git lfs pull #we shouldn't use the gradle daemon on NERSC, it seems that it's somehow shared within different nodes diff --git a/prepare_for_pack/prepare_archive.sh b/prepare_for_pack/prepare_archive.sh new file mode 100644 index 00000000000..1d3ba2bfd1b --- /dev/null +++ b/prepare_for_pack/prepare_archive.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +gemini_path='production/sfbay/gemini' +rm -rf production/ +mkdir -p $gemini_path +cp ../$gemini_path -R production/sfbay +echo 'folder content updated' + +rm production.zip +echo 'old archive deleted' + +zip -r production.zip production + diff --git a/src/main/R/freight/freight-processing.R b/src/main/R/freight/freight-processing.R new file mode 100644 index 00000000000..03e5a2c885e --- /dev/null +++ b/src/main/R/freight/freight-processing.R @@ -0,0 +1,209 @@ +setwd(dirname(rstudioapi::getSourceEditorContext()$path)) +source("../common/helpers.R") +source("../common/theme.R") +library('colinmisc') +library(dplyr) +library(ggplot2) +library(rapport) +library(sjmisc) +library(ggmap) +library(sf) +library(stringr) + +workDir <- normalizePath("~/Data/SMART") +activitySimDir <- normalizePath("~/Data/ACTIVITYSIM") + +events <- readCsv(pp(workDir, "/5.events.csv.gz")) +unloading <- events[actType=="Unloading"] +nrow(unloading[type=="actstart"]) +nrow(unloading[type=="actend"]) +warehouse <- events[actType=="Warehouse"] +nrow(warehouse[type=="actstart"]) +nrow(warehouse[type=="actend"]) +pt <- events[type=="PathTraversal"][,c("time","type","vehicleType","vehicle","secondaryFuelLevel", + "primaryFuelLevel","driver","mode","seatingCapacity","startX", + "startY", "endX", "endY", "capacity", "arrivalTime", "departureTime", + "secondaryFuel", "secondaryFuelType", "primaryFuelType", + "numPassengers", "length", "primaryFuel")] +freight_pt <- pt[startsWith(vehicle,"freight")] +nrow(freight_pt) +# pt$mode2 <- "Transit" +# pt[mode=="car"]$mode2 <- "Car" +# pt[mode=="car"&startsWith(vehicle,"rideHailVehicle")]$mode2 <- "Ridehail" +# pt[mode=="car"&startsWith(vehicle,"freight")]$mode2 <- "Freight" +# pt[mode=="walk"]$mode2 <- "Walk" +# pt[mode=="bike"]$mode2 <- "Bike" +# summary <- pt[,.(VMTInMiles=mean(length)/1609.34,fuelInKW=(mean(primaryFuel+secondaryFuel))*2.77778e-7),by=.(mode2)] +# + + +factor.remap <- c('Walk'='Walk','Bike'='Bike','Ridehail'='Ridehail','Car'='Car','Transit'='Public Transit', 'Freight'='Freight') +factor.colors <- c('Walk'='#669900','Bike'='#FFB164','Ridehail'='#B30C0C','Car'='#8A8A8A','Transit'='#0066CC','Freight'="#660099") +factor.colors.remapped <- factor.colors +ggplot(summary, aes(x="",y=VMTInMiles,fill=mode2))+ + geom_bar(stat='identity')+ + labs(y='',x='Scenario',fill='Mode',title='Mobility Metrics')+ + theme_marain()+ + theme(axis.text.x = element_text(angle = 0, hjust=0.5),strip.text = element_text(size=rel(1.2)))+ + scale_fill_manual(values = factor.colors.remapped) + + +source("~/Documents/Workspace/scripts/common/keys.R") +register_google(key = google_api_key_1) +oaklandMap <- ggmap::get_googlemap("oakland california", zoom = 13, maptype = "roadmap") +shpFile <- pp(activitySimDir, "/__San_Francisco_Bay_Region_2010_Census_Block_Groups-shp/641aa0d4-ce5b-4a81-9c30-8790c4ab8cfb202047-1-wkkklf.j5ouj.shp") +sfBayCbg <- st_read(shpFile) +# ggplot(data = oaklandCbg) + geom_sf()+ +# coord_sf( xlim = c(-130, -60),ylim = c(20, 50)) + + + +freight_pt[,hour:=as.integer(arrivalTime/3600)%%24] +##1 +# freight_pt_withCBG <- data.table::as.data.table(st_intersection(freight_pt_asSf,sfBayCbg)) +# freight_pt_summary <- freight_pt_withCBG[,.(count=.N),by=.(blkgrpid)] +# freight_pt_withCBG_asSf <- st_join(sfBayCbg, freight_pt_asSf) +# data <- freight_pt_withCBG_asSf %>% +# group_by(blkgrpid) %>% +# summarize(geometry = st_union(geometry)) +# ggplot() + +# geom_sf(data = data, aes(fill = blkgrpid)) + +# theme(legend.position = "none") + +##2 +#countyNames <- c('Alameda County','Contra Costa County','Marin County','Napa County','Santa Clara County','San Francisco County','San Mateo County','Sonoma County','Solano County') +source("~/Documents/Workspace/scripts/common/keys.R") +register_google(key = google_api_key_1) +oakland_map <- ggmap::get_googlemap("alameda california", zoom = 9, maptype = "roadmap",color = "bw", style = c(feature = "all", element = "labels", visibility = "off")) + +clusteringFreightBy <- function(data,cols,dataCbg,numClusters,labelData) { + data_asSf <- st_as_sf(data,coords=cols,crs=4326,agr="constant") + data_withCBG_asSf <- st_intersection(data_asSf,dataCbg) + data_withCBG_asSf$X <- st_coordinates(data_withCBG_asSf$geometry)[,1] + data_withCBG_asSf$Y <- st_coordinates(data_withCBG_asSf$geometry)[,2] + data_withCBG <- data.table::as.data.table(data_withCBG_asSf) + data_withCBG[,cluster:=kmeans(data_withCBG[,.(X,Y)],numClusters)$cluster] + result <- data_withCBG[,.(count=.N,x2=mean(X),y2=mean(Y)),by=.(hour,cluster)] + result$label <- labelData + result +} + +b2b_pt <- freight_pt[grepl("b2b",vehicle)][,label:="B2B"] +b2c_pt <- freight_pt[grepl("b2c",vehicle)][,label:="B2C"] + +b2b_pt_stops <- clusteringFreightBy(b2b_pt,c("endX","endY"),sfBayCbg,50,"B2B") +b2c_pt_stops <- clusteringFreightBy(b2c_pt,c("endX","endY"),sfBayCbg,50,"B2C") + +# Plot it +to_plot <- rbind(b2c_pt_stops) +hours_to_show <- c(8, 12, 16) +toplot <- to_plot[hour %in% hours_to_show] +toplot$hour.label <- "" +toplot[hour==8]$hour.label <- "8am" +toplot[hour==12]$hour.label <- "12pm" +toplot[hour==16]$hour.label <- "4pm" +#toplot[hour==20]$hour.label <- "8pm" +hour.label_order <- c("8am", "12pm", "4pm") +# counties <- data.table(urbnmapr::counties)[county_name%in%countyNames] +#,xlim=c(-122.36,-122.20),ylim=c(37.70,37.81) +p <- oakland_map %>% + ggmap() + + theme_marain() + + coord_map(projection = 'albers', lat0 = 39, lat1 = 45, xlim=c(-122.78,-121.7),ylim=c(37.21,38.45))+ + geom_point(dat=toplot,aes(x=x2,y=y2,size=count,stroke=0.5),alpha=.5,colour="#20b2aa") + + scale_size_continuous(name = "#Stops", breaks=c(25,75,125)) + + labs(title="Hourly B2C",x="",y="")+ + theme(panel.background = element_rect(fill = "#d4e6f2"), + legend.title = element_text(size = 10), + legend.text = element_text(size = 10), + axis.text.x = element_blank(), + axis.text.y = element_blank(), + axis.ticks.x = element_blank(), + axis.ticks.y = element_blank(), + strip.text.x = element_text(size = 10)) + + facet_wrap(~factor(hour.label, levels=hour.label_order)) + + guides(color= guide_legend(), size=guide_legend()) +ggsave(pp(workDir,'/b2c-stops.png'),p,width=9,height=5,units='in') + + +toplot <- rbind(b2b_pt_stops) +p <- oakland_map %>% + ggmap() + + theme_marain() + + coord_map(projection = 'albers', lat0 = 39, lat1 = 45, xlim=c(-122.78,-121.7),ylim=c(37.21,38.45))+ + geom_point(dat=toplot,aes(x=x2,y=y2,size=count,stroke=0.5,colour=label),alpha=.7,colour="#eca35b") + + scale_size_continuous(name = "#Stops", breaks=c(2,4,6)) + + labs(title="Daily B2B",x="",y="")+ + theme(panel.background = element_rect(fill = "#d4e6f2"), + legend.title = element_text(size = 10), + legend.text = element_text(size = 10), + axis.text.x = element_blank(), + axis.text.y = element_blank(), + axis.ticks.x = element_blank(), + axis.ticks.y = element_blank(), + strip.text.x = element_text(size = 10)) +ggsave(pp(workDir,'/b2b-stops.png'),p,width=4,height=5,units='in') + + +to_plot <- rbind(b2c_pt_stops,b2b_pt_stops)[,.(stopsPerHour=sum(cluster)),by=.(label,hour)] +ggplot(to_plot) + geom_line(aes(hour, stopsPerHour, colour=label)) + +to_plot <- rbind(b2b_pt,b2c_pt) +to_plot$timeBin <- as.integer(to_plot$time/1800) + + +to_plot <- rbind(b2b_pt,b2c_pt) +p <- to_plot[,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(arrivalTime),"15 min")), label)] %>% + ggplot(aes(timeBin, N, colour=label)) + + geom_line() + + scale_x_datetime("Hour", + breaks=scales::date_breaks("2 hour"), + labels=scales::date_format("%H", tz = dateTZ)) + + scale_y_continuous("Activity", breaks = scales::pretty_breaks()) + + scale_colour_manual("Supply Chain", values = c("#eca35b", "#20b2aa")) + + theme_marain() + + theme(legend.title = element_text(size = 10), + legend.text = element_text(size = 10), + axis.text.x = element_text(angle = 0, hjust = 1)) +ggsave(pp(workDir,'/freight-activity.png'),p,width=6,height=3,units='in') + + +to_plot <- rbind(b2b_pt,b2c_pt)[,.(VMT=mean(length)/1609.3),by=.(label)] +ggplot(to_plot, ) + +p <- ggplot(to_plot, aes(x=label,y=VMT,fill=label))+ + geom_bar(stat='identity')+ + labs(y='Miles',x='',title='Avg VMT')+ + scale_fill_manual("Supply Chain", values = c("#eca35b", "#20b2aa")) + + theme_marain()+ + theme(strip.text = element_text(size = 10), + axis.text.x = element_blank(), + legend.title = element_text(size = 10), + legend.text = element_text(size = 10)) +ggsave(pp(workDir,'/freight-avg-vmt.png'),p,width=4,height=3,units='in') + + +to_plot <- rbind(b2b_pt,b2c_pt)[,.(VMT=mean(primaryFuel+secondaryFuel)*2.77778e-7),by=.(label)] + +all_pt_x <- data.table::as.data.table(rbind(b2b_pt,b2c_pt)[,c("time","vehicle","departureTime","arrivalTime","label")]) +all_pt_1 <- all_pt_x[,-c("arrivalTime")][order(time),`:=`(IDX = 1:.N),by=vehicle] +all_pt_2 <- all_pt_x[,-c("departureTime")][order(time),`:=`(IDX = 1+1:.N),by=vehicle] + +all_pt <- all_pt_1[all_pt_2, on=c("vehicle", "IDX", "label")][!is.na(arrivalTime)&!is.na(departureTime)] +all_pt[,`:=`(stopDuration = departureTime - arrivalTime)] +all_pt[,.(mean(stopDuration)),by=.(label)] + +all_pt_1 <- all_pt[order(time),`:=`(IDX = 1:.N),by=vehicle] +all_pt_2 <- all_pt[order(time),`:=`(IDX = 1:.N),by=vehicle] + +all_pt[,,by=.(vehicle)] + +all_pt_x[vehicle=="freight-vehicle-freightVehicle-b2b-1640"] + + + + + + + + diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 7fe9e8fbc5b..4e1570e655f 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -24,11 +24,10 @@ library(ggmap) scaleup <- FALSE #expFactor <- (7.75/0.315) * 27.0 / 21.3 expFactor <- (6.015/0.6015) -loadInfo <- new("loadInfo", timebinInSec=900, siteXFCInKW=1000, plugXFCInKW=250) severity_order <- c("Public <1MW", "Public 1-5MW", "Public >5MW", "Ridehail Depot <1MW", "Ridehail Depot 1-5MW", "Ridehail Depot >5MW") extreme_lab_order <- c("<1MW", "1-5MW", ">5MW") -dataDir <- normalizePath("~/Data/GEMINI/2021Aug22-Oakland/BATCH3") +dataDir <- normalizePath("~/Data/GEMINI/2021Oct29/BATCH1") #events <- readCsv(pp(dataDir, "/events/0.events.BASE.csv.gz")) #eventsDir <- paste(dataDir, "/events",sep="") resultsDir <- paste(dataDir, "/results",sep="") @@ -37,16 +36,13 @@ mobilityDir <- paste(dataDir, "/mobility",sep="") dir.create(resultsDir, showWarnings = FALSE) dir.create(plotsDir, showWarnings = FALSE) -scenarioNames <- c('Scenario0', 'Scenario1') -scenarioBaselineLabel <- 'Scenario0' -countyNames <- c('Alameda County','Contra Costa County','Marin County','Napa County','Santa Clara County','San Francisco County','San Mateo County','Sonoma County','Solano County') - # MAIN processEventsFileAndScaleUp(dataDir, scaleup, expFactor) +countyNames <- c('Alameda County','Contra Costa County','Marin County','Napa County','Santa Clara County','San Francisco County','San Mateo County','Sonoma County','Solano County') # PLOTS if (!file.exists(pp(resultsDir,'/ready-to-plot.Rdata'))) { - generateReadyToPlot(resultsDir, loadTypes, loadInfo, countyNames) + generateReadyToPlot(resultsDir, loadTypes, countyNames) } ## Energy Share Per Load Type @@ -62,8 +58,16 @@ for(j in 1:nrow(publicLoads)){ scens <- as.data.table(readCsv(pp(resultsDir,'/../scenarios.csv'))) all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) +# sc2 <- all.sessions[code=="SC2"&!startsWith(parkingZoneId,"X")] +# sc3 <- all.sessions[code=="SC3"&!startsWith(parkingZoneId,"X")] +# nrow(sc2)*900/3600 +# nrow(sc3)*900/3600 - +##### +#scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') +scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') +scenarioBaselineLabel <- 'Scenario4' +#all.loads <- all.loads[!is.na(loadType)] ########################################## # LOADS & ENERGY ########################################## @@ -79,8 +83,7 @@ p <- toplot[,.(kw=sum(kw)),by=c('severity','hour.bin2', 'panel')] %>% facet_wrap(~panel) + scale_fill_manual(values = c(brewer.pal(3, "Blues"), brewer.pal(3, "Reds"))) + theme(strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/baseline-xfc-hours-per-site-per-day.png'),p,width=12,height=4,units='in') - +ggsave(pp(plotsDir,'/baseline-xfc-hours-per-site-per-day.png'),p,width=4,height=4,units='in') ## Baseline public charging toplot[,panel:=revalue(factor(site),c('public'='Public','depot'='Ridehail CAV Depot'))] @@ -154,17 +157,11 @@ register_google(key = google_api_key_1) oakland_map <- ggmap::get_googlemap("oakland california", zoom = 14, maptype = "roadmap") # Plot it -ggmap(oakland_map) + - theme_void() + - ggtitle("terrain") + - theme( - plot.title = element_text(colour = "orange"), - panel.border = element_rect(colour = "grey", fill=NA, size=2) - ) -toplot <- all.loads[name==scenarioBaselineLabel&hour.bin2 %in% c(6, 9, 18, 0)] +hours_to_show <- c(0, 8, 12, 18) +toplot <- all.loads[name==scenarioBaselineLabel&hour.bin2 %in% hours_to_show] toplot$hour.bin2.label <- "12am" -toplot[hour.bin2==6]$hour.bin2.label <- "6am" -toplot[hour.bin2==9]$hour.bin2.label <- "9am" +toplot[hour.bin2==8]$hour.bin2.label <- "8am" +toplot[hour.bin2==12]$hour.bin2.label <- "12pm" toplot[hour.bin2==18]$hour.bin2.label <- "6pm" counties <- data.table(urbnmapr::counties)[county_name%in%countyNames] setkey(toplot,xfc) @@ -172,7 +169,7 @@ p <- ggmap(oakland_map) + theme_marain() + geom_polygon(data = counties, mapping = aes(x = long, y = lat, group = group), fill="white", size=.2) + coord_map(projection = 'albers', lat0 = 39, lat1 = 45,xlim=c(-122.2890,-122.2447),ylim=c(37.7915,37.8170))+ - geom_point(dat=toplot[hour.bin2 %in% c(6, 9, 18, 0)],aes(x=x2,y=y2,size=kw,stroke=0.5,group=grp,colour=factor(extreme.lab, levels=extreme_lab_order)),alpha=.3)+ + geom_point(dat=toplot[hour.bin2 %in% hours_to_show],aes(x=x2,y=y2,size=kw,stroke=0.5,group=grp,colour=factor(extreme.lab, levels=extreme_lab_order)),alpha=.3)+ scale_colour_manual(values=c('darkgrey','orange','red'))+ scale_size_continuous(range=c(0.5,35),breaks=c(500,1000,2000,4000))+ labs(title="EV Charging Loads in Downtown Oakland",colour='Load Severity',size='Charging Site Power (kW)')+ @@ -183,17 +180,30 @@ ggsave(pp(plotsDir,'/baseline-ev-charging-loads-by-space-time-in-oakland.png'),p ## ************************************** ## public charging by scenario -p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% +thelabeller <- c("Scenario2" = "Scenario2 (100% Population)", "Scenario2-010" = "Scenario2 (10% sample)", "Scenario2-025" = "Scenario2 (25% sample)", "Scenario2-050" = "Scenario2 (50% sample)") +p <- all.loads[region=="Oakland-Alameda"&site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ theme_marain() + geom_area(colour="black", size=0.3) + scale_fill_manual(values = chargingTypes.colors, name = "") + labs(x = "hour", y = "GW", fill="load severity", title="Public Charging") + theme(strip.text = element_text(size=rel(1.2))) + - facet_wrap(~factor(name,scenarioNames),ncol = 3) -ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=12,height=7,units='in') + facet_wrap(~factor(name,scenarioNames),ncol = 2,labeller = labeller(.cols = thelabeller)) +ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units='in') +## ************************************** +## public charging by scenario +p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% + ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ + theme_marain() + + geom_area(colour="black", size=0.3) + + scale_fill_manual(values = chargingTypes.colors, name = "") + + labs(x = "hour", y = "GW", fill="load severity", title="Public Charging") + + theme(strip.text = element_text(size=rel(1.2))) + + facet_wrap(~factor(name,scenarioNames),ncol = 2) +ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units='in') +all.loads[name%in%scenarioNames,.(fuel=sum(fuel)),by=.(name)] ## public daily charging by scenario toplot <- join.on(all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','name')],all.loads[site=='public'&name%in%scenarioNames][,.(tot.kw=sum(kw)),by=c('name')],'name','name') p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=kw/tot.kw*100,fill=factor(loadType, levels = names(chargingTypes.colors))))+ @@ -203,7 +213,7 @@ p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=kw/tot.kw*100,fill=factor( labs(x = "", y = "Share of Charging (%)", fill="load severity", title="Public Charging") + theme(axis.text.x = element_text(angle = 0, hjust=0.5), strip.text = element_text(size=rel(1.2))) #theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/public-daily-charging-by-scenario.png'),p,width=3,height=3,units='in') +ggsave(pp(plotsDir,'/public-daily-charging-by-scenario.png'),p,width=5,height=3,units='in') @@ -225,11 +235,9 @@ ggsave(pp(plotsDir,'/xfc-loads-by-scenario.png'),p,width=12,height=7,units='in') ## Energy charged by scenario metrics <- all.loads[!is.na(kw)&name%in%scenarioNames][,.(gw=sum(kw)/1e6,gwh=sum(kw)/4e6),by=.(name,hour.bin2,severity)][,.(gw.peak=max(gw),gwh=sum(gwh)),by=.(name,severity)] -xfc.metric <- all.loads[!is.na(kw)&name%in%scenarioNames][!grepl('<1MW',severity),.(xfc.hours=.N/4),by=.(name,type,severity,taz)][,.(xfc.hours=mean(xfc.hours)),by=.(name,type,severity)] - toplot <- melt(metrics,id.vars=c('name','severity')) toplot[name%in%scenarioNames,panel:=revalue(factor(variable),c('gw.peak'='Regional Charging Peak (GW)','gwh'='Total Energy Charged (GWh)'))] -p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=value,fill=factor(severity, levels=severity_order)))+ +p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=value,fill=factor(severity,levels=severity_order)))+ geom_bar(stat='identity')+ facet_wrap(~panel,scales='free_y')+ labs(y='',x='Scenario',fill='Severity')+ @@ -242,6 +250,7 @@ ggsave(pp(plotsDir,'/energy-charged-by-scenario.png'),p,width=8,height=3,units=' ## XFC hours per site per day +xfc.metric <- all.loads[!is.na(kw)&name%in%scenarioNames][!grepl('<1MW',severity),.(xfc.hours=.N/4),by=.(name,type,severity,taz)][,.(xfc.hours=mean(xfc.hours)),by=.(name,type,severity)] xfc.metric[,panel:='XFC-Hours per Site per Day'] p <- ggplot(xfc.metric,aes(x=factor(name,scenarioNames),y=xfc.hours,fill=factor(severity, levels=severity_order)))+ geom_bar(stat='identity',position='dodge')+ @@ -259,6 +268,54 @@ ggsave(pp(plotsDir,'/xfc-hours-per-site-per-day.png'),p,width=5,height=3,units=' # MOBILITY ########################################## +# events <- readCsv(paste(dataDir, "/events-raw", "/0.events.SC2.csv.gz", sep="")) +# pt <- events[type=="PathTraversal"] +# pt2 <- pt[,c("time","type","vehicleType","vehicle","secondaryFuelLevel", +# "primaryFuelLevel","driver","mode","seatingCapacity","startX", +# "startY", "endX", "endY", "capacity", "arrivalTime", "departureTime", +# "secondaryFuel", "secondaryFuelType", "primaryFuelType", +# "numPassengers", "length", "primaryFuel")] +# pt2$name <- 'Scenario2' +# pt2$mode2 <- "Transit" +# pt2[mode=="car"]$mode2 <- "Car" +# pt2[mode=="car"&startsWith(vehicle,"rideHailVehicle")]$mode2 <- "Ridehail" +# pt2[mode=="walk"]$mode2 <- "Walk" +# pt2[mode=="bike"]$mode2 <- "Bike" +# write.csv( +# pt2, +# file = paste(dataDir, "/events-path", "/path.0.events.SC2.csv.gz", sep=""), +# row.names=FALSE, +# quote=FALSE, +# na="0") +pt2 <- readCsv(paste(dataDir, "/events-path", "/path.0.events.SC2.csv.gz", sep="")) +pt3 <- readCsv(paste(dataDir, "/events-path", "/path.0.events.SC3.csv.gz", sep="")) +pt3$name <- 'Scenario3' +pt <- rbind(pt2, pt3) +pt$fuelType <- "Diesel" +pt[startsWith(vehicleType,"conv-")]$fuelType <- "Gasoline" +pt[startsWith(vehicleType,"hev-")]$fuelType <- "Gasoline" +pt[startsWith(vehicleType,"ev-")]$fuelType <- "Electric" +pt[startsWith(vehicleType,"phev-")]$fuelType <- "Electric" + + + +summary <- pt[mode2%in%c("Car","Ridehail","Transit"),.(VMT=1e-6*sum(length)/1609.34,energy=(sum(primaryFuel+secondaryFuel))*2.77778e-13),by=.(fuelType,name)] +# factor.remap <- c('Walk'='Walk','Bike'='Bike','Ridehail'='Ridehail','Car'='Car','Transit'='Public Transit') +# factor.colors <- c('Walk'='#669900','Bike'='#FFB164','Ridehail'='#B30C0C','Car'='#8A8A8A','Transit'='#0066CC') +factor.colors <- c('Diesel'=marain.dark.grey,'Gasoline'='#8A8A8A','Electric'='#8A8A8A') +factor.remap <- c('Diesel'='Diesel','Gasoline'='Gasoline','Electric'='Electricity') +factor.colors.remapped <- factor.colors +names(factor.colors.remapped) <- factor.remap[names(factor.colors)] +p <- summary[fuelType=="Electric"] %>% ggplot(aes(x=name,y=energy,fill=fuelType))+ + geom_bar(stat='identity')+ + labs(y='',x='Scenario',fill='Mode',title='Mobility Metrics')+ + theme_marain()+ + theme(axis.text.x = element_text(angle = 0, hjust=0.5),strip.text = element_text(size=rel(1.2)))+ + scale_fill_manual(values = factor.colors.remapped) +ggsave(pp(plotsDir,'/metric-mobility.png'),p,width=8,height=3,units='in') + + +################################################# factor.remap <- c('walk'='Walk','bike'='Bike','rh'='Ridehail Solo','rhp'='Ridehail Pooled','rh_empty'='Ridehail (Empty)','cav'='Personal AV','cav_empty'='Personal AV (Empty)','car'='Car','transit'='Public Transit') factor.colors <- c('walk'='#669900','bike'='#FFB164','rh'='#B30C0C','rhp'='#660099','rh_empty'=marain.light.grey,'cav'='#FFE664','cav_empty'=marain.dark.grey,'car'='#8A8A8A','transit'='#0066CC') factor.colors.remapped <- factor.colors diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index c17308014d5..3b086264ec9 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -9,6 +9,7 @@ library(rapport) library(sjmisc) library(ggmap) library(sf) +library(stringr) workDir <- normalizePath("~/Data/GEMINI") activitySimDir <- normalizePath("~/Data/ACTIVITYSIM") @@ -21,7 +22,7 @@ oaklandCbg <- st_read(shpFile) ### #eventsraw <- readCsv(pp(workDir, "/2021Aug22-Oakland/BASE0/events-raw/2.events.BASE0.csv.gz")) -events <- readCsv(pp(workDir, "/2021Aug22-Oakland/BATCH3/events/filtered.0.events.SC0.csv.gz")) +events <- readCsv(pp(workDir, "/2021Oct29/BATCH1/events/filtered.3.events.SC4.csv.gz")) #################### REV @@ -46,7 +47,7 @@ write.csv( na="0") #################### PEV -refuel <- events[type%in%c("RefuelSessionEvent")&!startsWith(person,"rideHail")][ +refuel <- events[type%in%c("RefuelSessionEvent")][ ,.(person,startTime=time-duration,startTime2=time-duration,parkingTaz,chargingPointType, pricingModel,parkingType,locationX,locationY,vehicle,vehicleType,fuel,duration)] actstart <- events[type%in%c("actstart")&!startsWith(person,"rideHail")][ @@ -64,10 +65,14 @@ refuel_actstart$person <- as.character(refuel_actstart$person) # refuel_actstart <- readCsv(pp(workDir, "/2021Aug17-SFBay/BASE0/refuel_actstart.csv")) -# trips <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010-cut-718k-by-shapefile/trips.csv.gz")) +plans <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010/plans.csv.gz")) +trips <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010/trips.csv.gz")) # persons <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010-cut-718k-by-shapefile/persons.csv.gz")) # households <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010-cut-718k-by-shapefile/households.csv.gz")) # blocks <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010-cut-718k-by-shapefile/blocks.csv.gz")) + + + refueling_person_ids <- unique(refuel_actstart$person) plans <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010-cut-718k-by-shapefile/plans.csv.gz")) plans$person_id <- as.character(plans$person_id) @@ -226,7 +231,7 @@ oakland_charging_events_merged_with_urbansim_tripIds_scaledUpby10 <- scaleUpAllS # quote=FALSE, # na="") # -# +# # initInfra_1_5_updated_constrained_non_AlamedaOakland[startsWith(reservedFor, "household")] # # initInfra_1_5[household_id == 1800619] @@ -248,7 +253,7 @@ sfbay_contrained_parking <- sfbay_contrained_parking[,-c("chargingType")] setnames(sfbay_contrained_parking, "ReservedFor", "reservedFor") #sfbay_contrained_parking[chargingPointType!="NoCharger",.N,by=.(parkingType,chargingPointType)] -initInfra_1_5 <- readCsv(pp(workDir, "/init1.6_2021_Sep_22_wgs84.csv")) +initInfra_1_5 <- readCsv(pp(workDir, "/init1.6_2021_Oct_06_wgs84.csv")) initInfra_1_5_updated <- initInfra_1_5[,c("subSpace", "pType", "chrgType", "field_1", "household_id", "X", "Y")] setnames(initInfra_1_5_updated, "chrgType", "chargingPointType") setnames(initInfra_1_5_updated, "pType", "parkingType") @@ -308,7 +313,7 @@ initInfra_1_5_updated[,`:=`(parkingZoneId=paste("AO-PEV",taz,1:.N,sep="-")),] initInfra_1_5_updated$numStalls <- 1 write.csv( initInfra_1_5_updated, - file = pp(workDir, "/init1.6_2021_Sep_22_wgs84_updated.csv"), + file = pp(workDir, "/init1.6_2021_Oct_06_wgs84_updated.csv"), row.names=FALSE, quote=FALSE, na="") @@ -323,56 +328,314 @@ no_charger_or_non_AlamedaOakland_constrained <- sfbay_contrained_parking[ initInfra_1_5_updated_constrained_non_AlamedaOakland <- rbind(initInfra_1_5_updated, no_charger_or_non_AlamedaOakland_constrained) write.csv( initInfra_1_5_updated_constrained_non_AlamedaOakland, - file = pp(workDir, "/gemini-base-scenario-2-parking-infra16-and-constrained-nonAO.csv"), + file = pp(workDir, "/gemini-base-scenario-3-parking-charging-infra16.csv"), row.names=FALSE, quote=FALSE, na="") -logs <- readCsv(pp(workDir, "/beam_to_pydss_federate.csv")) +infra16 <- readCsv(pp(workDir, "/gemini-base-scenario-3-parking-charging-infra16.csv")) +infra16_charging <- infra16[chargingPointType!="NoCharger"] +write.csv( + infra16_charging, + file = pp(workDir, "/gemini-base-scenario-3-charging-with-household-infra16.csv"), + row.names=FALSE, + quote=FALSE, + na="") +infra16_charging[startsWith(reservedFor, "household")]$reservedFor <- "Any" +write.csv( + infra16_charging, + file = pp(workDir, "/gemini-base-scenario-3-charging-no-household-infra16.csv"), + row.names=FALSE, + quote=FALSE, + na="") + + +infra16_parking <- infra16[chargingPointType=="NoCharger"] +write.csv( + infra16_parking, + file = pp(workDir, "/gemini-base-scenario-3-parking-infra16.csv"), + row.names=FALSE, + quote=FALSE, + na="") + + +test <- readCsv(pp(workDir, "/2021Aug22-Oakland/stations/gemini-base-scenario-2-charging-with-household-infra16.csv")) + + +##### +chargingBehaviorFunc <- function(DT) { + rseSum <- DT[,.(fuel=sum(fuel)),by=.(parkingType,chargingPointType)] + rseSum[,fuelShare:=fuel/sum(fuel)] + #dcfc <- rseSum[chargingPointType=="publicfc(150.0|DC)"]$fuelShare + rseSum[chargingPointType=="publicxfc(250.0|DC)"]$fuelShare + #publicL2 <- rseSum[chargingPointType=="publiclevel2(7.2|AC)"]$fuelShare + #work <- rseSum[chargingPointType=="worklevel2(7.2|AC)"]$fuelShare + #home <- rseSum[chargingPointType=="homelevel1(1.8|AC)"]$fuelShare + rseSum[chargingPointType=="homelevel2(7.2|AC)"]$fuelShare + print("************************") + print(rseSum) + #print(pp("DCFC: ",dcfc," - ",)) + #print(pp("PublicL2: ",publicL2)) + #print(pp("Work: ",work)) + #print(pp("Home: ",home)) +} + +events100_SC3 <- "/2021Aug22-Oakland/BATCH3/events/filtered.0.events.SC3.csv.gz" +rse100_SC3_a <- readCsv(pp(workDir, events100_SC3)) +rse100_SC3_c <- rse100_SC3_a[type=='RefuelSessionEvent'] +rse100_SC3_d <- rse100_SC3_a[type=='ChargingPlugInEvent'] + +events100_SC2 <- "/2021Aug22-Oakland/BATCH3/events/filtered.0.events.SC2.csv.gz" +rse100_SC2_a <- readCsv(pp(workDir, events100_SC2)) +rse100_SC2_c <- rse100_SC2_a[type=='RefuelSessionEvent'] +rse100_SC2_d <- rse100_SC2_a[type=='ChargingPlugInEvent'] + +vehicles <- se100_SC3_c[startsWith(parkingZoneId,"AO-")]$vehicle +nrow(se100_SC3_c[startsWith(parkingZoneId,"AO-")]) +nrow(rse100_SC3_d[vehicle%in%vehicles]) + + +ev1 <- rse100_SC3_a[type %in% c("RefuelSessionEvent")][order(time),`:=`(IDX = 1:.N),by=vehicle] +ev2 <- rse100_SC3_a[type %in% c("ChargingPlugInEvent")][,c("vehicle", "time")][order(time),`:=`(IDX = 1:.N),by=vehicle] +ev <- ev1[ev2, on=c("vehicle", "IDX")] + +ev1 <- rse100_SC2_a[type %in% c("RefuelSessionEvent")][order(time),`:=`(IDX = 1:.N),by=vehicle] +ev2 <- rse100_SC2_a[type %in% c("ChargingPlugInEvent")][,c("vehicle", "time")][order(time),`:=`(IDX = 1:.N),by=vehicle] +ev <- ev1[ev2, on=c("vehicle", "IDX")] + + +events010 <- "/2021Aug22-Oakland/BATCH3/events/filtered.0.events.SC2-010.csv.gz" +rse010 <- readCsv(pp(workDir, events010))[type=='RefuelSessionEvent'] +events025 <- "/2021Aug22-Oakland/BATCH3/events/filtered.0.events.SC2-025.csv.gz" +rse025 <- readCsv(pp(workDir, events025))[type=='RefuelSessionEvent'] +events050 <- "/2021Aug22-Oakland/BATCH3/events/filtered.0.events.SC2-050.csv.gz" +rse050 <- readCsv(pp(workDir, events050))[type=='RefuelSessionEvent'] + +# 20.03*sum(rse100$fuel)/sum(rse010$fuel) +# 10.01*sum(rse100$fuel)/sum(rse025$fuel) +# 5.8*sum(rse100$fuel)/sum(rse050$fuel) + +charging_coef <- data.table( + actType=c("Home", "Work", "Charge", "Wherever", "Init"), + coef=c(0, 0, 0, 0, 0) +) + +sum(rse100_SC3_a[type %in% c("RefuelSessionEvent")]$fuel)/sum(rse100_SC2_a[type %in% c("RefuelSessionEvent")]$fuel) +sum(rse100_SC3_a[type %in% c("RefuelSessionEvent")&!startsWith(parkingZoneId,"X-")&chargingPointType%in%homelevel]$fuel)/sum(rse100_SC2_a[type %in% c("RefuelSessionEvent")&!startsWith(parkingZoneId,"X-")&chargingPointType%in%homelevel]$fuel) + + +charging100 <- rse100_SC2[,.(fuel100=mean(fuel)),by=.(actType)] +charging010 <- rse010[,.(fuel010=mean(fuel)),by=.(actType)][charging_coef,on=c("actType")][charging100,on=c("actType")] +charging025 <- rse025[,.(fuel025=mean(fuel)),by=.(actType)][charging_coef,on=c("actType")][charging100,on=c("actType")] +charging050 <- rse050[,.(fuel050=mean(fuel)),by=.(actType)][charging_coef,on=c("actType")][charging100,on=c("actType")] + +charging010$coef <- c(10.54, 10.06, 10.09, 6.42) +charging010 <- charging010[,fuel_100_010:=fuel100/fuel010][,fuel_100_010_W:=coef*fuel_100_010] + +charging025$coef <- c(3.99, 4.02, 3.98, 2.52) +charging025 <- charging025[,fuel_100_025:=fuel100/fuel025][,fuel_100_025_W:=coef*fuel_100_025] + +charging050$coef <- c(2, 2, 2, 2) +charging050 <- charging050[,fuel_100_050:=fuel100/fuel050][,fuel_100_050_W:=coef*fuel_100_050] + +# charging <- rse100[,.(fuel100=sum(fuel)),by=.(parkingType, chargingPointType)] + +# charging_100_010 <- data.table( +# chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", +# "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", +# "publicfc(150.0|DC)", "publicxfc(250.0|DC)"), +# coef_100_010=c(8.02,6.87,9.00,6.41,8.17,10.33)) +# charging010 <- rse010[,.(fuel010=sum(fuel)),by=.(parkingType,chargingPointType)][ +# charging,on=c("parkingType","chargingPointType")][ +# charging_100_010,on=c("chargingPointType")][ +# ,fuel_100_010:=fuel100/fuel010][ +# ,fuel_100_010_W:=coef_100_010*fuel_100_010] +# +# +# charging_100_025 <- data.table( +# chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", +# "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", +# "publicfc(150.0|DC)", "publicxfc(250.0|DC)"), +# coef_100_025=c(2.95,2.56,3.69,2.65,3.18,4.53)) +# charging025 <- rse025[,.(fuel025=sum(fuel)),by=.(parkingType,chargingPointType)][ +# charging,on=c("parkingType","chargingPointType")][ +# charging_100_025,on=c("chargingPointType")][ +# ,fuel_100_025:=fuel100/fuel025][ +# ,fuel_100_025_W:=coef_100_025*fuel_100_025] +# +# +# charging_100_050 <- data.table( +# chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", +# "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", +# "publicfc(150.0|DC)", "publicxfc(250.0|DC)"), +# coef_100_050=c(1.33,1.20,1.88,1.35,1.67,2.28)) +# charging050 <- rse050[,.(fuel050=sum(fuel)),by=.(parkingType,chargingPointType)][ +# charging,on=c("parkingType","chargingPointType")][ +# charging_100_050,on=c("chargingPointType")][ +# ,fuel_100_050:=fuel100/fuel050][ +# ,fuel_100_050_W:=coef_100_050*fuel_100_050] +# +# +# charging <- charging[charging010, on=c("parkingType","chargingPointType")] +# charging <- charging[charging025, on=c("parkingType","chargingPointType")] +# charging <- charging[charging050, on=c("parkingType","chargingPointType")] +# +# publiclevel2(7.2|AC) +# publicfc(150.0|DC) +# worklevel2(7.2|AC) +# homelevel2(7.2|AC) +# homelevel1(1.8|AC) +# publicxfc(250.0|DC) +#c(2.45, 1119.77, 739.21, 8.05, 2.35, 171.38) +#c(3.82, 141.68, 112.27, 9.02, 5.64, 64.84) +#c(10.0,10.0,10.0,10.0,10.0,10.0) +charging_0_010 <- data.table( + chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", + "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", + "publicfc(150.0|DC)", "publicxfc(250.0|DC)"), + fuel0_010_coef=c(8.02,6.87,9.00,6.41,8.17,10.33)) +charging <- charging[charging_0_010,on=c("chargingPointType")][,fuel0_010:=fuel0/fuel001][,fuel0_010_t:=fuel0_010_coef*fuel0_010] +#charging[,fuelShare0_001:=fuelShare0/fuelShare001] +#c(1.74, 21.39, 21.28, 3.55, 2.54, 13.11) +#c(1.10, 101.73, 91.85, 2.79, 1.30, 32.04) +#c(1.10, 101.73, 91.85, 2.79, 1.30, 32.04) +#c(4.0,4.0,4.0,4.0,4.0,4.0) +charging[,fuel0_025_coef:=c(4.0,4.0,4.0,4.0,4.0,4.0)] +charging[,fuel0_025:=fuel0/fuel010] +charging[,fuel0_025_t:=fuel0_025_coef*fuel0_025] +#charging[,fuelShare0_010:=fuelShare0/fuelShare010] +#c(1.0, 14.34, 14.28, 1.21, 0.70, 5.93) +#c(1.07, 5.58, 5.49, 1.87, 1.42, 3.65) +#c(2.0, 2.0, 2.0, 2.0, 2.0, 2.0) +charging[,fuel0_050_coef:=c(2.0, 2.0, 2.0, 2.0, 2.0, 2.0)] +charging[,fuel0_050:=fuel0/fuel050] +charging[,fuel0_050_t:=fuel0_050_coef*fuel0_050] +#charging[,fuelShare0_050:=fuelShare0/fuelShare050] +#c(1.0,290.55,325.98,2.64,1.0,53.32) +#chargingBis <- charging[,c("parkingType","chargingPointType","fuel0_025")] +chargingBis <- charging[ + ,c("parkingType","chargingPointType","fuel0_010", "fuel0_025","fuel0_050")] +chargingBisT <- charging[ + ,c("parkingType","chargingPointType","fuel0_010_t", "fuel0_025_t","fuel0_050_t")] + +gather(chargingBis, scenario, fuelDiff, fuel0_001:fuel0_050) %>% + ggplot(aes(scenario, fuelDiff, fill=chargingPointType)) + + geom_bar(stat='identity',position='dodge') + + +chargingBis$rate <- 4.0*((chargingBis$fuel0_010/chargingBis$fuel0_050)/5.0) -logs[,.(estimatedLoad=sum(estimatedLoad)),by=.(currentTime)] %>% - ggplot(aes(currentTime/3600.,estimatedLoad/1000)) + - geom_bar(stat="identity") -ggplot(logs) + geom_histogram(aes(estimatedLoad)) +### +testFile <- "/2021Aug22-Oakland/BATCH3/events/filtered.0.events.SC2.csv.gz" +test <- readCsv(pp(workDir, testFile)) +test2 <- test[type=='RefuelSessionEvent' & time >= 41400 & time <= 45000] +person2 <- unique(test2$person) +test3 <- test[person%in%person2][actType!=""] +test4 <- test3[time >= 41400 & time <= 45000] +test4[actType!="",.N,by=.(actType)][order(N)] + +test3All <- test[type=="actend"][time<=16*3600&time>=8*3600][sample(.N,234768)] + +test3All$actType2 <- "discr" +test3All[actType=="work"]$actType2 <- "work" +test3All[actType=="Work"]$actType2 <- "work" +test3All[actType=="atwork"]$actType2 <- "work" +test3All[actType=="Home"]$actType2 <- "home" +test3All$time2 <- test3All$time%%(24*3600) +#time<=14*3600&time>=10*3600, +test3All[,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(time),"15 min")), actType2)] %>% + ggplot(aes(timeBin, N, colour=actType2)) + + geom_line() + + scale_x_datetime("time", + breaks=scales::date_breaks("2 hour"), + labels=scales::date_format("%H", tz = dateTZ)) + + scale_y_continuous(breaks = scales::pretty_breaks()) + + theme_classic() + + theme(axis.text.x = element_text(angle = 90, hjust = 1)) #### +looFile <- "/activitysim-plans-base-2010-cut-718k-by-shapefile/plans.csv.gz" +looTest <- readCsv(pp(activitySimDir, looFile)) +#looTest2 <- looTest[ActivityElement=="activity"&person_id%in%person2] +looTest2 <- looTest[ActivityElement=="activity"] +looTest2$actType2 <- "discr" +looTest2[ActivityType=="work"]$actType2 <- "work" +looTest2[ActivityType=="Work"]$actType2 <- "work" +looTest2[ActivityType=="atwork"]$actType2 <- "work" +looTest2[ActivityType=="Home"]$actType2 <- "home" +looTest2[departure_time<=16&departure_time>=8,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(departure_time*3600),"1 hour")), actType2)] %>% + ggplot(aes(timeBin, N, colour=actType2)) + + geom_line() + + scale_x_datetime("time", + breaks=scales::date_breaks("2 hour"), + labels=scales::date_format("%H", tz = dateTZ)) + + scale_y_continuous(breaks = scales::pretty_breaks()) + + theme_classic() + + theme(axis.text.x = element_text(angle = 90, hjust = 1)) +### + +fooFile <- "/2021Aug22-Oakland/beamLog.out-choiceset.txt" + +## -parking <- readCsv(pp(workDir, "/gemini_taz_parking_plugs_power_150kw.csv")) +sc2 <- readCsv(pp(workDir, "/gemini-base-scenario-2-parking-charging-infra16.csv")) +sc3 <- readCsv(pp(workDir, "/gemini-base-scenario-3-parking-charging-infra16.csv")) -parking[,.(feeInCents=mean(feeInCents)),by=.(parkingType,chargingPointType)] +sc2Stalls <- sc2[startsWith(reservedFor, "household")]$parkingZoneId +sc3Stalls <- sc3[startsWith(reservedFor, "household")]$parkingZoneId +sum(sc2[startsWith(reservedFor, "household")]$numStalls) +sum(sc3[startsWith(reservedFor, "household")]$numStalls) +a <- sum(rse100_3[startsWith(parkingZoneId, "AO")]$fuel) +b <- sum(rse100[startsWith(parkingZoneId, "AO")]$fuel) +b <- rse100_3[startsWith(parkingZoneId, "AO"),.(fuel3=mean(fuel)),by=.(chargingPointType)] +a <- rse100[startsWith(parkingZoneId, "AO"),.(fuel2=mean(fuel)),by=.(chargingPointType)] ##### -eventsFile <- "/2021Aug22-Oakland/BATCH3-Calibration/events-raw/0.events (3).csv.gz" -events <- readCsv(pp(workDir, eventsFile)) - -rse <- events[type=='RefuelSessionEvent'] - -rse[,.N,by=.(parkingType,chargingPointType)] - -rseSum <- rse[,.(fuel=sum(fuel)),by=.(parkingType,chargingPointType)] -rseSum[,fuelShare:=fuel/sum(fuel)] -dcfc <- rseSum[chargingPointType=="publicfc(150.0|DC)"]$fuelShare + rseSum[chargingPointType=="publicxfc(250.0|DC)"]$fuelShare -publicL2 <- rseSum[chargingPointType=="publiclevel2(7.2|AC)"]$fuelShare -work <- rseSum[chargingPointType=="worklevel2(7.2|AC)"]$fuelShare -home <- rseSum[chargingPointType=="homelevel1(1.8|AC)"]$fuelShare + rseSum[chargingPointType=="homelevel2(7.2|AC)"]$fuelShare -print("************************") -print(pp("DCFC: ",dcfc)) -print(pp("PublicL2: ",publicL2)) -print(pp("Work: ",work)) -print(pp("Home: ",home)) - -rse$chargingPointType2 <- "DCFC" -rse[chargingPointType%in%c("homelevel1(1.8|AC)","homelevel2(7.2|AC)")]$chargingPointType2 <- "HOME" -rse[chargingPointType%in%c("worklevel2(7.2|AC)")]$chargingPointType2 <- "WORK" -rse[chargingPointType%in%c("publiclevel2(7.2|AC)")]$chargingPointType2 <- "PUBLIC" - -rse[,.N,by=.(chargingPointType2,timeBin=floor(time/300))] %>% - ggplot(aes((timeBin*300)/3600.,N,colour=chargingPointType2)) + - geom_line() + +sc4 <- readCsv(pp(workDir, "/2021Oct29/BATCH1/events/filtered.3.events.SC4.csv.gz")) +sc4Bis <- readCsv(pp(workDir, "/2021Oct29/BATCH1/events/filtered.3.events.SC4Bis.csv.gz")) + +ref4 <- sc4[type=="RefuelSessionEvent"] +ref4Bis <- sc4[type=="RefuelSessionEvent"] + +mean(ref4[time >= 0 && time < 7 * 3600]$fuel) +mean(ref4[time > 22]$fuel) + +test1 <- ref4[grepl("emergency", vehicle)] +test2 <- ref4Bis[grepl("emergency", vehicle)] + + +### + +events <- readCsv(pp(workDir, "/2021Oct29/BATCH1/events/filtered.0.events.SC4Bis5.csv.gz")) +events.sim <- readCsv(pp(workDir, "/2021Oct29/BATCH1/sim/events.sim.SC4Bis5.csv.gz")) +#temp <- readCsv(pp(workDir, "/2021Oct29/BATCH1/sim/events.sim.SC4Bis2.csv.gz")) + +chargingEvents <- events.sim[,-c("type", "IDX")] +nrow(chargingEvents[duration==0]) +nrow(chargingEvents[duration>0]) + +chargingEvents[duration<1800&duration>0] %>% ggplot(aes(duration)) + + theme_classic() + + geom_histogram(bins = 30) + +test <- chargingEvents[duration==0] +test$kindOfVehicle <- "real" +test[startsWith(vehicle,"VirtualCar")]$kindOfVehicle <- "virtual" + + +write.csv( + chargingEvents[duration>0], + file = pp(workDir, "/2021Oct29/BATCH1/chargingEventsFullBayArea.csv.gz"), + row.names=FALSE, + quote=FALSE, + na="0") + + + + diff --git a/src/main/R/gemini/gemini-utils.R b/src/main/R/gemini/gemini-utils.R index 5730de7d8cc..2cc8126817d 100644 --- a/src/main/R/gemini/gemini-utils.R +++ b/src/main/R/gemini/gemini-utils.R @@ -1,20 +1,26 @@ library(tidyverse) library(data.table) -setClass("loadInfo", slots=list(timebinInSec="numeric", siteXFCInKW="numeric", plugXFCInKW="numeric")) - -time.bins <- data.table(time=seq(0,61,by=0.25)*3600,quarter.hour=seq(0,61,by=0.25)) +nbOfBinsInHour <- 3600/900 +binsInterval <- 1/nbOfBinsInHour +siteXFCInKW <- 1000 +plugXFCInKW <- 250 +time.bins <- data.table(time=seq(0,61,by=binsInterval)*3600,quarter.hour=seq(0,61,by=binsInterval)) +chargingTypes.colors <- c("goldenrod2", "#66CCFF", "#669900", "#660099", "#FFCC33", "#CC3300", "#0066CC") +names(chargingTypes.colors) <- c("XFC", "DCFC", "Public-L2", "Work-L2", "Work-L1", "Home-L2", "Home-L1") loadTypes <- data.table::data.table( chargingPointType = c( - "homelevel1(1.8|AC)", "homelevel2(7.2|AC)", "publiclevel2(7.2|AC)", - "worklevel2(7.2|AC)", "custom(7.2|AC)", - "publicfc(150.0|DC)", "custom(150.0|DC)", "publicxfc(250.0|DC)", "custom(250.0|DC)"), - loadType = c( - "Home-L1", "Home-L2", "Public-L2", - "Work-L2", "Work-L2", - "DCFC", "DCFC", "XFC", "XFC")) - + "homelevel1(1.8|AC)", "homelevel2(7.2|AC)", + "worklevel2(7.2|AC)", + "publiclevel2(7.2|AC)", + "publicfc(50.0|DC)", "publicfc(150.0|DC)", "depotfc(150.0|DC)", + "publicxfc(250.0|DC)", "publicxfc(400.0|DC)", "depotfc(250.0|DC)", "depotfc(400.0|DC)"), + loadType = c("Home-L1", "Home-L2", + "Work-L2", + "Public-L2", + "DCFC", "DCFC", "DCFC", + "XFC", "XFC", "XFC", "XFC")) nextTimePoisson <- function(rate) { return(-log(1.0 - runif(1)) / rate) @@ -22,7 +28,7 @@ nextTimePoisson <- function(rate) { scaleUPSession <- function(DT, t, factor) { nb <- nrow(DT) nb.scaled <- nb*factor - rate <- nb.scaled/0.25 + rate <- nb.scaled/binsInterval DT.temp1 <- data.table(start.time2=round(t+cumsum(unlist(lapply(rep(rate, nb.scaled), nextTimePoisson)))*3600))[order(start.time2),] DT.temp2 <- DT[sample(.N,nrow(DT.temp1),replace=T)][order(start.time)] DT.temp1[,row2:=1:.N] @@ -33,18 +39,19 @@ extractChargingSessions <- function(events) { ## replace everything by chargingPointType, when develop problem is solved ## c("vehicle", "time", "type", "parkingTaz", "chargingPointType", "parkingType", "locationY", "locationX", "duration", "vehicleType") ev1 <- events[type %in% c("RefuelSessionEvent")][order(time),`:=`(IDX = 1:.N),by=vehicle] - ev2 <- events[type %in% c("ChargingPlugInEvent")][,c("vehicle", "time")][order(time),`:=`(IDX = 1:.N),by=vehicle] + ev1.vehicles <- unique(ev1$vehicle) + ev2 <- events[vehicle%in%ev1.vehicles][type %in% c("ChargingPlugInEvent")][,c("vehicle", "time")][order(time),`:=`(IDX = 1:.N),by=vehicle] setnames(ev2, "time", "start.time") - ev <- ev1[ev2, on=c("vehicle", "IDX")] + ev <- ev1[ev2, on=c("vehicle", "IDX")][!is.na(parkingTaz)] return(ev) } spreadChargingSessionsIntoPowerIntervals <- function(ev) { ev[,kw:=unlist(lapply(str_split(as.character(chargingPointType),'\\('),function(ll){ as.numeric(str_split(ll[2],'\\|')[[1]][1])}))] ev[,depot:=(substr(vehicle,0,5)=='rideH' & substr(vehicleType,0,5)=='ev-L5')] ev[,plug.xfc:=(kw>=250)] - sessions <- ev[chargingPointType!='None' & time/3600>=4 + sessions <- ev[chargingPointType!='NoCharger' ,.(start.time,depot,plug.xfc,taz=parkingTaz,kw, - x=locationX,y=locationY,duration=duration/60,chargingPointType, + x=locationX,y=locationY,duration=duration/3600.0,chargingPointType, parkingType,vehicleType,vehicle,person,fuel,parkingZoneId)] sessions[,row:=1:.N] start.time.dt <- data.table(time=sessions$start.time) @@ -54,7 +61,7 @@ spreadChargingSessionsIntoPowerIntervals <- function(ev) { } scaleUpAllSessions <- function(DT, expansion.factor) { sim.events <- data.table() - for (bin in seq(min(DT$start.time.bin),max(DT$start.time.bin),by=0.25)) + for (bin in seq(min(DT$start.time.bin),max(DT$start.time.bin),by=binsInterval)) { DT.bin <- DT[start.time.bin == bin] sim.events <- rbind(sim.events, scaleUPSession(DT.bin, bin*3600, expansion.factor)) @@ -66,6 +73,7 @@ scaleUpAllSessions <- function(DT, expansion.factor) { } filterEvents <- function(dataDir, filename, eventsList) { outputFilepath <- paste(dataDir,"/events/filtered.",filename, sep="") + outputFilepath2 <- paste(dataDir,"/events/paths.",filename, sep="") if(!file.exists(outputFilepath)) { events <- readCsv(paste(dataDir, "/events-raw", "/", filename, sep="")) filteredEvents <- events[type %in% eventsList][ @@ -132,16 +140,13 @@ processEventsFileAndScaleUp <- function(dataDir, scaleUpFlag, expFactor) { ## ***************** -extractLoads <- function(sessions, loadTypes, loadInfo, countyNames) { - hourShare <- loadInfo@timebinInSec/3600.0 - siteXFCInKW <- loadInfo@siteXFCInKW - plugXFCInKW <- loadInfo@plugXFCInKW - # here we expand each session into the appropriate number of 15-minute bins, so each row here is 1 15-minute slice of a session - sessions[,plug.xfc:=grepl("(250.0|DC)", chargingPointType)] - loads <- sessions[,.(chargingPointType,depot,plug.xfc,taz,kw=c(rep(kw,length(seq(0,duration/60,by=hourShare))-1),kw*(duration/60-max(seq(0,duration/60,by=hourShare)))/hourShare),x,y,duration,hour.bin=start.time.bin+seq(0,duration/60,by=hourShare)),by='row'] +extractLoads <- function(sessions, loadTypes, countyNames) { + # here we expand each session into the appropriate number of X-minute bins, so each row here is 1 X-minute slice of a session + sessions[,plug.xfc:=grepl("xfc", chargingPointType)] + loads <- sessions[,.(parkingZoneId,chargingPointType,depot,plug.xfc,taz,kw=c(rep(kw,length(seq(0,duration,by=binsInterval))-1),kw*(duration-max(seq(0,duration,by=binsInterval)))/binsInterval),x,y,duration,hour.bin=start.time.bin+seq(0,duration,by=binsInterval)),by='row'] loads[,site.xfc:=(sum(kw)>=siteXFCInKW),by=c('depot','taz','hour.bin')] loads[,xfc:=site.xfc|plug.xfc] - loads[,fuel:=kw*0.25/3.6e6] # the 0.25 converts avg. power in 15-minutes to kwh, then 3.6e6 converts to Joules + loads[,fuel:=kw*binsInterval*3.6e6] # the binsInterval converts avg. power in X-minutes to kwh, then 3.6e6 converts to Joules loads <- loads[,.(x=x[1],y=y[1],fuel=sum(fuel),kw=sum(kw,na.rm=T),site.xfc=site.xfc[1]),by=c('depot','taz','hour.bin','xfc','chargingPointType')] taz <- loads[,.(x2=mean(x),y2=mean(y)),by='taz'] loads <- merge(loads,taz,by='taz') @@ -157,9 +162,7 @@ extractLoads <- function(sessions, loadTypes, loadInfo, countyNames) { ## ***************** -generateReadyToPlot <- function(resultsDirName, loadTypes, loadInfo, countyNames) { - chargingTypes.colors <- c("goldenrod2", "#66CCFF", "#669900", "#660099", "#FFCC33", "#CC3300", "#0066CC") - names(chargingTypes.colors) <- c("XFC", "DCFC", "Public-L2", "Work-L2", "Work-L1", "Home-L2", "Home-L1") +generateReadyToPlot <- function(resultsDirName, loadTypes, countyNames) { file.list <- list.files(path=resultsDirName) all.sessions <- list() all.chargingTypes <- list() @@ -180,7 +183,7 @@ generateReadyToPlot <- function(resultsDirName, loadTypes, loadInfo, countyNames sessions[,code:=code] write.csv(sessions,file = pp(sim.xfc.temp.file,"-sessions.csv"),row.names=FALSE,quote=FALSE,na="0") - loads <- extractLoads(sessions, loadTypes, loadInfo, countyNames) + loads <- extractLoads(sessions, loadTypes, countyNames) loads[,hour.bin2:=hour.bin%%24] loads[,code:=code] write.csv(loads,file = pp(sim.xfc.temp.file,"-loads.csv"),row.names=FALSE,quote=FALSE,na="0") @@ -196,4 +199,4 @@ generateReadyToPlot <- function(resultsDirName, loadTypes, loadInfo, countyNames all.loads[,type:=ifelse(site=='depot','Ridehail Depot','Public')] all.loads[,severity:=paste(type,extreme.lab, sep=" ")] save(all.sessions,all.loads,chargingTypes.colors,file=pp(resultsDirName,'/ready-to-plot.Rdata')) -} +} \ No newline at end of file diff --git a/src/main/java/beam/agentsim/events/handling/BeamEventsLogger.java b/src/main/java/beam/agentsim/events/handling/BeamEventsLogger.java index 9a39f9c70ef..5db5c6795ad 100755 --- a/src/main/java/beam/agentsim/events/handling/BeamEventsLogger.java +++ b/src/main/java/beam/agentsim/events/handling/BeamEventsLogger.java @@ -179,6 +179,9 @@ private void overrideDefaultLoggerSetup(String eventsToWrite) { case "ShiftEvent": eventClass = ShiftEvent.class; break; + case "TeleportationEvent": + eventClass = TeleportationEvent.class; + break; default: Option> classEventOption=beamServices.beamCustomizationAPI().customEventsLogging(className); diff --git a/src/main/python/gemini/beam_pydss_broker.py b/src/main/python/gemini/beam_pydss_broker.py index 876fc80b6d2..0ca73e96ac3 100644 --- a/src/main/python/gemini/beam_pydss_broker.py +++ b/src/main/python/gemini/beam_pydss_broker.py @@ -16,7 +16,7 @@ if isConnected == 1: print("Broker created and connected") second = 0 -while h.helicsBrokerIsConnected(broker) == 1 and second < 7*24*3600: +while h.helicsBrokerIsConnected(broker) == 1: time.sleep(1) second += 1 if second % 3600 == 0: diff --git a/src/main/python/gemini/beam_pydss_processing.py b/src/main/python/gemini/beam_pydss_processing.py index 6aff2f81044..164808c49aa 100644 --- a/src/main/python/gemini/beam_pydss_processing.py +++ b/src/main/python/gemini/beam_pydss_processing.py @@ -1,6 +1,6 @@ import os -basefolder = "/Users/haitamlaarabi/Data/GEMINI/2021March22/370k-warmstart/output" +basefolder = "" beamLog_out = "{}/beamLog.out".format(basefolder) beamLog_out_csv = "{}/beamLog.csv".format(basefolder) file1 = open(beamLog_out, 'r') @@ -8,7 +8,7 @@ file2 = open(beamLog_out_csv, 'w') # Strips the newline character for line in Lines: - if "DELETE-THIS-" in line: + if "CHOICE-SET" in line: file2.writelines(line) print(line) file1.close() diff --git a/src/main/python/gemini/beam_to_pydss_federate.py b/src/main/python/gemini/beam_to_pydss_federate.py index 497b49b06ca..3eb7caab21a 100644 --- a/src/main/python/gemini/beam_to_pydss_federate.py +++ b/src/main/python/gemini/beam_to_pydss_federate.py @@ -9,7 +9,7 @@ import os -def run_beam_to_pydss_federate(station_bus_pairs): +def run_beam_to_pydss_federate(): fedinfo = h.helicsCreateFederateInfo() # set the name @@ -29,14 +29,6 @@ def run_beam_to_pydss_federate(station_bus_pairs): cfed = h.helicsCreateCombinationFederate("beam_to_pydss_federate", fedinfo) logging.info("beam_to_pydss_federate created") - # register publications - # publish an ordered list of charging station codes in same order as charging loads - # pubs_station_loads = {} - # - # for s in range(len(station_bus_pairs)): - # station_id = station_bus_pairs[s][0] - # pubs_station_loads[station_id] = h.helicsFederateRegisterTypePublication(cfed, station_id, "string_vector", "") - print("Register a publication of control signals") # Register a publication of control signals @@ -63,38 +55,18 @@ def syncTime(requestedtime): # start execution loop for t in range(0, 60*3600-timebin, timebin): syncTime(t) - isupdated = 0 - # while isupdated != 1: - # isupdated = h.helicsInputIsUpdated(subs_charger_loads) print("charger loads received at currenttime: " + str(t) + " seconds") logging.info("charger loads received at currenttime: " + str(t) + " seconds") charger_load_json = json.loads(h.helicsInputGetString(subs_charger_loads)) - updated_station_ids = [] - #updated_station_q = [] - #updated_station_p = [] - updated_station_loads = [] logging.info('Logging this as CSV') logging.info('stationId,estimatedLoad,currentTime') for station in charger_load_json: reservedFor = station['reservedFor'] parkingZoneId = station['parkingZoneId'] station_load = station['estimatedLoad'] - updated_station_ids.append(parkingZoneId) - updated_station_loads.append(station_load) logging.info(str(parkingZoneId)+','+str(station_load)+','+str(reservedFor)+','+str(t)) - # uncomment this when pydss is included - # for i in range(len(updated_station_ids)): - # # publish the station assignments - # updated_station = updated_station_ids[i] - # updated_load = updated_station_loads[i] - # h.helicsPublicationPublishVector(pubs_station_loads[updated_station], updated_load)#[station_P, station_Q]) - ############### This section should be un-commented and debugged when we have a controller signal to send to BEAM - # power limits and potentially market signals will come from the controler and if they need reformatting before sending to BEAM, that can be done here - #power_limit_upper = h.helicsInputGetString(subs_power_limit_upper) - #power_limit_lower = h.helicsInputGetString(subs_power_limit_lower) - #lmp_with_control_signal = h.helicsInputGetString(subs_lmp_control) ## format appropriately here # # Let's uncomment this and send dummy control signal to BEAM @@ -111,9 +83,6 @@ def syncTime(requestedtime): all_stations_with_control.append(station_with_control) h.helicsPublicationPublishString(pubs_control, json.dumps(all_stations_with_control, separators=(',', ':'))) - #h.helicsPublicationPublishString(pubs_power_limit_upper, power_limit_upper) - #h.helicsPublicationPublishString(pubs_power_limit_lower, power_limit_lower) - #h.helicsPublicationPublishString(pubs_lmp_control, lmp_with_control_signal) syncTime(t+1) # close the federate @@ -125,20 +94,8 @@ def syncTime(requestedtime): ############################################################################### -def load_station_bus_pairs(): - # with open('station_bus_pairs.csv', 'r') as sbpfile: - # station_bus_list = sbpfile.readlines() - station_bus_pairs = [] - # for sbp in station_bus_list: - # pair = sbp.split(',') - # station_id = pair[0].strip() - # bus_name = pair[1].strip() - # station_bus_pairs.append((station_id, bus_name)) - return station_bus_pairs - if __name__ == "__main__": logging.basicConfig(filename='beam_to_pydss_federate.log', level=logging.DEBUG, filemode='w') - station_bus_pairs = load_station_bus_pairs() logging.info("stations_list_loaded") - run_beam_to_pydss_federate(station_bus_pairs) + run_beam_to_pydss_federate() diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 2e0b5c58e5e..6ebb9393ca7 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,20 @@ import pandas as pd +import os -filename = '/Users/haitamlaarabi/Data/GEMINI/2021Jul30-Oakland/BASE0/events/0.events.BASE0.csv.gz' +filename = '~/Data/GEMINI/2021Oct29/BATCH1/events-raw/0.events.SC4Bis5.csv.gz' +full_filename = os.path.expanduser(filename) compression = None if filename.endswith(".gz"): compression = 'gzip' data = pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) +data_filtered = data.loc[ + data.type.isin(["RefuelSessionEvent", "ChargingPlugInEvent", "ChargingPlugOutEvent", "actstart"]) +] +data_filtered2 = data_filtered[ + ["vehicle", "time", "type", "parkingTaz", "chargingPointType", "parkingType", + "locationY", "locationX", "duration", "vehicleType", "person", "fuel", + "parkingZoneId", "pricingModel", "actType"] +] + +data_filtered2.to_csv('~/Data/GEMINI/2021Oct29/BATCH1/events/filtered.0.events.SC4Bis5.csv.gz') print("END") diff --git a/src/main/python/gemini/unlimited_charging_infrastructure.py b/src/main/python/gemini/unlimited_charging_infrastructure.py index 2df0fd971ab..d0936fe6dd6 100644 --- a/src/main/python/gemini/unlimited_charging_infrastructure.py +++ b/src/main/python/gemini/unlimited_charging_infrastructure.py @@ -1,28 +1,37 @@ #ADD MANY 50DC 150DC 250DC 350DC headerfile = "taz,parkingType,pricingModel,chargingPointType,numStalls,feeInCents,reservedFor" -with open('gemini_taz_unlimited_parking_plugs_power.csv', mode='w') as csv_writer: +with open('gemini_taz_unlimited_parking_stalls.csv', mode='w') as csv_writer: csv_writer.write(headerfile+"\n") for x in range(1, 1455): csv_writer.write(f"{x},Residential,Block,NoCharger,9999999,0,Any" + "\n") + csv_writer.write(f"{x},Workplace,Block,NoCharger,9999999,0,Any" + "\n") + csv_writer.write(f"{x},Public,Block,NoCharger,9999999,0,Any" + "\n") + + +with open('gemini_taz_unlimited_charging_point.csv', mode='w') as csv_writer: + csv_writer.write(headerfile+"\n") + + for x in range(1, 1455): csv_writer.write(f"{x},Residential,Block,HomeLevel1(1.8|AC),9999999,50,Any" + "\n") csv_writer.write(f"{x},Residential,Block,HomeLevel2(7.2|AC),9999999,200,Any" + "\n") - csv_writer.write(f"{x},Workplace,Block,NoCharger,9999999,0,Any" + "\n") csv_writer.write(f"{x},Workplace,Block,WorkLevel2(7.2|AC),9999999,200,Any" + "\n") - csv_writer.write(f"{x},Public,Block,NoCharger,9999999,0,Any" + "\n") csv_writer.write(f"{x},Public,Block,PublicLevel2(7.2|AC),9999999,200,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicFC(150|DC),9999999,7500,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicXFC(250|DC),9999999,15000,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicFC(50|DC),9999999,1600,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicFC(150|DC),9999999,4800,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicXFC(250|DC),9999999,9500,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicXFC(400|DC),9999999,15200,Any" + "\n") -with open('gemini_depot_unlimited_parking_power.csv', mode='w') as csv_writer: +with open('gemini_taz_unlimited_depots.csv', mode='w') as csv_writer: csv_writer.write(headerfile+"\n") for x in range(1, 1455): - csv_writer.write(f"{x},Public,FlatFee,DepotFC(150.0|DC),9999999,0,ridehail(GlobalRHM)" + "\n") - csv_writer.write(f"{x},Public,FlatFee,DepotXFC(250.0|DC),9999999,0,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotFC(150.0|DC),9999999,4800,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotXFC(250.0|DC),9999999,9500,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotXFC(400.0|DC),9999999,15200,ridehail(GlobalRHM)" + "\n") diff --git a/src/main/python/general_analysis/simulation_health_analysis.py b/src/main/python/general_analysis/simulation_health_analysis.py index e865c75dd03..989523f2ae3 100644 --- a/src/main/python/general_analysis/simulation_health_analysis.py +++ b/src/main/python/general_analysis/simulation_health_analysis.py @@ -43,4 +43,14 @@ with open('RunHealthAnalysis.txt', 'w') as file: for detector in detectors: - file.write(detector+","+str(len(matric_log.get(detector, [])))+"\n") \ No newline at end of file + file.write(f"{detector},{len(matric_log.get(detector, []))}\n") + +token = os.environ.get('SLACK_TOKEN') +channel = os.environ.get('SLACK_CHANNEL') +response = requests.post('https://slack.com/api/files.upload', + headers={"Authorization": "Bearer "+token}, + data={'initial_comment': 'Beam Health Analysis', 'channels': channel}, + files={'file': open('RunHealthAnalysis.txt', 'rb')} + ) + +print(response.text) diff --git a/src/main/python/nhts_analysis/get-NHTS-mode_choice.py b/src/main/python/nhts_analysis/get-NHTS-mode_choice.py new file mode 100644 index 00000000000..49eaff36622 --- /dev/null +++ b/src/main/python/nhts_analysis/get-NHTS-mode_choice.py @@ -0,0 +1,279 @@ +import pandas as pd + +import numpy as np +import scipy.ndimage +import geopandas as gpd + +# %% +trips_all = pd.read_csv('https://beam-outputs.s3.amazonaws.com/new_city/nhts/trippub.csv.gz', + usecols=[0, 1, 2, 3, 4, 5, 6, 7, 17, 26, 28, 58, 59, 60, 61, 64, 69, 70, 71, 72, 73, 74, 84, 89, 93, + 102, 103]) + +persons_all = pd.read_csv('https://beam-outputs.s3.amazonaws.com/new_city/nhts/perpub.csv.gz') + + +#%% + +modenames = {1:'Walk',2:'Bike',3:'Car',4:'Car',5:'Car',6:'Car',7:'Car',8:'Car',9:'Car',11:'Bus', + 13:'Bus', 14:'Bus', 15:'Rail', 16:'Subway',17:'Ridehail',20:'Ferry'} + +for cbsa in ['35620']:#persons_all.HH_CBSA.unique(): + trips = trips_all.loc[(trips_all['HH_CBSA'] == cbsa) , :] + + + valid = (trips.TRPMILES > 0) & (trips.TDWKND == 2) & (trips.TRPTRANS != 19) + + + + trips = trips.loc[valid, :] + trips['UniquePID'] = trips.HOUSEID * 100 + trips.PERSONID + trips['startHour'] = np.floor(trips.STRTTIME / 100) + np.mod(trips.STRTTIME, 100) / 60 + trips['endHour'] = np.floor(trips.ENDTIME / 100) + np.mod(trips.ENDTIME, 100) / 60 + trips['toWork'] = (trips.WHYTO == 3) | (trips.WHYTO == 4) + trips['fromWork'] = (trips.WHYFROM == 3) | (trips.WHYFROM == 4) + trips['mode'] = [modenames.get(val, 'Other') for val in trips['TRPTRANS']] + trips['distbin'] = np.digitize(trips.TRPMILES,np.logspace(-1.5,2,30)) + + + workInvolved = (trips.TRIPPURP == 'HBW') + workTrips = trips.loc[workInvolved, :] + + persons = persons_all.loc[(persons_all['HH_CBSA'] == cbsa), :] + + valid = (persons.TRAVDAY > 1) & (persons.TRAVDAY < 7) + + persons = persons.loc[valid,:] + persons['UniquePID'] = persons.HOUSEID * 100 + persons.PERSONID + + workPIDs = set(workTrips.UniquePID) + workerTrips = trips.loc[trips['UniquePID'].isin(workPIDs),:] + + + bydist = trips[['mode','distbin','WTTRDFIN']].groupby(['distbin','mode']).sum().unstack().fillna(0)['WTTRDFIN'] + bydist['dist'] = ((np.append(np.logspace(-1.5,2,30),150))) + bydist.set_index('dist', drop=True, inplace=True) + +#%% + +events = pd.read_csv('https://beam-outputs.s3.amazonaws.com/output/newyork/nyc-200k-baseline__2020-09-07_17-51-04_naj/ITERS/it.10/10.events.csv.gz', index_col=None) + + +pathTraversal = events.loc[(events['type'] == 'PathTraversal')].dropna(how='all', axis=1) #(events['mode'] == 'car') + + +modechoice = events.loc[events.type=='ModeChoice'].dropna(how='all', axis=1) + +mccats = {'walk_transit':'transit', 'drive_transit':'transit','ride_hail_transit':'transit','ride_hail':'ridehail','ride_hail_pooled':'ridehail', + 'walk':'walk','car':'car','bike':'bike'} + +modechoice['mode'] = [mccats.get(val, 'Other') for val in modechoice['mode']] + +bydistbeam = modechoice[['mode','distbin','person']].groupby(['distbin','mode']).count().unstack().fillna(0)['person'] + +pathTraversal['mode_extended'] = pathTraversal['mode'] +pathTraversal['isRH'] = ((pathTraversal['driver'].str.contains('rideHail')== True)) +pathTraversal['isCAV'] = ((pathTraversal['vehicleType'].str.contains('CAV')==True)) +pathTraversal.loc[pathTraversal['isRH'], 'mode_extended'] += '_RH' +pathTraversal.loc[pathTraversal['isCAV'], 'mode_extended'] += '_CAV' +# pathTraversal.loc[pathTraversal.mode == "tram","mode"] = "rail" + +pathTraversal['trueOccupancy'] = pathTraversal['numPassengers'] +pathTraversal.loc[pathTraversal['mode_extended'] == 'car', 'trueOccupancy'] += 1 +pathTraversal.loc[pathTraversal['mode_extended'] == 'walk', 'trueOccupancy'] += 1 +pathTraversal.loc[pathTraversal['mode_extended'] == 'bike', 'trueOccupancy'] += 1 +pathTraversal['vehicleMiles'] = pathTraversal['length']/1609.34 +pathTraversal['passengerMiles'] = (pathTraversal['length'] * pathTraversal['trueOccupancy'])/1609.34 +pathTraversal['vehicleHours'] = (pathTraversal['arrivalTime'] - pathTraversal['departureTime'])/3600. +pathTraversal['passengerHours'] = pathTraversal['vehicleHours'] * pathTraversal['trueOccupancy'] + +pathTraversal['hour'] = np.floor(pathTraversal.time / 3600.0) + + +#%% +mcd = pd.read_csv('https://beam-outputs.s3.amazonaws.com/output/newyork/nyc-200k-baseline__2020-09-07_17-51-04_naj/ITERS/it.10/10.modeChoiceDetailed.csv.gz') +mcdg = mcd[['altType','personId','altTime']].groupby(['personId','altTime']).agg('first') + + +#%% +from gtfspy import import_gtfs +from gtfspy import gtfs +from gtfspy import osm_transfers +import os + +imported_database_path = "test_db_kuopio.sqlite" +if not os.path.exists(imported_database_path): # reimport only if the imported database does not already exist + print("Importing gtfs zip file") + import_gtfs.import_gtfs(["../../../../test/input/newyork/r5-prod/NYC_Subway_20200109.zip", + "../../../../test/input/newyork/r5-prod/MTA_Manhattan_20200123.zip", + "../../../../test/input/newyork/r5-prod/MTA_Bronx_20200121.zip", + "../../../../test/input/newyork/r5-prod/MTA_Brooklyn_20200118.zip", + "../../../../test/input/newyork/r5-prod/MTA_Queens_20200118.zip", + "../../../../test/input/newyork/r5-prod/MTA_Staten_Island_20200118.zip"], + # "../../../../test/input/newyork/r5-prod/NJ_Transit_Bus_20200210.zip"], # input: list of GTFS zip files (or directories) + imported_database_path, # output: where to create the new sqlite3 database + print_progress=True, # whether to print progress when importing data + location_name="New York") + +G = gtfs.GTFS(imported_database_path) +route_shapes = G.get_all_route_shapes() +gdf = pd.DataFrame(route_shapes).set_index('name') + + +#%% + +occ = pd.read_csv("https://beam-outputs.s3.amazonaws.com/output/newyork/nyc-200k-baseline__2020-09-07_17-51-04_naj/ITERS/it.10/10.transitOccupancyByStop.csv") + +#%% +goodroute = "" +goodcol = "" +for col in occ.columns: + if col.startswith("MTA") | col.startswith("NYC_Subway"): + route = col.split('_')[-2] + if route in gdf.index: + print(route) + goodroute = route + goodcol = col + print(occ[col]) + else: + print("BAD") + +#%% +occ2 = occ.unstack().dropna(how='all').to_frame() +occ2['line'] = occ2.index.get_level_values(0).str.split('_').str[-2] +occ2['stop'] = occ2.index.get_level_values(1) + +routeridership = occ2.groupby(['line','stop']).agg(['sum','size']) + + +#%% +from zipfile import ZipFile + +gtfs = dict() +for zipname in os.listdir('../../../../test/input/newyork/r5-prod/'): + if zipname.endswith(".zip"): + zip_file = ZipFile('../../../../test/input/newyork/r5-prod/' + zipname) + files = dict() + text_files = zip_file.infolist() + for text_file in text_files: + files[text_file.filename.split('.')[0]] = pd.read_csv(zip_file.open(text_file.filename)) + gtfs[zipname.split('.')[0]] = files + +#%% +rows = [] +for col in occ.columns: + if ':' in col: + agency = col.split(':')[0] + trip = col.split(':')[1] + if agency in gtfs: + val = gtfs[agency]['trips'].loc[gtfs[agency]['trips'].trip_id == trip] + if val.size > 0: + val = val.iloc[0].to_dict() + val['occ'] = occ.loc[~occ[col].isna(),col].values + val['nStops'] = len(val['occ']) + val['agency'] = agency + rows.append(val) + +b = pd.DataFrame(rows) + + +#%% +collected = dict() + +for name, group in b.groupby(['route_id','direction_id','shape_id','nStops']): + try: + collected[name] = {'occupancy': group['occ'].mean(), 'headsign': group.iloc[0]['trip_headsign'], 'trips':group.shape[0]} + except: + bad = group + print("BAD "+ group.iloc[0]['trip_headsign']) + +collected = pd.DataFrame(collected).transpose() +collected.index.set_names(['route_id','direction_id','shape_id','nStops'], inplace=True).reset_index() +#%% +shapes = gtfs[agency]['shapes'].groupby('shape_id') + +#%% + +shape = 'M010235' +gdf = gpd.GeoDataFrame(shapes.get_group(shape), geometry = gpd.points_from_xy(shapes.get_group(shape).shape_pt_lon,shapes.get_group(shape).shape_pt_lat)) + + +#%% +campoModes = {1:"Walk",2:"Car",3:"Car",4:"Car",5:"Car",6:"Car",7:"Car",8:"Car",9:"Car",10:"Car",11:"Car",12:"Transit",14:"Ridehail",15:"Bike"} +campo = pd.read_csv('/Users/zaneedell/Downloads/austin-trips.csv') +date = pd.to_datetime({"year": campo['5. Year'], "month": campo['3. Month'], "day": campo['4. Day']}) +campo['date'] = date +campo['weekday'] = campo.date.dt.weekday +campo['mode'] = campo.loc[:,'26. Mode of Travel'].fillna(0).apply(lambda x: campoModes.get(int(x),'Other')) +campo.loc[campo['27. Other Mode'] == "RIDE AUSTIN", 'mode'] = "Ridehail" +campo.loc[campo['27. Other Mode'] == "UBER ", 'mode'] = "Ridehail" +campo.loc[campo['27. Other Mode'] == "UBER", 'mode'] = "Ridehail" +campo.loc[campo['27. Other Mode'] == "TRANSIT/TRAIN", 'mode'] = "Transit" +campo.loc[campo['27. Other Mode'] == "BUS/TRANSIT", 'mode'] = "Transit" +campo.loc[campo['27. Other Mode'] == "TRAIN", 'mode'] = "Transit" +campo.loc[campo['27. Other Mode'] == "Tram", 'mode'] = "Transit" + +campo['isWeekday'] = campo.date.dt.dayofweek <= 4 +campo['29. HH Members'].fillna(1.0, inplace=True) + + +campo['weight'] = 1 +campo.loc[campo['mode'] == "Car", "weight"] = campo.loc[campo['mode'] == "Car",'28. Number of People'] +campo.loc[campo['weight'] > 50, 'weight'] = 1 +campo.loc[(campo['mode'] == "Car") & (campo['weight'] == 2), 'mode'] = 'HOV2' +campo.loc[(campo['mode'] == "Car") & (campo['weight'] > 2), 'mode'] = 'HOV3' +modesplitCampo = campo.loc[campo.isWeekday, :].groupby('mode')['weight'].sum() +(modesplitCampo / modesplitCampo.loc[modesplitCampo.index != 'Other'].sum()).to_csv('/Users/zaneedell/Desktop/austin-gpra-pipeline/modesplit-pass.csv') +modesplitCampo2 = campo.loc[campo.isWeekday, :].groupby('mode')['29. HH Members'].sum() +(modesplitCampo2 / modesplitCampo2.loc[modesplitCampo2.index != 'Other'].sum()).to_csv('/Users/zaneedell/Desktop/austin-gpra-pipeline/modesplit-hh.csv') +(campo.loc[campo.isWeekday, 'mode'].value_counts() / sum((campo['mode'] != "Other") & campo.isWeekday)).to_csv('/Users/zaneedell/Desktop/austin-gpra-pipeline/modesplit-vehicleweighted.csv') + +campo.to_csv('/Users/zaneedell/Desktop/austin-gpra-pipeline/survey.csv.gz', compression='gzip') + + + + + +#%% +from shapely import geometry + +def combineRows(rows): + out = [{'personId': rows['6. Person Number'].iloc[0], + 'purpose': rows['25. Purpose'].iloc[0], + 'startLoc': geometry.Point(rows['21. Longitude'].iloc[0], rows['22. Latitude'].iloc[0]), + 'startCity': rows['12. Location City'].iloc[0], + 'prevPurpose': 1, + 'departureTime': rows['53. Departure Hour'].iloc[0] + rows['54. Departure Minute'].iloc[0] / 60 + }] + ind = 1 + for idx in range(len(rows)-1): + trip = dict() + trip['personId'] = rows['6. Person Number'].iloc[ind] + trip['startLoc'] = geometry.Point(rows['21. Longitude'].iloc[ind], rows['22. Latitude'].iloc[ind]) + trip['startCity'] = rows['12. Location City'].iloc[ind] + tripPurp = rows['25. Purpose'].iloc[ind] + out[-1]['purpose'] = tripPurp + trip['prevPurpose'] = tripPurp + if tripPurp == 11: + out[-1]['mode'] = out[-1]['mode'] = rows['mode'].iloc[ind] + else: + if 'mode' in out[-1]: + out[-1]['mode'] += ('->' + rows['mode'].iloc[ind]) + else: + out[-1]['mode'] = rows['mode'].iloc[ind] + trip['departureTime'] = rows['53. Departure Hour'].iloc[ind] + rows['54. Departure Minute'].iloc[ind] / 60 + out[-1]['endLoc'] = geometry.Point(rows['21. Longitude'].iloc[ind], rows['22. Latitude'].iloc[ind]) + out[-1]['endCity'] = rows['12. Location City'].iloc[ind] + out[-1]['arrivalTime'] = rows['51. Arrival Hour'].iloc[ind] + rows['52. Arrival Minute'].iloc[ind] / 60 + if ind < (len(rows) -1): + out.append(trip) + ind += 1 + return pd.DataFrame(out) + + +out = campo.groupby(['2. Sample Number', '6. Person Number']).apply(combineRows) +out['tourType'] = "NHB" +out.loc[out.prevPurpose == 1, "tourType"] = "HBO" +out.loc[out.purpose == 1, "tourType"] = "HBO" +out.loc[(out.prevPurpose == 1) & (out.purpose == 3), "tourType"] = "HBW" +out.loc[(out.prevPurpose == 3) & (out.purpose == 1), "tourType"] = "HBW" +modeSplitByPurpose = out.value_counts(['tourType','mode']).unstack(level=0).fillna(0) \ No newline at end of file diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 22f025e8e52..8262f04bd1e 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -289,6 +289,7 @@ beam.agentsim.agents.vehicles.vehiclesFilePath = ${beam.inputDirectory}"/vehicle beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC = "double | 1.0" beam.agentsim.agents.vehicles.meanRidehailVehicleStartingSOC = "double | 1.0" beam.agentsim.agents.vehicles.transitVehicleTypesByRouteFile = "" +beam.agentsim.agents.vehicles.generateEmergencyHouseholdVehicleWhenPlansRequireIt = "boolean | false" # these must be one of the shared vehicle types beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId = "sharedVehicle-sharedCar" beam.agentsim.agents.vehicles.dummySharedBike.vehicleTypeId = "sharedVehicle-sharedBike" @@ -329,9 +330,20 @@ beam.agentsim.agents.vehicles.sharedFleets = [ beam.agentsim.chargingNetworkManager { timeStepInSeconds = "int | 300" - + chargingPointCountScalingFactor = "double | 1.0" + chargingPointCostScalingFactor = "double | 1.0" + chargingPointFilePath = "" + scaleUp { + enabled = "boolean | false" + expansionFactor_home_activity = "double | 1.0" + expansionFactor_work_activity = "double | 1.0" + expansionFactor_charge_activity = "double | 1.0" + expansionFactor_init_activity = "double | 1.0" + expansionFactor_wherever_activity = "double | 1.0" + } helics { connectionEnabled = "boolean | false" + feedbackEnabled = "boolean | true" coreInitString = "String | --federates=1 --broker_address=tcp://127.0.0.1" coreType = "String | zmq" timeDeltaProperty = "double | 1.0" diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 96a42d0687a..07faba4162c 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -33,7 +33,17 @@ import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, IllegalTrig import beam.agentsim.scheduler.Trigger.TriggerWithId import beam.agentsim.scheduler.{BeamAgentSchedulerTimer, Trigger} import beam.router.Modes.BeamMode -import beam.router.Modes.BeamMode.{CAR, CAV, RIDE_HAIL, RIDE_HAIL_POOLED, RIDE_HAIL_TRANSIT, WALK, WALK_TRANSIT} +import beam.router.Modes.BeamMode.{ + CAR, + CAV, + HOV2_TELEPORTATION, + HOV3_TELEPORTATION, + RIDE_HAIL, + RIDE_HAIL_POOLED, + RIDE_HAIL_TRANSIT, + WALK, + WALK_TRANSIT +} import beam.router.RouteHistory import beam.router.model.{EmbodiedBeamLeg, EmbodiedBeamTrip} import beam.router.osm.TollCalculator @@ -189,10 +199,14 @@ object PersonAgent { case class PersonDepartureTrigger(tick: Int) extends Trigger + case class TeleportationEndsTrigger(tick: Int) extends Trigger + case object PerformingActivity extends BeamAgentState case object ChoosingMode extends Traveling + case object Teleporting extends Traveling + case object WaitingForDeparture extends Traveling case object WaitingForReservationConfirmation extends Traveling @@ -474,30 +488,89 @@ class PersonAgent( case Some(nextAct) => logDebug(s"wants to go to ${nextAct.getType} @ $tick") holdTickAndTriggerId(tick, triggerId) - val modeOfNextLeg = _experiencedBeamPlan.getPlanElements - .get(_experiencedBeamPlan.getPlanElements.indexOf(nextAct) - 1) match { - case leg: Leg => - BeamMode.fromString(leg.getMode) - case _ => None + val indexOfNextActivity = _experiencedBeamPlan.getPlanElements.indexOf(nextAct) + val modeOfNextLeg = _experiencedBeamPlan.getPlanElements.get(indexOfNextActivity - 1) match { + case leg: Leg => BeamMode.fromString(leg.getMode) + case _ => None + } + // If the mode of the next leg is defined and is CAV, use it, otherwise, + // If we don't have a current tour mode (i.e. are not on a tour aka at home), + // use the mode of the next leg as the new tour mode. + val nextTourMode = modeOfNextLeg match { + case Some(CAV) => + Some(CAV) + case _ => + data.currentTourMode.orElse(modeOfNextLeg) } + val personData = data.copy( + currentTourMode = nextTourMode, + numberOfReplanningAttempts = 0 + ) goto(ChoosingMode) using ChoosesModeData( - personData = data.copy( - // If the mode of the next leg is defined and is CAV, use it, otherwise, - // If we don't have a current tour mode (i.e. are not on a tour aka at home), - // use the mode of the next leg as the new tour mode. - currentTourMode = modeOfNextLeg match { - case Some(CAV) => - Some(CAV) - case _ => - data.currentTourMode.orElse(modeOfNextLeg) - }, - numberOfReplanningAttempts = 0 - ), + personData = personData, SpaceTime(currentActivity(data).getCoord, _currentTick.get) ) } } + when(Teleporting) { + case Event( + TriggerWithId(PersonDepartureTrigger(tick), triggerId), + data @ BasePersonData(_, Some(currentTrip), _, _, maybeCurrentTourMode, _, _, _, false, _, _, _) + ) => + assert(currentActivity(data).getLinkId != null) + + // We end our activity when we actually leave, not when we decide to leave, i.e. when we look for a bus or + // hail a ride. We stay at the party until our Uber is there. + eventsManager.processEvent( + new ActivityEndEvent( + tick, + id, + currentActivity(data).getLinkId, + currentActivity(data).getFacilityId, + currentActivity(data).getType + ) + ) + + eventsManager.processEvent( + new PersonDepartureEvent( + tick, + id, + currentActivity(data).getLinkId, + currentTrip.tripClassifier.value + ) + ) + + val arrivalTime = tick + currentTrip.totalTravelTimeInSecs + scheduler ! CompletionNotice( + triggerId, + Vector(ScheduleTrigger(TeleportationEndsTrigger(arrivalTime), self)) + ) + + stay() using data.copy(hasDeparted = true) + + case Event( + TriggerWithId(TeleportationEndsTrigger(tick), triggerId), + data @ BasePersonData(_, Some(currentTrip), _, _, maybeCurrentTourMode, _, _, _, true, _, _, _) + ) => + holdTickAndTriggerId(tick, triggerId) + + val teleportationEvent = new TeleportationEvent( + time = tick, + person = id, + departureTime = currentTrip.legs.head.beamLeg.startTime, + arrivalTime = tick, + startX = currentTrip.legs.head.beamLeg.travelPath.startPoint.loc.getX, + startY = currentTrip.legs.head.beamLeg.travelPath.startPoint.loc.getY, + endX = currentTrip.legs.last.beamLeg.travelPath.endPoint.loc.getX, + endY = currentTrip.legs.last.beamLeg.travelPath.endPoint.loc.getY, + currentTourMode = maybeCurrentTourMode.map(_.value) + ) + eventsManager.processEvent(teleportationEvent) + + goto(ProcessingNextLegOrStartActivity) using data.copy(hasDeparted = true) + } + when(WaitingForDeparture) { /** @@ -507,6 +580,8 @@ class PersonAgent( TriggerWithId(PersonDepartureTrigger(tick), triggerId), data @ BasePersonData(_, Some(currentTrip), _, _, _, _, _, _, false, _, _, _) ) => + assert(currentActivity(data).getLinkId != null) + // We end our activity when we actually leave, not when we decide to leave, i.e. when we look for a bus or // hail a ride. We stay at the party until our Uber is there. eventsManager.processEvent( @@ -518,7 +593,7 @@ class PersonAgent( currentActivity(data).getType ) ) - assert(currentActivity(data).getLinkId != null) + eventsManager.processEvent( new PersonDepartureEvent( tick, @@ -973,6 +1048,75 @@ class PersonAgent( ) ! resRequest goto(WaitingForReservationConfirmation) + case Event( + StateTimeout, + data @ BasePersonData( + currentActivityIndex, + _, + _, + _, + currentTourMode @ Some(HOV2_TELEPORTATION | HOV3_TELEPORTATION), + _, + _, + _, + _, + _, + _, + _ + ) + ) => + nextActivity(data) match { + case Some(activity) => + val (tick, triggerId) = releaseTickAndTriggerId() + val endTime = + if (activity.getEndTime >= tick && Math.abs(activity.getEndTime) < Double.PositiveInfinity) { + activity.getEndTime + } else if (activity.getEndTime >= 0.0 && activity.getEndTime < tick) { + tick + } else { + // logWarn(s"Activity endTime is negative or infinite ${activity}, assuming duration of 10 minutes.") + // TODO consider ending the day here to match MATSim convention for start/end activity + tick + 60 * 10 + } + val newEndTime = if (lastTickOfSimulation >= tick) { + Math.min(lastTickOfSimulation, endTime) + } else { + endTime + } + + assert(activity.getLinkId != null) + eventsManager.processEvent( + new PersonArrivalEvent(tick, id, activity.getLinkId, CAR.value) + ) + + eventsManager.processEvent( + new ActivityStartEvent( + tick, + id, + activity.getLinkId, + activity.getFacilityId, + activity.getType + ) + ) + scheduler ! CompletionNotice( + triggerId, + Vector(ScheduleTrigger(ActivityEndTrigger(newEndTime.toInt), self)) + ) + goto(PerformingActivity) using data.copy( + currentActivityIndex = currentActivityIndex + 1, + currentTrip = None, + restOfCurrentTrip = List(), + currentTourPersonalVehicle = None, + currentTourMode = if (activity.getType.equals("Home")) None else currentTourMode, + hasDeparted = false + ) + case None => + logDebug("PersonAgent nextActivity returned None") + val (_, triggerId) = releaseTickAndTriggerId() + scheduler ! CompletionNotice(triggerId) + stop + } + case Event( StateTimeout, data @ BasePersonData( @@ -1002,9 +1146,8 @@ class PersonAgent( } else if (activity.getEndTime >= 0.0 && activity.getEndTime < tick) { tick } else { - // logWarn(s"Activity endTime is negative or infinite ${activity}, assuming duration of 10 - // minutes.") - //TODO consider ending the day here to match MATSim convention for start/end activity + // logWarn(s"Activity endTime is negative or infinite ${activity}, assuming duration of 10 minutes.") + // TODO consider ending the day here to match MATSim convention for start/end activity tick + 60 * 10 } val newEndTime = if (lastTickOfSimulation >= tick) { @@ -1076,22 +1219,21 @@ class PersonAgent( eventsManager.processEvent(asSkimmerEvent) } - correctedTrip.legs.filter(x => x.beamLeg.mode == BeamMode.CAR || x.beamLeg.mode == BeamMode.CAV).foreach { - carLeg => - eventsManager.processEvent(DriveTimeSkimmerEvent(tick, beamServices, carLeg)) + correctedTrip.legs.filter(x => x.beamLeg.mode == CAR || x.beamLeg.mode == CAV).foreach { carLeg => + eventsManager.processEvent(DriveTimeSkimmerEvent(tick, beamServices, carLeg)) } resetFuelConsumed() - eventsManager.processEvent( - new ActivityStartEvent( - tick, - id, - activity.getLinkId, - activity.getFacilityId, - activity.getType - ) + val activityStartEvent = new ActivityStartEvent( + tick, + id, + activity.getLinkId, + activity.getFacilityId, + activity.getType ) + eventsManager.processEvent(activityStartEvent) + scheduler ! CompletionNotice( triggerId, Vector(ScheduleTrigger(ActivityEndTrigger(newEndTime.toInt), self)) diff --git a/src/main/scala/beam/agentsim/agents/Population.scala b/src/main/scala/beam/agentsim/agents/Population.scala index cd1d15997eb..33055f62c6f 100755 --- a/src/main/scala/beam/agentsim/agents/Population.scala +++ b/src/main/scala/beam/agentsim/agents/Population.scala @@ -11,6 +11,7 @@ import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTri import beam.agentsim.scheduler.Trigger.TriggerWithId import beam.router.RouteHistory import beam.router.osm.TollCalculator +import beam.sim.vehicles.VehiclesAdjustment import beam.sim.{BeamScenario, BeamServices} import beam.utils.logging.LoggingMessageActor import com.conveyal.r5.transit.TransportNetwork @@ -88,6 +89,7 @@ class Population( } private def initHouseholds(sharedVehicleTypes: Set[BeamVehicleType]): Unit = { + val vehicleAdjustment = VehiclesAdjustment.getVehicleAdjustment(beamScenario) scenario.getHouseholds.getHouseholds.values().forEach { household => //TODO a good example where projection should accompany the data if ( @@ -145,7 +147,8 @@ class Population( sharedVehicleFleets, sharedVehicleTypes, routeHistory, - boundingBox + boundingBox, + vehicleAdjustment ), household.getId.toString ) diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala index 901a743c2b9..fb063e8fe8d 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala @@ -306,16 +306,16 @@ class ModeChoiceMultinomialLogit( lazy val modeMultipliers: mutable.Map[Option[BeamMode], Double] = mutable.Map[Option[BeamMode], Double]( + // Some(WAITING) -> modalBehaviors.modeVotMultiplier.waiting, TODO think of alternative for waiting. For now assume "NONE" is waiting Some(TRANSIT) -> modalBehaviors.modeVotMultiplier.transit, Some(RIDE_HAIL) -> modalBehaviors.modeVotMultiplier.rideHail, Some(RIDE_HAIL_POOLED) -> modalBehaviors.modeVotMultiplier.rideHailPooled, Some(RIDE_HAIL_TRANSIT) -> modalBehaviors.modeVotMultiplier.rideHailTransit, Some(CAV) -> modalBehaviors.modeVotMultiplier.CAV, -// Some(WAITING) -> modalBehaviors.modeVotMultiplier.waiting, TODO think of alternative for waiting. For now assume "NONE" is waiting - Some(BIKE) -> modalBehaviors.modeVotMultiplier.bike, - Some(WALK) -> modalBehaviors.modeVotMultiplier.walk, - Some(CAR) -> modalBehaviors.modeVotMultiplier.drive, - None -> modalBehaviors.modeVotMultiplier.waiting + Some(BIKE) -> modalBehaviors.modeVotMultiplier.bike, + Some(WALK) -> modalBehaviors.modeVotMultiplier.walk, + Some(CAR) -> modalBehaviors.modeVotMultiplier.drive, + None -> modalBehaviors.modeVotMultiplier.waiting ) lazy val poolingMultipliers: mutable.Map[automationLevel, Double] = @@ -576,7 +576,15 @@ object ModeChoiceMultinomialLogit { val scale_factor: Double = configHolder.beamConfig.beam.agentsim.agents.modalBehaviors.mulitnomialLogit.utility_scale_factor val mnlUtilityFunctions: Map[String, Map[String, UtilityFunctionOperation]] = Map( - "car" -> Map( + BeamMode.CAR.value -> Map( + "intercept" -> + UtilityFunctionOperation("intercept", params.car_intercept) + ), + BeamMode.CAR_HOV2.value -> Map( + "intercept" -> + UtilityFunctionOperation("intercept", params.car_intercept) + ), + BeamMode.CAR_HOV3.value -> Map( "intercept" -> UtilityFunctionOperation("intercept", params.car_intercept) ), diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index 130d1e28d47..c27994187cf 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -17,13 +17,9 @@ import beam.agentsim.agents.ridehail.RideHailAgent.{ ModifyPassengerScheduleAcks } import beam.agentsim.agents.ridehail.RideHailManager.RoutingResponses -import beam.agentsim.agents.vehicles.{ - BeamVehicle, - BeamVehicleType, - PassengerSchedule, - PersonIdWithActorRef, - VehicleManager -} +import beam.agentsim.agents.vehicles.EnergyEconomyAttributes.Powertrain +import beam.agentsim.agents.vehicles.VehicleCategory.{Bike, Car, VehicleCategory} +import beam.agentsim.agents.vehicles._ import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} @@ -36,11 +32,13 @@ import beam.router.model.{BeamLeg, EmbodiedBeamLeg} import beam.router.osm.TollCalculator import beam.sim.config.BeamConfig.Beam import beam.sim.population.AttributesOfIndividual +import beam.sim.vehicles.VehiclesAdjustment import beam.sim.{BeamScenario, BeamServices} import beam.utils.logging.LoggingMessageActor import beam.utils.logging.pattern.ask import com.conveyal.r5.transit.TransportNetwork import com.vividsolutions.jts.geom.Envelope +import org.apache.commons.math3.distribution.UniformRealDistribution import org.matsim.api.core.v01.population.{Activity, Leg, Person} import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.api.experimental.events.EventsManager @@ -52,6 +50,7 @@ import org.matsim.households.Household import java.util.concurrent.TimeUnit import scala.collection.mutable import scala.concurrent.{ExecutionContext, Future} +import scala.jdk.CollectionConverters.collectionAsScalaIterableConverter object HouseholdActor { @@ -80,7 +79,8 @@ object HouseholdActor { sharedVehicleFleets: Seq[ActorRef] = Vector(), possibleSharedVehicleTypes: Set[BeamVehicleType], routeHistory: RouteHistory, - boundingBox: Envelope + boundingBox: Envelope, + vehiclesAdjustment: VehiclesAdjustment ): Props = { Props( new HouseholdActor( @@ -102,7 +102,8 @@ object HouseholdActor { sharedVehicleFleets, possibleSharedVehicleTypes, routeHistory, - boundingBox + boundingBox, + vehiclesAdjustment ) ) } @@ -111,6 +112,7 @@ object HouseholdActor { personId: Id[Person], whereWhen: SpaceTime, originActivity: Activity, + requireVehicleCategoryAvailable: Option[VehicleCategory], triggerId: Long ) extends HasTriggerId case class ReleaseVehicle(vehicle: BeamVehicle, triggerId: Long) extends HasTriggerId @@ -149,11 +151,12 @@ object HouseholdActor { val population: org.matsim.api.core.v01.population.Population, val household: Household, vehicles: Map[Id[BeamVehicle], BeamVehicle], - homeCoord: Coord, + fallbackHomeCoord: Coord, sharedVehicleFleets: Seq[ActorRef] = Vector(), possibleSharedVehicleTypes: Set[BeamVehicleType], routeHistory: RouteHistory, - boundingBox: Envelope + boundingBox: Envelope, + vehiclesAdjustment: VehiclesAdjustment ) extends LoggingMessageActor with HasTickAndTrigger with ActorLogging { @@ -188,15 +191,49 @@ object HouseholdActor { private var personAndActivityToCav: Map[(Id[Person], Activity), BeamVehicle] = Map() private var personAndActivityToLegs: Map[(Id[Person], Activity), List[BeamLeg]] = Map() + private val realDistribution: UniformRealDistribution = new UniformRealDistribution() + realDistribution.reseedRandomGenerator(beamScenario.beamConfig.matsim.modules.global.randomSeed) + override def loggedReceive: Receive = { case TriggerWithId(InitializeTrigger(tick), triggerId) => + val homeCoordFromPlans = household.members + .flatMap(per => + per.getSelectedPlan.getPlanElements.asScala.flatMap { + case act: Activity if act.getType == "Home" => Some(act.getCoord) + case _ => None + } + ) + .headOption + .getOrElse(fallbackHomeCoord) + val vehiclesByCategory = vehicles.filter(_._2.beamVehicleType.automationLevel <= 3).groupBy(_._2.beamVehicleType.vehicleCategory) - val fleetManagers = vehiclesByCategory.map { case (category, vs) => + + //We should create a vehicle manager for cars and bikes for all households in case they are generated during the simulation + + val vehiclesByAllCategories = List(Car, Bike) + .map(cat => cat -> vehiclesByCategory.getOrElse(cat, Map[Id[BeamVehicle], BeamVehicle]())) + .toMap + val fleetManagers = vehiclesByAllCategories.map { case (category, vs) => + val emergencyGenerator = new EmergencyHouseholdVehicleGenerator( + household, + homeCoordFromPlans, + beamScenario, + vehiclesAdjustment, + category + ) val fleetManager = context.actorOf( - Props(new HouseholdFleetManager(parkingManager, vs, homeCoord, beamServices.beamConfig.beam.debug)), + Props( + new HouseholdFleetManager( + parkingManager, + vs, + homeCoordFromPlans, + Some(emergencyGenerator), + beamServices.beamConfig.beam.debug + ) + ), category.toString ) context.watch(fleetManager) @@ -229,7 +266,7 @@ object HouseholdActor { s"Setting up household cav ${cav.id} with driver ${cav.getDriver} to be set with driver ${cavDriverRef}" ) context.watch(cavDriverRef) - cav.spaceTime = SpaceTime(homeCoord, 0) + cav.spaceTime = SpaceTime(homeCoordFromPlans, 0) schedulerRef ! ScheduleTrigger(InitializeTrigger(0), cavDriverRef) cav.setManager(Some(self)) cav.becomeDriver(cavDriverRef) @@ -482,12 +519,12 @@ object HouseholdActor { Future .sequence(vehicles.filter(_._2.beamVehicleType.automationLevel > 3).values.map { veh => veh.setManager(Some(self)) - veh.spaceTime = SpaceTime(homeCoord.getX, homeCoord.getY, 0) for { ParkingInquiryResponse(stall, _, _) <- parkingManager ? ParkingInquiry .init(veh.spaceTime, "init", triggerId = triggerId) } { veh.useParkingStall(stall) + veh.spaceTime = SpaceTime(stall.locationUTM.getX, stall.locationUTM.getY, 0) } Future.successful(()) }) @@ -504,4 +541,66 @@ object HouseholdActor { } } + class EmergencyHouseholdVehicleGenerator( + household: Household, + homeCoordFromPlans: Coord, + beamScenario: BeamScenario, + vehiclesAdjustment: VehiclesAdjustment, + defaultCategory: VehicleCategory + ) { + private val realDistribution: UniformRealDistribution = new UniformRealDistribution() + realDistribution.reseedRandomGenerator(beamScenario.beamConfig.matsim.modules.global.randomSeed) + + private val generateEmergencyHousehold = + beamScenario.beamConfig.beam.agentsim.agents.vehicles.generateEmergencyHouseholdVehicleWhenPlansRequireIt + + def createVehicle(personId: Id[Person], vehicleIndex: Int, category: VehicleCategory): Option[BeamVehicle] = { + val vehicleTypeMaybe = + if (generateEmergencyHousehold && defaultCategory == category) { + category match { + case VehicleCategory.Car => + vehiclesAdjustment + .sampleVehicleTypesForHousehold( + 1, + VehicleCategory.Car, + household.getIncome.getIncome, + household.getMemberIds.size(), + householdPopulation = null, + homeCoordFromPlans, + realDistribution + ) + .headOption + .orElse { + beamScenario.vehicleTypes.get( + Id.create( + beamScenario.beamConfig.beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId, + classOf[BeamVehicleType] + ) + ) + } + case VehicleCategory.Bike => + beamScenario.vehicleTypes + .get( + Id.create( + beamScenario.beamConfig.beam.agentsim.agents.vehicles.dummySharedBike.vehicleTypeId, + classOf[BeamVehicleType] + ) + ) + case _ => None + } + } else None + vehicleTypeMaybe map { vehicleType => + val vehicle = new BeamVehicle( + Id.createVehicleId(personId.toString + "-emergency-" + vehicleIndex), + new Powertrain(vehicleType.primaryFuelConsumptionInJoulePerMeter), + vehicleType + ) + beamScenario.privateVehicles.put(vehicle.id, vehicle) + vehicle.initializeFuelLevelsFromUniformDistribution( + beamScenario.beamConfig.beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC + ) + vehicle + } + } + } } diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 3aa609cdc6f..57f4719f2d2 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -1,57 +1,54 @@ package beam.agentsim.agents.household -import java.util.concurrent.TimeUnit -import akka.actor.Status.{Failure, Success} import akka.actor.ActorRef +import akka.actor.Status.{Failure, Success} import akka.pattern.pipe import akka.util.Timeout import beam.agentsim.Resource.NotifyVehicleIdle import beam.agentsim.agents.BeamAgent.Finish import beam.agentsim.agents.InitializeTrigger -import beam.agentsim.agents.household.HouseholdActor.{ - GetVehicleTypes, - MobilityStatusInquiry, - MobilityStatusResponse, - ReleaseVehicle, - ReleaseVehicleAndReply, - VehicleTypesResponse -} +import beam.agentsim.agents.household.HouseholdActor._ import beam.agentsim.agents.household.HouseholdFleetManager.ResolvedParkingResponses import beam.agentsim.agents.modalbehaviors.DrivesVehicle.ActualVehicle -import beam.agentsim.agents.vehicles.{BeamVehicle, VehicleManager} +import beam.agentsim.agents.vehicles.BeamVehicle import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.CompletionNotice -import beam.agentsim.scheduler.Trigger.TriggerWithId import beam.agentsim.scheduler.HasTriggerId +import beam.agentsim.scheduler.Trigger.TriggerWithId import beam.sim.config.BeamConfig.Beam.Debug -import beam.utils.logging.{ExponentialLazyLogging, LoggingMessageActor} import beam.utils.logging.pattern.ask +import beam.utils.logging.{ExponentialLazyLogging, LoggingMessageActor} import org.matsim.api.core.v01.{Coord, Id} +import java.util.concurrent.TimeUnit import scala.concurrent.{ExecutionContext, Future} class HouseholdFleetManager( parkingManager: ActorRef, vehicles: Map[Id[BeamVehicle], BeamVehicle], homeCoord: Coord, + maybeEmergencyHouseholdVehicleGenerator: Option[EmergencyHouseholdVehicleGenerator], implicit val debug: Debug ) extends LoggingMessageActor with ExponentialLazyLogging { private implicit val timeout: Timeout = Timeout(50000, TimeUnit.SECONDS) private implicit val executionContext: ExecutionContext = context.dispatcher + private var nextVehicleIndex = 0 - private var availableVehicles: List[BeamVehicle] = Nil + private val vehiclesInternal: collection.mutable.Map[Id[BeamVehicle], BeamVehicle] = + collection.mutable.Map(vehicles.toSeq: _*) + private var availableVehicles: List[BeamVehicle] = Nil var triggerSender: Option[ActorRef] = None override def loggedReceive: Receive = { case ResolvedParkingResponses(triggerId, xs) => logger.debug(s"ResolvedParkingResponses ($triggerId, $xs)") xs.foreach { case (id, resp) => - val veh = vehicles(id) + val veh = vehiclesInternal(id) veh.setManager(Some(self)) - veh.spaceTime = SpaceTime(homeCoord.getX, homeCoord.getY, 0) + veh.spaceTime = SpaceTime(resp.stall.locationUTM.getX, resp.stall.locationUTM.getY, 0) veh.setMustBeDrivenHome(true) veh.useParkingStall(resp.stall) self ! ReleaseVehicleAndReply(veh, triggerId = triggerId) @@ -73,7 +70,13 @@ class HouseholdFleetManager( case NotifyVehicleIdle(vId, whenWhere, _, _, _, _) => val vehId = vId.asInstanceOf[Id[BeamVehicle]] - vehicles(vehId).spaceTime = whenWhere + vehiclesInternal.get(vehId) match { + case Some(vehicle) => + vehicle.spaceTime = whenWhere + logger.debug("updated vehicle {} with location {}", vehId, whenWhere) + case _ => + logger.error("WHY ISN'T THIS VEHICLE HERE") + } logger.debug("updated vehicle {} with location {}", vehId, whenWhere) case ReleaseVehicle(vehicle, _) => @@ -98,16 +101,63 @@ class HouseholdFleetManager( case GetVehicleTypes(triggerId) => sender() ! VehicleTypesResponse(vehicles.values.map(_.beamVehicleType).toSet, triggerId) - case MobilityStatusInquiry(_, _, _, triggerId) => - availableVehicles = availableVehicles match { - case firstVehicle :: rest => - logger.debug("Vehicle {} is now taken", firstVehicle.id) - firstVehicle.becomeDriver(sender) - sender() ! MobilityStatusResponse(Vector(ActualVehicle(firstVehicle)), triggerId) - rest - case Nil => - sender() ! MobilityStatusResponse(Vector(), triggerId) - Nil + case MobilityStatusInquiry(personId, whenWhere, _, requireVehicleCategoryAvailable, triggerId) => + { + for { + neededVehicleCategory <- requireVehicleCategoryAvailable + emergencyHouseholdVehicleGenerator <- maybeEmergencyHouseholdVehicleGenerator + vehicle <- emergencyHouseholdVehicleGenerator.createVehicle(personId, nextVehicleIndex, neededVehicleCategory) + } yield { + if (availableVehicles.isEmpty) { + // Create a vehicle out of thin air + nextVehicleIndex += 1 + vehicle.setManager(Some(self)) + vehicle.spaceTime = whenWhere + val mobilityRequester = sender() + vehiclesInternal(vehicle.id) = vehicle + + // Pipe my car through the parking manager + // and complete initialization only when I got them all. + val responseFuture = parkingManager ? ParkingInquiry.init( + whenWhere, + "wherever", + triggerId = triggerId + ) + logger.warn( + s"No vehicles available for category ${neededVehicleCategory} available for person ${personId.toString}, creating a new vehicle with id ${vehicle.id.toString}" + ) + + responseFuture.collect { case ParkingInquiryResponse(stall, _, otherTriggerId) => + vehicle.useParkingStall(stall) + logger.debug("Vehicle {} is now taken, which was just created", vehicle.id) + vehicle.becomeDriver(mobilityRequester) + MobilityStatusResponse(Vector(ActualVehicle(vehicle)), otherTriggerId) + } pipeTo mobilityRequester + } else { + availableVehicles = availableVehicles match { + case firstVehicle :: rest => + logger.debug("Vehicle {} is now taken", firstVehicle.id) + firstVehicle.becomeDriver(sender) + sender() ! MobilityStatusResponse(Vector(ActualVehicle(firstVehicle)), triggerId) + rest + case _ => + logger.error(s"THE LIST OF VEHICLES SHOULDN'T BE EMPTY") + Nil + } + } + } + }.getOrElse { + availableVehicles = availableVehicles match { + case firstVehicle :: rest => + logger.debug("Vehicle {} is now taken", firstVehicle.id) + firstVehicle.becomeDriver(sender) + sender() ! MobilityStatusResponse(Vector(ActualVehicle(firstVehicle)), triggerId) + rest + case Nil => + logger.debug(s"Not returning vehicle because no default is defined") + sender() ! MobilityStatusResponse(Vector(), triggerId) + Nil + } } case Finish => diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index 3591513304f..6b7506b5915 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -3,36 +3,39 @@ package beam.agentsim.agents.modalbehaviors import akka.actor.{ActorRef, FSM} import akka.pattern.pipe import beam.agentsim.agents.BeamAgent._ -import beam.agentsim.agents.PersonAgent.{ChoosingMode, _} +import beam.agentsim.agents.PersonAgent._ import beam.agentsim.agents._ import beam.agentsim.agents.household.HouseholdActor.{MobilityStatusInquiry, MobilityStatusResponse, ReleaseVehicle} import beam.agentsim.agents.modalbehaviors.ChoosesMode._ import beam.agentsim.agents.modalbehaviors.DrivesVehicle.{ActualVehicle, Token, VehicleOrToken} import beam.agentsim.agents.ridehail.{RideHailInquiry, RideHailRequest, RideHailResponse} import beam.agentsim.agents.vehicles.AccessErrorCodes.RideHailNotRequestedError +import beam.agentsim.agents.vehicles.VehicleCategory.VehicleCategory +import beam.agentsim.agents.vehicles.EnergyEconomyAttributes.Powertrain import beam.agentsim.agents.vehicles.VehicleProtocol.StreetVehicle -import beam.agentsim.agents.vehicles.{PersonIdWithActorRef, _} +import beam.agentsim.agents.vehicles._ import beam.agentsim.events.{ModeChoiceEvent, SpaceTime} +import beam.agentsim.infrastructure.parking.GeoLevel import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse, ZonalParkingManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.router.BeamRouter._ import beam.router.Modes.BeamMode import beam.router.Modes.BeamMode.{WALK, _} import beam.router.model.{BeamLeg, EmbodiedBeamLeg, EmbodiedBeamTrip} -import beam.sim.{BeamServices, Geofence} +import beam.router.{Modes, RoutingWorker} import beam.sim.population.AttributesOfIndividual +import beam.sim.{BeamServices, Geofence} import beam.utils.logging.pattern.ask import beam.utils.plan.sampling.AvailableModeUtils._ import com.vividsolutions.jts.geom.Envelope -import org.matsim.api.core.v01.population.{Activity, Leg} import org.matsim.api.core.v01.Id +import org.matsim.api.core.v01.population.{Activity, Leg} import org.matsim.core.population.routes.NetworkRoute import org.matsim.core.utils.misc.Time +import java.util.concurrent.atomic.AtomicReference import scala.concurrent.duration._ import scala.concurrent.{ExecutionContext, Future} -import beam.agentsim.infrastructure.parking.GeoLevel -import beam.router.{Modes, RoutingWorker} /** * BEAM @@ -97,6 +100,34 @@ trait ChoosesMode { needsToCalculateCost = needsToCalculateCost ) + private var teleportationVehiclesCount = 0 + + private lazy val teleportationVehicleBeamType: BeamVehicleType = { + val sharedVehicleType = beamScenario.vehicleTypes( + Id.create( + beamServices.beamConfig.beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId, + classOf[BeamVehicleType] + ) + ) + + sharedVehicleType + } + + private def createSharedTeleportationVehicle(location: SpaceTime): BeamVehicle = { + teleportationVehiclesCount += 1 + + val stringId = s"${BeamVehicle.idPrefixSharedTeleportationVehicle}-$teleportationVehiclesCount" + val vehicle = new BeamVehicle( + BeamVehicle.createId(id, Some(stringId)), + new Powertrain(0.0), + beamVehicleType = teleportationVehicleBeamType, + vehicleManagerId = new AtomicReference(VehicleManager.NoManager.managerId) + ) + vehicle.spaceTime = location + + vehicle + } + def bodyVehiclePersonId: PersonIdWithActorRef = PersonIdWithActorRef(id, self) def boundingBox: Envelope @@ -155,6 +186,46 @@ trait ChoosesMode { _ ) => self ! MobilityStatusResponse(Vector(beamVehicles(vehicle)), getCurrentTriggerIdOrGenerate) + // If we don't know the mode in advance we'll see what's out there + case ChoosesModeData( + BasePersonData( + _, + _, + _, + _, + Some(HOV2_TELEPORTATION | HOV3_TELEPORTATION), + _, + _, + _, + _, + _, + _, + _ + ), + currentLocation, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _ + ) => + val teleportationVehicle = createSharedTeleportationVehicle(currentLocation) + val vehicles = Vector(ActualVehicle(teleportationVehicle)) + self ! MobilityStatusResponse(vehicles, getCurrentTriggerIdOrGenerate) // Only need to get available street vehicles if our mode requires such a vehicle case ChoosesModeData( BasePersonData( @@ -162,7 +233,7 @@ trait ChoosesMode { _, _, _, - None | Some(CAR | BIKE | DRIVE_TRANSIT | BIKE_TRANSIT), + None, _, _, _, @@ -198,6 +269,55 @@ trait ChoosesMode { currentLocation, _experiencedBeamPlan.activities(currentActivityIndex) ) pipeTo self + // If we know the mode in advance we need to make sure a vehicle exists + case ChoosesModeData( + BasePersonData( + currentActivityIndex, + _, + _, + _, + Some(mode @ (CAR | BIKE | DRIVE_TRANSIT | BIKE_TRANSIT | CAR_HOV2 | CAR_HOV3)), + _, + _, + _, + _, + _, + _, + _ + ), + currentLocation, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _, + _ + ) => + implicit val executionContext: ExecutionContext = context.system.dispatcher + val requireVehicleCategoryAvailable = mode match { + case CAR | DRIVE_TRANSIT | CAR_HOV2 | CAR_HOV3 => Some(VehicleCategory.Car) + case BIKE_TRANSIT | BIKE => Some(VehicleCategory.Bike) + case _ => None + } + requestAvailableVehicles( + vehicleFleets, + currentLocation, + _experiencedBeamPlan.activities(currentActivityIndex), + requireVehicleCategoryAvailable + ) pipeTo self // Otherwise, send empty list to self case _ => self ! MobilityStatusResponse(Vector(), getCurrentTriggerIdOrGenerate) @@ -207,7 +327,8 @@ trait ChoosesMode { private def requestAvailableVehicles( vehicleFleets: Seq[ActorRef], location: SpaceTime, - activity: Activity + activity: Activity, + requireVehicleCategoryAvailable: Option[VehicleCategory] = None ): Future[MobilityStatusResponse] = { implicit val executionContext: ExecutionContext = context.system.dispatcher Future @@ -217,6 +338,7 @@ trait ChoosesMode { id, location, activity, + requireVehicleCategoryAvailable, getCurrentTriggerIdOrGenerate ) ) @@ -242,20 +364,16 @@ trait ChoosesMode { matsimPlan.getPerson ).filterNot(mode => choosesModeData.excludeModes.contains(mode)) // Make sure the current mode is allowable + val replanningIsAvailable = + choosesModeData.personData.numberOfReplanningAttempts < beamServices.beamConfig.beam.agentsim.agents.modalBehaviors.maximumNumberOfReplanningAttempts val correctedCurrentTourMode = choosesModeData.personData.currentTourMode match { - case Some(mode) - if availableModes - .contains( - mode - ) && choosesModeData.personData.numberOfReplanningAttempts < beamServices.beamConfig.beam.agentsim.agents.modalBehaviors.maximumNumberOfReplanningAttempts => + case Some(mode @ (HOV2_TELEPORTATION | HOV3_TELEPORTATION)) + if availableModes.contains(CAR) && replanningIsAvailable => Some(mode) - case Some(mode) if availableModes.contains(mode) => - Some(WALK) - case None - if choosesModeData.personData.numberOfReplanningAttempts >= beamServices.beamConfig.beam.agentsim.agents.modalBehaviors.maximumNumberOfReplanningAttempts => - Some(WALK) - case _ => - None + case Some(mode) if availableModes.contains(mode) && replanningIsAvailable => Some(mode) + case Some(mode) if availableModes.contains(mode) => Some(WALK) + case None if !replanningIsAvailable => Some(WALK) + case _ => None } val bodyStreetVehicle = createBodyStreetVehicle(currentPersonLocation) @@ -264,7 +382,7 @@ trait ChoosesMode { var availablePersonalStreetVehicles = correctedCurrentTourMode match { - case None | Some(CAR | BIKE) => + case None | Some(CAR | BIKE | HOV2_TELEPORTATION | HOV3_TELEPORTATION) => // In these cases, a personal vehicle will be involved newlyAvailableBeamVehicles case Some(DRIVE_TRANSIT | BIKE_TRANSIT) => @@ -384,23 +502,33 @@ trait ChoosesMode { // Request from household the trip legs to put into trip householdRef ! CavTripLegsRequest(bodyVehiclePersonId, currentActivity(choosesModeData.personData)) responsePlaceholders = makeResponsePlaceholders(withPrivateCAV = true) - case Some(mode @ (CAR | BIKE)) => + case Some(HOV2_TELEPORTATION) => + val vehicles = filterStreetVehiclesForQuery(newlyAvailableBeamVehicles.map(_.streetVehicle), CAR) + .map(car_vehicle => car_vehicle.copy(mode = CAR_HOV2)) + makeRequestWith(withTransit = false, vehicles :+ bodyStreetVehicle) + responsePlaceholders = makeResponsePlaceholders(withRouting = true) + case Some(HOV3_TELEPORTATION) => + val vehicles = filterStreetVehiclesForQuery(newlyAvailableBeamVehicles.map(_.streetVehicle), CAR) + .map(car_vehicle => car_vehicle.copy(mode = CAR_HOV3)) + makeRequestWith(withTransit = false, vehicles :+ bodyStreetVehicle) + responsePlaceholders = makeResponsePlaceholders(withRouting = true) + case Some(tourMode @ (CAR | BIKE | CAR_HOV2 | CAR_HOV3)) => val maybeLeg = _experiencedBeamPlan.getPlanElements .get(_experiencedBeamPlan.getPlanElements.indexOf(nextAct) - 1) match { case l: Leg => Some(l) case _ => None } maybeLeg.map(_.getRoute) match { - case Some(r: NetworkRoute) => + case Some(networkRoute: NetworkRoute) => val maybeVehicle = - filterStreetVehiclesForQuery(newlyAvailableBeamVehicles.map(_.streetVehicle), mode).headOption + filterStreetVehiclesForQuery(newlyAvailableBeamVehicles.map(_.streetVehicle), tourMode).headOption maybeVehicle match { case Some(vehicle) => router ! matsimLegToEmbodyRequest( - r, + networkRoute, vehicle, departTime, - mode, + tourMode, beamServices, choosesModeData.currentLocation.loc, nextAct.getCoord, @@ -408,14 +536,33 @@ trait ChoosesMode { ) responsePlaceholders = makeResponsePlaceholders(withRouting = true) case _ => - makeRequestWith(withTransit = false, Vector(bodyStreetVehicle)) + makeRequestWith( + withTransit = false, + Vector(bodyStreetVehicle) + ) + logger.error("If the agent has this trip in their plans, we should have created a vehicle for them") responsePlaceholders = makeResponsePlaceholders(withRouting = true) } case _ => - makeRequestWith( - withTransit = false, - filterStreetVehiclesForQuery(newlyAvailableBeamVehicles.map(_.streetVehicle), mode) :+ bodyStreetVehicle - ) + val availableVehicles = + filterStreetVehiclesForQuery(newlyAvailableBeamVehicles.map(_.streetVehicle), tourMode).map(vehicle => { + vehicle.mode match { + case CAR => vehicle.copy(mode = tourMode) + case _ => vehicle + } + }) + if (availableVehicles.isEmpty) { + logger.error("If the agent has this trip in their plans, we should have created a vehicle for them") + makeRequestWith( + withTransit = false, + Vector(bodyStreetVehicle) + ) + } else { + makeRequestWith( + withTransit = false, + availableVehicles :+ bodyStreetVehicle + ) + } responsePlaceholders = makeResponsePlaceholders(withRouting = true) } case Some(mode @ (DRIVE_TRANSIT | BIKE_TRANSIT)) => @@ -602,8 +749,19 @@ trait ChoosesMode { routeHistory.rememberRoute(leg.travelPath.linkIds, leg.startTime) } } - val parkingRequestIds = makeParkingInquiries(choosesModeData, response.itineraries) - val newParkingRequestIds = choosesModeData.parkingRequestIds ++ parkingRequestIds + val thereAreTeleportationItineraries = response.itineraries.foldLeft(false) { (thereAreTeleportations, trip) => + val thereAreTeleportationVehicles = trip.legs.foldLeft(false) { (accum, leg) => + accum || BeamVehicle.isSharedTeleportationVehicle(leg.beamVehicleId) + } + thereAreTeleportations || thereAreTeleportationVehicles + } + val newParkingRequestIds = if (thereAreTeleportationItineraries) { + choosesModeData.parkingRequestIds + } else { + val parkingRequestIds: Seq[(Int, VehicleOnTrip)] = makeParkingInquiries(choosesModeData, response.itineraries) + choosesModeData.parkingRequestIds ++ parkingRequestIds + } + val dummyVehiclesPresented = makeVehicleRequestsForDummySharedVehicles(response.itineraries) val newData = if (dummyVehiclesPresented) { choosesModeData.copy( @@ -728,6 +886,7 @@ trait ChoosesMode { VehicleManager.getReservedFor(veh.vehicleManagerId.get).get, Some(veh), None, + Some(this.id), attributes.valueOfTime, getActivityEndTime(nextAct, beamServices) - leg.beamLeg.endTime, reserveStall = false, @@ -737,11 +896,8 @@ trait ChoosesMode { } } - parkingInquiries.foreach { case (_, inquiry) => - if (inquiry.isChargingRequestOrEV) chargingNetworkManager ! inquiry - else parkingManager ! inquiry - } parkingInquiries.map { case (vehicleOnTrip, inquiry) => + park(inquiry) inquiry.requestId -> vehicleOnTrip } } @@ -829,10 +985,15 @@ trait ChoosesMode { responseCopy } - private def legVehicleHasParkingBehavior(embodiedLeg: EmbodiedBeamLeg) = { + private def legVehicleHasParkingBehavior(embodiedLeg: EmbodiedBeamLeg): Boolean = { /* we need to park cars and any shared vehicles */ - embodiedLeg.beamLeg.mode == CAR && dummyRHVehicle.id != embodiedLeg.beamVehicleId || - (embodiedLeg.beamLeg.mode == BIKE && beamVehicles.get(embodiedLeg.beamVehicleId).forall(_.isInstanceOf[Token])) + /* teleportation vehicles are not actual vehicles, so, they do not require parking */ + val isTeleportationVehicle = BeamVehicle.isSharedTeleportationVehicle(embodiedLeg.beamVehicleId) + val isRealCar = embodiedLeg.beamLeg.mode == CAR && dummyRHVehicle.id != embodiedLeg.beamVehicleId + !isTeleportationVehicle && ( + isRealCar + || (embodiedLeg.beamLeg.mode == BIKE && beamVehicles.get(embodiedLeg.beamVehicleId).forall(_.isInstanceOf[Token])) + ) } private def dummyWalkLeg(time: Int, location: Location, unbecomeDriverOnCompletion: Boolean) = { @@ -1212,6 +1373,10 @@ trait ChoosesMode { combinedItinerariesForChoice.filter(trip => trip.tripClassifier == WALK_TRANSIT || trip.tripClassifier == RIDE_HAIL_TRANSIT ) + case Some(HOV2_TELEPORTATION) => + combinedItinerariesForChoice.filter(_.tripClassifier == HOV2_TELEPORTATION) + case Some(HOV3_TELEPORTATION) => + combinedItinerariesForChoice.filter(_.tripClassifier == HOV3_TELEPORTATION) case Some(mode) => combinedItinerariesForChoice.filter(_.tripClassifier == mode) case _ => @@ -1270,10 +1435,11 @@ trait ChoosesMode { body.toStreetVehicle, geo ) - goto(FinishingModeChoice) using choosesModeData.copy( + val dataForNextStep = choosesModeData.copy( pendingChosenTrip = Some(bushwhackingTrip), availableAlternatives = availableAlts ) + goto(FinishingModeChoice) using dataForNextStep } case _ => // Bad things happen but we want them to continue their day, so we signal to downstream that trip should be made to be expensive @@ -1362,63 +1528,83 @@ trait ChoosesMode { ) ) } - - eventsManager.processEvent( - new ModeChoiceEvent( - tick, - id, - chosenTrip.tripClassifier.value, - data.personData.currentTourMode.map(_.value).getOrElse(""), - data.expectedMaxUtilityOfLatestChoice.getOrElse[Double](Double.NaN), - _experiencedBeamPlan - .activities(data.personData.currentActivityIndex) - .getLinkId - .toString, - data.availableAlternatives.get, - data.availablePersonalStreetVehicles.nonEmpty, - chosenTrip.legs.view.map(_.beamLeg.travelPath.distanceInM).sum, - _experiencedBeamPlan.tourIndexOfElement(nextActivity(data.personData).get), - chosenTrip - ) + val chosenMode = chosenTrip.tripClassifier.value + val modeChoiceEvent = new ModeChoiceEvent( + tick, + id, + chosenMode, + data.personData.currentTourMode.map(_.value).getOrElse(""), + data.expectedMaxUtilityOfLatestChoice.getOrElse[Double](Double.NaN), + _experiencedBeamPlan + .activities(data.personData.currentActivityIndex) + .getLinkId + .toString, + data.availableAlternatives.get, + data.availablePersonalStreetVehicles.nonEmpty, + chosenTrip.legs.view.map(_.beamLeg.travelPath.distanceInM).sum, + _experiencedBeamPlan.tourIndexOfElement(nextActivity(data.personData).get), + chosenTrip ) - val (vehiclesUsed, vehiclesNotUsed) = data.availablePersonalStreetVehicles - .partition(vehicle => chosenTrip.vehiclesInTrip.contains(vehicle.id)) + eventsManager.processEvent(modeChoiceEvent) - var isCurrentPersonalVehicleVoided = false - vehiclesNotUsed.collect { case ActualVehicle(vehicle) => - data.personData.currentTourPersonalVehicle.foreach { currentVehicle => - if (currentVehicle == vehicle.id) { - logError( - s"Current tour vehicle is the same as the one being removed: $currentVehicle - ${vehicle.id} - $data" + data.personData.currentTourMode match { + case Some(HOV2_TELEPORTATION | HOV3_TELEPORTATION) => + scheduler ! CompletionNotice( + triggerId, + Vector( + ScheduleTrigger( + PersonDepartureTrigger(math.max(chosenTrip.legs.head.beamLeg.startTime, tick)), + self + ) ) - isCurrentPersonalVehicleVoided = true + ) + + goto(Teleporting) using data.personData.copy( + currentTrip = Some(chosenTrip), + restOfCurrentTrip = List() + ) + + case _ => + val (vehiclesUsed, vehiclesNotUsed) = data.availablePersonalStreetVehicles + .partition(vehicle => chosenTrip.vehiclesInTrip.contains(vehicle.id)) + + var isCurrentPersonalVehicleVoided = false + vehiclesNotUsed.collect { case ActualVehicle(vehicle) => + data.personData.currentTourPersonalVehicle.foreach { currentVehicle => + if (currentVehicle == vehicle.id) { + logError( + s"Current tour vehicle is the same as the one being removed: $currentVehicle - ${vehicle.id} - $data" + ) + isCurrentPersonalVehicleVoided = true + } + } + beamVehicles.remove(vehicle.id) + vehicle.getManager.get ! ReleaseVehicle(vehicle, triggerId) } - } - beamVehicles.remove(vehicle.id) - vehicle.getManager.get ! ReleaseVehicle(vehicle, triggerId) - } - scheduler ! CompletionNotice( - triggerId, - Vector( - ScheduleTrigger( - PersonDepartureTrigger(math.max(chosenTrip.legs.head.beamLeg.startTime, tick)), - self + scheduler ! CompletionNotice( + triggerId, + Vector( + ScheduleTrigger( + PersonDepartureTrigger(math.max(chosenTrip.legs.head.beamLeg.startTime, tick)), + self + ) + ) ) - ) - ) - goto(WaitingForDeparture) using data.personData.copy( - currentTrip = Some(chosenTrip), - restOfCurrentTrip = chosenTrip.legs.toList, - currentTourMode = data.personData.currentTourMode - .orElse(Some(chosenTrip.tripClassifier)), - currentTourPersonalVehicle = - if (isCurrentPersonalVehicleVoided) - vehiclesUsed.headOption.filter(mustBeDrivenHome).map(_.id) - else - data.personData.currentTourPersonalVehicle - .orElse(vehiclesUsed.headOption.filter(mustBeDrivenHome).map(_.id)) - ) + goto(WaitingForDeparture) using data.personData.copy( + currentTrip = Some(chosenTrip), + restOfCurrentTrip = chosenTrip.legs.toList, + currentTourMode = data.personData.currentTourMode + .orElse(Some(chosenTrip.tripClassifier)), + currentTourPersonalVehicle = + if (isCurrentPersonalVehicleVoided) + vehiclesUsed.headOption.filter(mustBeDrivenHome).map(_.id) + else + data.personData.currentTourPersonalVehicle + .orElse(vehiclesUsed.headOption.filter(mustBeDrivenHome).map(_.id)) + ) + } + } } diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala index 52e2b5f64b3..db86a521677 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala @@ -15,12 +15,13 @@ import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.NotApplicable import beam.agentsim.events._ import beam.agentsim.infrastructure.ChargingNetworkManager._ -import beam.agentsim.infrastructure.ParkingStall +import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType +import beam.agentsim.infrastructure.{ParkingInquiry, ParkingStall} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger.TriggerWithId import beam.agentsim.scheduler.{HasTriggerId, Trigger} import beam.router.Modes.BeamMode -import beam.router.Modes.BeamMode.WALK +import beam.router.Modes.BeamMode.{HOV2_TELEPORTATION, HOV3_TELEPORTATION, WALK} import beam.router.model.{BeamLeg, BeamPath} import beam.router.osm.TollCalculator import beam.router.skim.event.TransitCrowdingSkimmerEvent @@ -41,7 +42,7 @@ import org.matsim.api.core.v01.population.Person import org.matsim.core.api.experimental.events.EventsManager import org.matsim.vehicles.Vehicle -import scala.collection.mutable +import scala.collection.{immutable, mutable} import scala.language.postfixOps /** @@ -218,6 +219,20 @@ trait DrivesVehicle[T <: DrivingData] extends BeamAgent[T] with Stash with Expon def updateLatestObservedTick(newTick: Int): Unit = if (newTick > latestObservedTick) latestObservedTick = newTick when(Driving) { + case Event( + TriggerWithId(EndLegTrigger(tick), triggerId), + LiterallyDrivingData(data: BasePersonData, _, _) + ) if data.currentTourMode.contains(HOV2_TELEPORTATION) || data.currentTourMode.contains(HOV3_TELEPORTATION) => + updateLatestObservedTick(tick) + + val dataForNextLegOrActivity: BasePersonData = data.copy( + currentVehicle = Vector(), + currentTripCosts = 0.0 + ) + + holdTickAndTriggerId(tick, triggerId) + goto(ProcessingNextLegOrStartActivity) using dataForNextLegOrActivity.asInstanceOf[T] + case _ @Event( TriggerWithId(EndLegTrigger(tick), triggerId), LiterallyDrivingData(data, legEndingAt, _) @@ -308,13 +323,16 @@ trait DrivesVehicle[T <: DrivingData] extends BeamAgent[T] with Stash with Expon val tollOnCurrentLeg = toll(currentLeg) tollsAccumulated += tollOnCurrentLeg val riders = data.passengerSchedule.schedule(currentLeg).riders.toIndexedSeq.map(_.personId) + val numberOfPassengers: Int = calculateNumberOfPassengersBasedOnCurrentTourMode(data, currentLeg, riders) + val currentTourMode: Option[String] = getCurrentTourMode(data) val pte = PathTraversalEvent( tick, currentVehicleUnderControl, id.toString, currentBeamVehicle.beamVehicleType, - riders.size, + numberOfPassengers, currentLeg, + currentTourMode, fuelConsumed.primaryFuel, fuelConsumed.secondaryFuel, currentBeamVehicle.primaryFuelLevelInJoules, @@ -438,6 +456,35 @@ trait DrivesVehicle[T <: DrivingData] extends BeamAgent[T] with Stash with Expon stay() } + private def getCurrentTourMode(data: DrivingData): Option[String] = { + data match { + case bpd: BasePersonData => + bpd.currentTourMode match { + case Some(mode: BeamMode) => Some(mode.value) + case _ => None + } + case _ => None + } + } + + private def calculateNumberOfPassengersBasedOnCurrentTourMode( + data: DrivingData, + currentLeg: BeamLeg, + riders: immutable.IndexedSeq[Id[Person]] + ): Int = { + val numberOfPassengers = data match { + case bpd: BasePersonData => + (bpd.currentTourMode, currentLeg.mode) match { + // can't directly check HOV2/3 because the equals in BeamMode is overridden + case (Some(mode @ BeamMode.CAR), BeamMode.CAR) if mode.value == BeamMode.CAR_HOV2.value => riders.size + 1 + case (Some(mode @ BeamMode.CAR), BeamMode.CAR) if mode.value == BeamMode.CAR_HOV3.value => riders.size + 2 + case _ => riders.size + } + case _ => riders.size + } + numberOfPassengers + } + when(DrivingInterrupted) { case ev @ Event(StopDriving(stopTick, triggerId), LiterallyDrivingData(data, _, _)) => log.debug("state(DrivesVehicle.DrivingInterrupted): {}", ev) @@ -465,13 +512,17 @@ trait DrivesVehicle[T <: DrivingData] extends BeamAgent[T] with Stash with Expon val tollOnCurrentLeg = toll(partiallyCompletedBeamLeg) tollsAccumulated += tollOnCurrentLeg + val numberOfPassengers: Int = + calculateNumberOfPassengersBasedOnCurrentTourMode(data, partiallyCompletedBeamLeg, riders) + val currentTourMode: Option[String] = getCurrentTourMode(data) val pte = PathTraversalEvent( updatedStopTick, currentVehicleUnderControl, id.toString, currentBeamVehicle.beamVehicleType, - riders.size, + numberOfPassengers, partiallyCompletedBeamLeg, + currentTourMode, fuelConsumed.primaryFuel, fuelConsumed.secondaryFuel, currentBeamVehicle.primaryFuelLevelInJoules, @@ -838,4 +889,15 @@ trait DrivesVehicle[T <: DrivingData] extends BeamAgent[T] with Stash with Expon else 0.0 } + + protected def park(parkingInquiry: ParkingInquiry): Unit = { + val isRefuelNeeded: Boolean = parkingInquiry.beamVehicle match { + case Some(vehicle) => vehicle.isPHEV || vehicle.isBEV + case _ => parkingInquiry.parkingActivityType == ParkingActivityType.Charge + } + if (isRefuelNeeded) + chargingNetworkManager ! parkingInquiry + else + parkingManager ! parkingInquiry + } } diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala index bf42fd151f4..d7584a0e860 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ModeChoiceCalculator.scala @@ -6,7 +6,6 @@ import beam.agentsim.agents.choice.mode._ import beam.router.Modes.BeamMode import beam.router.Modes.BeamMode._ import beam.router.model.{EmbodiedBeamLeg, EmbodiedBeamTrip} -import beam.router.skim.readonly.TransitCrowdingSkims import beam.sim.BeamServices import beam.sim.config.{BeamConfig, BeamConfigHolder} import beam.sim.population.AttributesOfIndividual diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 6e596d3f883..f1565978ba3 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -94,8 +94,7 @@ trait ChoosesParking extends { val personData = stateData.asInstanceOf[BasePersonData] val firstLeg = personData.restOfCurrentTrip.head - val lastLeg = - personData.restOfCurrentTrip.takeWhile(_.beamVehicleId == firstLeg.beamVehicleId).last + val lastLeg = personData.restOfCurrentTrip.takeWhile(_.beamVehicleId == firstLeg.beamVehicleId).last val parkingDuration: Double = { for { @@ -117,15 +116,13 @@ trait ChoosesParking extends { VehicleManager.getReservedFor(currentBeamVehicle.vehicleManagerId.get).get, Some(this.currentBeamVehicle), remainingTripData, + Some(this.id), attributes.valueOfTime, parkingDuration, triggerId = getCurrentTriggerIdOrGenerate ) - if (parkingInquiry.isChargingRequestOrEV) - chargingNetworkManager ! parkingInquiry - else - parkingManager ! parkingInquiry + park(parkingInquiry) } when(ConnectingToChargingPoint) { @@ -154,18 +151,11 @@ trait ChoosesParking extends { s"the agent will now disconnect the vehicle ${currentBeamVehicle.id} to let the simulation continue!" ) handleReleasingParkingSpot(tick, currentBeamVehicle, None, id, parkingManager, eventsManager, triggerId) - goto(ReleasingParkingSpot) using data + goto(WaitingToDrive) using data case Event(UnpluggingVehicle(tick, energyCharged, triggerId), data) => log.debug(s"Vehicle ${currentBeamVehicle.id} ended charging and it is not handled by the CNM at tick $tick") - handleReleasingParkingSpot( - tick, - currentBeamVehicle, - Some(energyCharged), - id, - parkingManager, - eventsManager, - triggerId - ) + val energyMaybe = Some(energyCharged) + handleReleasingParkingSpot(tick, currentBeamVehicle, energyMaybe, id, parkingManager, eventsManager, triggerId) goto(WaitingToDrive) using data } @@ -178,7 +168,7 @@ trait ChoosesParking extends { if (currentBeamVehicle.isConnectedToChargingPoint()) { log.debug("Sending ChargingUnplugRequest to ChargingNetworkManager at {}", tick) chargingNetworkManager ! ChargingUnplugRequest( - tick + beamServices.beamConfig.beam.agentsim.schedulerParallelismWindow, + tick, currentBeamVehicle, triggerId ) diff --git a/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala b/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala index f2ef3cb9296..1ac8cc2492d 100755 --- a/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala @@ -533,15 +533,9 @@ class RideHailAgent( val tickToUse = Math.max(tick, latestObservedTick) updateLatestObservedTick(tick) log.debug("state(RideHailAgent.Offline): {}; Vehicle ID: {}", ev, vehicle.id) - if (vehicle.isCAV) { - if (debugEnabled) outgoingMessages += ev - startRefueling(tickToUse, triggerId, Vector()) - goto(Refueling) - } else { - holdTickAndTriggerId(tickToUse, triggerId) - requestParkingStall() - stay - } + if (debugEnabled) outgoingMessages += ev + startRefueling(tickToUse, triggerId, Vector()) + goto(Refueling) case ev @ Event(TriggerWithId(StartLegTrigger(_, _), triggerId), _) => log.warning( "state(RideHailingAgent.Offline.StartLegTrigger) this should be avoided instead of what I'm about to do which is ignore and complete this trigger: {} ", @@ -977,7 +971,7 @@ class RideHailAgent( log.debug("state(RideHailingAgent.Refueling.EndingRefuelSession): {}, Vehicle ID: {}", ev, vehicle.id) holdTickAndTriggerId(tick, triggerId) chargingNetworkManager ! ChargingUnplugRequest( - tick + beamServices.beamConfig.beam.agentsim.schedulerParallelismWindow, + tick, currentBeamVehicle, triggerId ) @@ -1002,6 +996,13 @@ class RideHailAgent( } else { goto(Offline) } + case ev @ Event(StartingRefuelSession(_, _), _) => + log.debug( + "state(RideHailingAgent.Refueling.StartingRefuelSession): {}, Vehicle ID: {}", + ev, + vehicle.id + ) + stay } when(RefuelingInterrupted) { case Event(Resume(_), _) => @@ -1144,7 +1145,7 @@ class RideHailAgent( parkingDuration = parkingDuration, triggerId = getCurrentTriggerIdOrGenerate ) - chargingNetworkManager ! inquiry + park(inquiry) } def handleStartRefuel(triggerId: Long, triggers: Seq[ScheduleTrigger]): Unit = { diff --git a/src/main/scala/beam/agentsim/agents/ridehail/RideHailIterationsStatsCollector.scala b/src/main/scala/beam/agentsim/agents/ridehail/RideHailIterationsStatsCollector.scala index c5e4c37e3c4..7422fd8c2e4 100755 --- a/src/main/scala/beam/agentsim/agents/ridehail/RideHailIterationsStatsCollector.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/RideHailIterationsStatsCollector.scala @@ -1,6 +1,7 @@ package beam.agentsim.agents.ridehail import beam.agentsim.events.{ModeChoiceEvent, PathTraversalEvent} +import beam.router.Modes.BeamMode import beam.sim.BeamServices import beam.sim.common.GeoUtils import com.conveyal.r5.transit.TransportNetwork @@ -328,7 +329,7 @@ class RideHailIterationsStatsCollector( val vehicleId = event.vehicleId.toString val numPass = event.numberOfPassengers - if (mode.equalsIgnoreCase("car") && vehicleId.contains("rideHail")) { + if (BeamMode.isCar(mode) && vehicleId.contains("rideHail")) { if (numPass > 0) { vehicles.put(vehicleId, 1) } else if (vehicles.getOrElse(vehicleId, -1) < 0) { diff --git a/src/main/scala/beam/agentsim/agents/ridehail/repositioningmanager/InverseSquareDistanceRepositioningFactor.scala b/src/main/scala/beam/agentsim/agents/ridehail/repositioningmanager/InverseSquareDistanceRepositioningFactor.scala index 0ec22097011..29a68077df3 100644 --- a/src/main/scala/beam/agentsim/agents/ridehail/repositioningmanager/InverseSquareDistanceRepositioningFactor.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/repositioningmanager/InverseSquareDistanceRepositioningFactor.scala @@ -6,7 +6,6 @@ import beam.agentsim.agents.vehicles.BeamVehicle import beam.agentsim.infrastructure.taz.H3TAZ import beam.router.BeamRouter.Location import beam.router.Modes.BeamMode.CAR -import beam.router.skim.Skims import beam.sim.BeamServices import beam.utils.{ActivitySegment, ProfilingUtils} import com.typesafe.scalalogging.LazyLogging diff --git a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala index 0ad0e8b6531..11f834bc512 100755 --- a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala +++ b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala @@ -1,7 +1,6 @@ package beam.agentsim.agents.vehicles import akka.actor.ActorRef -import beam.agentsim.agents.PersonAgent import beam.agentsim.agents.vehicles.BeamVehicle.{BeamVehicleState, FuelConsumed} import beam.agentsim.agents.vehicles.ConsumptionRateFilterStore.{Primary, Secondary} import beam.agentsim.agents.vehicles.EnergyEconomyAttributes.Powertrain @@ -300,8 +299,6 @@ class BeamVehicle( ) } - def isRidehailVehicle = id.toString.startsWith("rideHailVehicle") - def addFuel(fuelInJoules: Double): Unit = { fuelRWLock.write { primaryFuelLevelInJoulesInternal = primaryFuelLevelInJoulesInternal + fuelInJoules @@ -542,6 +539,17 @@ object BeamVehicle { secondaryLoggingData: IndexedSeq[LoggingData]*/ ) + val idPrefixSharedTeleportationVehicle = "teleportationSharedVehicle" + val idPrefixRideHail = "rideHailVehicle" + + def isRidehailVehicle(vehicleId: Id[BeamVehicle]): Boolean = { + vehicleId.toString.startsWith(idPrefixRideHail) + } + + def isSharedTeleportationVehicle(vehicleId: Id[BeamVehicle]): Boolean = { + vehicleId.toString.startsWith(idPrefixSharedTeleportationVehicle) + } + def noSpecialChars(theString: String): String = theString.replaceAll("[\\\\|\\\\^]+", ":") diff --git a/src/main/scala/beam/agentsim/events/PathTraversalEvent.scala b/src/main/scala/beam/agentsim/events/PathTraversalEvent.scala index 861c4b547f7..6221b4ce120 100644 --- a/src/main/scala/beam/agentsim/events/PathTraversalEvent.scala +++ b/src/main/scala/beam/agentsim/events/PathTraversalEvent.scala @@ -40,6 +40,7 @@ case class PathTraversalEvent( amountPaid: Double, fromStopIndex: Option[Int], toStopIndex: Option[Int], + currentTourMode: Option[String], /*, linkIdsToLaneOptions: IndexedSeq[(Int, Option[Int])], linkIdsToSpeedOptions: IndexedSeq[(Int, Option[Double])], @@ -94,6 +95,7 @@ case class PathTraversalEvent( attr.put(ATTRIBUTE_TOLL_PAID, amountPaid.toString) attr.put(ATTRIBUTE_FROM_STOP_INDEX, fromStopIndex.map(_.toString).getOrElse("")) attr.put(ATTRIBUTE_TO_STOP_INDEX, toStopIndex.map(_.toString).getOrElse("")) + attr.put(ATTRIBUTE_CURRENT_TOUR_MODE, currentTourMode.getOrElse("")) /* attr.put(ATTRIBUTE_LINKID_WITH_LANE_MAP, linkIdsToLaneOptions.map{case ((linkId, laneOption)) => s"$linkId:${laneOption.getOrElse(0)}"}.mkString(",")) attr.put(ATTRIBUTE_LINKID_WITH_SPEED_MAP, linkIdsToSpeedOptions.map{case ((linkId, speedOption)) => s"$linkId:${speedOption.getOrElse(0)}"}.mkString(",")) @@ -120,6 +122,7 @@ object PathTraversalEvent { val ATTRIBUTE_PRIMARY_FUEL: String = "primaryFuel" val ATTRIBUTE_SECONDARY_FUEL: String = "secondaryFuel" val ATTRIBUTE_NUM_PASS: String = "numPassengers" + val ATTRIBUTE_CURRENT_TOUR_MODE: String = "currentTourMode" val ATTRIBUTE_LINK_IDS: String = "links" val ATTRIBUTE_LINK_TRAVEL_TIME: String = "linkTravelTime" @@ -159,6 +162,7 @@ object PathTraversalEvent { vehicleType: BeamVehicleType, numPass: Int, beamLeg: BeamLeg, + currentTourMode: Option[String], primaryFuelConsumed: Double, secondaryFuelConsumed: Double, endLegPrimaryFuelLevel: Double, @@ -202,7 +206,8 @@ object PathTraversalEvent { amountPaid = amountPaid, fromStopIndex = beamLeg.travelPath.transitStops.map(_.fromIdx), toStopIndex = beamLeg.travelPath.transitStops.map(_.toIdx), - /*, + currentTourMode = currentTourMode, + /* linkIdsToLaneOptions = linkIdsToLaneOptions, linkIdsToSpeedOptions = linkIdsToSpeedOptions, linkIdsToGradientOptions = linkIdsToGradientOptions, @@ -251,6 +256,8 @@ object PathTraversalEvent { val fromStopIndex: Option[Int] = attr.get(ATTRIBUTE_FROM_STOP_INDEX).flatMap(x => if (x == "") None else Some(x.toInt)) val toStopIndex: Option[Int] = attr.get(ATTRIBUTE_TO_STOP_INDEX).flatMap(x => if (x == "") None else Some(x.toInt)) + val currentTourMode: Option[String] = + attr.get(ATTRIBUTE_CURRENT_TOUR_MODE).flatMap(x => if (x == "") None else Some(x)) /* val linkIdsToLaneOptions = attr(ATTRIBUTE_LINKID_WITH_LANE_MAP).split(",").map(x=>{ val linkIdToLaneSplit = x.split(":") @@ -312,6 +319,7 @@ object PathTraversalEvent { amountPaid, fromStopIndex, toStopIndex, + currentTourMode, /*, linkIdsToLaneOptions, linkIdsToSpeedOptions, diff --git a/src/main/scala/beam/agentsim/events/RefuelSessionEvent.scala b/src/main/scala/beam/agentsim/events/RefuelSessionEvent.scala index ae151dc1bbd..ba8569ea1fc 100644 --- a/src/main/scala/beam/agentsim/events/RefuelSessionEvent.scala +++ b/src/main/scala/beam/agentsim/events/RefuelSessionEvent.scala @@ -17,9 +17,10 @@ case class RefuelSessionEvent( energyInJoules: Double, sessionStartingFuelLevelInJoules: Double, sessionDuration: Double, - val vehId: Id[Vehicle], + vehId: Id[Vehicle], vehicleType: BeamVehicleType, personId: Id[Person], + activityType: String, shiftStatus: ShiftStatus = NotApplicable ) extends Event(tick) with HasPersonId @@ -58,6 +59,7 @@ case class RefuelSessionEvent( attributes.put(ATTRIBUTE_PARKING_TAZ, stall.tazId.toString) attributes.put(ATTRIBUTE_VEHICLE_TYPE, vehicleType.id.toString) attributes.put(ATTRIBUTE_PERSON, personId.toString) + attributes.put(ATTRIBUTE_ACTTYPE, activityType.toString) attributes.put(ATTRIBUTE_SHIFT_STATUS, shiftStatusString) attributes } @@ -79,6 +81,7 @@ object RefuelSessionEvent { val ATTRIBUTE_VEHICLE_TYPE: String = "vehicleType" val ATTRIBUTE_SHIFT_STATUS: String = "shiftStatus" val ATTRIBUTE_PERSON: String = "person" + val ATTRIBUTE_ACTTYPE: String = "actType" sealed trait ShiftStatus case object OnShift extends ShiftStatus diff --git a/src/main/scala/beam/agentsim/events/TeleportationEvent.scala b/src/main/scala/beam/agentsim/events/TeleportationEvent.scala new file mode 100644 index 00000000000..afdc5a2b980 --- /dev/null +++ b/src/main/scala/beam/agentsim/events/TeleportationEvent.scala @@ -0,0 +1,61 @@ +package beam.agentsim.events + +import beam.agentsim.agents.PersonAgent +import org.matsim.api.core.v01.Id +import org.matsim.api.core.v01.events.Event + +import java.util +import java.util.concurrent.atomic.AtomicReference + +case class TeleportationEvent( + time: Double, + person: Id[PersonAgent], + departureTime: Int, + arrivalTime: Int, + startX: Double, + startY: Double, + endX: Double, + endY: Double, + currentTourMode: Option[String] +) extends Event(time) + with ScalaEvent { + import TeleportationEvent._ + + override def getEventType: String = EVENT_TYPE + + private val filledAttrs: AtomicReference[util.Map[String, String]] = + new AtomicReference[util.Map[String, String]](null) + + override def getAttributes: util.Map[String, String] = { + if (filledAttrs.get() != null) filledAttrs.get() + else { + val attr = super.getAttributes + + attr.put(ATTRIBUTE_DEPARTURE_TIME, departureTime.toString) + attr.put(ATTRIBUTE_PERSON, person.toString) + attr.put(ATTRIBUTE_ARRIVAL_TIME, arrivalTime.toString) + attr.put(ATTRIBUTE_START_COORDINATE_X, startX.toString) + attr.put(ATTRIBUTE_START_COORDINATE_Y, startY.toString) + attr.put(ATTRIBUTE_END_COORDINATE_X, endX.toString) + attr.put(ATTRIBUTE_END_COORDINATE_Y, endY.toString) + attr.put(ATTRIBUTE_CURRENT_TOUR_MODE, currentTourMode.getOrElse("")) + + filledAttrs.set(attr) + attr + } + } +} + +object TeleportationEvent { + val EVENT_TYPE: String = "TeleportationEvent" + + val ATTRIBUTE_CURRENT_TOUR_MODE: String = "currentTourMode" + + val ATTRIBUTE_DEPARTURE_TIME: String = "departureTime" + val ATTRIBUTE_PERSON: String = "person" + val ATTRIBUTE_ARRIVAL_TIME: String = "arrivalTime" + val ATTRIBUTE_START_COORDINATE_X: String = "startX" + val ATTRIBUTE_START_COORDINATE_Y: String = "startY" + val ATTRIBUTE_END_COORDINATE_X: String = "endX" + val ATTRIBUTE_END_COORDINATE_Y: String = "endY" +} diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 23144763644..ac14d9d0b97 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -37,7 +37,7 @@ class ChargingFunctions[GEO: GeoLevel]( /** * function that verifies if RideHail Then Fast Charging Only * @param zone ParkingZone - * @param activityTypeLowerCased a String expressing activity Type in lower case + * @param inquiry ParkingInquiry * @return */ def ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 552f1746b91..245ee4fc1f4 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -22,7 +22,7 @@ import scala.util.Random /** * Created by haitamlaarabi */ -class ChargingNetwork[GEO: GeoLevel](chargingZones: Map[Id[ParkingZoneId], ParkingZone[GEO]]) +class ChargingNetwork[GEO: GeoLevel](val chargingZones: Map[Id[ParkingZoneId], ParkingZone[GEO]]) extends ParkingNetwork[GEO](chargingZones) { import ChargingNetwork._ @@ -82,6 +82,7 @@ class ChargingNetwork[GEO: GeoLevel](chargingZones: Map[Id[ParkingZoneId], Parki */ def processChargingPlugRequest( request: ChargingPlugRequest, + activityType: String, theSender: ActorRef ): Option[ChargingVehicle] = { lookupStation(request.stall.parkingZoneId) @@ -91,6 +92,7 @@ class ChargingNetwork[GEO: GeoLevel](chargingZones: Map[Id[ParkingZoneId], Parki request.vehicle, request.stall, request.personId, + activityType, request.shiftStatus, request.shiftDuration, theSender @@ -300,6 +302,7 @@ object ChargingNetwork extends LazyLogging { vehicle: BeamVehicle, stall: ParkingStall, personId: Id[Person], + activityType: String, shiftStatus: ShiftStatus = NotApplicable, shiftDuration: Option[Int] = None, theSender: ActorRef @@ -310,7 +313,7 @@ object ChargingNetwork extends LazyLogging { chargingVehicle case _ => val chargingVehicle = - ChargingVehicle(vehicle, stall, this, tick, personId, shiftStatus, shiftDuration, theSender) + ChargingVehicle(vehicle, stall, this, tick, personId, activityType, shiftStatus, shiftDuration, theSender) if (numAvailableChargers > 0) { chargingVehiclesInternal.put(vehicle.id, chargingVehicle) chargingVehicle.updateStatus(Connected, tick) @@ -372,7 +375,13 @@ object ChargingNetwork extends LazyLogging { } } - final case class ChargingCycle(startTime: Int, endTime: Int, energyToCharge: Double, maxDuration: Int) { + final case class ChargingCycle( + startTime: Int, + endTime: Int, + energyToCharge: Double, + energyToChargeIfUnconstrained: Double, + maxDuration: Int + ) { var refueled: Boolean = false } @@ -382,6 +391,7 @@ object ChargingNetwork extends LazyLogging { chargingStation: ChargingStation, arrivalTime: Int, personId: Id[Person], + activityType: String, shiftStatus: ShiftStatus, shiftDuration: Option[Int], theSender: ActorRef, @@ -420,7 +430,7 @@ object ChargingNetwork extends LazyLogging { */ def refuel: Option[ChargingCycle] = { chargingSessions.lastOption match { - case Some(cycle @ ChargingCycle(_, _, energy, _)) if !cycle.refueled => + case Some(cycle @ ChargingCycle(_, _, energy, _, _)) if !cycle.refueled => vehicle.addFuel(energy) cycle.refueled = true logger.debug(s"Charging vehicle $vehicle. Provided energy of = $energy J") @@ -452,7 +462,13 @@ object ChargingNetwork extends LazyLogging { * @param endTime endTime of charging * @return boolean value expressing if the charging cycle has been added */ - def processCycle(startTime: Int, endTime: Int, energy: Double, maxDuration: Int): Option[ChargingCycle] = { + def processCycle( + startTime: Int, + endTime: Int, + energy: Double, + energyToChargeIfUnconstrained: Double, + maxDuration: Int + ): Option[ChargingCycle] = { val addNewChargingCycle = chargingSessions.lastOption match { case None => // first charging cycle @@ -479,7 +495,7 @@ object ChargingNetwork extends LazyLogging { false } if (addNewChargingCycle) { - val newCycle = ChargingCycle(startTime, endTime, energy, maxDuration) + val newCycle = ChargingCycle(startTime, endTime, energy, energyToChargeIfUnconstrained, maxDuration) chargingSessions.append(newCycle) Some(newCycle) } else None diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index a197f33af95..7513bafeeb1 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -6,11 +6,10 @@ import akka.pattern.pipe import akka.util.Timeout import beam.agentsim.agents.BeamAgent.Finish import beam.agentsim.agents.InitializeTrigger -import beam.agentsim.agents.vehicles.{BeamVehicle, VehicleManager} +import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor +import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.{NotApplicable, ShiftStatus} -import beam.agentsim.events.{ChargingPlugInEvent, ChargingPlugOutEvent, RefuelSessionEvent} -import beam.agentsim.infrastructure.ChargingNetwork.{ChargingCycle, ChargingStation, ChargingStatus, ChargingVehicle} -import beam.agentsim.infrastructure.power.SitePowerManager.PhysicalBounds +import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingStatus, ChargingVehicle} import beam.agentsim.infrastructure.power.{PowerController, SitePowerManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger.TriggerWithId @@ -18,7 +17,6 @@ import beam.agentsim.scheduler.{HasTriggerId, Trigger} import beam.sim.BeamServices import beam.sim.config.BeamConfig import beam.sim.config.BeamConfig.Beam.Debug -import beam.utils.DateUtils import beam.utils.logging.LoggingMessageActor import beam.utils.logging.pattern.ask import com.typesafe.scalalogging.LazyLogging @@ -40,30 +38,17 @@ class ChargingNetworkManager( parkingNetworkManager: ActorRef, scheduler: ActorRef ) extends LoggingMessageActor - with ActorLogging { + with ActorLogging + with ChargingNetworkManagerHelper + with ScaleUpCharging { import ChargingNetworkManager._ import ChargingStatus._ - import beamServices._ - - private val beamConfig: BeamConfig = beamScenario.beamConfig - private val cnmConfig = beamConfig.beam.agentsim.chargingNetworkManager - - private val sitePowerManager = new SitePowerManager(chargingNetwork, rideHailNetwork, beamServices) - - private val powerController = - new PowerController(chargingNetwork, rideHailNetwork, beamConfig, sitePowerManager.unlimitedPhysicalBounds) - private val endOfSimulationTime: Int = DateUtils.getEndOfTime(beamConfig) + protected val beamConfig: BeamConfig = beamServices.beamScenario.beamConfig import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future implicit val timeout: Timeout = Timeout(10, TimeUnit.HOURS) implicit val debug: Debug = beamConfig.beam.debug - - private val parallelismWindow: Int = beamConfig.beam.agentsim.schedulerParallelismWindow - - private def currentTimeBin(tick: Int): Int = cnmConfig.timeStepInSeconds * (tick / cnmConfig.timeStepInSeconds) - private def nextTimeBin(tick: Int): Int = currentTimeBin(tick) + cnmConfig.timeStepInSeconds - private var timeSpentToPlanEnergyDispatchTrigger: Long = 0 private var nHandledPlanEnergyDispatchTrigger: Int = 0 @@ -73,6 +58,12 @@ class ChargingNetworkManager( None } + protected val chargingNetworkHelper: ChargingNetworkHelper = ChargingNetworkHelper(chargingNetwork, rideHailNetwork) + protected val powerController = new PowerController(chargingNetworkHelper, beamConfig) + + protected val sitePowerManager = + new SitePowerManager(chargingNetworkHelper, powerController.unlimitedPhysicalBounds, beamServices) + override def postStop(): Unit = { maybeDebugReport.foreach(_.cancel()) log.debug( @@ -83,7 +74,7 @@ class ChargingNetworkManager( super.postStop() } - override def loggedReceive: Receive = { + override def loggedReceive: Receive = super[ScaleUpCharging].loggedReceive orElse { case DebugReport => log.debug( s"timeSpentToPlanEnergyDispatchTrigger: $timeSpentToPlanEnergyDispatchTrigger ms, " + @@ -93,9 +84,11 @@ class ChargingNetworkManager( case inquiry: ParkingInquiry => log.debug(s"Received parking inquiry: $inquiry") - getAppropriateChargingNetwork(inquiry.reservedFor.managerId).processParkingInquiry(inquiry) match { - case Some(parkingResponse) => sender() ! parkingResponse - case _ => (parkingNetworkManager ? inquiry).pipeTo(sender()) + chargingNetworkHelper.get(inquiry.reservedFor.managerId).processParkingInquiry(inquiry) match { + case Some(parkingResponse) => + inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) + sender() ! parkingResponse + case _ => (parkingNetworkManager ? inquiry).pipeTo(sender()) } case TriggerWithId(InitializeTrigger(_), triggerId) => @@ -107,45 +100,46 @@ class ChargingNetworkManager( case TriggerWithId(PlanEnergyDispatchTrigger(timeBin), triggerId) => val s = System.currentTimeMillis log.debug(s"Planning energy dispatch for vehicles currently connected to a charging point, at t=$timeBin") - val estimatedLoad = sitePowerManager.requiredPowerInKWOverNextPlanningHorizon(timeBin) - log.debug("Total Load estimated is {} at tick {}", estimatedLoad.values.sum, timeBin) - + val loadEstimate = sitePowerManager.requiredPowerInKWOverNextPlanningHorizon(timeBin) + log.debug("Total Load estimated is {} at tick {}", loadEstimate.values.sum, timeBin) + val simulatedParkingInquiries = simulateEventsIfScalingEnabled(timeBin, triggerId) + log.debug("number of simulatedParkingInquiries is {} at tick {}", simulatedParkingInquiries.size, timeBin) // obtaining physical bounds - val physicalBounds = powerController.obtainPowerPhysicalBounds(timeBin, Some(estimatedLoad)) - - val triggers = chargingNetwork.connectedVehicles.par.flatMap { case (_, chargingVehicle) => + val physicalBounds = powerController.obtainPowerPhysicalBounds(timeBin, Some(loadEstimate)) + val allConnectedVehicles = chargingNetwork.connectedVehicles ++ rideHailNetwork.connectedVehicles + val triggers = allConnectedVehicles.par.flatMap { case (_, chargingVehicle) => // Refuel handleRefueling(chargingVehicle) // Calculate the energy to charge and prepare for next current cycle of charging dispatchEnergyAndProcessChargingCycle( chargingVehicle, timeBin, - timeBin + cnmConfig.timeStepInSeconds, + timeBin + beamConfig.beam.agentsim.chargingNetworkManager.timeStepInSeconds, physicalBounds, triggerId, - false + interruptCharging = false ) } - val nextStepPlanningTriggers = if (!isEndOfSimulation(timeBin)) Vector(ScheduleTrigger(PlanEnergyDispatchTrigger(nextTimeBin(timeBin)), self)) else Vector() - val e = System.currentTimeMillis() nHandledPlanEnergyDispatchTrigger += 1 timeSpentToPlanEnergyDispatchTrigger += e - s log.debug(s"timeSpentToPlanEnergyDispatchTrigger: $timeSpentToPlanEnergyDispatchTrigger. tick: $timeBin") - - sender ! CompletionNotice(triggerId, triggers.toIndexedSeq ++ nextStepPlanningTriggers) + sender ! CompletionNotice( + triggerId, + triggers.toIndexedSeq ++ nextStepPlanningTriggers ++ simulatedParkingInquiries + ) case TriggerWithId(ChargingTimeOutTrigger(tick, vehicle), triggerId) => log.debug(s"ChargingTimeOutTrigger for vehicle ${vehicle.id} at $tick") vehicle.stall match { case Some(stall) => - getAppropriateChargingNetwork(stall.reservedFor.managerId).endChargingSession(vehicle.id, tick) map { - handleEndCharging(tick, _, triggerId, false) + chargingNetworkHelper.get(stall.reservedFor.managerId).endChargingSession(vehicle.id, tick) map { + handleEndCharging(tick, _, triggerId, chargingInterrupted = false) } getOrElse log.debug(s"Vehicle ${vehicle.id} has already ended charging") case _ => log.debug(s"Vehicle ${vehicle.id} doesn't have a stall") } @@ -155,7 +149,10 @@ class ChargingNetworkManager( log.debug(s"ChargingPlugRequest received for vehicle $vehicle at $tick and stall ${vehicle.stall}") if (vehicle.isBEV || vehicle.isPHEV) { // connecting the current vehicle - getAppropriateChargingNetwork(stall.reservedFor.managerId).processChargingPlugRequest(request, sender()) map { + val activityType = vehicle2InquiryMap.get(vehicle.id).map(_.activityType).getOrElse("") + chargingNetworkHelper + .get(stall.reservedFor.managerId) + .processChargingPlugRequest(request, activityType, sender()) map { case chargingVehicle if chargingVehicle.chargingStatus.last.status == WaitingAtStation => log.debug( s"Vehicle $vehicle is moved to waiting line at $tick in station ${chargingVehicle.chargingStation}, " + @@ -167,6 +164,8 @@ class ChargingNetworkManager( sender() ! WaitingToCharge(tick, vehicle.id, triggerId) case chargingVehicle => handleStartCharging(tick, chargingVehicle, triggerId = triggerId) + collectVehicleRequestInfo(chargingVehicle) + vehicle2InquiryMap.remove(vehicle.id) } } else { sender() ! Failure( @@ -179,22 +178,29 @@ class ChargingNetworkManager( val bounds = powerController.obtainPowerPhysicalBounds(tick, None) vehicle.stall match { case Some(stall) => - getAppropriateChargingNetwork(stall.reservedFor.managerId).disconnectVehicle(vehicle.id, tick) match { - case Some(chargingVehicle @ ChargingVehicle(_, _, station, _, _, _, _, _, status, sessions)) => + chargingNetworkHelper.get(stall.reservedFor.managerId).disconnectVehicle(vehicle.id, tick) match { + case Some(chargingVehicle @ ChargingVehicle(_, _, station, _, _, _, _, _, _, status, sessions)) => if (sessions.nonEmpty && !status.exists(_.status == GracePeriod)) { // If the vehicle was still charging val unplugTime = currentTimeBin(tick) val index = sessions.indexWhere(x => currentTimeBin(x.startTime) == unplugTime && x.startTime <= tick) val (startTime, endTime) = if (index == -1) (unplugTime, tick) else (sessions(index).startTime, tick) - dispatchEnergyAndProcessChargingCycle(chargingVehicle, startTime, endTime, bounds, triggerId, true) + dispatchEnergyAndProcessChargingCycle( + chargingVehicle, + startTime, + endTime, + bounds, + triggerId, + interruptCharging = true + ) } val (_, totEnergy) = chargingVehicle.calculateChargingSessionLengthAndEnergyInJoule - sender ! UnpluggingVehicle(tick + parallelismWindow, totEnergy, triggerId) + sender ! UnpluggingVehicle(tick, totEnergy, triggerId) chargingNetwork .processWaitingLine(tick, station) .foreach { newChargingVehicle => self ! ChargingPlugRequest( - tick + parallelismWindow, + tick, newChargingVehicle.vehicle, newChargingVehicle.stall, newChargingVehicle.personId, @@ -205,11 +211,11 @@ class ChargingNetworkManager( } case _ => log.debug(s"Vehicle $vehicle is already disconnected or unhandled at $tick") - sender ! UnhandledVehicle(tick + parallelismWindow, vehicle.id, triggerId) + sender ! UnhandledVehicle(tick, vehicle.id, triggerId) } case _ => log.debug(s"Cannot unplug $vehicle as it doesn't have a stall at $tick") - sender ! UnhandledVehicle(tick + parallelismWindow, vehicle.id, triggerId) + sender ! UnhandledVehicle(tick, vehicle.id, triggerId) } case Finish => @@ -228,160 +234,8 @@ class ChargingNetworkManager( context.stop(self) } - /** - * @param reservedFor vehicle manager id - * @return - */ - private def getAppropriateChargingNetwork(reservedFor: Id[VehicleManager]): ChargingNetwork[_] = { - VehicleManager.getReservedFor(reservedFor) match { - case VehicleManager.TypeEnum.RideHail => rideHailNetwork - case _ => chargingNetwork - } - } - - /** - * if this is the last timebin of the simulation - * @param tick current tick - * @return a boolean - */ - private def isEndOfSimulation(tick: Int) = nextTimeBin(tick) >= endOfSimulationTime - - /** - * @param chargingVehicle the vehicle being charged - * @param startTime the start time - * @param endTime the end time - * @param physicalBounds physical bounds - * @param triggerId trigger Id - * @param interruptCharging True if the charging should be interrupted - * @return - */ - private def dispatchEnergyAndProcessChargingCycle( - chargingVehicle: ChargingVehicle, - startTime: Int, - endTime: Int, - physicalBounds: Map[ChargingStation, PhysicalBounds], - triggerId: Long, - interruptCharging: Boolean - ): Option[ScheduleTrigger] = { - assume(endTime - startTime >= 0, s"timeInterval should not be negative! startTime $startTime endTime $endTime") - // Calculate the energy to charge each vehicle connected to the a charging station - val updatedEndTime = chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow).getOrElse(endTime) - val duration = Math.max(0, updatedEndTime - startTime) - val maxCycleDuration = Math.min( - nextTimeBin(startTime) - startTime, - chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow - startTime).getOrElse(Int.MaxValue) - ) - chargingVehicle.checkAndCorrectCycleAfterInterruption(updatedEndTime) - val (chargingDuration, energyToCharge) = sitePowerManager.dispatchEnergy(duration, chargingVehicle, physicalBounds) - log.debug( - s"dispatchEnergyAndProcessChargingCycle. startTime:$startTime, endTime:$endTime, updatedEndTime:$updatedEndTime, " + - s"duration:$duration, maxCycleDuration:$maxCycleDuration, chargingVehicle:$chargingVehicle, " + - s"chargingDuration:$chargingDuration" - ) - // update charging vehicle with dispatched energy and schedule ChargingTimeOutScheduleTrigger - chargingVehicle - .processCycle(startTime, startTime + chargingDuration, energyToCharge, maxCycleDuration) - .flatMap { - case cycle if chargingIsCompleteUsing(cycle) || interruptCharging => - handleEndCharging(cycle.endTime, chargingVehicle, triggerId, interruptCharging) - None - case cycle if chargingNotCompleteUsing(cycle) && !isEndOfSimulation(startTime) => - log.debug( - s"Vehicle {} is still charging @ Stall: {}. Provided energy: {} J. Remaining: {} J", - chargingVehicle.vehicle.id, - chargingVehicle.stall, - cycle.energyToCharge, - energyToCharge - ) - None - case cycle => - // charging is going to end during this current session - Some(ScheduleTrigger(ChargingTimeOutTrigger(cycle.endTime, chargingVehicle.vehicle), self)) - } - } - - /** - * Connect the vehicle - * @param tick current time - * @param chargingVehicle charging vehicle information - */ - private def handleStartCharging( - tick: Int, - chargingVehicle: ChargingVehicle, - triggerId: Long - ): Unit = { - val nextTick = nextTimeBin(tick) - val vehicle = chargingVehicle.vehicle - if (vehicle.stall.isEmpty) - vehicle.useParkingStall(chargingVehicle.stall) - log.debug(s"Starting charging for vehicle $vehicle at $tick") - val physicalBounds = powerController.obtainPowerPhysicalBounds(tick, None) - chargingVehicle.theSender ! StartingRefuelSession(tick + parallelismWindow, triggerId) - handleStartChargingHelper(tick, chargingVehicle, beamServices) - dispatchEnergyAndProcessChargingCycle(chargingVehicle, tick, nextTick, physicalBounds, triggerId, false).foreach( - scheduler ! _ - ) - } - - /** - * Disconnect the vehicle - * @param tick current time - * @param chargingVehicle charging vehicle information - * @param triggerId the trigger - * @param chargingInterrupted Boolean - */ - private def handleEndCharging( - tick: Int, - chargingVehicle: ChargingVehicle, - triggerId: Long, - chargingInterrupted: Boolean - ): Unit = { - val result = chargingVehicle.chargingStatus.last.status match { - case Connected => - chargingVehicle.chargingStation.endCharging(chargingVehicle.vehicle.id, tick) orElse { - log.debug( - s"Vehicle ${chargingVehicle.vehicle.id} has already ended charging" - ) - None - } - case _ => Some(chargingVehicle) - } - if (result.isDefined) { - handleRefueling(chargingVehicle) - handleEndChargingHelper(tick, chargingVehicle, beamServices) - if (!chargingInterrupted) - chargingVehicle.theSender ! EndingRefuelSession(tick + parallelismWindow, chargingVehicle.vehicle.id, triggerId) - } - } - - /** - * Refuel the vehicle using last charging session and collect the corresponding load - * @param chargingVehicle vehicle charging information - */ - private def handleRefueling(chargingVehicle: ChargingVehicle): Unit = { - chargingVehicle.refuel.foreach { case ChargingCycle(startTime, endTime, _, _) => - sitePowerManager.collectObservedLoadInKW( - startTime, - endTime - startTime, - chargingVehicle.vehicle, - chargingVehicle.chargingStation - ) - } - } - - /** - * if charging completed then duration of charging should be zero - * @param cycle the latest charging cycle - * @return - */ - private def chargingIsCompleteUsing(cycle: ChargingCycle) = (cycle.endTime - cycle.startTime) == 0 - - /** - * if charging won't complete during the current cycle - * @param cycle the latest charging cycle - * @return - */ - private def chargingNotCompleteUsing(cycle: ChargingCycle) = (cycle.endTime - cycle.startTime) >= cycle.maxDuration + protected def getScheduler: ActorRef = scheduler + protected def getBeamServices: BeamServices = beamServices } object ChargingNetworkManager extends LazyLogging { @@ -415,66 +269,28 @@ object ChargingNetworkManager extends LazyLogging { Props(new ChargingNetworkManager(beamServices, chargingNetwork, rideHailNetwork, parkingManager, scheduler)) } - /** - * process the event ChargingPlugInEvent - * @param currentTick current time - * @param chargingVehicle vehicle charging information - */ - private def handleStartChargingHelper( - currentTick: Int, - chargingVehicle: ChargingVehicle, - beamServices: BeamServices - ): Unit = { - import chargingVehicle._ - val chargingPlugInEvent = new ChargingPlugInEvent( - tick = currentTick, - stall = stall, - locationWGS = beamServices.geo.utm2Wgs(stall.locationUTM), - vehId = vehicle.id, - primaryFuelLevel = vehicle.primaryFuelLevelInJoules, - secondaryFuelLevel = Some(vehicle.secondaryFuelLevelInJoules) - ) - logger.debug(s"ChargingPlugInEvent: $chargingPlugInEvent") - beamServices.matsimServices.getEvents.processEvent(chargingPlugInEvent) - } + case class ChargingNetworkHelper(chargingNetwork: ChargingNetwork[_], rideHailNetwork: ChargingNetwork[_]) { - /** - * Calculates the duration of the refuel session, the provided energy and throws corresponding events - * @param currentTick current time - * @param chargingVehicle vehicle charging information - */ - def handleEndChargingHelper(currentTick: Int, chargingVehicle: ChargingVehicle, beamServices: BeamServices): Unit = { - val (totDuration, totEnergy) = chargingVehicle.calculateChargingSessionLengthAndEnergyInJoule - val vehicle = chargingVehicle.vehicle - val stall = chargingVehicle.stall - logger.debug( - s"Vehicle ${chargingVehicle.vehicle} was disconnected at time {} with {} J delivered during {} sec", - currentTick, - totEnergy, - totDuration - ) - // Refuel Session - val refuelSessionEvent = new RefuelSessionEvent( - currentTick, - stall.copy(locationUTM = beamServices.geo.utm2Wgs(stall.locationUTM)), - totEnergy, - vehicle.primaryFuelLevelInJoules - totEnergy, - totDuration, - vehicle.id, - vehicle.beamVehicleType, - chargingVehicle.personId, - chargingVehicle.shiftStatus - ) - logger.debug(s"RefuelSessionEvent: $refuelSessionEvent") - beamServices.matsimServices.getEvents.processEvent(refuelSessionEvent) - val chargingPlugOutEvent: ChargingPlugOutEvent = new ChargingPlugOutEvent( - currentTick, - stall.copy(locationUTM = beamServices.geo.utm2Wgs(stall.locationUTM)), - vehicle.id, - vehicle.primaryFuelLevelInJoules, - Some(vehicle.secondaryFuelLevelInJoules) - ) - logger.debug(s"ChargingPlugOutEvent: $chargingPlugOutEvent") - beamServices.matsimServices.getEvents.processEvent(chargingPlugOutEvent) + lazy val allChargingStations: List[ChargingStation] = + chargingNetwork.chargingStations ++ rideHailNetwork.chargingStations + + /** + * @param managerId vehicle manager id + * @return + */ + def get(managerId: Id[VehicleManager]): ChargingNetwork[_] = { + get(VehicleManager.getReservedFor(managerId).get) + } + + /** + * @param managerType vehicle manager type + * @return + */ + def get(managerType: ReservedFor): ChargingNetwork[_] = { + managerType match { + case VehicleManager.TypeEnum.RideHail => rideHailNetwork + case _ => chargingNetwork + } + } } } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala new file mode 100644 index 00000000000..ba65aa11b92 --- /dev/null +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -0,0 +1,251 @@ +package beam.agentsim.infrastructure + +import beam.agentsim.agents.vehicles.BeamVehicle +import beam.agentsim.events.{ChargingPlugInEvent, ChargingPlugOutEvent, RefuelSessionEvent} +import beam.agentsim.infrastructure.ChargingNetwork.ChargingStatus.Connected +import beam.agentsim.infrastructure.ChargingNetwork.{ChargingCycle, ChargingStation, ChargingVehicle} +import beam.agentsim.infrastructure.ChargingNetworkManager.{ + ChargingTimeOutTrigger, + EndingRefuelSession, + StartingRefuelSession +} +import beam.agentsim.infrastructure.power.PowerController.PhysicalBounds +import beam.agentsim.scheduler.BeamAgentScheduler.ScheduleTrigger +import beam.sim.config.BeamConfig.Beam.Agentsim +import beam.utils.DateUtils +import org.matsim.api.core.v01.Id + +import scala.collection.concurrent.TrieMap + +trait ChargingNetworkManagerHelper extends { + this: ChargingNetworkManager => + + private lazy val endOfSimulationTime: Int = DateUtils.getEndOfTime(beamConfig) + private lazy val cnmConfig: Agentsim.ChargingNetworkManager = beamConfig.beam.agentsim.chargingNetworkManager + private lazy val parallelismWindow: Int = beamConfig.beam.agentsim.schedulerParallelismWindow + protected val vehicle2InquiryMap: TrieMap[Id[BeamVehicle], ParkingInquiry] = TrieMap() + + /** + * if this is the last timebin of the simulation + * @param tick current tick + * @return a boolean + */ + protected def isEndOfSimulation(tick: Int): Boolean = nextTimeBin(tick) >= endOfSimulationTime + + /** + * if charging completed then duration of charging should be zero + * @param cycle the latest charging cycle + * @return + */ + protected def chargingIsCompleteUsing(cycle: ChargingCycle): Boolean = (cycle.endTime - cycle.startTime) == 0 + + /** + * if charging won't complete during the current cycle + * @param cycle the latest charging cycle + * @return + */ + protected def chargingNotCompleteUsing(cycle: ChargingCycle): Boolean = + (cycle.endTime - cycle.startTime) >= cycle.maxDuration + + /** + * Get current time bin + * @param tick time + * @return + */ + protected def currentTimeBin(tick: Int): Int = cnmConfig.timeStepInSeconds * (tick / cnmConfig.timeStepInSeconds) + + /** + * get next time bin + * @param tick time + * @return + */ + protected def nextTimeBin(tick: Int): Int = currentTimeBin(tick) + cnmConfig.timeStepInSeconds + + /** + * @param chargingVehicle the vehicle being charged + * @param startTime the start time + * @param endTime the end time + * @param physicalBounds physical bounds + * @param triggerId trigger Id + * @param interruptCharging True if the charging should be interrupted + * @return + */ + protected def dispatchEnergyAndProcessChargingCycle( + chargingVehicle: ChargingVehicle, + startTime: Int, + endTime: Int, + physicalBounds: Map[ChargingStation, PhysicalBounds], + triggerId: Long, + interruptCharging: Boolean + ): Option[ScheduleTrigger] = { + assume(endTime - startTime >= 0, s"timeInterval should not be negative! startTime $startTime endTime $endTime") + // Calculate the energy to charge each vehicle connected to the a charging station + val updatedEndTime = chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow).getOrElse(endTime) + val duration = Math.max(0, updatedEndTime - startTime) + val maxCycleDuration = Math.min( + nextTimeBin(startTime) - startTime, + chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow - startTime).getOrElse(Int.MaxValue) + ) + chargingVehicle.checkAndCorrectCycleAfterInterruption(updatedEndTime) + val (chargingDuration, energyToCharge, energyToChargeIfUnconstrained) = + sitePowerManager.dispatchEnergy(duration, chargingVehicle, physicalBounds) + val theActualEndTime = startTime + chargingDuration + log.debug( + s"dispatchEnergyAndProcessChargingCycle. startTime:$startTime, endTime:$endTime, updatedEndTime:$updatedEndTime, " + + s"theActualEndTime:$theActualEndTime, duration:$duration, maxCycleDuration:$maxCycleDuration, " + + s"chargingVehicle:$chargingVehicle, chargingDuration:$chargingDuration" + ) + // update charging vehicle with dispatched energy and schedule ChargingTimeOutScheduleTrigger + chargingVehicle + .processCycle(startTime, theActualEndTime, energyToCharge, energyToChargeIfUnconstrained, maxCycleDuration) + .flatMap { + case cycle if chargingIsCompleteUsing(cycle) || interruptCharging => + handleEndCharging(cycle.endTime, chargingVehicle, triggerId, interruptCharging) + None + case cycle if chargingNotCompleteUsing(cycle) && !isEndOfSimulation(startTime) => + log.debug( + s"Vehicle {} is still charging @ Stall: {}. Provided energy: {} J. Remaining: {} J", + chargingVehicle.vehicle.id, + chargingVehicle.stall, + cycle.energyToCharge, + energyToCharge + ) + None + case cycle => + // charging is going to end during this current session + Some(ScheduleTrigger(ChargingTimeOutTrigger(cycle.endTime, chargingVehicle.vehicle), self)) + } + } + + /** + * Connect the vehicle + * @param tick current time + * @param chargingVehicle charging vehicle information + */ + protected def handleStartCharging( + tick: Int, + chargingVehicle: ChargingVehicle, + triggerId: Long + ): Unit = { + val nextTick = nextTimeBin(tick) + val vehicle = chargingVehicle.vehicle + if (vehicle.stall.isEmpty) + vehicle.useParkingStall(chargingVehicle.stall) + log.debug(s"Starting charging for vehicle $vehicle at $tick") + val physicalBounds = powerController.obtainPowerPhysicalBounds(tick, None) + chargingVehicle.theSender ! StartingRefuelSession(tick, triggerId) + processStartChargingEvent(tick, chargingVehicle) + dispatchEnergyAndProcessChargingCycle( + chargingVehicle, + tick, + nextTick, + physicalBounds, + triggerId, + interruptCharging = false + ).foreach( + getScheduler ! _ + ) + } + + /** + * Disconnect the vehicle + * @param tick current time + * @param chargingVehicle charging vehicle information + * @param triggerId the trigger + * @param chargingInterrupted Boolean + */ + protected def handleEndCharging( + tick: Int, + chargingVehicle: ChargingVehicle, + triggerId: Long, + chargingInterrupted: Boolean + ): Unit = { + val result = chargingVehicle.chargingStatus.last.status match { + case Connected => + chargingVehicle.chargingStation.endCharging(chargingVehicle.vehicle.id, tick) orElse { + log.debug( + s"Vehicle ${chargingVehicle.vehicle.id} has already ended charging" + ) + None + } + case _ => Some(chargingVehicle) + } + if (result.isDefined) { + handleRefueling(chargingVehicle) + processEndChargingEvents(tick, chargingVehicle) + if (!chargingInterrupted) + chargingVehicle.theSender ! EndingRefuelSession(tick, chargingVehicle.vehicle.id, triggerId) + } + } + + /** + * Refuel the vehicle using last charging session and collect the corresponding load + * @param chargingVehicle vehicle charging information + */ + protected def handleRefueling(chargingVehicle: ChargingVehicle): Unit = { + chargingVehicle.refuel.foreach { case ChargingCycle(startTime, endTime, _, energyToChargeIfUnconstrained, _) => + val station = chargingVehicle.chargingStation + sitePowerManager.collectObservedLoadInKW(startTime, endTime - startTime, energyToChargeIfUnconstrained, station) + } + } + + /** + * process the event ChargingPlugInEvent + * @param currentTick current time + * @param chargingVehicle vehicle charging information + */ + private def processStartChargingEvent(currentTick: Int, chargingVehicle: ChargingVehicle): Unit = { + import chargingVehicle._ + val chargingPlugInEvent = new ChargingPlugInEvent( + tick = currentTick, + stall = stall, + locationWGS = getBeamServices.geo.utm2Wgs(stall.locationUTM), + vehId = vehicle.id, + primaryFuelLevel = vehicle.primaryFuelLevelInJoules, + secondaryFuelLevel = Some(vehicle.secondaryFuelLevelInJoules) + ) + log.debug(s"ChargingPlugInEvent: $chargingPlugInEvent") + getBeamServices.matsimServices.getEvents.processEvent(chargingPlugInEvent) + } + + /** + * Calculates the duration of the refuel session, the provided energy and throws corresponding events + * @param currentTick current time + * @param chargingVehicle vehicle charging information + */ + def processEndChargingEvents(currentTick: Int, chargingVehicle: ChargingVehicle): Unit = { + val (totDuration, totEnergy) = chargingVehicle.calculateChargingSessionLengthAndEnergyInJoule + val vehicle = chargingVehicle.vehicle + val stall = chargingVehicle.stall + log.debug( + s"Vehicle ${chargingVehicle.vehicle} was disconnected at time {} with {} J delivered during {} sec", + currentTick, + totEnergy, + totDuration + ) + // Refuel Session + val refuelSessionEvent = new RefuelSessionEvent( + currentTick, + stall.copy(locationUTM = getBeamServices.geo.utm2Wgs(stall.locationUTM)), + totEnergy, + vehicle.primaryFuelLevelInJoules - totEnergy, + totDuration, + vehicle.id, + vehicle.beamVehicleType, + chargingVehicle.personId, + chargingVehicle.activityType, + chargingVehicle.shiftStatus + ) + log.debug(s"RefuelSessionEvent: $refuelSessionEvent") + getBeamServices.matsimServices.getEvents.processEvent(refuelSessionEvent) + val chargingPlugOutEvent: ChargingPlugOutEvent = new ChargingPlugOutEvent( + currentTick, + stall.copy(locationUTM = getBeamServices.geo.utm2Wgs(stall.locationUTM)), + vehicle.id, + vehicle.primaryFuelLevelInJoules, + Some(vehicle.secondaryFuelLevelInJoules) + ) + log.debug(s"ChargingPlugOutEvent: $chargingPlugOutEvent") + getBeamServices.matsimServices.getEvents.processEvent(chargingPlugOutEvent) + } +} diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 2691ead4c4a..9932dd35cb2 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -143,7 +143,7 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( val parkingZoneMNLParamsFunction: ParkingAlternative[GEO] => Map[ParkingMNL.Parameters, Double] = (parkingAlternative: ParkingAlternative[GEO]) => { val params = setupMNLParameters(parkingAlternative, inquiry) - if (inquiry.activityType == ParkingActivityType.Home) { + if (inquiry.parkingActivityType == ParkingActivityType.Home) { logger.debug( f"tour=${inquiry.remainingTripData .map { diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala index 7af4721b992..e261ff6c806 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala @@ -40,6 +40,18 @@ object InfrastructureUtils extends LazyLogging { val parkingManagerCfg = beamConfig.beam.agentsim.taz.parkingManager val mainParkingFile: String = beamConfig.beam.agentsim.taz.parkingFilePath + val parkingStallCountScalingFactor: Double = beamConfig.beam.agentsim.taz.parkingStallCountScalingFactor + val parkingCostScalingFactor: Double = beamConfig.beam.agentsim.taz.parkingCostScalingFactor + + val (mainChargingFile, chargingStallCountScalingFactor, chargingCostScalingFactor) = + if (beamConfig.beam.agentsim.chargingNetworkManager.chargingPointFilePath.isEmpty) + (mainParkingFile, parkingStallCountScalingFactor, parkingCostScalingFactor) + else + ( + beamConfig.beam.agentsim.chargingNetworkManager.chargingPointFilePath, + beamConfig.beam.agentsim.chargingNetworkManager.chargingPointCountScalingFactor, + beamConfig.beam.agentsim.chargingNetworkManager.chargingPointCostScalingFactor + ) // ADD HERE ALL PARKING FILES THAT BELONGS TO VEHICLE MANAGERS val vehicleManagersParkingFiles: IndexedSeq[(String, ReservedFor, Seq[ParkingType])] = { // SHARED FLEET @@ -68,103 +80,85 @@ object InfrastructureUtils extends LazyLogging { (sharedFleetsParkingFiles ++ freightParkingFile ++ ridehailParkingFile).toIndexedSeq } - // STALLS ARE LOADED HERE + // CHARGING STALLS ARE LOADED HERE + val allChargingStalls = loadStalls[TAZ]( + mainChargingFile, + vehicleManagersParkingFiles, + beamScenario.tazTreeMap.tazQuadTree, + chargingStallCountScalingFactor, + chargingCostScalingFactor, + beamScenario.beamConfig.matsim.modules.global.randomSeed, + beamScenario.beamConfig, + Some(beamServices) + ) + val chargingStalls = loadChargingStalls(allChargingStalls) + val rideHailChargingStalls = loadRideHailChargingStalls(allChargingStalls) + + // CHARGING ZONES ARE BUILT HERE + logger.info(s"building charging networks...") + val (nonRhChargingNetwork, rhChargingNetwork) = ( + ChargingNetwork.init( + chargingStalls, + envelopeInUTM, + beamServices + ), + rideHailChargingStalls.map { case (managerId, chargingZones) => + DefaultRideHailDepotParkingManager.init( + managerId, + chargingZones, + envelopeInUTM, + beamServices + ) + }.head + ) + + // PARKING STALLS ARE LOADED HERE logger.info(s"loading stalls...") - val stalls = beamConfig.beam.agentsim.taz.parkingManager.level.toLowerCase match { + val parkingStalls = beamConfig.beam.agentsim.taz.parkingManager.level.toLowerCase match { case "taz" => - loadStalls[TAZ]( - mainParkingFile, - vehicleManagersParkingFiles, - beamScenario.tazTreeMap.tazQuadTree, - beamScenario.beamConfig.beam.agentsim.taz.parkingStallCountScalingFactor, - beamScenario.beamConfig.beam.agentsim.taz.parkingCostScalingFactor, - beamScenario.beamConfig.matsim.modules.global.randomSeed, - beamScenario.beamConfig, - Some(beamServices) + loadParkingStalls( + loadStalls[TAZ]( + mainParkingFile, + vehicleManagersParkingFiles, + beamScenario.tazTreeMap.tazQuadTree, + parkingStallCountScalingFactor, + parkingCostScalingFactor, + beamScenario.beamConfig.matsim.modules.global.randomSeed, + beamScenario.beamConfig, + Some(beamServices) + ) ) case "link" => - loadStalls[Link]( - mainParkingFile, - vehicleManagersParkingFiles, - beamScenario.linkQuadTree, - beamScenario.beamConfig.beam.agentsim.taz.parkingStallCountScalingFactor, - beamScenario.beamConfig.beam.agentsim.taz.parkingCostScalingFactor, - beamScenario.beamConfig.matsim.modules.global.randomSeed, - beamScenario.beamConfig, - Some(beamServices) + loadParkingStalls( + loadStalls[Link]( + mainParkingFile, + vehicleManagersParkingFiles, + beamScenario.linkQuadTree, + parkingStallCountScalingFactor, + parkingCostScalingFactor, + beamScenario.beamConfig.matsim.modules.global.randomSeed, + beamScenario.beamConfig, + Some(beamServices) + ) ) case _ => throw new IllegalArgumentException( s"Unsupported parking level type ${parkingManagerCfg.level}, only TAZ | Link are supported" ) } - - // CHARGING ZONES ARE BUILT HERE - logger.info(s"building charging networks...") - val (nonRhChargingNetwork, rhChargingNetwork) = - beamConfig.beam.agentsim.taz.parkingManager.level.toLowerCase match { - case "taz" => - val stallsTAZ = stalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[TAZ]]] - ( - ChargingNetwork.init( - buildNonRideHailChargingZones(stallsTAZ), - envelopeInUTM, - beamServices - ), - buildRideHailChargingZones[TAZ](stallsTAZ).map { case (managerId, chargingZones) => - DefaultRideHailDepotParkingManager.init( - managerId, - chargingZones, - envelopeInUTM, - beamServices - ) - }.head - ) - case "link" => - val stallsLINK = stalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[Link]]] - ( - ChargingNetwork.init( - buildNonRideHailChargingZones(stallsLINK), - beamScenario.linkQuadTree, - beamScenario.linkIdMapping, - beamScenario.linkToTAZMapping, - envelopeInUTM, - beamServices - ), - buildRideHailChargingZones[Link](stallsLINK).map { case (managerId, chargingZones) => - DefaultRideHailDepotParkingManager.init( - managerId, - chargingZones, - beamScenario.linkQuadTree, - beamScenario.linkIdMapping, - beamScenario.linkToTAZMapping, - envelopeInUTM, - beamServices - ) - }.head - ) - case _ => - throw new IllegalArgumentException( - s"Unsupported parking level type ${parkingManagerCfg.level}, only TAZ | Link are supported" - ) - } - - // PARKING ZONES ARE BUILT HERE logger.info(s"building parking networks...") val parkingNetwork = beamConfig.beam.agentsim.taz.parkingManager.method match { case "DEFAULT" => beamConfig.beam.agentsim.taz.parkingManager.level.toLowerCase match { case "taz" => - val stallsTAZ = stalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[TAZ]]] ZonalParkingManager.init( - buildParkingZones(stallsTAZ), + parkingStalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[TAZ]]], envelopeInUTM, beamServices ) case "link" => - val stallsLINK = stalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[Link]]] ZonalParkingManager.init( - buildParkingZones(stallsLINK), + parkingStalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[Link]]], beamScenario.linkQuadTree, beamScenario.linkIdMapping, beamScenario.linkToTAZMapping, @@ -177,10 +171,9 @@ object InfrastructureUtils extends LazyLogging { ) } case "HIERARCHICAL" => - val stallsLINK = stalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[Link]]] HierarchicalParkingManager .init( - buildParkingZones(stallsLINK), + parkingStalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[Link]]], beamScenario.tazTreeMap, beamScenario.linkToTAZMapping, geo.distUTMInMeters(_, _), @@ -191,9 +184,8 @@ object InfrastructureUtils extends LazyLogging { beamConfig.beam.agentsim.agents.parking.mulitnomialLogit ) case "PARALLEL" => - val stallsTAZ = stalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[TAZ]]] ParallelParkingManager.init( - buildParkingZones(stallsTAZ), + parkingStalls.asInstanceOf[Map[Id[ParkingZoneId], ParkingZone[TAZ]]], beamScenario.beamConfig, beamScenario.tazTreeMap, geo.distUTMInMeters, @@ -291,7 +283,7 @@ object InfrastructureUtils extends LazyLogging { * @param stalls Map[Id[ParkingZoneId], ParkingZone[GEO]] * @return */ - def buildParkingZones[GEO]( + def loadParkingStalls[GEO]( stalls: Map[Id[ParkingZoneId], ParkingZone[GEO]] ): Map[Id[ParkingZoneId], ParkingZone[GEO]] = stalls.filter(_._2.chargingPointType.isEmpty) @@ -299,7 +291,7 @@ object InfrastructureUtils extends LazyLogging { * @param stalls list of parking zones * @return */ - def buildRideHailChargingZones[GEO]( + def loadRideHailChargingStalls[GEO]( stalls: Map[Id[ParkingZoneId], ParkingZone[GEO]] ): Map[Id[VehicleManager], Map[Id[ParkingZoneId], ParkingZone[GEO]]] = { import VehicleManager._ @@ -312,7 +304,7 @@ object InfrastructureUtils extends LazyLogging { * @param stalls list of parking zones * @return */ - def buildNonRideHailChargingZones[GEO]( + def loadChargingStalls[GEO]( stalls: Map[Id[ParkingZoneId], ParkingZone[GEO]] ): Map[Id[ParkingZoneId], ParkingZone[GEO]] = { import VehicleManager._ diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index e4722fc3293..2030621c8a9 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -70,7 +70,7 @@ class ParkingFunctions[GEO: GeoLevel]( val parkingCostsPriceFactor: Double = parkingAlternative.costInDollars val goingHome: Boolean = - inquiry.activityType == ParkingActivityType.Home && parkingAlternative.parkingType == ParkingType.Residential + inquiry.parkingActivityType == ParkingActivityType.Home && parkingAlternative.parkingType == ParkingType.Residential val homeActivityPrefersResidentialFactor: Double = if (goingHome) 1.0 else 0.0 @@ -117,7 +117,7 @@ class ParkingFunctions[GEO: GeoLevel]( val output = parkingZoneSearchResult match { case Some(result) => result case _ => - inquiry.activityType match { + inquiry.parkingActivityType match { case ParkingActivityType.Init | ParkingActivityType.Home => val newStall = ParkingStall.defaultResidentialStall(inquiry.destinationUtm.loc, GeoLevel[GEO].defaultGeoId) ParkingZoneSearch.ParkingZoneSearchResult(newStall, DefaultParkingZone) @@ -197,7 +197,7 @@ class ParkingFunctions[GEO: GeoLevel]( */ protected def getPreferredParkingTypes(inquiry: ParkingInquiry): Set[ParkingType] = { // a lookup for valid parking types based on this inquiry - inquiry.activityType match { + inquiry.parkingActivityType match { case ParkingActivityType.Home => Set(ParkingType.Residential, ParkingType.Public) case ParkingActivityType.Init => Set(ParkingType.Residential, ParkingType.Public) case ParkingActivityType.Work => Set(ParkingType.Workplace, ParkingType.Public) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala index a478f44523a..956f0425487 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala @@ -3,12 +3,14 @@ package beam.agentsim.infrastructure import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.agents.vehicles.{BeamVehicle, VehicleManager} import beam.agentsim.events.SpaceTime -import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType +import beam.agentsim.infrastructure.ParkingInquiry.{activityTypeStringToEnum, ParkingActivityType} import beam.agentsim.infrastructure.parking.ParkingMNL import beam.agentsim.scheduler.HasTriggerId import beam.utils.ParkingManagerIdGenerator import com.typesafe.scalalogging.LazyLogging import enumeratum.{Enum, EnumEntry} +import org.matsim.api.core.v01.Id +import org.matsim.api.core.v01.population.Person import scala.collection.immutable @@ -26,10 +28,11 @@ import scala.collection.immutable */ case class ParkingInquiry( destinationUtm: SpaceTime, - activityType: ParkingActivityType, + activityType: String, reservedFor: ReservedFor = VehicleManager.AnyManager, beamVehicle: Option[BeamVehicle] = None, remainingTripData: Option[ParkingMNL.RemainingTripData] = None, + personId: Option[Id[Person]] = None, valueOfTime: Double = 0.0, parkingDuration: Double = 0, reserveStall: Boolean = true, @@ -37,13 +40,7 @@ case class ParkingInquiry( ParkingManagerIdGenerator.nextId, // note, this expects all Agents exist in the same JVM to rely on calling this singleton triggerId: Long ) extends HasTriggerId { - - def isChargingRequestOrEV: Boolean = { - beamVehicle match { - case Some(vehicle) => vehicle.isPHEV || vehicle.isBEV - case _ => activityType == ParkingActivityType.Charge - } - } + val parkingActivityType: ParkingActivityType = activityTypeStringToEnum(activityType) } object ParkingInquiry extends LazyLogging { @@ -60,14 +57,13 @@ object ParkingInquiry extends LazyLogging { case object Secondary extends ParkingActivityType } - private def activityTypeStringToEnum(activityType: String): ParkingActivityType = { + def activityTypeStringToEnum(activityType: String): ParkingActivityType = { activityType.toLowerCase match { - case "home" => ParkingActivityType.Home - case "init" => ParkingActivityType.Init - case "work" => ParkingActivityType.Work - case "secondary" => ParkingActivityType.Secondary - case "charge" => ParkingActivityType.Charge - case "wherever" => ParkingActivityType.Wherever + case "home" => ParkingActivityType.Home + case "init" => ParkingActivityType.Init + case "work" => ParkingActivityType.Work + case "charge" => ParkingActivityType.Charge + case "wherever" => ParkingActivityType.Wherever case otherType => logger.debug(s"This Parking Activity Type ($otherType) has not been defined") ParkingActivityType.Wherever @@ -80,6 +76,7 @@ object ParkingInquiry extends LazyLogging { reservedFor: ReservedFor = VehicleManager.AnyManager, beamVehicle: Option[BeamVehicle] = None, remainingTripData: Option[ParkingMNL.RemainingTripData] = None, + personId: Option[Id[Person]] = None, valueOfTime: Double = 0.0, parkingDuration: Double = 0, reserveStall: Boolean = true, @@ -88,10 +85,11 @@ object ParkingInquiry extends LazyLogging { ): ParkingInquiry = ParkingInquiry( destinationUtm, - activityTypeStringToEnum(activityType), + activityType, reservedFor, beamVehicle, remainingTripData, + personId, valueOfTime, parkingDuration, reserveStall, diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala new file mode 100644 index 00000000000..12133ca3eb4 --- /dev/null +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -0,0 +1,349 @@ +package beam.agentsim.infrastructure + +import beam.agentsim.agents.vehicles.EnergyEconomyAttributes.Powertrain +import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor +import beam.agentsim.agents.vehicles._ +import beam.agentsim.events.RefuelSessionEvent.NotApplicable +import beam.agentsim.events.SpaceTime +import beam.agentsim.infrastructure.ChargingNetwork.ChargingVehicle +import beam.agentsim.infrastructure.ChargingNetworkManager._ +import beam.agentsim.infrastructure.ParkingInquiry.{activityTypeStringToEnum, ParkingActivityType} +import beam.agentsim.infrastructure.taz.{TAZ, TAZTreeMap} +import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} +import beam.agentsim.scheduler.Trigger +import beam.agentsim.scheduler.Trigger.TriggerWithId +import beam.sim.config.BeamConfig.Beam.Agentsim +import beam.utils.MathUtils.roundUniformly +import beam.utils.{MathUtils, VehicleIdGenerator} +import org.apache.commons.math3.distribution.EnumeratedDistribution +import org.apache.commons.math3.random.MersenneTwister +import org.apache.commons.math3.util.{Pair => CPair} +import org.matsim.api.core.v01.Id +import org.matsim.api.core.v01.population.Person + +import java.util.concurrent.atomic.AtomicReference +import scala.collection.JavaConverters._ +import scala.collection.concurrent.TrieMap +import scala.collection.mutable +import scala.language.postfixOps +import scala.util.Random + +trait ScaleUpCharging extends { + this: ChargingNetworkManager => + import ScaleUpCharging._ + + private lazy val rand: Random = new Random(beamConfig.matsim.modules.global.randomSeed) + private lazy val mersenne: MersenneTwister = new MersenneTwister(beamConfig.matsim.modules.global.randomSeed) + private lazy val cnmConfig: Agentsim.ChargingNetworkManager = beamConfig.beam.agentsim.chargingNetworkManager + private lazy val timeStepByHour = beamConfig.beam.agentsim.chargingNetworkManager.timeStepInSeconds / 3600.0 + private lazy val virtualParkingInquiries: TrieMap[Int, ParkingInquiry] = TrieMap() + private lazy val vehicleRequests = mutable.HashMap.empty[(Id[TAZ], ParkingActivityType), List[VehicleRequestInfo]] + + private lazy val scaleUpFactors: Map[ParkingActivityType, Double] = { + if (!cnmConfig.scaleUp.enabled) Map() + else { + Map( + ParkingActivityType.Home -> cnmConfig.scaleUp.expansionFactor_home_activity, + ParkingActivityType.Init -> cnmConfig.scaleUp.expansionFactor_init_activity, + ParkingActivityType.Work -> cnmConfig.scaleUp.expansionFactor_work_activity, + ParkingActivityType.Charge -> cnmConfig.scaleUp.expansionFactor_charge_activity, + ParkingActivityType.Wherever -> cnmConfig.scaleUp.expansionFactor_wherever_activity + ) + } + } + + private lazy val defaultScaleUpFactor: Double = + if (!cnmConfig.scaleUp.enabled) 1.0 else cnmConfig.scaleUp.expansionFactor_wherever_activity + + override def loggedReceive: Receive = { + case t @ TriggerWithId(PlanParkingInquiryTrigger(_, requestId), triggerId) => + log.debug(s"Received parking response: $t") + self ! virtualParkingInquiries.getOrElse( + requestId, + log.error( + s"Something is broken in ScaleUpCharging. Request $requestId is not present in virtualParkingInquiries" + ) + ) + sender ! CompletionNotice(triggerId) + case t @ TriggerWithId(PlanChargingUnplugRequestTrigger(tick, beamVehicle, requestId), triggerId) => + log.debug(s"Received parking response: $t") + self ! ChargingUnplugRequest(tick, beamVehicle, triggerId) + virtualParkingInquiries.remove(requestId) + case response @ ParkingInquiryResponse(stall, requestId, triggerId) => + log.debug(s"Received parking response: $response") + virtualParkingInquiries.get(requestId) match { + case Some(parkingInquiry) if stall.chargingPointType.isDefined => + val beamVehicle = parkingInquiry.beamVehicle.get + self ! ChargingPlugRequest( + parkingInquiry.destinationUtm.time, + beamVehicle, + stall, + parkingInquiry.personId.map(Id.create(_, classOf[Person])).getOrElse(Id.create("", classOf[Person])), + triggerId, + NotApplicable, + None + ) + val endTime = (parkingInquiry.destinationUtm.time + parkingInquiry.parkingDuration).toInt + getScheduler ! ScheduleTrigger( + PlanChargingUnplugRequestTrigger(endTime, beamVehicle, parkingInquiry.requestId), + self + ) + case Some(_) if stall.chargingPointType.isEmpty => + log.debug(s"parking inquiry with requestId $requestId returned a NoCharger stall") + case _ => + log.warning(s"inquiryMap does not have this requestId $requestId that returned stall $stall") + } + case reply @ StartingRefuelSession(_, _) => + log.debug(s"Received parking response: $reply") + case reply @ EndingRefuelSession(_, _, _) => + log.debug(s"Received parking response: $reply") + case reply @ WaitingToCharge(_, _, _) => + log.debug(s"Received parking response: $reply") + case reply @ UnhandledVehicle(_, _, triggerId) => + log.debug(s"Received parking response: $reply") + getScheduler ! CompletionNotice(triggerId) + case reply @ UnpluggingVehicle(_, _, triggerId) => + log.debug(s"Received parking response: $reply") + getScheduler ! CompletionNotice(triggerId) + } + + /** + * Next Time poisson + * @param rate rate of charging event + * @return + */ + private def nextTimeStepUsingPoissonProcess(rate: Double): Double = + 3600.0 * (-Math.log(1.0 - rand.nextDouble()) / rate) + + /** + * @param timeBin current time bin + * @param triggerId trigger di for the scheduler + * @return + */ + protected def simulateEventsIfScalingEnabled(timeBin: Int, triggerId: Long): Vector[ScheduleTrigger] = { + val results = vehicleRequests + .groupBy(_._1._1) + .par + .mapValues(_.map { case ((_, parkingActivityType), data) => + val numObservation = data.size + val totPowerInKW = data.map(x => toPowerInKW(x.energyToChargeInJoule, x.durationToChargeInSec)).sum + val durationList = data.map(_.durationToChargeInSec) + val socList = data.map(x => x.remainingFuelInJoule / x.fuelCapacityInJoule) + val energyList = data.map(_.energyToChargeInJoule) + val fuelCapacityList = data.map(_.fuelCapacityInJoule) + val meanDur: Double = durationList.sum / numObservation.toDouble + val meanSOC: Double = socList.sum / numObservation.toDouble + val meanEnergy: Double = energyList.sum / energyList.size.toDouble + val meanFuelCapacity: Double = fuelCapacityList.sum / numObservation.toDouble + val pmfActivityType = + data + .groupBy(_.activityType) + .map { case (activityType, elems) => + new CPair[String, java.lang.Double](activityType, elems.size.toDouble) + } + .toVector + val vehicleInfoSummary = VehicleInfoSummary( + numObservation = numObservation, + totPowerInKW = totPowerInKW, + meanDur = meanDur, + meanSOC = meanSOC, + meanEnergy = meanEnergy, + meanFuelCapacity = meanFuelCapacity, + stdDevDur = Math.sqrt(durationList.map(_ - meanDur).map(t => t * t).sum / numObservation), + stdDevSOC = Math.sqrt(socList.map(_ - meanSOC).map(t => t * t).sum / numObservation), + stdDevEnergy = Math.sqrt(energyList.map(_ - meanEnergy).map(t => t * t).sum / numObservation), + stdFuelCapacity = Math.sqrt(fuelCapacityList.map(_ - meanFuelCapacity).map(t => t * t).sum / numObservation), + new EnumeratedDistribution[String](mersenne, pmfActivityType.asJava) + ) + parkingActivityType -> (data, vehicleInfoSummary) + }) + .flatMap { case (tazId, activityType2vehicleInfo) => + val partialTriggersAndInquiries = Vector.newBuilder[(ScheduleTrigger, ParkingInquiry)] + activityType2vehicleInfo.foldLeft((0.0, 0.0, Vector.empty[CPair[ParkingActivityType, java.lang.Double]])) { + case ((powerAcc, numEventsAcc, pmfAcc), (activityType, (_, dataSummary))) => + val power = (scaleUpFactors.getOrElse(activityType, defaultScaleUpFactor) - 1) * dataSummary.totPowerInKW + val pmf = new CPair[ParkingActivityType, java.lang.Double](activityType, power) + val numEvents = + (scaleUpFactors.getOrElse(activityType, defaultScaleUpFactor) - 1) * dataSummary.numObservation + (powerAcc + power, numEventsAcc + numEvents, pmfAcc :+ pmf) + } match { + case (totPowerInKWToSimulate, totNumberOfEvents, pmf) if totPowerInKWToSimulate > 0 => + val distribution = new EnumeratedDistribution[ParkingActivityType](mersenne, pmf.asJava) + val rate = totNumberOfEvents / timeStepByHour + var cumulatedSimulatedPower = 0.0 + var timeStep = 0 + while (cumulatedSimulatedPower < totPowerInKWToSimulate && timeStep < timeStepByHour * 3600) { + val (_, summary) = activityType2vehicleInfo(distribution.sample()) + val duration = summary.getDuration(rand) + if (duration > 0) { + timeStep += roundUniformly(nextTimeStepUsingPoissonProcess(rate), rand).toInt + val soc = summary.getSOC(rand) + val energyToCharge = summary.getEnergy(rand) + val taz = getBeamServices.beamScenario.tazTreeMap.getTAZ(tazId).get + val destinationUtm = TAZTreeMap.randomLocationInTAZ(taz, rand) + val vehicleType = getBeamVehicleType(summary.getFuelCapacity(rand, energyToCharge, soc)) + val reservedFor = VehicleManager.AnyManager + val beamVehicle = getBeamVehicle(vehicleType, reservedFor, soc) + val personId = getPerson(beamVehicle.id) + val startTime = timeBin + timeStep + val parkingInquiry = ParkingInquiry( + SpaceTime(destinationUtm, startTime), + summary.activityTypeDistribution.sample(), + reservedFor, + Some(beamVehicle), + None, // remainingTripData + Some(personId), + 1.0, // valueOfTime + duration, + triggerId = triggerId + ) + val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) + cumulatedSimulatedPower += toPowerInKW(energyToCharge, duration) + partialTriggersAndInquiries += ((trigger, parkingInquiry)) + } + } + case _ => + log.warning("The observed load is null. Most likely due to vehicles not needing to charge!") + } + partialTriggersAndInquiries.result() + } + .seq + .toVector + results.foreach(x => virtualParkingInquiries.put(x._2.requestId, x._2)) + val triggers = results.map(_._1) + vehicleRequests.clear() + triggers + } + + /** + * @param chargingVehicle the vehicle that just plugged in + */ + protected def collectVehicleRequestInfo(chargingVehicle: ChargingVehicle): Unit = { + if (cnmConfig.scaleUp.enabled && !isVirtualCar(chargingVehicle.vehicle.id)) { + val (durationToCharge, energyToCharge) = + chargingVehicle.vehicle.refuelingSessionDurationAndEnergyInJoulesForStall( + Some(chargingVehicle.stall), + sessionDurationLimit = None, + stateOfChargeLimit = None, + chargingPowerLimit = None + ) + vehicleRequests.synchronized { + val key = (chargingVehicle.stall.tazId, activityTypeStringToEnum(chargingVehicle.activityType)) + vehicleRequests.put( + key, + vehicleRequests.getOrElse(key, List.empty) :+ VehicleRequestInfo( + energyToCharge, + durationToCharge, + Math.max(chargingVehicle.vehicle.primaryFuelLevelInJoules, 0.0), + chargingVehicle.vehicle.beamVehicleType.primaryFuelCapacityInJoule, + chargingVehicle.activityType + ) + ) + } + } + } + + /** + * get Beam Vehicle Type + * @return BeamVehicleType + */ + protected def getBeamVehicleType(fuelCapacityInJoule: Double): BeamVehicleType = { + BeamVehicleType( + id = Id.create(VIRTUAL_CAR_ALIAS + "Type", classOf[BeamVehicleType]), + seatingCapacity = 4, + standingRoomCapacity = 0, + lengthInMeter = 4.1, + primaryFuelType = FuelType.Electricity, + primaryFuelConsumptionInJoulePerMeter = 626, + primaryFuelCapacityInJoule = fuelCapacityInJoule, + vehicleCategory = VehicleCategory.Car + ) + } + + /** + * get Beam Vehicle + * @param vehicleType BeamVehicleType + * @param reservedFor ReservedFor + * @param soc State Of Charge In Double + * @return + */ + protected def getBeamVehicle(vehicleType: BeamVehicleType, reservedFor: ReservedFor, soc: Double): BeamVehicle = { + val powerTrain = new Powertrain(vehicleType.primaryFuelConsumptionInJoulePerMeter) + val nextId = VehicleIdGenerator.nextId + val beamVehicle = new BeamVehicle( + Id.create(VIRTUAL_CAR_ALIAS + "-" + nextId, classOf[BeamVehicle]), + powerTrain, + vehicleType, + new AtomicReference(reservedFor.managerId), + randomSeed = rand.nextInt + ) + beamVehicle.initializeFuelLevels(soc) + beamVehicle + } + + /** + * @param vehicleId vehicle Id + * @return + */ + protected def getPerson(vehicleId: Id[BeamVehicle]): Id[Person] = { + Id.create(vehicleId.toString.replace(VIRTUAL_CAR_ALIAS, "VirtualPerson"), classOf[Person]) + } + + /** + * identify whether the vehicle has been created for scaling up or not + * @param vehicleId vehicle Id + * @return + */ + protected def isVirtualCar(vehicleId: Id[BeamVehicle]): Boolean = vehicleId.toString.contains(VIRTUAL_CAR_ALIAS) +} + +object ScaleUpCharging { + val VIRTUAL_CAR_ALIAS: String = "VirtualCar" + case class PlanParkingInquiryTrigger(tick: Int, requestId: Int) extends Trigger + case class PlanChargingUnplugRequestTrigger(tick: Int, beamVehicle: BeamVehicle, requestId: Int) extends Trigger + + case class VehicleRequestInfo( + energyToChargeInJoule: Double, + durationToChargeInSec: Int, + remainingFuelInJoule: Double, + fuelCapacityInJoule: Double, + activityType: String + ) + + case class VehicleInfoSummary( + numObservation: Int, + totPowerInKW: Double, + meanDur: Double, + meanSOC: Double, + meanEnergy: Double, + meanFuelCapacity: Double, + stdDevDur: Double, + stdDevSOC: Double, + stdDevEnergy: Double, + stdFuelCapacity: Double, + activityTypeDistribution: EnumeratedDistribution[String] + ) { + + def getDuration(rand: Random): Int = { + MathUtils.roundUniformly(Math.max(meanDur + (rand.nextGaussian() * stdDevDur), 0.0), rand).toInt + } + + def getSOC(rand: Random): Double = Math.max(meanSOC + (rand.nextGaussian() * stdDevSOC), 0.0) + + def getEnergy(rand: Random): Double = Math.max(meanEnergy + (rand.nextGaussian() * stdDevEnergy), 0.0) + + def getFuelCapacity(rand: Random, energy: Double, soc: Double): Double = { + Math.max(meanFuelCapacity + (rand.nextGaussian() * stdFuelCapacity), if (soc == 1) energy else energy / (1 - soc)) + } + } + + /** + * @param energy Joules + * @param duration Seconds + * @return + */ + def toPowerInKW(energy: Double, duration: Int): Double = { + if (duration > 0 && energy >= 0) (energy / 3.6e+6) / (duration / 3600.0) + else 0 + } +} diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala index d7602ef655a..6acd6087742 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala @@ -138,7 +138,7 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { val parkingZone = stalls(parkingZoneId) val (pricingModel, feeInCents) = parkingZone.pricingModel match { case None => ("", "") - case Some(pm) => (s"$pm", s"${pm.costInDollars / 100.0}") + case Some(pm) => (s"$pm", s"${pm.costInDollars * 100.0}") } val chargingPoint = parkingZone.chargingPointType match { case None => "NoCharger" @@ -456,7 +456,6 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { logger.error(s"Failed to match row of parking configuration '$csvRow' to expected schema") return None } - implicit val parkingStallCountScalingFactorImplicit: Double = parkingStallCountScalingFactor implicit val randImplicit: Random = rand val tazString = csvRow.get("taz") val parkingTypeString = csvRow.get("parkingType") @@ -479,7 +478,7 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { val pricingModel = PricingModel(pricingModelString, newCostInDollarsString) val timeRestrictions = parseTimeRestrictions(timeRestrictionsString) val chargingPoint = ChargingPointType(chargingTypeString) - val numStalls = calculateNumStalls(numStallsString.toDouble, reservedFor) + val numStalls = calculateNumStalls(numStallsString.toDouble, reservedFor, parkingStallCountScalingFactor) val parkingZoneIdMaybe = if (parkingZoneIdString == null || parkingZoneIdString.isEmpty) None else Some(ParkingZone.createId(parkingZoneIdString)) @@ -517,18 +516,17 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { } } - private def calculateNumStalls( - initialNumStalls: Double, - reservedFor: ReservedFor - )(implicit parkingStallCountScalingFactor: Double, rand: Random): Int = { + private def calculateNumStalls(initialNumStalls: Double, reservedFor: ReservedFor, scalingFactor: Double)(implicit + rand: Random + ): Int = { reservedFor.managerType match { case VehicleManager.TypeEnum.Household => - if (rand.nextDouble() <= parkingStallCountScalingFactor) + if (rand.nextDouble() <= scalingFactor) initialNumStalls.toInt else 0 case _ => - val expectedNumberOfStalls = initialNumStalls * parkingStallCountScalingFactor + val expectedNumberOfStalls = initialNumStalls * scalingFactor MathUtils.roundUniformly(expectedNumberOfStalls, rand).toInt } } diff --git a/src/main/scala/beam/agentsim/infrastructure/power/PowerController.scala b/src/main/scala/beam/agentsim/infrastructure/power/PowerController.scala index ac8468a7606..d048015f259 100644 --- a/src/main/scala/beam/agentsim/infrastructure/power/PowerController.scala +++ b/src/main/scala/beam/agentsim/infrastructure/power/PowerController.scala @@ -1,33 +1,33 @@ package beam.agentsim.infrastructure.power import beam.agentsim.agents.vehicles.VehicleManager -import beam.agentsim.infrastructure.ChargingNetwork import beam.agentsim.infrastructure.ChargingNetwork.ChargingStation +import beam.agentsim.infrastructure.ChargingNetworkManager.ChargingNetworkHelper +import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.ParkingZone.createId -import beam.agentsim.infrastructure.power.SitePowerManager.PhysicalBounds import beam.cosim.helics.BeamHelicsInterface._ import beam.sim.config.BeamConfig +import cats.Eval import com.typesafe.scalalogging.LazyLogging import scala.util.control.NonFatal import scala.util.{Failure, Try} -class PowerController( - chargingNetwork: ChargingNetwork[_], - rideHailNetwork: ChargingNetwork[_], - beamConfig: BeamConfig, - unlimitedPhysicalBounds: Map[ChargingStation, PhysicalBounds] -) extends LazyLogging { - import SitePowerManager._ +class PowerController(chargingNetworkHelper: ChargingNetworkHelper, beamConfig: BeamConfig) extends LazyLogging { + import PowerController._ private val timeStep = beamConfig.beam.agentsim.chargingNetworkManager.timeStepInSeconds private val isConnectedToHelics = beamConfig.beam.agentsim.chargingNetworkManager.helics.connectionEnabled + private[infrastructure] lazy val unlimitedPhysicalBounds = getUnlimitedPhysicalBounds( + chargingNetworkHelper.allChargingStations + ).value + private[power] lazy val beamFederateOption: Option[BeamFederate] = if (isConnectedToHelics) { logger.warn("ChargingNetworkManager should be connected to a grid via Helics...") val helicsConfig = beamConfig.beam.agentsim.chargingNetworkManager.helics Try { - logger.debug("Init PowerController resources...") + logger.info("Init PowerController resources...") getFederate( helicsConfig.federateName, helicsConfig.coreType, @@ -89,32 +89,36 @@ class PowerController( } logger.debug("Obtained power from the grid {}...", gridBounds) - gridBounds.flatMap { x => - val reservedFor = x("reservedFor").asInstanceOf[String] match { - case managerIdString if managerIdString.isEmpty => VehicleManager.AnyManager - case managerIdString => VehicleManager.createOrGetReservedFor(managerIdString, Some(beamConfig)).get - } - val appropriateChargingNetwork = reservedFor.managerType match { - case VehicleManager.TypeEnum.RideHail => rideHailNetwork - case _ => chargingNetwork - } - appropriateChargingNetwork.lookupStation(createId(x("parkingZoneId").asInstanceOf[String])) match { - case Some(station) => - Some( - station -> PhysicalBounds( - station, - x("power_limit_upper").asInstanceOf[PowerInKW], - x("power_limit_lower").asInstanceOf[PowerInKW], - x("lmp_with_control_signal").asInstanceOf[Double] + if (beamConfig.beam.agentsim.chargingNetworkManager.helics.feedbackEnabled) { + gridBounds.flatMap { x => + val reservedFor = x("reservedFor").asInstanceOf[String] match { + case managerIdString if managerIdString.isEmpty => VehicleManager.AnyManager + case managerIdString => + VehicleManager.createOrGetReservedFor(managerIdString, Some(beamConfig)).get + } + chargingNetworkHelper + .get(reservedFor) + .lookupStation(createId(x("parkingZoneId").asInstanceOf[String])) match { + case Some(station) => + Some( + station -> PhysicalBounds( + station, + x("power_limit_upper").asInstanceOf[PowerInKW], + x("power_limit_lower").asInstanceOf[PowerInKW], + x("lmp_with_control_signal").asInstanceOf[Double] + ) ) - ) - case _ => - logger.error( - "Cannot find the charging station correspondent to what has been received from the co-simulation" - ) - None - } - }.toMap + case _ => + logger.error( + "Cannot find the charging station correspondent to what has been received from the co-simulation" + ) + None + } + }.toMap + } else { + // unlimited physical bounds for now until we figure out why the simulation gets affected + unlimitedPhysicalBounds + } case _ => logger.debug("Not connected to grid, falling to default physical bounds at time {}...", currentTime) unlimitedPhysicalBounds @@ -141,3 +145,34 @@ class PowerController( } } } + +object PowerController { + type PowerInKW = Double + type EnergyInJoules = Double + type ChargingDurationInSec = Int + + case class PhysicalBounds( + station: ChargingStation, + powerLimitUpper: PowerInKW, + powerLimitLower: PowerInKW, + lpmWithControlSignal: Double + ) + + /** + * create unlimited physical bounds + * @param stations sequence of stations for which to produce physical bounds + * @return map of physical bounds + */ + def getUnlimitedPhysicalBounds(stations: Seq[ChargingStation]): Eval[Map[ChargingStation, PhysicalBounds]] = { + Eval.later { + stations.map { case station @ ChargingStation(zone) => + station -> PhysicalBounds( + station, + ChargingPointType.getChargingPointInstalledPowerInKw(zone.chargingPointType.get) * zone.maxStalls, + ChargingPointType.getChargingPointInstalledPowerInKw(zone.chargingPointType.get) * zone.maxStalls, + 0.0 + ) + }.toMap + } + } +} diff --git a/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala b/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala index e98aefc7633..9a965092199 100644 --- a/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala @@ -1,27 +1,23 @@ package beam.agentsim.infrastructure.power -import beam.agentsim.agents.vehicles.BeamVehicle -import beam.agentsim.infrastructure.ChargingNetwork import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingVehicle} +import beam.agentsim.infrastructure.ChargingNetworkManager.ChargingNetworkHelper import beam.agentsim.infrastructure.charging.ChargingPointType +import beam.agentsim.infrastructure.power.PowerController._ import beam.router.skim.event import beam.sim.BeamServices -import cats.Eval import com.typesafe.scalalogging.LazyLogging import org.matsim.api.core.v01.Coord import scala.collection.mutable class SitePowerManager( - chargingNetwork: ChargingNetwork[_], - rideHailNetwork: ChargingNetwork[_], + chargingNetworkHelper: ChargingNetworkHelper, + unlimitedPhysicalBounds: Map[ChargingStation, PhysicalBounds], beamServices: BeamServices ) extends LazyLogging { - import SitePowerManager._ private val cnmConfig = beamServices.beamConfig.beam.agentsim.chargingNetworkManager - private lazy val allChargingStations = chargingNetwork.chargingStations ++ rideHailNetwork.chargingStations - private[infrastructure] val unlimitedPhysicalBounds = getUnlimitedPhysicalBounds(allChargingStations).value private val temporaryLoadEstimate = mutable.HashMap.empty[ChargingStation, Double] /** @@ -31,7 +27,7 @@ class SitePowerManager( * @return power (in Kilo Watt) over planning horizon */ def requiredPowerInKWOverNextPlanningHorizon(tick: Int): Map[ChargingStation, PowerInKW] = { - val plans = allChargingStations.par + val plans = chargingNetworkHelper.allChargingStations.par .map(station => station -> temporaryLoadEstimate.getOrElse(station, 0.0)) .seq .toMap @@ -51,8 +47,8 @@ class SitePowerManager( timeInterval: Int, chargingVehicle: ChargingVehicle, physicalBounds: Map[ChargingStation, PhysicalBounds] - ): (ChargingDurationInSec, EnergyInJoules) = { - val ChargingVehicle(vehicle, _, station, _, _, _, _, _, _, _) = chargingVehicle + ): (ChargingDurationInSec, EnergyInJoules, EnergyInJoules) = { + val ChargingVehicle(vehicle, _, station, _, _, _, _, _, _, _, _) = chargingVehicle // dispatch val maxZoneLoad = physicalBounds(station).powerLimitUpper val maxUnlimitedZoneLoad = unlimitedPhysicalBounds(station).powerLimitUpper @@ -64,42 +60,42 @@ class SitePowerManager( stateOfChargeLimit = None, chargingPowerLimit = Some(chargingPowerLimit) ) + val (_, energyToChargeIfUnconstrained) = vehicle.refuelingSessionDurationAndEnergyInJoules( + sessionDurationLimit = Some(timeInterval), + stateOfChargeLimit = None, + chargingPowerLimit = None + ) if ((chargingDuration > 0 && energyToCharge == 0) || chargingDuration == 0 && energyToCharge > 0) { logger.debug( - s"chargingDuration is $chargingDuration while energyToCharge is $energyToCharge. Something is broken or due to physical bounds!!" + s"chargingDuration is $chargingDuration while energyToCharge is $energyToCharge. " + + s"Something is broken or due to physical bounds!!" ) } - (chargingDuration, energyToCharge) + (chargingDuration, energyToCharge, energyToChargeIfUnconstrained) } /** * Collect rough power demand per vehicle * @param time start time of charging cycle * @param duration duration of charging cycle - * @param vehicle vehicle charging + * @param energyToChargeIfUnconstrained the energy to charge * @param station the station where vehicle is charging */ def collectObservedLoadInKW( time: Int, duration: Int, - vehicle: BeamVehicle, + energyToChargeIfUnconstrained: Double, station: ChargingStation ): Unit = { - // Collect data on load demand - val (chargingDuration, requiredEnergy) = vehicle.refuelingSessionDurationAndEnergyInJoules( - sessionDurationLimit = Some(duration), - stateOfChargeLimit = None, - chargingPowerLimit = None - ) - val requiredLoad = if (chargingDuration == 0) 0.0 else (requiredEnergy / 3.6e+6) / (chargingDuration / 3600.0) + val requiredLoad = if (duration == 0) 0.0 else (energyToChargeIfUnconstrained / 3.6e+6) / (duration / 3600.0) + // Keep track of previous time bin load temporaryLoadEstimate.synchronized { val requiredLoadAcc = temporaryLoadEstimate.getOrElse(station, 0.0) + requiredLoad temporaryLoadEstimate.put(station, requiredLoadAcc) } - val timeBin = cnmConfig.timeStepInSeconds * (time / cnmConfig.timeStepInSeconds) beamServices.matsimServices.getEvents.processEvent( event.TAZSkimmerEvent( - timeBin, + cnmConfig.timeStepInSeconds * (time / cnmConfig.timeStepInSeconds), new Coord(0, 0), station.zone.parkingZoneId.toString, requiredLoad, @@ -110,34 +106,3 @@ class SitePowerManager( ) } } - -object SitePowerManager { - type PowerInKW = Double - type EnergyInJoules = Double - type ChargingDurationInSec = Int - - case class PhysicalBounds( - station: ChargingStation, - powerLimitUpper: PowerInKW, - powerLimitLower: PowerInKW, - lpmWithControlSignal: Double - ) - - /** - * create unlimited physical bounds - * @param stations sequence of stations for which to produce physical bounds - * @return map of physical bounds - */ - def getUnlimitedPhysicalBounds(stations: Seq[ChargingStation]): Eval[Map[ChargingStation, PhysicalBounds]] = { - Eval.later { - stations.map { case station @ ChargingStation(zone) => - station -> PhysicalBounds( - station, - ChargingPointType.getChargingPointInstalledPowerInKw(zone.chargingPointType.get) * zone.maxStalls, - ChargingPointType.getChargingPointInstalledPowerInKw(zone.chargingPointType.get) * zone.maxStalls, - 0.0 - ) - }.toMap - } - } -} diff --git a/src/main/scala/beam/agentsim/infrastructure/taz/TAZ.scala b/src/main/scala/beam/agentsim/infrastructure/taz/TAZ.scala index 11f12f51f21..d78d0d71e45 100644 --- a/src/main/scala/beam/agentsim/infrastructure/taz/TAZ.scala +++ b/src/main/scala/beam/agentsim/infrastructure/taz/TAZ.scala @@ -3,9 +3,7 @@ package beam.agentsim.infrastructure.taz import scala.annotation.tailrec import beam.router.BeamRouter.Location import beam.sim.common.GeoUtils -import org.matsim.api.core.v01.network.Link import org.matsim.api.core.v01.{Coord, Id} -import org.matsim.core.network.LinkImpl import org.matsim.core.utils.collections.QuadTree import scala.collection.JavaConverters._ diff --git a/src/main/scala/beam/analysis/DelayMetricAnalysis.scala b/src/main/scala/beam/analysis/DelayMetricAnalysis.scala index da08236ebdd..523be91562b 100644 --- a/src/main/scala/beam/analysis/DelayMetricAnalysis.scala +++ b/src/main/scala/beam/analysis/DelayMetricAnalysis.scala @@ -1,10 +1,9 @@ package beam.analysis import java.util - import beam.agentsim.events.PathTraversalEvent import beam.analysis.plots.{GraphUtils, GraphsStatsAgentSimEventsListener} -import beam.router.Modes.BeamMode.CAR +import beam.router.Modes.BeamMode import beam.utils.NetworkHelper import beam.utils.logging.ExponentialLazyLogging import com.google.inject.Inject @@ -65,9 +64,7 @@ class DelayMetricAnalysis @Inject() ( event match { case pathTraversalEvent: PathTraversalEvent => calculateNetworkUtilization(pathTraversalEvent) - - val mode = pathTraversalEvent.mode - if (mode.value.equalsIgnoreCase(CAR.value)) { + if (pathTraversalEvent.mode == BeamMode.CAR) { val linkIds = pathTraversalEvent.linkIds val linkTravelTimes = pathTraversalEvent.linkTravelTime assert(linkIds.length == linkTravelTimes.length) diff --git a/src/main/scala/beam/analysis/ParkingStatsCollector.scala b/src/main/scala/beam/analysis/ParkingStatsCollector.scala index 9b50755b5df..941c77fe292 100644 --- a/src/main/scala/beam/analysis/ParkingStatsCollector.scala +++ b/src/main/scala/beam/analysis/ParkingStatsCollector.scala @@ -67,23 +67,21 @@ class ParkingStatsCollector(beamServices: BeamServices) extends GraphAnalysis wi start tracking the departing person */ case modeChoiceEvent: ModeChoiceEvent => - modeChoiceEvent.mode match { - case BeamMode.CAR.value | BeamMode.DRIVE_TRANSIT.value => - // start tracking the person for outbound stats - if (!personOutboundParkingStatsTracker.contains(modeChoiceEvent.personId.toString)) { - personOutboundParkingStatsTracker.put( - modeChoiceEvent.personId.toString, - ParkingStatsCollector.EMPTY_PERSON_OUTBOUND_STATS - ) - } - // start tracking the person for inbound stats - if (!personInboundParkingStatsTracker.contains(modeChoiceEvent.personId.toString)) { - personInboundParkingStatsTracker.put( - modeChoiceEvent.personId.toString, - ParkingStatsCollector.EMPTY_PERSON_INBOUND_STATS - ) - } - case _ => + if (BeamMode.isCar(modeChoiceEvent.mode) || modeChoiceEvent.mode == BeamMode.DRIVE_TRANSIT.value) { + // start tracking the person for outbound stats + if (!personOutboundParkingStatsTracker.contains(modeChoiceEvent.personId.toString)) { + personOutboundParkingStatsTracker.put( + modeChoiceEvent.personId.toString, + ParkingStatsCollector.EMPTY_PERSON_OUTBOUND_STATS + ) + } + // start tracking the person for inbound stats + if (!personInboundParkingStatsTracker.contains(modeChoiceEvent.personId.toString)) { + personInboundParkingStatsTracker.put( + modeChoiceEvent.personId.toString, + ParkingStatsCollector.EMPTY_PERSON_INBOUND_STATS + ) + } } /* diff --git a/src/main/scala/beam/router/Modes.scala b/src/main/scala/beam/router/Modes.scala index 61e567b52ca..a30d7986f63 100755 --- a/src/main/scala/beam/router/Modes.scala +++ b/src/main/scala/beam/router/Modes.scala @@ -1,21 +1,6 @@ package beam.router -import beam.router.Modes.BeamMode.{ - BIKE, - BUS, - CABLE_CAR, - CAR, - CAV, - FERRY, - FUNICULAR, - GONDOLA, - RAIL, - RIDE_HAIL, - SUBWAY, - TRAM, - TRANSIT, - WALK -} +import beam.router.Modes.BeamMode.{BIKE, CAR, CAV, WALK} import com.conveyal.r5.api.util.{LegMode, TransitModes} import com.conveyal.r5.profile.StreetMode import enumeratum.values._ @@ -39,6 +24,13 @@ object Modes { val matsimMode: String ) extends StringEnumEntry { + import BeamMode._ + + override def equals(obj: Any): Boolean = obj match { + case mode: BeamMode if BeamMode.isCar(mode.value) => BeamMode.isCar(this.value) + case _ => super.equals(obj) + } + def isTransit: Boolean = isR5TransitMode(this) def isMassTransit: Boolean = this == SUBWAY || this == RAIL || this == FERRY || this == TRAM def isRideHail: Boolean = this == RIDE_HAIL @@ -46,12 +38,27 @@ object Modes { object BeamMode extends StringEnum[BeamMode] with StringCirceEnum[BeamMode] { + def isCar(stringMode: String): Boolean = + stringMode.equalsIgnoreCase(CAR.value) || + stringMode.equalsIgnoreCase(CAR_HOV2.value) || + stringMode.equalsIgnoreCase(CAR_HOV3.value) + override val values: immutable.IndexedSeq[BeamMode] = findValues + case object HOV2_TELEPORTATION extends BeamMode(value = "hov2_teleportation", None, "") + + case object HOV3_TELEPORTATION extends BeamMode(value = "hov3_teleportation", None, "") + // Driving / Automobile-like (hailed rides are a bit of a hybrid) case object CAR extends BeamMode(value = "car", Some(Left(LegMode.CAR)), TransportMode.car) + // car with 1 guaranteed additional passenger + case object CAR_HOV2 extends BeamMode(value = "car_hov2", Some(Left(LegMode.CAR)), TransportMode.car) + + // car with 2 guaranteed additional passengers + case object CAR_HOV3 extends BeamMode(value = "car_hov3", Some(Left(LegMode.CAR)), TransportMode.car) + case object CAV extends BeamMode(value = "cav", Some(Left(LegMode.CAR)), TransportMode.car) case object RIDE_HAIL extends BeamMode(value = "ride_hail", Some(Left(LegMode.CAR)), TransportMode.other) @@ -133,7 +140,9 @@ object Modes { RIDE_HAIL_TRANSIT, DRIVE_TRANSIT, WALK_TRANSIT, - BIKE_TRANSIT + BIKE_TRANSIT, + HOV2_TELEPORTATION, + HOV3_TELEPORTATION ) def fromString(stringMode: String): Option[BeamMode] = { diff --git a/src/main/scala/beam/router/RoutingWorker.scala b/src/main/scala/beam/router/RoutingWorker.scala index 24dd97322dc..276bd4b8430 100755 --- a/src/main/scala/beam/router/RoutingWorker.scala +++ b/src/main/scala/beam/router/RoutingWorker.scala @@ -385,15 +385,9 @@ class RoutingWorker(workerParams: R5Parameters) extends Actor with ActorLogging val definedResponses = responses.flatten (definedResponses, r5ResponseOption) match { case (head +: _, Some(r5Resp)) => - head.copy( - itineraries = r5Resp.itineraries ++ definedResponses.flatMap(_.itineraries), - searchedModes = r5Resp.searchedModes ++ definedResponses.flatMap(_.searchedModes) - ) + head.copy(itineraries = definedResponses.flatMap(_.itineraries) ++ r5Resp.itineraries) case (head +: _, None) => - head.copy( - itineraries = definedResponses.flatMap(_.itineraries), - searchedModes = definedResponses.flatMap(_.searchedModes).toSet - ) + head.copy(itineraries = definedResponses.flatMap(_.itineraries)) case (Seq(), Some(r5Resp)) => r5Resp case (Seq(), None) => r5.calcRoute(request) diff --git a/src/main/scala/beam/router/cch/CchWrapper.scala b/src/main/scala/beam/router/cch/CchWrapper.scala index d0f43a8e41f..332749ee3b8 100644 --- a/src/main/scala/beam/router/cch/CchWrapper.scala +++ b/src/main/scala/beam/router/cch/CchWrapper.scala @@ -137,18 +137,10 @@ class CchWrapper(workerParams: R5Parameters) extends Router { req.requestId, Some(req), isEmbodyWithCurrentTravelTime = false, - triggerId = req.triggerId, - searchedModes = Set(alternative.tripClassifier) + triggerId = req.triggerId ) } else - RoutingResponse( - Seq(), - req.requestId, - Some(req), - isEmbodyWithCurrentTravelTime = false, - triggerId = req.triggerId, - searchedModes = req.streetVehicles.map(_.mode).toSet - ) + RoutingResponse(Seq(), req.requestId, Some(req), isEmbodyWithCurrentTravelTime = false, triggerId = req.triggerId) } def rebuildNativeCCHWeights(newTravelTime: TravelTime): Unit = { diff --git a/src/main/scala/beam/router/graphhopper/GraphHopperWrapper.scala b/src/main/scala/beam/router/graphhopper/GraphHopperWrapper.scala index 93939a4022a..3767e0b7eb1 100644 --- a/src/main/scala/beam/router/graphhopper/GraphHopperWrapper.scala +++ b/src/main/scala/beam/router/graphhopper/GraphHopperWrapper.scala @@ -94,10 +94,7 @@ abstract class GraphHopperWrapper( routingRequest.requestId, Some(routingRequest), isEmbodyWithCurrentTravelTime = false, - triggerId = routingRequest.triggerId, - searchedModes = - if (alternatives.isEmpty) routingRequest.streetVehicles.map(_.mode).toSet - else (alternatives.map(_.tripClassifier).toSet) + triggerId = routingRequest.triggerId ) } diff --git a/src/main/scala/beam/router/model/EmbodiedBeamLeg.scala b/src/main/scala/beam/router/model/EmbodiedBeamLeg.scala index b4e52aa0db1..c6603482906 100644 --- a/src/main/scala/beam/router/model/EmbodiedBeamLeg.scala +++ b/src/main/scala/beam/router/model/EmbodiedBeamLeg.scala @@ -15,7 +15,7 @@ case class EmbodiedBeamLeg( isPooledTrip: Boolean = false, replanningPenalty: Double = 0 ) { - val isRideHail: Boolean = beamVehicleId.toString.startsWith("rideHailVehicle") + val isRideHail: Boolean = BeamVehicle.isRidehailVehicle(beamVehicleId) } object EmbodiedBeamLeg { diff --git a/src/main/scala/beam/router/model/EmbodiedBeamTrip.scala b/src/main/scala/beam/router/model/EmbodiedBeamTrip.scala index 26823a54f12..e04ea2f5269 100644 --- a/src/main/scala/beam/router/model/EmbodiedBeamTrip.scala +++ b/src/main/scala/beam/router/model/EmbodiedBeamTrip.scala @@ -6,8 +6,11 @@ import beam.router.Modes.BeamMode.{ BIKE, BIKE_TRANSIT, CAR, + CAR_HOV3, CAV, DRIVE_TRANSIT, + HOV2_TELEPORTATION, + HOV3_TELEPORTATION, RIDE_HAIL, RIDE_HAIL_POOLED, RIDE_HAIL_TRANSIT, @@ -79,12 +82,20 @@ object EmbodiedBeamTrip { } else { theMode = RIDE_HAIL } + } else if (theMode == WALK && BeamVehicle.isSharedTeleportationVehicle(leg.beamVehicleId)) { + if (leg.beamLeg.mode.value == CAR_HOV3.value) { + theMode = HOV3_TELEPORTATION + } else { + theMode = HOV2_TELEPORTATION + } } else if (theMode == WALK && leg.beamLeg.mode == CAR) { - theMode = CAR + theMode = leg.beamLeg.mode + } else if (theMode == WALK && leg.beamLeg.mode.isRideHail) { + theMode = leg.beamLeg.mode } else if (theMode == WALK && leg.beamLeg.mode == CAV) { - theMode = CAV + theMode = leg.beamLeg.mode } else if (theMode == WALK && leg.beamLeg.mode == BIKE) { - theMode = BIKE + theMode = leg.beamLeg.mode } if (leg.beamLeg.mode == BIKE) hasUsedBike = true if (leg.beamLeg.mode == CAR) hasUsedCar = true diff --git a/src/main/scala/beam/router/r5/R5Parameters.scala b/src/main/scala/beam/router/r5/R5Parameters.scala index dafd30ce98c..02f9c13e500 100644 --- a/src/main/scala/beam/router/r5/R5Parameters.scala +++ b/src/main/scala/beam/router/r5/R5Parameters.scala @@ -53,7 +53,7 @@ object R5Parameters { ZonedDateTime.parse(beamConfig.beam.routing.baseDate) ) val geo = new GeoUtilsImpl(beamConfig) - val vehicleTypes = readBeamVehicleTypeFile(beamConfig) + val vehicleTypes = readBeamVehicleTypeFile(beamConfig.beam.agentsim.agents.vehicles.vehicleTypesFilePath) val fuelTypePrices = readFuelTypeFile(beamConfig.beam.agentsim.agents.vehicles.fuelTypesFilePath).toMap val ptFares = PtFares(beamConfig.beam.agentsim.agents.ptFare.filePath) val fareCalculator = new FareCalculator(beamConfig) diff --git a/src/main/scala/beam/router/r5/R5Wrapper.scala b/src/main/scala/beam/router/r5/R5Wrapper.scala index aa146d67cbc..83ca231f6d5 100644 --- a/src/main/scala/beam/router/r5/R5Wrapper.scala +++ b/src/main/scala/beam/router/r5/R5Wrapper.scala @@ -923,8 +923,9 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo for (edge: StreetEdgeInfo <- segment.streetEdges.asScala) { activeLinkIds += edge.edgeId.intValue() } + val beamLeg: BeamLeg = - createBeamLeg(vehicle.vehicleTypeId, startPoint, endCoord, segment.mode, activeLinkIds) + createBeamLeg(vehicle.vehicleTypeId, startPoint, endCoord, segment.mode, activeLinkIds, Some(vehicle.mode)) val toll = if (segment.mode == LegMode.CAR) { val osm = segment.streetEdges.asScala .map(e => @@ -959,7 +960,8 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo startPoint: SpaceTime, endCoord: Coord, legMode: LegMode, - activeLinkIds: IndexedSeq[Int] + activeLinkIds: IndexedSeq[Int], + maybeVehicleMode: Option[BeamMode] = None ): BeamLeg = { val tripStartTime: Int = startPoint.time // During routing `travelTimeByLinkCalculator` is used with shouldAddNoise = true (if it is not transit) @@ -981,9 +983,15 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo endPoint = SpaceTime(endCoord, startPoint.time + math.round(linksTimesDistances.travelTimes.tail.sum.toFloat)), distanceInM = distance ) + + val newLegMode = maybeVehicleMode match { + case Some(vehicleMode @ CAR) => vehicleMode + case _ => mapLegMode(legMode) + } + val beamLeg = BeamLeg( tripStartTime, - mapLegMode(legMode), + newLegMode, theTravelPath.duration, travelPath = theTravelPath ) diff --git a/src/main/scala/beam/router/r5/WorkerParameters.scala b/src/main/scala/beam/router/r5/WorkerParameters.scala index ec0824012a5..33f3d41de1e 100644 --- a/src/main/scala/beam/router/r5/WorkerParameters.scala +++ b/src/main/scala/beam/router/r5/WorkerParameters.scala @@ -53,7 +53,7 @@ object WorkerParameters { ZonedDateTime.parse(beamConfig.beam.routing.baseDate) ) val geo = new GeoUtilsImpl(beamConfig) - val vehicleTypes = readBeamVehicleTypeFile(beamConfig) + val vehicleTypes = readBeamVehicleTypeFile(beamConfig.beam.agentsim.agents.vehicles.vehicleTypesFilePath) val fuelTypePrices = readFuelTypeFile(beamConfig.beam.agentsim.agents.vehicles.fuelTypesFilePath).toMap val ptFares = PtFares(beamConfig.beam.agentsim.agents.ptFare.filePath) val fareCalculator = new FareCalculator(beamConfig) diff --git a/src/main/scala/beam/router/skim/ActivitySimPathType.scala b/src/main/scala/beam/router/skim/ActivitySimPathType.scala index bad1bdb345e..6acd04db8f5 100644 --- a/src/main/scala/beam/router/skim/ActivitySimPathType.scala +++ b/src/main/scala/beam/router/skim/ActivitySimPathType.scala @@ -165,9 +165,10 @@ object ActivitySimPathType { private def isWalkTransit(beamMode: BeamMode): Boolean = beamMode match { case BeamMode.BUS | BeamMode.FERRY | BeamMode.RAIL | BeamMode.SUBWAY | BeamMode.TRAM | BeamMode.CABLE_CAR => true - case BeamMode.CAR | BeamMode.CAV | BeamMode.RIDE_HAIL | BeamMode.RIDE_HAIL_POOLED => false - case BeamMode.FUNICULAR | BeamMode.GONDOLA | BeamMode.WALK | BeamMode.BIKE | BeamMode.BIKE_TRANSIT => false - case BeamMode.TRANSIT | BeamMode.WALK_TRANSIT | BeamMode.DRIVE_TRANSIT | BeamMode.RIDE_HAIL_TRANSIT => false + case BeamMode.CAR | BeamMode.CAV | BeamMode.RIDE_HAIL | BeamMode.RIDE_HAIL_POOLED => false + case BeamMode.FUNICULAR | BeamMode.GONDOLA | BeamMode.WALK | BeamMode.BIKE | BeamMode.BIKE_TRANSIT => false + case BeamMode.TRANSIT | BeamMode.WALK_TRANSIT | BeamMode.DRIVE_TRANSIT | BeamMode.RIDE_HAIL_TRANSIT => false + case BeamMode.CAR_HOV2 | BeamMode.CAR_HOV3 | BeamMode.HOV2_TELEPORTATION | BeamMode.HOV3_TELEPORTATION => false } private def isCar(beamMode: BeamMode): Boolean = beamMode match { diff --git a/src/main/scala/beam/router/skim/SkimsUtils.scala b/src/main/scala/beam/router/skim/SkimsUtils.scala index 7d24c5a32ee..5e3c7455555 100644 --- a/src/main/scala/beam/router/skim/SkimsUtils.scala +++ b/src/main/scala/beam/router/skim/SkimsUtils.scala @@ -2,7 +2,6 @@ package beam.router.skim import java.awt.geom.Ellipse2D import java.awt.{BasicStroke, Color} - import beam.agentsim.infrastructure.taz.{TAZ, TAZTreeMap} import beam.analysis.plots.{GraphUtils, GraphsStatsAgentSimEventsListener} import beam.router.BeamRouter.Location @@ -11,6 +10,8 @@ import beam.router.Modes.BeamMode.{ BIKE, BIKE_TRANSIT, CAR, + CAR_HOV2, + CAR_HOV3, CAV, DRIVE_TRANSIT, RIDE_HAIL, @@ -62,6 +63,8 @@ object SkimsUtils extends LazyLogging { val speedMeterPerSec: Map[BeamMode, Double] = Map( CAV -> carSpeedMeterPerSec, CAR -> carSpeedMeterPerSec, + CAR_HOV2 -> carSpeedMeterPerSec, + CAR_HOV3 -> carSpeedMeterPerSec, WALK -> walkSpeedMeterPerSec, BIKE -> bicycleSpeedMeterPerSec, WALK_TRANSIT -> transitSpeedMeterPerSec, diff --git a/src/main/scala/beam/sim/BeamHelper.scala b/src/main/scala/beam/sim/BeamHelper.scala index 142b6b70433..29fea54d478 100755 --- a/src/main/scala/beam/sim/BeamHelper.scala +++ b/src/main/scala/beam/sim/BeamHelper.scala @@ -258,7 +258,10 @@ trait BeamHelper extends LazyLogging { } def loadScenario(beamConfig: BeamConfig): BeamScenario = { - val vehicleTypes = maybeScaleTransit(beamConfig, readBeamVehicleTypeFile(beamConfig)) + val vehicleTypes = maybeScaleTransit( + beamConfig, + readBeamVehicleTypeFile(beamConfig.beam.agentsim.agents.vehicles.vehicleTypesFilePath) + ) val vehicleCsvReader = new VehicleCsvReader(beamConfig) val baseFilePath = Paths.get(beamConfig.beam.agentsim.agents.vehicles.vehicleTypesFilePath).getParent @@ -896,6 +899,7 @@ trait BeamHelper extends LazyLogging { val errors = InputConsistencyCheck.checkConsistency(beamConfig) if (errors.nonEmpty) { logger.error("Input consistency check failed:\n" + errors.mkString("\n")) + throw new RuntimeException("Input consistency check failed") } level = beamConfig.beam.metrics.level diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 9607b468c81..0688f78e571 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -1484,6 +1484,7 @@ object BeamConfig { fractionOfInitialVehicleFleet: scala.Double, fractionOfPeopleWithBicycle: scala.Double, fuelTypesFilePath: java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, linkToGradePercentFilePath: java.lang.String, meanPrivateVehicleStartingSOC: scala.Double, meanRidehailVehicleStartingSOC: scala.Double, @@ -1704,6 +1705,9 @@ object BeamConfig { fuelTypesFilePath = if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( + "generateEmergencyHouseholdVehicleWhenPlansRequireIt" + ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), linkToGradePercentFilePath = if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", meanPrivateVehicleStartingSOC = @@ -1796,7 +1800,11 @@ object BeamConfig { } case class ChargingNetworkManager( + chargingPointCostScalingFactor: scala.Double, + chargingPointCountScalingFactor: scala.Double, + chargingPointFilePath: java.lang.String, helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, timeStepInSeconds: scala.Int ) @@ -1810,6 +1818,7 @@ object BeamConfig { dataInStreamPoint: java.lang.String, dataOutStreamPoint: java.lang.String, federateName: java.lang.String, + feedbackEnabled: scala.Boolean, intLogLevel: scala.Int, timeDeltaProperty: scala.Double ) @@ -1830,18 +1839,65 @@ object BeamConfig { dataOutStreamPoint = if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } + case class ScaleUp( + enabled: scala.Boolean, + expansionFactor_charge_activity: scala.Double, + expansionFactor_home_activity: scala.Double, + expansionFactor_init_activity: scala.Double, + expansionFactor_wherever_activity: scala.Double, + expansionFactor_work_activity: scala.Double + ) + + object ScaleUp { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { + BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = + if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") + else 1.0, + expansionFactor_home_activity = + if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") + else 1.0, + expansionFactor_init_activity = + if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") + else 1.0, + expansionFactor_wherever_activity = + if (c.hasPathOrNull("expansionFactor_wherever_activity")) + c.getDouble("expansionFactor_wherever_activity") + else 1.0, + expansionFactor_work_activity = + if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") + else 1.0 + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( + chargingPointCostScalingFactor = + if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") + else 1.0, + chargingPointCountScalingFactor = + if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") + else 1.0, + chargingPointFilePath = + if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( if (c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}") ), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( + if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") + else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") + ), timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } diff --git a/src/main/scala/beam/sim/population/PercentagePopulationAdjustment.scala b/src/main/scala/beam/sim/population/PercentagePopulationAdjustment.scala index 9f71aa07021..650ec5270e3 100644 --- a/src/main/scala/beam/sim/population/PercentagePopulationAdjustment.scala +++ b/src/main/scala/beam/sim/population/PercentagePopulationAdjustment.scala @@ -13,9 +13,10 @@ case class PercentagePopulationAdjustment(beamServices: BeamServices) extends Po override def updatePopulation(scenario: Scenario): Population = { val population = scenario.getPopulation - removeModeAll(population, BeamMode.CAR.value) - - assignModeUniformDistribution(population, BeamMode.CAR.value, 0.5) + Seq(BeamMode.CAR, BeamMode.CAR_HOV2, BeamMode.CAR_HOV3).foreach { mode => + removeModeAll(population, mode.value) + assignModeUniformDistribution(population, mode.value, 0.5) + } population } diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index 019459e91e8..c7c78020520 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -68,7 +68,7 @@ case class AttributesOfIndividual( modeChoiceModel.situationMultipliers, vehicleAutomationLevel, beamServices - ) * getModeVotMultiplier(Option(CAR), modeChoiceModel.modeMultipliers) + ) * getModeVotMultiplier(Option(beamMode), modeChoiceModel.modeMultipliers) } case _ => getModeVotMultiplier(Option(beamMode), modeChoiceModel.modeMultipliers) diff --git a/src/main/scala/beam/sim/vehicles/VehiclesAdjustment.scala b/src/main/scala/beam/sim/vehicles/VehiclesAdjustment.scala index c407a93e1ba..3dbe5efacb4 100644 --- a/src/main/scala/beam/sim/vehicles/VehiclesAdjustment.scala +++ b/src/main/scala/beam/sim/vehicles/VehiclesAdjustment.scala @@ -3,9 +3,8 @@ package beam.sim.vehicles import beam.agentsim.agents.Population import beam.agentsim.agents.vehicles.BeamVehicleType import beam.agentsim.agents.vehicles.VehicleCategory.VehicleCategory -import beam.sim.{BeamScenario, BeamServices} +import beam.sim.BeamScenario import beam.utils.logging.ExponentialLazyLogging -import com.typesafe.scalalogging.LazyLogging import org.apache.commons.math3.distribution.UniformRealDistribution import org.matsim.api.core.v01.Coord diff --git a/src/main/scala/beam/sim/vehiclesharing/FixedNonReservingFleetManager.scala b/src/main/scala/beam/sim/vehiclesharing/FixedNonReservingFleetManager.scala index 2300384ef0d..d08f1bf1785 100644 --- a/src/main/scala/beam/sim/vehiclesharing/FixedNonReservingFleetManager.scala +++ b/src/main/scala/beam/sim/vehiclesharing/FixedNonReservingFleetManager.scala @@ -92,7 +92,7 @@ private[vehiclesharing] class FixedNonReservingFleetManager( case GetVehicleTypes(triggerId) => sender() ! VehicleTypesResponse(vehicles.values.map(_.beamVehicleType).toSet, triggerId) - case MobilityStatusInquiry(_, whenWhere, _, triggerId) => + case MobilityStatusInquiry(_, whenWhere, _, _, triggerId) => // Search box: maxWalkingDistance meters around query location val boundingBox = new Envelope(new Coordinate(whenWhere.loc.getX, whenWhere.loc.getY)) boundingBox.expandBy(maxWalkingDistance) diff --git a/src/main/scala/beam/sim/vehiclesharing/InexhaustibleReservingFleetManager.scala b/src/main/scala/beam/sim/vehiclesharing/InexhaustibleReservingFleetManager.scala index bdcd7d11baf..c532abdf3fc 100644 --- a/src/main/scala/beam/sim/vehiclesharing/InexhaustibleReservingFleetManager.scala +++ b/src/main/scala/beam/sim/vehiclesharing/InexhaustibleReservingFleetManager.scala @@ -42,7 +42,7 @@ private[vehiclesharing] class InexhaustibleReservingFleetManager( case GetVehicleTypes(triggerId) => sender() ! VehicleTypesResponse(Set(vehicleType), triggerId) - case MobilityStatusInquiry(_, whenWhere, _, triggerId) => + case MobilityStatusInquiry(_, whenWhere, _, _, triggerId) => // Create a vehicle out of thin air val vehicle = new BeamVehicle( Id.createVehicleId(self.path.name + "-" + nextVehicleIndex), diff --git a/src/main/scala/beam/utils/BeamVehicleUtils.scala b/src/main/scala/beam/utils/BeamVehicleUtils.scala index 25c78bd43aa..e92d19a3670 100755 --- a/src/main/scala/beam/utils/BeamVehicleUtils.scala +++ b/src/main/scala/beam/utils/BeamVehicleUtils.scala @@ -4,7 +4,6 @@ import beam.agentsim.agents.vehicles.EnergyEconomyAttributes.Powertrain import beam.agentsim.agents.vehicles.FuelType.FuelType import beam.agentsim.agents.vehicles._ import beam.agentsim.infrastructure.charging.ChargingPointType -import beam.sim.config.BeamConfig import org.matsim.api.core.v01.Id import org.supercsv.io.CsvMapReader import org.supercsv.prefs.CsvPreference @@ -115,32 +114,6 @@ object BeamVehicleUtils { }.toMap } - def readBeamVehicleTypeFile(beamConfig: BeamConfig): Map[Id[BeamVehicleType], BeamVehicleType] = { - val vehicleTypes = readBeamVehicleTypeFile(beamConfig.beam.agentsim.agents.vehicles.vehicleTypesFilePath) - val rideHailTypeId = beamConfig.beam.agentsim.agents.rideHail.initialization.procedural.vehicleTypeId - val dummySharedCarId = beamConfig.beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId - val vehicleTypeString = vehicleTypes.keySet.map(_.toString()) - val defaultVehicleType = BeamVehicleType( - id = Id.create("DefaultVehicleType", classOf[BeamVehicleType]), - seatingCapacity = 4, - standingRoomCapacity = 0, - lengthInMeter = 4.5, - primaryFuelType = FuelType.Gasoline, - primaryFuelConsumptionInJoulePerMeter = 3655.98, - primaryFuelCapacityInJoule = 3655980000.0, - vehicleCategory = VehicleCategory.Car - ) - - val missingTypes = scala.collection.mutable.HashMap.empty[Id[BeamVehicleType], BeamVehicleType] - if (!vehicleTypeString.contains(dummySharedCarId)) { - missingTypes.put(Id.create(dummySharedCarId, classOf[BeamVehicleType]), defaultVehicleType) - } - if (!vehicleTypeString.contains(rideHailTypeId)) { - missingTypes.put(Id.create(rideHailTypeId, classOf[BeamVehicleType]), defaultVehicleType) - } - vehicleTypes ++ missingTypes - } - def readCsvFileByLine[A](filePath: String, z: A)(readLine: (java.util.Map[String, String], A) => A): A = { FileUtils.using(new CsvMapReader(FileUtils.readerFromFile(filePath), CsvPreference.STANDARD_PREFERENCE)) { mapReader => diff --git a/src/main/scala/beam/utils/IdGenerator.scala b/src/main/scala/beam/utils/IdGenerator.scala index a8eafd9f4ff..e67e875e3fd 100644 --- a/src/main/scala/beam/utils/IdGenerator.scala +++ b/src/main/scala/beam/utils/IdGenerator.scala @@ -45,3 +45,11 @@ object ReservationRequestIdGenerator extends IdGenerator { id.getAndIncrement() } } + +object VehicleIdGenerator extends IdGenerator { + private val id: AtomicInteger = new AtomicInteger(0) + + def nextId: Int = { + id.getAndIncrement() + } +} diff --git a/src/main/scala/beam/utils/Network2ShapeFile.scala b/src/main/scala/beam/utils/Network2ShapeFile.scala deleted file mode 100644 index 8f4b26c143f..00000000000 --- a/src/main/scala/beam/utils/Network2ShapeFile.scala +++ /dev/null @@ -1,189 +0,0 @@ -package beam.utils - -import beam.sim.common.GeoUtils -import com.typesafe.scalalogging.LazyLogging -import com.vividsolutions.jts.geom.{Coordinate, Envelope, GeometryFactory, LineString} -import org.geotools.feature.simple.{SimpleFeatureBuilder, SimpleFeatureTypeBuilder} -import org.matsim.api.core.v01.network.{Link, Node} -import org.matsim.core.network.NetworkUtils -import org.matsim.core.network.io.NetworkReaderMatsimV2 -import org.matsim.core.utils.geometry.geotools.MGC -import org.matsim.core.utils.gis.ShapeFileWriter -import org.opengis.feature.simple.SimpleFeature -import org.opengis.referencing.crs.CoordinateReferenceSystem - -import scala.collection.JavaConverters._ -import scala.util.Try - -object Network2ShapeFile extends LazyLogging { - - /* Link attributes to be written into SHP file */ - case class NetworkLink( - fromNode: Node, - toNode: Node, - id: String, - modes: String, - origId: String, - roadType: String, - length: Double, - freeSpeed: Double, - capacity: Double, - lanes: Double - ) { - - /* Coordinate of toNode in com.vividsolutions format */ - def vividCoordTo: Coordinate = new Coordinate(toNode.getCoord.getX, toNode.getCoord.getY) - - /* Coordinate of fromNode in com.vividsolutions format */ - def vividCoordFrom: Coordinate = new Coordinate(fromNode.getCoord.getX, fromNode.getCoord.getY) - - /* returns SimpleFeature for shapefile writer */ - def toFeature( - geometryFactory: GeometryFactory, - featureBuilder: SimpleFeatureBuilder - ): Option[SimpleFeature] = { - val nodeCoordinates = Seq(fromNode, toNode) - .map(node => new Coordinate(node.getCoord.getX, node.getCoord.getY)) - .toArray - val lineString: LineString = geometryFactory.createLineString(nodeCoordinates) - - val attributes = lineString +: attributesArray - - try { - Some(featureBuilder.buildFeature(null, attributes)) - } catch { - case exception: Throwable => - logger.error(s"Can not create simple feature from Link. Exception: $exception") - None - } - } - - /* returns link attributes as Array[Object] to generate SimpleFeature - the order should match fields order in NetworkLink.nameToType */ - private def attributesArray: Array[Object] = { - Array( - id, - fromNode.getId.toString, - toNode.getId.toString, - modes, - origId, - roadType, - length, - freeSpeed, - capacity, - lanes - ).map(_.asInstanceOf[Object]) - } - } - - object NetworkLink { - - /* returns map of field name to field type - required for SimpleFeatureTypeBuilder - the order should match values order in NetworkLink.attributesArray */ - val nameToType = IndexedSeq( - "ID" -> classOf[java.lang.String], - "fromID" -> classOf[java.lang.String], - "toID" -> classOf[java.lang.String], - "modes" -> classOf[java.lang.String], - "origid" -> classOf[java.lang.String], - "roadType" -> classOf[java.lang.String], - "length" -> classOf[java.lang.Double], - "freespeed" -> classOf[java.lang.Double], - "capacity" -> classOf[java.lang.Double], - "lanes" -> classOf[java.lang.Double] - ) - - /* creates a NetworkLink object from Link object */ - def apply(link: Link): NetworkLink = { - val linkType = NetworkUtils.getType(link) - val modes: String = Try(link.getAllowedModes.asScala.mkString(",")) getOrElse "" - val origId: String = Try(link.getAttributes.getAttribute("origid").toString) getOrElse "" - - NetworkLink( - fromNode = link.getFromNode, - toNode = link.getToNode, - id = link.getId.toString, - modes = modes, - origId = origId, - roadType = linkType, - length = link.getLength, - freeSpeed = link.getFreespeed, - capacity = link.getCapacity, - lanes = link.getNumberOfLanes - ) - } - } - - /* create a SimpleFeatureBuilder with NetworkLink fields and types */ - private def createFeatureBuilder(crs: CoordinateReferenceSystem): SimpleFeatureBuilder = { - val typeBuilder = new SimpleFeatureTypeBuilder() - typeBuilder.setName("link") - typeBuilder.setCRS(crs) - - typeBuilder.add("the_geom", classOf[LineString]) - NetworkLink.nameToType.foreach { case (name, memberType) => - typeBuilder.add(name, memberType) - } - - new SimpleFeatureBuilder(typeBuilder.buildFeatureType()) - } - - /* the main function to convert matSim network file to shapefile with filtering of links */ - def networkToShapeFile( - matsimNetworkPath: String, - outputShapeFilePath: String, - crs: CoordinateReferenceSystem, - networkFilter: NetworkLink => Boolean - ): Unit = { - val network = NetworkUtils.createNetwork() - val reader = new NetworkReaderMatsimV2(network) - reader.readFile(matsimNetworkPath) - logger.info(s"Read $matsimNetworkPath"); - - val featureBuilder = createFeatureBuilder(crs) - val geometryFactory = new GeometryFactory() - val networkLinks = NetworkUtils.getSortedLinks(network).map(link => NetworkLink(link)) - logger.info(s"Read ${networkLinks.length} network links from network file") - - val features = networkLinks - .filter(networkFilter) - .flatMap(_.toFeature(geometryFactory, featureBuilder)) - logger.info(s"Got ${features.length} features to write to shape file") - - logger.info("Writing features to shape file $outputShapeFilePath ..."); - ShapeFileWriter.writeGeometries(features.toSeq.asJava, outputShapeFilePath); - logger.info("Done"); - } - - def runConversionWithFiltering(matsimNetworkFilePath: String, outputShapeFilePath: String): Unit = { - val crsString = "epsg:26910" - val crs = MGC.getCRS(crsString) - - val geoUtils = new GeoUtils { - override def localCRS: String = crsString - } - - val envelopeWGS = new Envelope(-122.48632, -122.41355, 37.77463, 37.74184) - val envelopeUTM = geoUtils.wgs2Utm(envelopeWGS) - - def filter(networkLink: NetworkLink): Boolean = { - envelopeUTM.contains(networkLink.vividCoordTo) || envelopeUTM.contains(networkLink.vividCoordFrom) - } - - networkToShapeFile(matsimNetworkFilePath, outputShapeFilePath, crs, filter) - } - - /* the main method to run transformation from matSim network into SHP file */ - def main(args: Array[String]): Unit = { - if (args.length != 2) { - throw new IllegalArgumentException( - s"Got ${args.length} arguments, but expected two: <1:path to input physSim network file> <2:path to output shapefile>" - ) - } else { - val matsimNetworkPath = args(0) - val outputShapeFilePath = args(1) - runConversionWithFiltering(matsimNetworkPath, outputShapeFilePath) - } - } -} diff --git a/src/main/scala/beam/utils/TravelTimeGoogleApp.scala b/src/main/scala/beam/utils/TravelTimeGoogleApp.scala index 5c45540bdd1..40df9fcb495 100644 --- a/src/main/scala/beam/utils/TravelTimeGoogleApp.scala +++ b/src/main/scala/beam/utils/TravelTimeGoogleApp.scala @@ -56,9 +56,11 @@ object TravelTimeGoogleApp extends App with StrictLogging { using( EventReader.fromCsvFile( pathToEventFile, - event => - event.getEventType == PathTraversalEvent.EVENT_TYPE && event.getAttributes - .get(PathTraversalEvent.ATTRIBUTE_MODE) == BeamMode.CAR.value + event => { + val isPTE = event.getEventType == PathTraversalEvent.EVENT_TYPE + val isCar = BeamMode.isCar(event.getAttributes.get(PathTraversalEvent.ATTRIBUTE_MODE)) + isPTE && isCar + } ) ) { case (_, c) => c.close() diff --git a/src/main/scala/beam/utils/csv/readers/BeamCsvScenarioReader.scala b/src/main/scala/beam/utils/csv/readers/BeamCsvScenarioReader.scala index 6d5f623c976..dc1bbea7d45 100644 --- a/src/main/scala/beam/utils/csv/readers/BeamCsvScenarioReader.scala +++ b/src/main/scala/beam/utils/csv/readers/BeamCsvScenarioReader.scala @@ -79,7 +79,7 @@ object BeamCsvScenarioReader extends BeamScenarioReader with ExponentialLazyLogg planIndex = planIndex, planScore = getIfNotNull(rec, "planScore", "0").toDouble, planSelected = getIfNotNull(rec, "planSelected", "false").toBoolean, - planElementType = planElementType, + planElementType = PlanElement.PlanElementType(planElementType), planElementIndex = planElementIndex, activityType = activityType, activityLocationX = Option(rec.get("activityLocationX")).map(_.toDouble), diff --git a/src/main/scala/beam/utils/csv/writers/PlansCsvWriter.scala b/src/main/scala/beam/utils/csv/writers/PlansCsvWriter.scala index a0802ec63b5..6828eb9ae79 100755 --- a/src/main/scala/beam/utils/csv/writers/PlansCsvWriter.scala +++ b/src/main/scala/beam/utils/csv/writers/PlansCsvWriter.scala @@ -78,7 +78,7 @@ object PlansCsvWriter extends ScenarioCsvWriter { planIndex = planIndex, planScore = planScore, planSelected = isSelectedPlan, - planElementType = "leg", + planElementType = PlanElement.Leg, planElementIndex = planeElementIndex, activityType = None, activityLocationX = None, @@ -101,7 +101,7 @@ object PlansCsvWriter extends ScenarioCsvWriter { planIndex = planIndex, planScore = planScore, planSelected = isSelectedPlan, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = planeElementIndex, activityType = Option(act.getType), activityLocationX = Option(act.getCoord.getX), diff --git a/src/main/scala/beam/utils/data/synthpop/IndustryAssigner.scala b/src/main/scala/beam/utils/data/synthpop/IndustryAssigner.scala index 5e5040736e7..810bd059704 100644 --- a/src/main/scala/beam/utils/data/synthpop/IndustryAssigner.scala +++ b/src/main/scala/beam/utils/data/synthpop/IndustryAssigner.scala @@ -3,6 +3,7 @@ package beam.utils.data.synthpop import beam.utils.data.ctpp.models.ResidenceToWorkplaceFlowGeography import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} import beam.utils.data.ctpp.readers.flow.IndustryTableReader +import beam.utils.scenario.PlanElement import beam.utils.scenario.generic.readers.CsvPlanElementReader class IndustryAssigner {} @@ -28,7 +29,7 @@ object IndustryAssigner { val homeWorkActivities = CsvPlanElementReader .read(pathToPlans) .filter { plan => - plan.planElementType.equalsIgnoreCase("activity") && plan.activityType.exists(act => + plan.planElementType == PlanElement.Activity && plan.activityType.exists(act => act.equalsIgnoreCase("home") || act.equalsIgnoreCase("Work") ) } diff --git a/src/main/scala/beam/utils/data/synthpop/ODSampler.scala b/src/main/scala/beam/utils/data/synthpop/ODSampler.scala index ed14e0442b2..3047a7d6db3 100644 --- a/src/main/scala/beam/utils/data/synthpop/ODSampler.scala +++ b/src/main/scala/beam/utils/data/synthpop/ODSampler.scala @@ -1,7 +1,5 @@ package beam.utils.data.synthpop -import java.util - import beam.utils.data.ctpp.models.OD import org.apache.commons.math3.distribution.EnumeratedDistribution import org.apache.commons.math3.random.RandomGenerator diff --git a/src/main/scala/beam/utils/data/synthpop/PumaLevelScenarioGenerator.scala b/src/main/scala/beam/utils/data/synthpop/PumaLevelScenarioGenerator.scala index fdeab333651..a0b4d11bacd 100644 --- a/src/main/scala/beam/utils/data/synthpop/PumaLevelScenarioGenerator.scala +++ b/src/main/scala/beam/utils/data/synthpop/PumaLevelScenarioGenerator.scala @@ -63,7 +63,7 @@ class PumaLevelScenarioGenerator( planIndex = 0, planScore = 0, planSelected = true, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = 1, activityType = None, activityLocationX = None, @@ -236,7 +236,7 @@ class PumaLevelScenarioGenerator( // Create Home Activity: end time is when a person leaves a home val leavingHomeActivity = planElementTemplate.copy( personId = createdPerson.personId, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = 1, activityType = Some("Home"), activityLocationX = Some(utmHouseholdCoord.getX), @@ -246,7 +246,11 @@ class PumaLevelScenarioGenerator( ) // Create Leg val leavingHomeLeg = planElementTemplate - .copy(personId = createdPerson.personId, planElementType = "leg", planElementIndex = 2) + .copy( + personId = createdPerson.personId, + planElementType = PlanElement.Leg, + planElementIndex = 2 + ) val utmWorkingLocation = geoUtils.wgs2Utm(wgsWorkingLocation) val margin = 1.3 @@ -258,7 +262,7 @@ class PumaLevelScenarioGenerator( val leavingWorkActivity = planElementTemplate.copy( personId = createdPerson.personId, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = 3, activityType = Some("Work"), activityLocationX = Some(utmWorkingLocation.getX), @@ -266,12 +270,16 @@ class PumaLevelScenarioGenerator( activityEndTime = Some(timeLeavingWorkSeconds / 3600.0) ) val leavingWorkLeg = planElementTemplate - .copy(personId = createdPerson.personId, planElementType = "leg", planElementIndex = 4) + .copy( + personId = createdPerson.personId, + planElementType = PlanElement.Leg, + planElementIndex = 4 + ) // Create Home Activity: end time not defined val homeActivity = planElementTemplate.copy( personId = createdPerson.personId, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = 5, activityType = Some("Home"), activityLocationX = Some(utmWorkingLocation.getX), diff --git a/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala b/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala index ce1fe986266..8ddbc2ff41f 100644 --- a/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala +++ b/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala @@ -1,10 +1,5 @@ package beam.utils.data.synthpop -import java.io.File -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter -import java.util.concurrent.atomic.AtomicInteger - import beam.agentsim.infrastructure.geozone._ import beam.sim.common.GeoUtils import beam.sim.population.PopulationAdjustment @@ -21,7 +16,7 @@ import beam.utils.data.synthpop.generators.{ WorkedDurationGeneratorImpl } import beam.utils.data.synthpop.models.Models -import beam.utils.data.synthpop.models.Models.{BlockGroupGeoId, County, Gender, GenericGeoId, State, TazGeoId} +import beam.utils.data.synthpop.models.Models._ import beam.utils.scenario._ import beam.utils.scenario.generic.writers.{ CsvHouseholdInfoWriter, @@ -33,6 +28,10 @@ import com.typesafe.scalalogging.StrictLogging import org.apache.commons.math3.random.{MersenneTwister, RandomGenerator} import org.matsim.api.core.v01.Coord +import java.io.File +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.util.concurrent.atomic.AtomicInteger import scala.collection.mutable import scala.util.{Random, Try} @@ -85,7 +84,7 @@ class SimpleScenarioGenerator( planIndex = 0, planScore = 0, planSelected = true, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = 1, activityType = None, activityLocationX = None, @@ -298,7 +297,7 @@ class SimpleScenarioGenerator( // Create Home Activity: end time is when a person leaves a home val leavingHomeActivity = planElementTemplate.copy( personId = createdPerson.personId, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = 1, activityType = Some("Home"), activityLocationX = Some(wgsHouseholdLocation.getX), @@ -308,7 +307,11 @@ class SimpleScenarioGenerator( ) // Create Leg val leavingHomeLeg = planElementTemplate - .copy(personId = createdPerson.personId, planElementType = "leg", planElementIndex = 2) + .copy( + personId = createdPerson.personId, + planElementType = PlanElement.Leg, + planElementIndex = 2 + ) val timeLeavingWorkSeconds = { val utmHouseholdCoord = geoUtils.wgs2Utm(wgsHouseholdLocation) @@ -323,7 +326,7 @@ class SimpleScenarioGenerator( val leavingWorkActivity = planElementTemplate.copy( personId = createdPerson.personId, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = 3, activityType = Some("Work"), activityLocationX = Some(wgsWorkingLocation.getX), @@ -332,12 +335,16 @@ class SimpleScenarioGenerator( geoId = Some(toTazGeoId(workTazGeoId.state, workTazGeoId.county, workTazGeoId.taz)) ) val leavingWorkLeg = planElementTemplate - .copy(personId = createdPerson.personId, planElementType = "leg", planElementIndex = 4) + .copy( + personId = createdPerson.personId, + planElementType = PlanElement.Leg, + planElementIndex = 4 + ) // Create Home Activity: end time not defined val homeActivity = planElementTemplate.copy( personId = createdPerson.personId, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = 5, activityType = Some("Home"), activityLocationX = Some(wgsHouseholdLocation.getX), @@ -619,7 +626,7 @@ object SimpleScenarioGenerator extends StrictLogging { val geoUtils: GeoUtils = new GeoUtils { override def localCRS: String = parsedArgs.localCRS } - val allActivities = planElements.filter(_.planElementType == "activity").map { plan => + val allActivities = planElements.filter(_.planElementType == PlanElement.Activity).map { plan => geoUtils.utm2Wgs(new Coord(plan.activityLocationX.get, plan.activityLocationY.get)) } gen.writeH3(pathToOutput, allActivities, 1000) diff --git a/src/main/scala/beam/utils/map/ActivitiesClustering.scala b/src/main/scala/beam/utils/map/ActivitiesClustering.scala index 1af1109f0fb..3892742f461 100644 --- a/src/main/scala/beam/utils/map/ActivitiesClustering.scala +++ b/src/main/scala/beam/utils/map/ActivitiesClustering.scala @@ -103,7 +103,7 @@ class ActivitiesClustering(val pathToPlansCsv: String, nClusters: Int) extends S private def readActivities(pathToPlansCsv: String): Array[PlanElement] = { BeamCsvScenarioReader .readPlansFile(pathToPlansCsv) - .collect { case p if p.planElementType.contains("activity") => p } + .collect { case p if p.planElementType == PlanElement.Activity => p } } private def createAndInitializeDatabase(acts: scala.collection.Iterable[PlanElement]): Database = { diff --git a/src/main/scala/beam/utils/map/RepositioningAnalyzer.scala b/src/main/scala/beam/utils/map/RepositioningAnalyzer.scala index d1179fd7ad2..0d5fe3829ad 100644 --- a/src/main/scala/beam/utils/map/RepositioningAnalyzer.scala +++ b/src/main/scala/beam/utils/map/RepositioningAnalyzer.scala @@ -95,7 +95,7 @@ object RepositioningAnalyzer extends LazyLogging { Iterator.continually(csvRdr.read(header: _*)).takeWhile(_ != null).map(toPlanInfo).toArray } .filter(x => - x.planElementType == "activity" && x.activityEndTime.isDefined && !x.activityEndTime + x.planElementType == PlanElement.Activity && x.activityEndTime.isDefined && !x.activityEndTime .contains(Double.NegativeInfinity) ) .map { planElement => diff --git a/src/main/scala/beam/utils/plan/sampling/PlansSamplerApp.scala b/src/main/scala/beam/utils/plan/sampling/PlansSamplerApp.scala index 39c19b2892f..67ab393207d 100644 --- a/src/main/scala/beam/utils/plan/sampling/PlansSamplerApp.scala +++ b/src/main/scala/beam/utils/plan/sampling/PlansSamplerApp.scala @@ -1,8 +1,8 @@ package beam.utils.plan.sampling -import java.util +import beam.router.Modes.BeamMode -import beam.router.Modes.BeamMode.CAR +import java.util import beam.utils.matsim_conversion.{MatsimConversionTool, ShapeUtils} import beam.utils.plan.sampling.HouseholdAttrib.{HomeCoordX, HomeCoordY, HousingType} import beam.utils.plan.sampling.PopulationAttrib.Rank @@ -464,7 +464,7 @@ object PlansSampler { val filteredPermissibleModes = modeAllocator .getPermissibleModes(person.getSelectedPlan) .asScala - .filterNot(pm => PersonUtils.getAge(person) < 16 && pm.equalsIgnoreCase(CAR.toString)) + .filterNot(pm => PersonUtils.getAge(person) < 16 && BeamMode.isCar(pm)) AvailableModeUtils.setAvailableModesForPerson(person, newPop, filteredPermissibleModes.toSeq) } diff --git a/src/main/scala/beam/utils/scenario/BeamScenarioLoader.scala b/src/main/scala/beam/utils/scenario/BeamScenarioLoader.scala index f3bd5815bee..dc0127da8ee 100644 --- a/src/main/scala/beam/utils/scenario/BeamScenarioLoader.scala +++ b/src/main/scala/beam/utils/scenario/BeamScenarioLoader.scala @@ -205,9 +205,9 @@ class BeamScenarioLoader( } listOfElementsGroupedByPlan.foreach { planElement => - if (planElement.planElementType.equalsIgnoreCase("leg")) { + if (planElement.planElementType == PlanElement.Leg) { buildAndAddLegToPlan(currentPlan, planElement) - } else if (planElement.planElementType.equalsIgnoreCase("activity")) { + } else if (planElement.planElementType == PlanElement.Activity) { buildAndAddActivityToPlan(currentPlan, planElement) } } diff --git a/src/main/scala/beam/utils/scenario/Models.scala b/src/main/scala/beam/utils/scenario/Models.scala index 18b45194854..54bb7d98a96 100644 --- a/src/main/scala/beam/utils/scenario/Models.scala +++ b/src/main/scala/beam/utils/scenario/Models.scala @@ -14,12 +14,27 @@ case class PersonInfo( valueOfTime: Double ) +object PlanElement { + sealed trait PlanElementType + + object PlanElementType { + + def apply(planElementType: String): PlanElementType = + planElementType match { + case "activity" => Activity + case "leg" => Leg + } + } + object Activity extends PlanElementType + object Leg extends PlanElementType +} + case class PlanElement( personId: PersonId, planIndex: Int, planScore: Double, planSelected: Boolean, - planElementType: String, + planElementType: PlanElement.PlanElementType, planElementIndex: Int, activityType: Option[String], activityLocationX: Option[Double], diff --git a/src/main/scala/beam/utils/scenario/PreviousRunPlanMerger.scala b/src/main/scala/beam/utils/scenario/PreviousRunPlanMerger.scala index 457a96c4cce..c1becd0b644 100644 --- a/src/main/scala/beam/utils/scenario/PreviousRunPlanMerger.scala +++ b/src/main/scala/beam/utils/scenario/PreviousRunPlanMerger.scala @@ -60,12 +60,9 @@ object PreviousRunPlanMerger extends LazyLogging { val matchedPersons = persons & mergePersons val numberToReplace = (persons.size * fraction).round.toInt val personIdsToReplace = random.shuffle(matchedPersons.toSeq).take(numberToReplace).toSet - logger.info("Adding new plans to {} people", personIdsToReplace.size) + logger.info("Replacing {} people plans", personIdsToReplace.size) val shouldReplace = (plan: PlanElement) => personIdsToReplace.contains(plan.personId) - val (oldToBeReplaced, oldElements) = plans.partition(shouldReplace) - val newElements = plansToMerge.filter(shouldReplace) - val unselectedPlanElements = oldToBeReplaced.map(_.copy(planSelected = false)) - oldElements ++ unselectedPlanElements ++ newElements + plans.filterNot(shouldReplace) ++ plansToMerge.filter(shouldReplace) } } diff --git a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala index f1a39b9adcd..12d6c46208a 100644 --- a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala +++ b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala @@ -1,13 +1,14 @@ package beam.utils.scenario import beam.agentsim.agents.vehicles.EnergyEconomyAttributes.Powertrain -import beam.agentsim.agents.vehicles.{BeamVehicle, VehicleCategory, VehicleManager} +import beam.agentsim.agents.vehicles.{BeamVehicle, VehicleCategory} import beam.router.Modes.BeamMode import beam.sim.BeamScenario import beam.sim.common.GeoUtils import beam.sim.vehicles.VehiclesAdjustment import beam.utils.SequenceUtils import beam.utils.plan.sampling.AvailableModeUtils +import beam.utils.scenario.urbansim.HOVModeTransformer import com.typesafe.scalalogging.LazyLogging import org.apache.commons.math3.distribution.UniformRealDistribution import org.matsim.api.core.v01.population.Population @@ -52,6 +53,7 @@ class UrbanSimScenarioLoader( val activities = plans.view.filter { p => p.activityType.exists(actType => actType.toLowerCase == "home") } + val personIdsWithinRange = activities .filter { act => @@ -103,7 +105,12 @@ class UrbanSimScenarioLoader( val persons = Await.result(personsF, 1800.seconds) val households = Await.result(householdsF, 1800.seconds) - val (plans, plansMerged) = previousRunPlanMerger.map(_.merge(inputPlans)).getOrElse(inputPlans -> false) + val (mergedPlans, plansMerged) = previousRunPlanMerger.map(_.merge(inputPlans)).getOrElse(inputPlans -> false) + + val plans = { + HOVModeTransformer.reseedRandomGenerator(beamScenario.beamConfig.matsim.modules.global.randomSeed) + HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(mergedPlans) + } val householdIds = households.map(_.householdId.id).toSet @@ -128,6 +135,7 @@ class UrbanSimScenarioLoader( applyPlans(plans) logger.info("The scenario loading is completed..") + scenario -> plansMerged } @@ -269,7 +277,7 @@ class UrbanSimScenarioLoader( None } val planTripStats = planElements.toSeq - .filter(_.planElementType == "activity") + .filter(_.planElementType == PlanElement.Activity) .sliding(2) .flatMap { case Seq(firstElement, secondElement, _*) => @@ -561,14 +569,14 @@ class UrbanSimScenarioLoader( person.setSelectedPlan(plan) } val planElement = planInfo.planElementType - if (planElement.equalsIgnoreCase("leg")) { + if (planElement == PlanElement.Leg) { planInfo.legMode match { case Some(mode) => PopulationUtils.createAndAddLeg(plan, mode) case None => PopulationUtils.createAndAddLeg(plan, "") } - } else if (planElement.equalsIgnoreCase("activity")) { + } else if (planElement == PlanElement.Activity) { assert( planInfo.activityLocationX.isDefined, s"planElement is `activity`, but `x` is None! planInfo: $planInfo" diff --git a/src/main/scala/beam/utils/scenario/generic/GenericScenarioSource.scala b/src/main/scala/beam/utils/scenario/generic/GenericScenarioSource.scala index e2c455fe19f..9b76f1f3dff 100644 --- a/src/main/scala/beam/utils/scenario/generic/GenericScenarioSource.scala +++ b/src/main/scala/beam/utils/scenario/generic/GenericScenarioSource.scala @@ -19,7 +19,7 @@ class GenericScenarioSource( override def getPlans: Iterable[PlanElement] = { CsvPlanElementReader.read(pathToPlans).map { plan: PlanElement => - if (plan.planElementType.equalsIgnoreCase("activity") && shouldConvertWgs2Utm) { + if (plan.planElementType == PlanElement.Activity && shouldConvertWgs2Utm) { val utmCoord = geoUtils.wgs2Utm(new Coord(plan.activityLocationX.get, plan.activityLocationY.get)) plan.copy(activityLocationX = Some(utmCoord.getX), activityLocationY = Some(utmCoord.getY)) } else { diff --git a/src/main/scala/beam/utils/scenario/generic/readers/PlanElementReader.scala b/src/main/scala/beam/utils/scenario/generic/readers/PlanElementReader.scala index 85f75422de2..b9cbf6da231 100644 --- a/src/main/scala/beam/utils/scenario/generic/readers/PlanElementReader.scala +++ b/src/main/scala/beam/utils/scenario/generic/readers/PlanElementReader.scala @@ -41,7 +41,7 @@ object CsvPlanElementReader extends PlanElementReader { planIndex = planIndex, planScore = getIfNotNull(rec, "planScore").toDouble, planSelected = getIfNotNull(rec, "planSelected").toBoolean, - planElementType = planElementType, + planElementType = PlanElement.PlanElementType(planElementType), planElementIndex = planElementIndex, activityType = activityType, activityLocationX = Option(rec.get("activityLocationX")).map(_.toDouble), @@ -94,7 +94,7 @@ object XmlPlanElementReader extends PlanElementReader { planIndex = planIdx, planScore = plan.getScore, planSelected = person.getSelectedPlan == plan, - planElementType = "activity", + planElementType = PlanElement.Activity, planElementIndex = planElementIdx, activityType = Option(activity.getType), activityLocationX = Option(activity.getCoord).map(_.getX), @@ -118,7 +118,7 @@ object XmlPlanElementReader extends PlanElementReader { planIndex = planIdx, planScore = plan.getScore, planSelected = person.getSelectedPlan == plan, - planElementType = "leg", + planElementType = PlanElement.Leg, planElementIndex = planElementIdx, activityType = None, activityLocationX = None, diff --git a/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala b/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala new file mode 100644 index 00000000000..fbdd2f408ca --- /dev/null +++ b/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala @@ -0,0 +1,419 @@ +package beam.utils.scenario.urbansim + +import beam.router.Modes.BeamMode._ +import beam.utils.scenario._ +import beam.utils.scenario.urbansim.HOVModeTransformer.ForcedCarHOVTransformer.{ + isForcedCarHOVTrip, + mapToForcedCarHOVTrip +} +import beam.utils.scenario.urbansim.HOVModeTransformer.ForcedHOVTeleportationTransformer.{ + isForcedHOVTeleportationTrip, + mapToForcedHOVTeleportation +} +import beam.utils.scenario.urbansim.HOVModeTransformer.RandomCarHOVTransformer.mapRandomHOVTeleportationOrCar +import com.typesafe.scalalogging.LazyLogging + +import scala.collection.mutable +import scala.util.Random + +/** + * ActivitySim HOV modes transformer to their Beam representation. + * + * ActivitySim provide modes wider than beam modes, like `HOV2` and `HOV3`.
+ * `HOV2` - Ride a car with 2 persons in it.
+ * `HOV3` - Ride a car with 3 persons in it.
+ * However it is unknown who is a driver and who is passenger. + * The transformation is done in several steps:
+ * 1) If it is impossible for a person to be a driver [[HOV2_TELEPORTATION]]/[[HOV3_TELEPORTATION]] assigned.
+ * 2) If seems that it is impossible for a person to be a passenger [[CAR_HOV2]]/[[CAR_HOV3]] assigned.
+ * 3) For all others the random choice is used. + * The driver person is chosen randomly with 50% chance for `HOV2` and 33% for `HOV3`.
+ * The mode for the driver is replaced from `HOV2` to [[CAR_HOV2]] and respectively to [[CAR_HOV3]] for `HOV3`.
+ * The same action is done for passengers for which mode is chosen [[HOV2_TELEPORTATION]] or [[HOV3_TELEPORTATION]]. + * If the person doesnt have an available car from the household, only [[HOV2_TELEPORTATION]] or [[HOV3_TELEPORTATION]] + * will be assigned, not [[CAR_HOV2]]/[[CAR_HOV3]]. + */ +object HOVModeTransformer extends LazyLogging { + + def reseedRandomGenerator(randomSeed: Int): Unit = rand.setSeed(randomSeed) + + private implicit val rand: Random = new Random(42) + private val hov2: String = "hov2" // HOV2 + private val hov3: String = "hov3" // HOV3 + + private def isHOV2(mode: String): Boolean = mode.toLowerCase() match { + case `hov2` => true + case _ => false + } + + private def isHOV3(mode: String): Boolean = mode.toLowerCase() match { + case `hov3` => true + case _ => false + } + + private val allCarModes = Seq(CAR, CAV, CAR_HOV2, CAR_HOV3).map(_.value.toLowerCase) + private val allHOVModes = Set(hov2, hov3) + + private val allCarModesWithHOV: Set[String] = + (allCarModes ++ allHOVModes).toSet + + def transformHOVtoHOVCARorHOVTeleportation( + plansProbablyWithHOV: Iterable[PlanElement] + ): Iterable[PlanElement] = { + val allHOVUsers: Set[PersonId] = plansProbablyWithHOV + .filter(planElement => { + val legMode = planElement.legMode.map(_.toLowerCase) + legMode.contains(hov2) || legMode.contains(hov3) + }) + .map(_.personId) + .toSet + + var forcedHOV2Teleports = 0 + var forcedHOV3Teleports = 0 + + if (forcedHOV2Teleports > 0 || forcedHOV3Teleports > 0) { + logger.info( + s"There were $forcedHOV2Teleports hov2 and $forcedHOV3Teleports hov3 forced teleports because actors did not get access to a car." + ) + } + + var forcedCarHOV2Count = 0 + var forcedCarHOV3Count = 0 + + def thereAreMoreHOVTeleportations: Boolean = { + forcedHOV2Teleports > forcedCarHOV2Count || + forcedHOV3Teleports > forcedCarHOV3Count * 2 + } + + def thereAreMoreHOVCars: Boolean = { + forcedCarHOV2Count > forcedHOV2Teleports || + forcedCarHOV3Count * 2 > forcedHOV3Teleports + } + + def replaceHOVwithCar(trip: List[PlanElement]): List[PlanElement] = { + trip.map { + case hov2Leg if itIsAnHOV2Leg(hov2Leg) => + forcedHOV2Teleports -= 1 + hov2Leg.copy(legMode = Some(CAR_HOV2.value)) + case hov3Leg if itIsAnHOV3Leg(hov3Leg) => + //as car_hov3 contains two passengers, reduce by 2 + forcedHOV3Teleports -= 2 + hov3Leg.copy(legMode = Some(CAR_HOV3.value)) + case other => other + } + } + + def replaceHOVwithTeleportation(trip: List[PlanElement]): List[PlanElement] = { + trip.map { + case hov2Leg if itIsAnHOV2Leg(hov2Leg) => + forcedCarHOV2Count -= 1 + hov2Leg.copy(legMode = Some(HOV2_TELEPORTATION.value)) + case hov3Leg if itIsAnHOV3Leg(hov3Leg) => + forcedCarHOV3Count -= 1 + hov3Leg.copy(legMode = Some(HOV3_TELEPORTATION.value)) + case other => other + } + } + + val tripsTransformed: Iterable[List[PlanElement]] = splitToTrips(plansProbablyWithHOV) + .map { trip => + if (allHOVUsers.contains(trip.head.personId)) { + if (isForcedHOVTeleportationTrip(trip)) { + val (mappedTrip, forcedHOV2, forcedHOV3) = mapToForcedHOVTeleportation(trip) + forcedHOV2Teleports += forcedHOV2 + forcedHOV3Teleports += forcedHOV3 + mappedTrip + } else if (isForcedCarHOVTrip(trip)) { + val (mappedTrip, forcedHOV2, forcedHOV3) = mapToForcedCarHOVTrip(trip) + forcedCarHOV2Count += forcedHOV2 + forcedCarHOV3Count += forcedHOV3 + mappedTrip + } else if (thereAreMoreHOVTeleportations) { + replaceHOVwithCar(trip) + } else if (thereAreMoreHOVCars) { + replaceHOVwithTeleportation(trip) + } else { + mapRandomHOVTeleportationOrCar(trip) + } + } else { + trip + } + } + // we need to merge plans without creating duplicates of home activity for persons with more than one trip + val plans = joinTripsIntoPlans(tripsTransformed) + plans + } + + def joinTripsIntoPlans(tripsTransformed: Iterable[List[PlanElement]]): Iterable[PlanElement] = { + val personToLastActivity = mutable.HashMap.empty[PersonId, PlanElement] + val plans = tripsTransformed.map { trip => + val personId = trip.head.personId + val tripToAdd = personToLastActivity.get(personId) match { + // we need to remove the first activity because it is a duplicate + // that was added while plans were split to trips + case Some(lastSeenActivity) if lastSeenActivity == trip.head => trip.tail + case _ => trip + } + personToLastActivity(personId) = trip.last + tripToAdd + } + + plans.flatten + } + + /** + * Splits provided plans to trips. Each sub collection is a separate trip for separate person. + */ + def splitToTrips(planElements: Iterable[PlanElement]): Iterable[List[PlanElement]] = { + val trips = mutable.ListBuffer.empty[List[PlanElement]] + val personToTrip = mutable.HashMap.empty[PersonId, mutable.ListBuffer[PlanElement]] + val homeActivity = "home" + val plansByPerson = mutable.LinkedHashMap.empty[PersonId, mutable.ListBuffer[PlanElement]] + + planElements.foreach { plan => + plansByPerson.get(plan.personId) match { + case Some(plans) => plans.append(plan) + case None => plansByPerson(plan.personId) = mutable.ListBuffer(plan) + } + } + + def isHomeActivity(activity: PlanElement): Boolean = { + activity.activityType.map(_.toLowerCase).contains(homeActivity) + } + + def canBeSplitToTrips(plans: Iterable[PlanElement]): Boolean = { + isHomeActivity(plans.head) && isHomeActivity(plans.last) + } + + def addLeg(leg: PlanElement): Unit = personToTrip.get(leg.personId) match { + case Some(trip) => trip.append(leg) + case None => + //not possible if there are no bugs, as before splitting plans are checked if it is possible + throw new RuntimeException( + s"Trip should be started from activity. Can't append leg to the trip, missing trip for person ${leg.personId}" + ) + } + + def addActivity(activity: PlanElement): Unit = personToTrip.get(activity.personId) match { + case Some(trip) if isHomeActivity(activity) && trip.size > 1 => + trips.append(trip.toList :+ activity) + personToTrip.remove(activity.personId) + + // we should start a new trip in case a person will continue, if not we will drop this orphaned home activity later + // this also creates a home activity duplicates later when we join trips back together + // i.e. + // original plans: home - leg - work - leg - home - leg - other - leg - home + // splitted trip1: home - leg - work - leg - home + // trip2: home - leg - other - leg - home + personToTrip(activity.personId) = mutable.ListBuffer(activity) + + case Some(trip) if isHomeActivity(activity) && trip.size == 1 => + // replace home activity + personToTrip(activity.personId) = mutable.ListBuffer(activity) + + case Some(trip) => trip.append(activity) + + case None => personToTrip(activity.personId) = mutable.ListBuffer(activity) + } + + val cantSplitTripsForPersons = mutable.ListBuffer.empty[PersonId] + plansByPerson.values.foreach { plans => + if (canBeSplitToTrips(plans)) { + plans.foreach { planElement => + planElement.planElementType match { + case PlanElement.Activity => addActivity(planElement) + case PlanElement.Leg => addLeg(planElement) + } + } + } else { + cantSplitTripsForPersons.append(plans.head.personId) + trips.append(plans.toList) + } + } + + if (cantSplitTripsForPersons.nonEmpty) { + logger.info( + "Cannot split plans to trips because plans does not start and end by Home activity for {} persons: {} etc.", + cantSplitTripsForPersons.size, + cantSplitTripsForPersons.take(10).mkString(",") + ) + } + + // remove orphaned home locations + personToTrip.retain((_, trip) => trip.size > 1) + + if (personToTrip.nonEmpty) { + val cnt = personToTrip.size + val persons = personToTrip.keySet.mkString(",") + logger.warn( + s"There are $cnt trips which did not end with Home activity. Affected persons: $persons" + ) + } + + trips ++ personToTrip.values.map(_.toList) + } + + def itIsAnHOV2Leg(planElement: PlanElement): Boolean = { + planElement.planElementType == PlanElement.Leg && + planElement.legMode.exists(legMode => legMode.toLowerCase == hov2) + } + + def itIsAnHOV3Leg(planElement: PlanElement): Boolean = { + planElement.planElementType == PlanElement.Leg && + planElement.legMode.exists(legMode => legMode.toLowerCase == hov3) + } + + object ForcedHOVTeleportationTransformer { + + def isForcedHOVTeleportationTrip(trip: Iterable[PlanElement]): Boolean = { + val maybeTripCarInfo = (trip.head.activityLocationX, trip.head.activityLocationY) match { + case (Some(locationX), Some(locationY)) => Some(TripCarInfo(locationX, locationY, carIsNearby = true)) + case _ => None + } + maybeTripCarInfo match { + case None => + throw new RuntimeException( + s"Trip can start only from activity that contains location. person: ${trip.headOption.map(_.personId)}" + ) + + case Some(initialTripCarInfo) => + val collectedTripCarInfo = trip.foldLeft(initialTripCarInfo) { + // if car was lost once, there is no need to analyze anymore + case (tripCarInfo, _) if tripCarInfo.carWasLost => tripCarInfo + + // if this is an activity and car was driven, then move the car to the new location + case (tripCarInfo, planElement) + if planElement.planElementType == PlanElement.Activity && tripCarInfo.carWasUsed => + tripCarInfo.withNewActivityLocation(planElement) + + // if this is an activity and car was not driven, check if car is nearby right now + case (tripCarInfo, planElement) if planElement.planElementType == PlanElement.Activity => + tripCarInfo.withInformationIfCarIsNearby(planElement) + + // if this is a leg then check what happens with the car + case (tripCarInfo, planElement) if planElement.planElementType == PlanElement.Leg => + val isCARmode = planElement.legMode.exists(mode => allCarModesWithHOV.contains(mode.toLowerCase)) + if (isCARmode && tripCarInfo.carIsNearby) { + tripCarInfo.copy(carWasUsed = true) + } else if (isCARmode) { + tripCarInfo.copy(carWasLost = true) + } else { + tripCarInfo.copy(carWasUsed = false) + } + } + + collectedTripCarInfo.carWasLost || !collectedTripCarInfo.carWasUsed + } + } + + /** @return the tuple of (transformed trip, transformed HOV2 count, transformed HOV3 count) */ + def mapToForcedHOVTeleportation(trip: List[PlanElement]): (List[PlanElement], Int, Int) = { + var forcedHOV2Teleports = 0 + var forcedHOV3Teleports = 0 + // return trip with all HOV replaced by HOV_teleportation + val transformedTrip = trip.map { + case hov2Leg if itIsAnHOV2Leg(hov2Leg) => + forcedHOV2Teleports += 1 + hov2Leg.copy(legMode = Some(HOV2_TELEPORTATION.value)) + + case hov3Leg if itIsAnHOV3Leg(hov3Leg) => + forcedHOV3Teleports += 1 + hov3Leg.copy(legMode = Some(HOV3_TELEPORTATION.value)) + + case leg if leg.planElementType == PlanElement.Leg => leg + case activity if activity.planElementType == PlanElement.Activity => activity + } + + (transformedTrip, forcedHOV2Teleports, forcedHOV3Teleports) + } + + private case class TripCarInfo( + lastCarPositionX: Double, + lastCarPositionY: Double, + carIsNearby: Boolean, + carWasLost: Boolean = false, + carWasUsed: Boolean = false + ) { + + def withNewActivityLocation(activity: PlanElement): TripCarInfo = { + (activity.activityLocationX, activity.activityLocationY) match { + case (Some(locationX), Some(locationY)) => + this.copy(lastCarPositionX = locationX, lastCarPositionY = locationY) + case _ => this + } + } + + def withInformationIfCarIsNearby(activity: PlanElement): TripCarInfo = { + val carIsNearby = (activity.activityLocationX, activity.activityLocationY) match { + case (Some(locationX), Some(locationY)) => isNearby(locationX, lastCarPositionX, locationY, lastCarPositionY) + case _ => false + } + this.copy(carIsNearby = carIsNearby) + } + + def isNearby(x1: Double, x2: Double, y1: Double, y2: Double): Boolean = { + x1 == x2 && y1 == y2 + } + } + } + + object ForcedCarHOVTransformer { + + def isForcedCarHOVTrip(trip: List[PlanElement]): Boolean = { + val modes = trip.flatMap(_.legMode.map(_.toLowerCase)) + modes.exists(allCarModes.contains) && modes.exists(allHOVModes.contains) + } + + /** @return the tuple of (transformed trip, transformed CAR_HOV2 count, transformed CAR_HOV3 count) */ + def mapToForcedCarHOVTrip(trip: List[PlanElement]): (List[PlanElement], Int, Int) = { + var forcedCarHOV2Count = 0 + var forcedCarHOV3Count = 0 + + val transformedTrip = trip.map { + case hov2Leg if itIsAnHOV2Leg(hov2Leg) => + forcedCarHOV2Count += 1 + hov2Leg.copy(legMode = Some(CAR_HOV2.value)) + + case hov3Leg if itIsAnHOV3Leg(hov3Leg) => + forcedCarHOV3Count += 1 + hov3Leg.copy(legMode = Some(CAR_HOV3.value)) + + case leg if leg.planElementType == PlanElement.Leg => leg + case activity if activity.planElementType == PlanElement.Activity => activity + } + + (transformedTrip, forcedCarHOV2Count, forcedCarHOV3Count) + } + } + + object RandomCarHOVTransformer { + private val chanceToBeCarHOV2 = 0.5 + private val chanceToBeCarHOV3 = 0.333333333333 + + def mapRandomHOVTeleportationOrCar(trip: List[PlanElement])(implicit rand: Random): List[PlanElement] = { + def getHOV2CarOrTeleportation: String = { + if (rand.nextDouble <= chanceToBeCarHOV2) { + CAR_HOV2.value + } else { + HOV2_TELEPORTATION.value + } + } + + def getHOV3CarOrTeleportation: String = { + if (rand.nextDouble <= chanceToBeCarHOV3) { + CAR_HOV3.value + } else { + HOV3_TELEPORTATION.value + } + } + + trip.map { planElement => + planElement.legMode match { + case Some(value) if isHOV2(value) => planElement.copy(legMode = Some(getHOV2CarOrTeleportation)) + case Some(value) if isHOV3(value) => planElement.copy(legMode = Some(getHOV3CarOrTeleportation)) + case _ => planElement + } + } + } + } +} diff --git a/src/main/scala/beam/utils/scenario/urbansim/UrbanSimScenarioSource.scala b/src/main/scala/beam/utils/scenario/urbansim/UrbanSimScenarioSource.scala index 209b7c8ff3d..dbf51649eca 100644 --- a/src/main/scala/beam/utils/scenario/urbansim/UrbanSimScenarioSource.scala +++ b/src/main/scala/beam/utils/scenario/urbansim/UrbanSimScenarioSource.scala @@ -58,7 +58,7 @@ class UrbanSimScenarioSource( PlanElement( personId = PersonId(plan.personId), planIndex = 0, // TODO FIXME! - planElementType = plan.planElement, + planElementType = PlanElement.PlanElementType(plan.planElement), planElementIndex = plan.planElementIndex, planScore = 0, // TODO: DataExchange.PlanElement does not have score planSelected = false, // TODO: DataExchange.PlanElement does not have planSelected diff --git a/src/main/scala/beam/utils/scenario/urbansim/censusblock/EntityTransformer.scala b/src/main/scala/beam/utils/scenario/urbansim/censusblock/EntityTransformer.scala index 1751871ac5f..4199f63f498 100644 --- a/src/main/scala/beam/utils/scenario/urbansim/censusblock/EntityTransformer.scala +++ b/src/main/scala/beam/utils/scenario/urbansim/censusblock/EntityTransformer.scala @@ -2,10 +2,28 @@ package beam.utils.scenario.urbansim.censusblock trait EntityTransformer[T] { - def getIfNotNull(rec: java.util.Map[String, String], column: String): String = - getOptional(rec, column).getOrElse( - throw new java.lang.AssertionError(s"Assertion failed: Value in column '$column' is null") + def getIfNotNull( + rec: java.util.Map[String, String], + columnName: String, + maybeSecondColumnName: Option[String] = None + ): String = { + val maybeValueFirstTry: Option[String] = getOptional(rec, columnName) + val maybeValue = if (maybeValueFirstTry.isEmpty && maybeSecondColumnName.nonEmpty) { + getOptional(rec, maybeSecondColumnName.get) + } else { + maybeValueFirstTry + } + + maybeValue.getOrElse( + maybeSecondColumnName match { + case Some(secondColumnName) => + throw new java.lang.AssertionError( + s"Assertion failed: Value in columns '$columnName' and '$secondColumnName' is null" + ) + case _ => throw new java.lang.AssertionError(s"Assertion failed: Value in column '$columnName' is null") + } ) + } def getOptional(rec: java.util.Map[String, String], column: String): Option[String] = Option(rec.get(column)) diff --git a/src/main/scala/beam/utils/scenario/urbansim/censusblock/ScenarioAdjuster.scala b/src/main/scala/beam/utils/scenario/urbansim/censusblock/ScenarioAdjuster.scala index 1b17d0abc83..aa21404e047 100644 --- a/src/main/scala/beam/utils/scenario/urbansim/censusblock/ScenarioAdjuster.scala +++ b/src/main/scala/beam/utils/scenario/urbansim/censusblock/ScenarioAdjuster.scala @@ -28,13 +28,15 @@ class ScenarioAdjuster(val urbansim: Beam.Urbansim, val population: Population, urbansim.fractionOfModesToClear.bike, seed ) - clearModes( - persons, - BeamMode.CAR.value, - leg => leg.getMode.equalsIgnoreCase(BeamMode.CAR.value), - urbansim.fractionOfModesToClear.car, - seed - ) + Seq(BeamMode.CAR, BeamMode.CAR_HOV2, BeamMode.CAR_HOV3).foreach { mode => + clearModes( + persons, + mode.value, + leg => leg.getMode.equalsIgnoreCase(mode.value), + urbansim.fractionOfModesToClear.car, + seed + ) + } clearModes( persons, BeamMode.DRIVE_TRANSIT.value, diff --git a/src/main/scala/beam/utils/scenario/urbansim/censusblock/UrbansimReaderV2.scala b/src/main/scala/beam/utils/scenario/urbansim/censusblock/UrbansimReaderV2.scala index dbc20e35df8..f77db2d8c9c 100644 --- a/src/main/scala/beam/utils/scenario/urbansim/censusblock/UrbansimReaderV2.scala +++ b/src/main/scala/beam/utils/scenario/urbansim/censusblock/UrbansimReaderV2.scala @@ -1,7 +1,7 @@ package beam.utils.scenario.urbansim.censusblock import beam.sim.common.GeoUtils -import beam.utils.scenario.urbansim.censusblock.entities.{InputHousehold} +import beam.utils.scenario.urbansim.censusblock.entities.InputHousehold import beam.utils.scenario.urbansim.censusblock.merger.{HouseholdMerger, PersonMerger, PlanMerger} import beam.utils.scenario.urbansim.censusblock.reader._ import beam.utils.scenario.{HouseholdInfo, PersonInfo, PlanElement, ScenarioSource} @@ -60,7 +60,7 @@ class UrbansimReaderV2( merger .merge(planReader.iterator()) .map { plan: PlanElement => - if (plan.planElementType.equalsIgnoreCase("activity") && shouldConvertWgs2Utm) { + if (plan.planElementType == PlanElement.Activity && shouldConvertWgs2Utm) { val utmCoord = geoUtils.wgs2Utm(new Coord(plan.activityLocationX.get, plan.activityLocationY.get)) plan.copy(activityLocationX = Some(utmCoord.getX), activityLocationY = Some(utmCoord.getY)) } else { diff --git a/src/main/scala/beam/utils/scenario/urbansim/censusblock/entities/InputHousehold.scala b/src/main/scala/beam/utils/scenario/urbansim/censusblock/entities/InputHousehold.scala index 127e9373da4..b9f0d6c8dbf 100644 --- a/src/main/scala/beam/utils/scenario/urbansim/censusblock/entities/InputHousehold.scala +++ b/src/main/scala/beam/utils/scenario/urbansim/censusblock/entities/InputHousehold.scala @@ -15,8 +15,8 @@ object InputHousehold extends EntityTransformer[InputHousehold] { override def transform(rec: util.Map[String, String]): InputHousehold = { val householdId = getIfNotNull(rec, "household_id") - val income = getIfNotNull(rec, "income").toInt - val cars = getIfNotNull(rec, "cars").toInt + val income = Math.round(getIfNotNull(rec, "income").toFloat) + val cars = getIfNotNull(rec, "cars", Some("auto_ownership")).toInt val blockId = getIfNotNull(rec, "block_id").toLong InputHousehold(householdId, income, cars, blockId) diff --git a/src/main/scala/beam/utils/scenario/urbansim/censusblock/merger/PlanMerger.scala b/src/main/scala/beam/utils/scenario/urbansim/censusblock/merger/PlanMerger.scala index 0aaa6bf0599..b3c62ddb498 100644 --- a/src/main/scala/beam/utils/scenario/urbansim/censusblock/merger/PlanMerger.scala +++ b/src/main/scala/beam/utils/scenario/urbansim/censusblock/merger/PlanMerger.scala @@ -13,7 +13,7 @@ class PlanMerger(modeMap: Map[String, String]) extends Merger[InputPlanElement, 0, 0, planSelected = true, - inputPlanElement.activityElement.toString, + PlanElement.PlanElementType(inputPlanElement.activityElement.toString), inputPlanElement.planElementIndex, inputPlanElement.ActivityType, inputPlanElement.x, diff --git a/src/test/scala/beam/agentsim/agents/PersonAgentSpec.scala b/src/test/scala/beam/agentsim/agents/PersonAgentSpec.scala index ec5a5065153..f94eacbd2b7 100644 --- a/src/test/scala/beam/agentsim/agents/PersonAgentSpec.scala +++ b/src/test/scala/beam/agentsim/agents/PersonAgentSpec.scala @@ -21,6 +21,7 @@ import beam.router.model.RoutingModel.TransitStopsInfo import beam.router.model.{EmbodiedBeamLeg, _} import beam.router.osm.TollCalculator import beam.router.skim.core.AbstractSkimmerEvent +import beam.sim.vehicles.VehiclesAdjustment import beam.tags.FlakyTest import beam.utils.TestConfigUtils.testConfig import beam.utils.{SimRunnerForTest, StuckFinder, TestConfigUtils} @@ -192,7 +193,8 @@ class PersonAgentSpec Vector(), Set.empty, new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) scheduler ! ScheduleTrigger(InitializeTrigger(0), householdActor) @@ -400,11 +402,12 @@ class PersonAgentSpec population = population, household = household, vehicles = Map(), - homeCoord = new Coord(0.0, 0.0), + fallbackHomeCoord = new Coord(0.0, 0.0), Vector(), Set.empty, new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) scheduler ! ScheduleTrigger(InitializeTrigger(0), householdActor) @@ -691,7 +694,8 @@ class PersonAgentSpec Vector(), Set.empty, new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) scheduler ! ScheduleTrigger(InitializeTrigger(0), householdActor) diff --git a/src/test/scala/beam/agentsim/agents/PersonAndTransitDriverSpec.scala b/src/test/scala/beam/agentsim/agents/PersonAndTransitDriverSpec.scala index bb2b0453874..ffa67f436e6 100644 --- a/src/test/scala/beam/agentsim/agents/PersonAndTransitDriverSpec.scala +++ b/src/test/scala/beam/agentsim/agents/PersonAndTransitDriverSpec.scala @@ -21,6 +21,7 @@ import beam.router.RouteHistory import beam.router.model.RoutingModel.TransitStopsInfo import beam.router.model._ import beam.router.skim.core.AbstractSkimmerEvent +import beam.sim.vehicles.VehiclesAdjustment import beam.utils.TestConfigUtils.testConfig import beam.utils.{SimRunnerForTest, StuckFinder, TestConfigUtils} import com.typesafe.config.{Config, ConfigFactory} @@ -298,11 +299,12 @@ class PersonAndTransitDriverSpec population = population, household = household, vehicles = Map(), - homeCoord = new Coord(0.0, 0.0), + fallbackHomeCoord = new Coord(0.0, 0.0), Vector(), Set.empty, new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) scheduler ! ScheduleTrigger(InitializeTrigger(0), householdActor) diff --git a/src/test/scala/beam/agentsim/agents/PersonWithPersonalVehiclePlanSpec.scala b/src/test/scala/beam/agentsim/agents/PersonWithPersonalVehiclePlanSpec.scala index f94c2572858..3c67cbf7e5b 100644 --- a/src/test/scala/beam/agentsim/agents/PersonWithPersonalVehiclePlanSpec.scala +++ b/src/test/scala/beam/agentsim/agents/PersonWithPersonalVehiclePlanSpec.scala @@ -17,6 +17,7 @@ import beam.router.Modes.BeamMode.{BIKE, CAR, WALK} import beam.router.RouteHistory import beam.router.model.{EmbodiedBeamLeg, _} import beam.router.skim.core.AbstractSkimmerEvent +import beam.sim.vehicles.VehiclesAdjustment import beam.utils.TestConfigUtils.testConfig import beam.utils.{SimRunnerForTest, StuckFinder, TestConfigUtils} import com.typesafe.config.{Config, ConfigFactory} @@ -131,7 +132,8 @@ class PersonWithPersonalVehiclePlanSpec Vector(), Set.empty, new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) ) @@ -368,7 +370,8 @@ class PersonWithPersonalVehiclePlanSpec Vector(), Set.empty, new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) ) @@ -518,7 +521,8 @@ class PersonWithPersonalVehiclePlanSpec Vector(), Set.empty, new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) scheduler ! ScheduleTrigger(InitializeTrigger(0), householdActor) @@ -562,6 +566,123 @@ class PersonWithPersonalVehiclePlanSpec expectMsgType[CompletionNotice] } + it("should create a last resort car if told to drive but no cars are available") { + val modeChoiceEvents = new TestProbe(system) + val personEntersVehicleEvents = new TestProbe(system) + val eventsManager = new EventsManagerImpl() + eventsManager.addHandler( + new BasicEventHandler { + override def handleEvent(event: Event): Unit = { + event match { + case _: AbstractSkimmerEvent => // ignore + case _: ModeChoiceEvent => modeChoiceEvents.ref ! event + case _: PersonEntersVehicleEvent => personEntersVehicleEvents.ref ! event + case _ => // ignore + } + } + } + ) + val vehicleType = beamScenario.vehicleTypes(Id.create("beamVilleCar", classOf[BeamVehicleType])) + val car1 = new BeamVehicle( + Id.createVehicleId("car-1"), + new Powertrain(0.0), + vehicleType + ) + + val household = householdsFactory.createHousehold(hoseHoldDummyId) + val population = PopulationUtils.createPopulation(ConfigUtils.createConfig()) + + val person: Person = createTestPerson(Id.createPersonId("dummyAgent"), car1.id, CAR) + population.addPerson(person) + val otherPerson: Person = createTestPerson(Id.createPersonId("dummyAgent2"), car1.id, CAR) + population.addPerson(otherPerson) + + household.setMemberIds(JavaConverters.bufferAsJavaList(mutable.Buffer(person.getId, otherPerson.getId))) + + val scheduler = TestActorRef[BeamAgentScheduler]( + SchedulerProps( + beamConfig, + stopTick = 24 * 60 * 60, + maxWindow = 10, + new StuckFinder(beamConfig.beam.debug.stuckAgentDetection) + ) + ) + val parkingManager = system.actorOf(Props(new TrivialParkingManager)) + //val chargingNetworkManager = system.actorOf(Props(new ChargingNetworkManager(services, beamScenario, scheduler))) + + val householdActor = TestActorRef[HouseholdActor]( + new HouseholdActor( + services, + beamScenario, + _ => modeChoiceCalculator, + scheduler, + beamScenario.transportNetwork, + services.tollCalculator, + self, + self, + parkingManager, + self, + eventsManager, + population, + household, + Map(car1.id -> car1), + new Coord(0.0, 0.0), + Vector(), + Set(vehicleType), + new RouteHistory(beamConfig), + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) + ) + ) + scheduler ! ScheduleTrigger(InitializeTrigger(0), householdActor) + + scheduler ! StartSchedule(0) + + for (_ <- 0 to 1) { + expectMsgPF() { + case EmbodyWithCurrentTravelTime(leg, vehicleId, _, _, triggerId) => + val embodiedLeg = EmbodiedBeamLeg( + beamLeg = leg.copy( + duration = 500, + travelPath = leg.travelPath.copy( + linkTravelTime = IndexedSeq(0, 100, 100, 100, 100, 100, 0), + endPoint = leg.travelPath.endPoint.copy(time = leg.startTime + 500) + ) + ), + beamVehicleId = vehicleId, + Id.create("TRANSIT-TYPE-DEFAULT", classOf[BeamVehicleType]), + asDriver = true, + cost = 0.0, + unbecomeDriverOnCompletion = true + ) + lastSender ! RoutingResponse( + itineraries = Vector(EmbodiedBeamTrip(Vector(embodiedLeg))), + requestId = 1, + request = None, + isEmbodyWithCurrentTravelTime = false, + triggerId = triggerId + ) + case RoutingRequest(_, _, _, _, _, _, _, _, _, _, triggerId) => + lastSender ! RoutingResponse( + itineraries = Vector(), + requestId = 1, + request = None, + isEmbodyWithCurrentTravelTime = false, + triggerId = triggerId + ) + } + } + + modeChoiceEvents.expectMsgType[ModeChoiceEvent] + modeChoiceEvents.expectMsgType[ModeChoiceEvent] + + personEntersVehicleEvents.expectMsgType[PersonEntersVehicleEvent] + personEntersVehicleEvents.expectMsgType[PersonEntersVehicleEvent] + personEntersVehicleEvents.expectMsgType[PersonEntersVehicleEvent] + + expectMsgType[CompletionNotice] + } + it("should walk to a car that is far away (if told so by the router") { val eventsManager = new EventsManagerImpl() eventsManager.addHandler( @@ -617,7 +738,8 @@ class PersonWithPersonalVehiclePlanSpec Vector(), Set.empty, new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) scheduler ! ScheduleTrigger(InitializeTrigger(0), householdActor) diff --git a/src/test/scala/beam/agentsim/agents/PersonWithVehicleSharingSpec.scala b/src/test/scala/beam/agentsim/agents/PersonWithVehicleSharingSpec.scala index 84ef9da2a67..9cada9b4d96 100644 --- a/src/test/scala/beam/agentsim/agents/PersonWithVehicleSharingSpec.scala +++ b/src/test/scala/beam/agentsim/agents/PersonWithVehicleSharingSpec.scala @@ -26,6 +26,7 @@ import beam.router.Modes.BeamMode.{CAR, WALK} import beam.router.RouteHistory import beam.router.model.{EmbodiedBeamLeg, _} import beam.router.skim.core.AbstractSkimmerEvent +import beam.sim.vehicles.VehiclesAdjustment import beam.utils.TestConfigUtils.testConfig import beam.utils.{SimRunnerForTest, StuckFinder, TestConfigUtils} import com.typesafe.config.{Config, ConfigFactory} @@ -138,7 +139,8 @@ class PersonWithVehicleSharingSpec sharedVehicleFleets = Vector(mockSharedVehicleFleet.ref), Set(beamScenario.vehicleTypes(Id.create("beamVilleCar", classOf[BeamVehicleType]))), new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) ) @@ -295,7 +297,8 @@ class PersonWithVehicleSharingSpec sharedVehicleFleets = Vector(mockSharedVehicleFleet.ref), Set(beamScenario.vehicleTypes(Id.create("beamVilleCar", classOf[BeamVehicleType]))), new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) ) @@ -558,7 +561,8 @@ class PersonWithVehicleSharingSpec Vector(mockSharedVehicleFleet.ref), Set(beamScenario.vehicleTypes(Id.create("beamVilleCar", classOf[BeamVehicleType]))), new RouteHistory(beamConfig), - boundingBox + boundingBox, + VehiclesAdjustment.getVehicleAdjustment(beamScenario) ) ) scheduler ! ScheduleTrigger(InitializeTrigger(0), householdActor) @@ -652,7 +656,7 @@ class PersonWithVehicleSharingSpec person2EntersVehicleEvents.expectNoMessage() - mockSharedVehicleFleet.expectMsgPF() { case MobilityStatusInquiry(_, SpaceTime(_, 28820), _, triggerId) => + mockSharedVehicleFleet.expectMsgPF() { case MobilityStatusInquiry(_, SpaceTime(_, 28820), _, _, triggerId) => mockSharedVehicleFleet.lastSender ! MobilityStatusResponse(Vector(), triggerId) } diff --git a/src/test/scala/beam/agentsim/agents/TeleportationSpec.scala b/src/test/scala/beam/agentsim/agents/TeleportationSpec.scala new file mode 100644 index 00000000000..0426a4d4cd1 --- /dev/null +++ b/src/test/scala/beam/agentsim/agents/TeleportationSpec.scala @@ -0,0 +1,112 @@ +package beam.agentsim.agents + +import akka.actor.ActorSystem +import beam.agentsim.events.{ModeChoiceEvent, PathTraversalEvent, TeleportationEvent} +import beam.router.Modes.BeamMode +import beam.sim.config.{BeamConfig, MatSimBeamConfigBuilder} +import beam.sim.{BeamHelper, BeamServices} +import beam.utils.FileUtils +import beam.utils.TestConfigUtils.testConfig +import org.matsim.api.core.v01.events.ActivityStartEvent +import org.matsim.core.controler +import org.matsim.core.controler.AbstractModule +import org.matsim.core.events.handler.BasicEventHandler +import org.matsim.core.scenario.MutableScenario +import org.scalatest.BeforeAndAfterAll +import org.scalatest.funspec.AnyFunSpecLike +import org.scalatest.matchers.should.Matchers + +import scala.collection.mutable +import scala.collection.mutable.ListBuffer + +class TeleportationSpec extends AnyFunSpecLike with Matchers with BeamHelper with BeforeAndAfterAll { + + def runWithConfig(configPath: String, eventHandler: BasicEventHandler): Unit = { + val config = testConfig(configPath).resolve() + val configBuilder = new MatSimBeamConfigBuilder(config) + val matsimConfig = configBuilder.buildMatSimConf() + val beamConfig = BeamConfig(config) + FileUtils.setConfigOutputFile(beamConfig, matsimConfig) + val (scenarioBuilt, beamScenario, _) = buildBeamServicesAndScenario(beamConfig, matsimConfig) + val scenario: MutableScenario = scenarioBuilt + + val injector = controler.Injector.createInjector( + scenario.getConfig, + new AbstractModule() { + override def install(): Unit = { + install(module(config, beamConfig, scenario, beamScenario)) + addEventHandlerBinding().toInstance(eventHandler) + } + } + ) + implicit val actorSystem: ActorSystem = injector.getInstance(classOf[ActorSystem]) + val beamServices: BeamServices = buildBeamServices(injector) + beamServices.controler.run() + } + + describe("Run BEAM with teleportation") { + + describe("Run with multiple persons") { + var teleportationEvents = 0 + val carHov3passengers = mutable.Set.empty[Int] + val carHov2passengers = mutable.Set.empty[Int] + val activitiesOfPerson2 = ListBuffer[(String, Double, String)]() + runWithConfig( + "test/input/beamville/beam-urbansimv2.conf", + { + case _: TeleportationEvent => + teleportationEvents = teleportationEvents + 1 + case e: PathTraversalEvent if e.currentTourMode.contains("car_hov3") && e.mode == BeamMode.CAR => + carHov3passengers.add(e.numberOfPassengers) + case e: PathTraversalEvent if e.currentTourMode.contains("car_hov2") && e.mode == BeamMode.CAR => + carHov2passengers.add(e.numberOfPassengers) + case e: ActivityStartEvent if e.getPersonId.toString == "2" => + activitiesOfPerson2.append((e.getLinkId.toString, e.getTime, e.getActType)) + case _ => + } + ) + + it("should have teleportation events") { + teleportationEvents shouldBe 12 + } + + it("should check the number of passengers in HOV cars") { + carHov3passengers.toSet shouldBe Set(2) + carHov2passengers.toSet shouldBe Set(1) + } + + it("should check if activities happen at expected location with expected duration") { + val activitiesList = activitiesOfPerson2.toList + // links + activitiesList.map(_._1) shouldBe List("300", "142", "300", "142", "300", "142") + // times + activitiesList.map(_._2) shouldBe List(21891.0, 26430.0, 32697.0, 37231.0, 39891.0, 44282.0) + // type + activitiesList.map(_._3) shouldBe List("Other", "Home", "Other", "Home", "Other", "Home") + } + + } + + describe("Run with a single person") { + it("if a person uses teleportation when there should be no PathTraversal events for a car") { + var teleportationEvents = 0 + val pathTraversalModes = mutable.Set[BeamMode]() + + runWithConfig( + "test/input/beamville/beam-urbansimv2_1person.conf", + { + case _: TeleportationEvent => + teleportationEvents = teleportationEvents + 1 + case e: PathTraversalEvent => + pathTraversalModes.add(e.mode) + case _ => + } + ) + teleportationEvents shouldBe 2 + pathTraversalModes.toSet shouldBe Set(BeamMode.BUS, BeamMode.SUBWAY) + } + } + + } + +} diff --git a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala index 241adee80bd..e16150ba176 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala @@ -62,7 +62,9 @@ class ChargingNetworkManagerSpec |} |beam.agentsim.chargingNetworkManager { | timeStepInSeconds = 300 - | + | scaleUp { + | enabled = false + | } | helics { | connectionEnabled = false | coreInitString = "--federates=1 --broker_address=tcp://127.0.0.1" @@ -177,7 +179,7 @@ class ChargingNetworkManagerSpec chargingNetworkManager ! ChargingPlugRequest(10, beamVilleCar, parkingStall, personId, 0) expectMsgType[StartingRefuelSession] - expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(40, beamVilleCar.id, 0) + expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(10, beamVilleCar.id, 0) expectNoMessage() beamVilleCar.primaryFuelLevelInJoules should be(2.7e8) @@ -190,7 +192,7 @@ class ChargingNetworkManagerSpec beamVilleCar.isConnectedToChargingPoint() should be(true) chargingNetworkManager ! ChargingUnplugRequest(610, beamVilleCar, 0) - expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(640, 0.0, 0) + expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(610, 0.0, 0) beamVilleCar.isConnectedToChargingPoint() should be(false) } @@ -218,13 +220,13 @@ class ChargingNetworkManagerSpec beamVilleCar.primaryFuelLevelInJoules should be(1.805e8) chargingNetworkManager ! TriggerWithId(ChargingTimeOutTrigger(442, beamVilleCar), 0) - expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(472, beamVilleCar.id, 0) + expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(442, beamVilleCar.id, 0) expectMsgType[CompletionNotice].newTriggers shouldBe Vector() expectNoMessage() beamVilleCar.primaryFuelLevelInJoules should be(2.16e8) chargingNetworkManager ! ChargingUnplugRequest(500, beamVilleCar, 0) - expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(530, 1.08e8, 0) + expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(500, 1.08e8, 0) expectNoMessage() beamVilleCar.primaryFuelLevelInJoules should be(2.16e8) beamVilleCar.isConnectedToChargingPoint() should be(false) @@ -254,13 +256,13 @@ class ChargingNetworkManagerSpec beamVilleCar.primaryFuelLevelInJoules should be(2.075e8) chargingNetworkManager ! TriggerWithId(ChargingTimeOutTrigger(334, beamVilleCar), 0) - expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(364, beamVilleCar.id, 0) + expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(334, beamVilleCar.id, 0) expectMsgType[CompletionNotice] shouldBe CompletionNotice(0) expectNoMessage() beamVilleCar.primaryFuelLevelInJoules should be(2.16e8) chargingNetworkManager ! ChargingUnplugRequest(700, beamVilleCar, 0) - expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(730, 8.1e7, 0) + expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(700, 8.1e7, 0) expectNoMessage() beamVilleCar.primaryFuelLevelInJoules should be(2.16e8) beamVilleCar.isConnectedToChargingPoint() should be(false) @@ -282,7 +284,7 @@ class ChargingNetworkManagerSpec beamVilleCar.primaryFuelLevelInJoules should be(1.35e8) chargingNetworkManager ! ChargingUnplugRequest(35, beamVilleCar, 0) - expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(65, 6249999.999999999, 0) + expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(35, 6249999.999999999, 0) expectNoMessage() beamVilleCar.primaryFuelLevelInJoules should be(1.4125e8) beamVilleCar.isConnectedToChargingPoint() should be(false) @@ -322,7 +324,7 @@ class ChargingNetworkManagerSpec beamVilleCar.primaryFuelLevelInJoules should be(1.265e8) chargingNetworkManager ! ChargingUnplugRequest(315, beamVilleCar, 0) - expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(345, 7.625e7, 0) + expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(315, 7.625e7, 0) expectNoMessage() beamVilleCar.primaryFuelLevelInJoules should be(1.3025e8) @@ -361,13 +363,13 @@ class ChargingNetworkManagerSpec beamVilleCar.primaryFuelLevelInJoules should be(1.79e8) chargingNetworkManager ! TriggerWithId(ChargingTimeOutTrigger(748, beamVilleCar), 0) - expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(778, beamVilleCar.id, 0) + expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(748, beamVilleCar.id, 0) expectMsgType[CompletionNotice] expectNoMessage() beamVilleCar.primaryFuelLevelInJoules should be(2.16e8) chargingNetworkManager ! ChargingUnplugRequest(750, beamVilleCar, 0) - expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(780, 1.62e8, 0) + expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(750, 1.62e8, 0) expectNoMessage() beamVilleCar.primaryFuelLevelInJoules should be(2.16e8) } @@ -404,7 +406,7 @@ class ChargingNetworkManagerSpec beamVilleCar3.primaryFuelLevelInJoules should be(1.08e8) chargingNetworkManager ! TriggerWithId(ChargingTimeOutTrigger(442, beamVilleCar2), 12) - expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(472, beamVilleCar2.id, 12) + expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(442, beamVilleCar2.id, 12) expectMsgType[CompletionNotice] expectNoMessage() beamVilleCar2.primaryFuelLevelInJoules should be(2.16e8) @@ -421,18 +423,18 @@ class ChargingNetworkManagerSpec beamVilleCar3.primaryFuelLevelInJoules should be(1.08e8) chargingNetworkManager ! ChargingUnplugRequest(750, beamVilleCar2, 0) - expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(780, 1.08e8, 0) - expectMsgType[StartingRefuelSession] shouldBe StartingRefuelSession(810, 0) + expectMsgType[UnpluggingVehicle] shouldBe UnpluggingVehicle(750, 1.08e8, 0) + expectMsgType[StartingRefuelSession] shouldBe StartingRefuelSession(750, 0) expectNoMessage() beamVilleCar2.primaryFuelLevelInJoules should be(2.16e8) beamVilleCar3.primaryFuelLevelInJoules should be(1.08e8) chargingNetworkManager ! TriggerWithId(ChargingTimeOutTrigger(874, beamVilleCar3), 0) - expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(904, beamVilleCar3.id, 0) + expectMsgType[EndingRefuelSession] shouldBe EndingRefuelSession(874, beamVilleCar3.id, 0) expectMsgType[CompletionNotice] expectNoMessage() beamVilleCar2.primaryFuelLevelInJoules should be(2.16e8) - beamVilleCar3.primaryFuelLevelInJoules should be(1.38e8) + beamVilleCar3.primaryFuelLevelInJoules should be(1.455e8) beamVilleCar3.isConnectedToChargingPoint() should be(true) beamVilleCar2.isConnectedToChargingPoint() should be(false) } diff --git a/src/test/scala/beam/agentsim/infrastructure/ParallelParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ParallelParkingManagerSpec.scala index 68e3bc246d4..5853eefd418 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ParallelParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ParallelParkingManagerSpec.scala @@ -8,7 +8,6 @@ import beam.agentsim.agents.BeamvilleFixtures import beam.agentsim.agents.vehicles.VehicleManager import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.events.SpaceTime -import beam.agentsim.infrastructure.InfrastructureUtils.buildParkingZones import beam.agentsim.infrastructure.parking.PricingModel.FlatFee import beam.agentsim.infrastructure.parking._ import beam.agentsim.infrastructure.taz.{TAZ, TAZTreeMap} @@ -348,7 +347,7 @@ class ParallelParkingManagerSpec beamConfig, None ) - val parkingZones = buildParkingZones[TAZ](stalls) + val parkingZones = InfrastructureUtils.loadParkingStalls[TAZ](stalls) val zpm = ParallelParkingManager.init( parkingZones, beamConfig, diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index 677dda69985..1a802a6f45d 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -430,7 +430,7 @@ class ZonalParkingManagerSpec beamConfig, None ) - val parkingZones = InfrastructureUtils.buildParkingZones(stalls) + val parkingZones = InfrastructureUtils.loadParkingStalls(stalls) val zonesMap = ZonalParkingManager[TAZ]( parkingZones, tazMap.tazQuadTree, diff --git a/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala index d5344569d62..2f2199c4fd7 100644 --- a/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala @@ -3,9 +3,10 @@ package beam.agentsim.infrastructure.power import beam.agentsim.agents.vehicles.VehicleManager import beam.agentsim.infrastructure.ChargingNetwork import beam.agentsim.infrastructure.ChargingNetwork.ChargingStation +import beam.agentsim.infrastructure.ChargingNetworkManager.ChargingNetworkHelper import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.{ParkingType, ParkingZone, PricingModel} -import beam.agentsim.infrastructure.power.SitePowerManager.PhysicalBounds +import beam.agentsim.infrastructure.power.PowerController.PhysicalBounds import beam.agentsim.infrastructure.taz.TAZ import beam.cosim.helics.BeamHelicsInterface._ import beam.sim.config.BeamConfig @@ -24,7 +25,9 @@ class PowerControllerSpec extends AnyWordSpecLike with Matchers with BeforeAndAf .parseString(s""" |beam.agentsim.chargingNetworkManager { | timeStepInSeconds = 300 - | + | scaleUp { + | enabled = false + | } | helics { | connectionEnabled = false | coreInitString = "--federates=1 --broker_address=tcp://127.0.0.1" @@ -73,16 +76,16 @@ class PowerControllerSpec extends AnyWordSpecLike with Matchers with BeforeAndAf reset(beamFederateMock) when(beamFederateMock.sync(300)).thenReturn(300.0) when(beamFederateMock.collectJSON()).thenReturn(List(dummyPhysicalBounds)) + when(chargingNetwork.chargingStations).thenReturn(List(dummyChargingStation)) + when(rideHailNetwork.chargingStations).thenReturn(List()) } "PowerController when connected to grid" should { + val chargingNetworkHelper: ChargingNetworkHelper = new ChargingNetworkHelper(chargingNetwork, rideHailNetwork) { + override lazy val allChargingStations: List[ChargingStation] = List(dummyChargingStation) + } val powerController: PowerController = - new PowerController( - chargingNetwork, - rideHailNetwork, - beamConfig, - SitePowerManager.getUnlimitedPhysicalBounds(Seq(dummyChargingStation)).value - ) { + new PowerController(chargingNetworkHelper, beamConfig) { override private[power] lazy val beamFederateOption = Some(beamFederateMock) } @@ -91,20 +94,16 @@ class PowerControllerSpec extends AnyWordSpecLike with Matchers with BeforeAndAf 300, Some(Map[ChargingStation, Double](dummyChargingStation -> 5678.90)) ) - bounds shouldBe Map(ChargingStation(dummyChargingZone) -> PhysicalBounds(dummyChargingStation, 7.2, 7.2, 0.0)) + bounds shouldBe Map(dummyChargingStation -> PhysicalBounds(dummyChargingStation, 7.2, 7.2, 0.0)) // TODO: test beam federate connection //verify(beamFederateMock, times(1)).syncAndCollectJSON(300) } } "PowerController when not connected to grid" should { + val chargingNetworkHelper: ChargingNetworkHelper = ChargingNetworkHelper(chargingNetwork, rideHailNetwork) val powerController: PowerController = - new PowerController( - chargingNetwork, - rideHailNetwork, - beamConfig, - SitePowerManager.getUnlimitedPhysicalBounds(Seq(dummyChargingStation)).value - ) { + new PowerController(chargingNetworkHelper, beamConfig) { override private[power] lazy val beamFederateOption = None } diff --git a/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala index bc7100ade09..4e646e133b1 100644 --- a/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala @@ -6,7 +6,7 @@ import beam.agentsim.agents.vehicles.EnergyEconomyAttributes.Powertrain import beam.agentsim.agents.vehicles.{BeamVehicle, BeamVehicleType, VehicleManager} import beam.agentsim.events.RefuelSessionEvent.NotApplicable import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingStatus, ChargingVehicle} -import beam.agentsim.infrastructure.ChargingNetworkManager.ChargingPlugRequest +import beam.agentsim.infrastructure.ChargingNetworkManager.{ChargingNetworkHelper, ChargingPlugRequest} import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.{ParkingType, ParkingZone, PricingModel} import beam.agentsim.infrastructure.taz.TAZ @@ -60,7 +60,9 @@ class SitePowerManagerSpec |} |beam.agentsim.chargingNetworkManager { | timeStepInSeconds = 300 - | + | scaleUp { + | enabled = false + | } | helics { | connectionEnabled = false | coreInitString = "--federates=1 --broker_address=tcp://127.0.0.1" @@ -141,26 +143,15 @@ class SitePowerManagerSpec "SitePowerManager" should { val dummyStation = ChargingStation(dummyChargingZone) - val sitePowerManager = new SitePowerManager(chargingNetwork, rideHailNetwork, beamServices) + val unlimitedBounds = PowerController.getUnlimitedPhysicalBounds(Seq(dummyStation)).value + val sitePowerManager = + new SitePowerManager(ChargingNetworkHelper(chargingNetwork, rideHailNetwork), unlimitedBounds, beamServices) - "get power over planning horizon 0.0 for charged vehicles" in { - sitePowerManager.requiredPowerInKWOverNextPlanningHorizon(300) shouldBe Map( - ChargingStation(dummyChargingZone) -> 0.0 - ) - } - "get power over planning horizon greater than 0.0 for discharged vehicles" in { - val vehiclesMap = Map(vehiclesList.map { case (v, _) => v.id -> v }: _*) - vehiclesMap.foreach(_._2.addFuel(-10000)) - sitePowerManager.requiredPowerInKWOverNextPlanningHorizon(300) shouldBe Map( - ChargingStation(dummyChargingZone) -> 0.0 - ) - } "replan horizon and get charging plan per vehicle" in { vehiclesList.foreach { case (v, person) => v.addFuel(v.primaryFuelLevelInJoules * 0.9 * -1) val request = ChargingPlugRequest(0, v, v.stall.get, person, 0) - val Some(chargingVehicle) = - chargingNetwork.processChargingPlugRequest(request, ActorRef.noSender) + val Some(chargingVehicle) = chargingNetwork.processChargingPlugRequest(request, "", ActorRef.noSender) chargingVehicle.chargingStatus.last shouldBe ChargingStatus(ChargingStatus.Connected, 0) chargingVehicle shouldBe ChargingVehicle( v, @@ -168,16 +159,15 @@ class SitePowerManagerSpec dummyStation, 0, person, + "", NotApplicable, None, ActorRef.noSender, ListBuffer(ChargingStatus(ChargingStatus.Connected, 0)) ) - sitePowerManager.dispatchEnergy( - 300, - chargingVehicle, - SitePowerManager.getUnlimitedPhysicalBounds(Seq(dummyStation)).value - ) should (be((1, 250000.0)) or be((300, 7.5e7))) + sitePowerManager.dispatchEnergy(300, chargingVehicle, unlimitedBounds) should (be( + (1, 250000.0, 250000.0) + ) or be((300, 7.5e7, 7.5e7))) } } diff --git a/src/test/scala/beam/analysis/SimpleRideHailUtilizationTest.scala b/src/test/scala/beam/analysis/SimpleRideHailUtilizationTest.scala index f913ea0077d..bd0b89c62ab 100644 --- a/src/test/scala/beam/analysis/SimpleRideHailUtilizationTest.scala +++ b/src/test/scala/beam/analysis/SimpleRideHailUtilizationTest.scala @@ -35,6 +35,7 @@ class SimpleRideHailUtilizationTest extends AnyFunSuite with Matchers { amountPaid = 1, None, None, + None, riders = Vector() ) diff --git a/src/test/scala/beam/analysis/cartraveltime/StudyAreaTripFilterTest.scala b/src/test/scala/beam/analysis/cartraveltime/StudyAreaTripFilterTest.scala index 6724460d830..34877841bc8 100644 --- a/src/test/scala/beam/analysis/cartraveltime/StudyAreaTripFilterTest.scala +++ b/src/test/scala/beam/analysis/cartraveltime/StudyAreaTripFilterTest.scala @@ -52,6 +52,7 @@ class StudyAreaTripFilterTest extends AnyFunSuite with Matchers { vehicleType = vehicleType, numPass = 1, beamLeg = beamLeg, + currentTourMode = None, primaryFuelConsumed = 1.0, secondaryFuelConsumed = 0.0, endLegPrimaryFuelLevel = 1.0, diff --git a/src/test/scala/beam/integration/ChargingSpec.scala b/src/test/scala/beam/integration/ChargingSpec.scala index dbebb777f33..f38222d72f1 100644 --- a/src/test/scala/beam/integration/ChargingSpec.scala +++ b/src/test/scala/beam/integration/ChargingSpec.scala @@ -3,6 +3,7 @@ package beam.integration import beam.agentsim.agents.vehicles.BeamVehicleType import beam.agentsim.agents.vehicles.FuelType.Electricity import beam.agentsim.events._ +import beam.agentsim.infrastructure.ScaleUpCharging import beam.agentsim.infrastructure.charging.ChargingPointType import beam.router.Modes.BeamMode import beam.sim.config.{BeamConfig, MatSimBeamConfigBuilder} @@ -27,28 +28,47 @@ import org.scalatest.matchers.should.Matchers import scala.collection.mutable.ArrayBuffer class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { - private val beamVilleCarId = Id.create("beamVilleCar", classOf[BeamVehicleType]) - private val vehicleId = Id.create(2, classOf[Vehicle]) - private val filesPath = s"${System.getenv("PWD")}/test/test-resources/beam/input" - - val config: Config = ConfigFactory - .parseString( - s"""|beam.outputs.events.fileOutputFormats = csv - |beam.physsim.skipPhysSim = true - |beam.agentsim.lastIteration = 0 - |beam.agentsim.tuning.transitCapacity = 0.0 - |beam.agentsim.agents.rideHail.initialization.procedural.fractionOfInitialVehicleFleet = 0 - |beam.agentsim.agents.vehicles.sharedFleets = [] - |beam.agentsim.agents.vehicles.vehiclesFilePath = $filesPath"/vehicles-simple.csv" - |beam.agentsim.agents.vehicles.vehicleTypesFilePath = $filesPath"/vehicleTypes-simple.csv" - |beam.agentsim.taz.parkingFilePath = $filesPath"/taz-parking-ac-only.csv" - | - """.stripMargin - ) - .withFallback(testConfig("test/input/beamville/beam.conf")) - .resolve() - "Running a single person car-only scenario" must "catch charging events" in { + "Running a single person car-only scenario and scale up charging events" must "catch charging events and measure virtual power greater or equal than real power" in { + val beamVilleCarId = Id.create("beamVilleCar", classOf[BeamVehicleType]) + val vehicleId = Id.create(2, classOf[Vehicle]) + val filesPath = s"${System.getenv("PWD")}/test/test-resources/beam/input" + val config: Config = ConfigFactory + .parseString( + s"""|beam.outputs.events.fileOutputFormats = csv + |beam.physsim.skipPhysSim = true + |beam.agentsim.lastIteration = 0 + |beam.agentsim.tuning.transitCapacity = 0.0 + |beam.agentsim.agents.rideHail.initialization.procedural.fractionOfInitialVehicleFleet = 0 + |beam.agentsim.agents.vehicles.sharedFleets = [] + |beam.agentsim.agents.vehicles.vehiclesFilePath = $filesPath"/vehicles-simple.csv" + |beam.agentsim.agents.vehicles.vehicleTypesFilePath = $filesPath"/vehicleTypes-simple.csv" + |beam.agentsim.taz.parkingFilePath = $filesPath"/taz-parking-ac-only.csv" + |beam.agentsim.chargingNetworkManager { + | timeStepInSeconds = 300 + | chargingPointCountScalingFactor = 1.0 + | chargingPointCostScalingFactor = 1.0 + | chargingPointFilePath = "" + | scaleUp { + | enabled = true + | expansionFactor_home_activity = 3.0 + | expansionFactor_work_activity = 3.0 + | expansionFactor_charge_activity = 3.0 + | expansionFactor_wherever_activity = 3.0 + | expansionFactor_init_activity = 3.0 + | } + | helics { + | connectionEnabled = false + | } + | helics { + | connectionEnabled = false + | } + |} + | + """.stripMargin + ) + .withFallback(testConfig("test/input/beamville/beam.conf")) + .resolve() val configBuilder = new MatSimBeamConfigBuilder(config) val matsimConfig = configBuilder.buildMatSimConf() val beamConfig = BeamConfig(config) @@ -61,7 +81,8 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { val chargingPlugOutEvents: ArrayBuffer[Double] = new ArrayBuffer[Double]() val refuelSessionEvents: ArrayBuffer[(Double, Long, Double)] = new ArrayBuffer[(Double, Long, Double)]() var energyConsumed: Double = 0.0 - + var totVirtualPower = 0.0 + var totRealPower = 0.0 val injector = org.matsim.core.controler.Injector.createInjector( scenario.getConfig, new AbstractModule() { @@ -81,6 +102,7 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { `vehicleId`, _, _, + _, _ ) => refuelSessionEvents += ( @@ -90,8 +112,13 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { ChargingPointType.getChargingPointInstalledPowerInKw(stall.chargingPointType.get) ) ) + totRealPower += ScaleUpCharging.toPowerInKW(energyInJoules, sessionDuration.toInt) case e: PathTraversalEvent if e.vehicleId == vehicleId => energyConsumed += e.primaryFuelConsumed + case e: RefuelSessionEvent if e.vehId.toString.startsWith(ScaleUpCharging.VIRTUAL_CAR_ALIAS) => + totVirtualPower += ScaleUpCharging.toPowerInKW(e.energyInJoules, e.sessionDuration.toInt) + case e: RefuelSessionEvent => + totRealPower += ScaleUpCharging.toPowerInKW(e.energyInJoules, e.sessionDuration.toInt) case _ => } } @@ -156,5 +183,10 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { // consumed energy should be more or less equal total added energy // TODO Hard to test this without ensuring an energy conservation mechanism // totalEnergyInJoules shouldBe (energyConsumed +- 1000) + + assume( + totVirtualPower - totRealPower > 0, + "There should be at least as much virtual power as real power when scaling up by 2" + ) } } diff --git a/src/test/scala/beam/router/skim/ActivitySimSkimmerEventTest.scala b/src/test/scala/beam/router/skim/ActivitySimSkimmerEventTest.scala index 2f3db2e86b0..4fcccaf5549 100644 --- a/src/test/scala/beam/router/skim/ActivitySimSkimmerEventTest.scala +++ b/src/test/scala/beam/router/skim/ActivitySimSkimmerEventTest.scala @@ -2,6 +2,7 @@ package beam.router.skim import beam.router.Modes.BeamMode import beam.router.model.{BeamLeg, BeamPath, EmbodiedBeamLeg, EmbodiedBeamTrip} +import org.matsim.api.core.v01.Id import org.mockito.Mockito.when import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers @@ -17,6 +18,7 @@ class ActivitySimSkimmerEventTest extends AnyFlatSpec with Matchers { when(beamLeg.mode).thenReturn(mode) when(beamLeg.duration).thenReturn(duration) when(leg.beamLeg).thenReturn(beamLeg) + when(leg.beamVehicleId).thenReturn(Id.createVehicleId("MockVechicleId")) leg } diff --git a/src/test/scala/beam/utils/Network2ShapeFileTest.scala b/src/test/scala/beam/utils/Network2ShapeFileTest.scala deleted file mode 100644 index 64773e76271..00000000000 --- a/src/test/scala/beam/utils/Network2ShapeFileTest.scala +++ /dev/null @@ -1,51 +0,0 @@ -package beam.utils - -import beam.utils.Network2ShapeFile.networkToShapeFile -import beam.utils.map.ShapefileReader -import org.matsim.core.network.NetworkUtils -import org.matsim.core.network.io.NetworkReaderMatsimV2 -import org.matsim.core.utils.geometry.geotools.MGC -import org.opengis.feature.simple.SimpleFeature -import org.opengis.referencing.operation.MathTransform -import org.scalatest.matchers.should.Matchers -import org.scalatest.wordspec.AnyWordSpecLike - -import scala.jdk.CollectionConverters.collectionAsScalaIterableConverter - -class Network2ShapeFileTest extends AnyWordSpecLike with Matchers { - "Network2ShapeFile transformation" should { - "generate the same number of features" in { - val beamvilleNetwork = "test/test-resources/beam/beamville-physsim-network.xml" - val outputShapeFile = "output/beamville-network.shp" - - val crsString = "epsg:32631" - val crs = MGC.getCRS(crsString) - - // write out shapefile - networkToShapeFile(beamvilleNetwork, outputShapeFile, crs, _ => true) - - // read network agaim - val network = NetworkUtils.createNetwork() - val reader = new NetworkReaderMatsimV2(network) - reader.readFile(beamvilleNetwork) - - @SuppressWarnings(Array("UnusedMethodParameter")) - def mapToID2AllProperties(mathTransform: MathTransform, feature: SimpleFeature): (String, Map[String, AnyRef]) = { - val featureId = feature.getAttribute("ID").toString - val allProps = - feature.getProperties.asScala.map(property => property.getName.toString -> property.getValue).toMap - - featureId -> allProps - } - - // read all features from shp file - val shpFeatures = ShapefileReader.read(crsString, outputShapeFile, _ => true, mapToID2AllProperties).toMap - - // compare the lengths - val originalNumberOfLinks = network.getLinks.size() - val resultCount = shpFeatures.size - - resultCount shouldBe originalNumberOfLinks - } - } -} diff --git a/src/test/scala/beam/utils/scenario/PreviousRunPlanMergerTest.scala b/src/test/scala/beam/utils/scenario/PreviousRunPlanMergerTest.scala index 5d96d0990f7..48d93d56ab1 100644 --- a/src/test/scala/beam/utils/scenario/PreviousRunPlanMergerTest.scala +++ b/src/test/scala/beam/utils/scenario/PreviousRunPlanMergerTest.scala @@ -58,12 +58,6 @@ class PreviousRunPlanMergerTest extends AnyWordSpecLike with Matchers { createPlanElement("2", 0, 49503), createPlanElement("2", 1, 49504), //old createPlanElement("6", 2, 49508), //old as unique - createPlanElement("0", 0, 49499, planSelected = false), - createPlanElement("0", 1, 49500, planSelected = false), - createPlanElement("3", 0, 49505, planSelected = false), - createPlanElement("3", 1, 49506, planSelected = false), - createPlanElement("3", 2, 49507, planSelected = false), - createPlanElement("4", 2, 49508, planSelected = false), createPlanElement("0", 0, 49509), createPlanElement("0", 1, 49510), createPlanElement("0", 2, 49511), //new merged @@ -76,7 +70,7 @@ class PreviousRunPlanMergerTest extends AnyWordSpecLike with Matchers { ) } - "should return all plans merged when fraction = 1.0" in { + "should return all plans merged when fraction = 1.1" in { val res = PreviousRunPlanMerger.merge(oldPlans, newPlans, 1.0, new Random(1)) res.toSet.count(oldPlans.contains) should be(3) @@ -87,14 +81,6 @@ class PreviousRunPlanMergerTest extends AnyWordSpecLike with Matchers { createPlanElement("7", 0, 49501), createPlanElement("7", 1, 49502), //old as unique createPlanElement("6", 2, 49508), //old as unique - createPlanElement("0", 0, 49499, planSelected = false), - createPlanElement("0", 1, 49500, planSelected = false), - createPlanElement("2", 0, 49503, planSelected = false), - createPlanElement("2", 1, 49504, planSelected = false), - createPlanElement("3", 0, 49505, planSelected = false), - createPlanElement("3", 1, 49506, planSelected = false), - createPlanElement("3", 2, 49507, planSelected = false), - createPlanElement("4", 2, 49508, planSelected = false), createPlanElement("0", 0, 49509), createPlanElement("0", 1, 49510), createPlanElement("0", 2, 49511), //new merged @@ -178,18 +164,13 @@ class PreviousRunPlanMergerTest extends AnyWordSpecLike with Matchers { ) } - def createPlanElement( - personId: String, - planIndex: Int, - activityEndTime: Double, - planSelected: Boolean = true - ): PlanElement = { + def createPlanElement(personId: String, planIndex: Int, activityEndTime: Double): PlanElement = { PlanElement( PersonId(personId), planIndex, 1, - planSelected = planSelected, - "activity", + true, + PlanElement.Activity, 0, Some("a"), Some(1), @@ -220,8 +201,8 @@ class PreviousRunPlanMergerTest extends AnyWordSpecLike with Matchers { PersonId(personId), 0, planScore, - planSelected = true, - "activity", + true, + PlanElement.Activity, planElementIdx, Some(activityType), Some(x), @@ -244,8 +225,8 @@ class PreviousRunPlanMergerTest extends AnyWordSpecLike with Matchers { PersonId(personId), 0, planScore, - planSelected = true, - "leg", + true, + PlanElement.Leg, planElementIdx, None, None, diff --git a/src/test/scala/beam/utils/scenario/urbansim/HOVModeTransformerTest.scala b/src/test/scala/beam/utils/scenario/urbansim/HOVModeTransformerTest.scala new file mode 100644 index 00000000000..a1b6822838e --- /dev/null +++ b/src/test/scala/beam/utils/scenario/urbansim/HOVModeTransformerTest.scala @@ -0,0 +1,531 @@ +package beam.utils.scenario.urbansim + +import beam.router.Modes.BeamMode +import beam.router.Modes.BeamMode._ +import beam.utils.scenario._ +import beam.utils.scenario.urbansim.censusblock.merger.PlanMerger +import beam.utils.scenario.urbansim.censusblock.reader.{PlanReader} +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.should.Matchers + +import scala.util.Random + +class HOVModeTransformerTest extends AnyFunSuite with Matchers { + + import HOVModeTransformerTest._ + + test("only 'HOV' legs should be affected") { + val modes = BeamMode.allModes ++ Seq(HOV2_TELEPORTATION, HOV3_TELEPORTATION, CAR_HOV2, CAR_HOV3) + val plansBefore = modes.zipWithIndex.flatMap { case (mode, idx) => + newTrip(personId = 1, idx, mode.value) + } + val plansAfter = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plansBefore) + plansAfter should equal(plansBefore) + } + + test("'HOV' legs should not be in the result") { + val allHov = Set("HOV2", "HOV3", "hov2", "hov3") + allHov.foreach { mode => + val plansBefore = newTrip(1, 1, mode) + + val plansAfter = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plansBefore) + plansAfter.foreach { plan => + plan.legMode match { + case Some(mode) => allHov shouldNot contain(mode) + case _ => + } + } + } + } + + test("'HOV2' legs should be transformed only into car_hov2|hov2_teleportation") { + val expected = Set(CAR_HOV2.value, HOV2_TELEPORTATION.value) + val allHov = Set("HOV2", "hov2") + allHov.foreach { mode => + val plansBefore = newTrip(1, 1, mode) + + val plansAfter = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plansBefore) + plansAfter.foreach { plan => + plan.legMode match { + case Some(mode) => expected should contain(mode) + case _ => + } + } + } + } + + test("'HOV3' legs should be transformed only into car_hov3|hov3_teleportation") { + val expected = Set(CAR_HOV3.value, HOV3_TELEPORTATION.value) + val allHov = Set("HOV3", "hov3") + allHov.foreach { mode => + val plansBefore = newTrip(1, 1, mode) + + val plansAfter = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plansBefore) + plansAfter.foreach { plan => + plan.legMode match { + case Some(mode) => expected should contain(mode) + case _ => + } + } + } + } + + private def getNumberOfHOVTrips(numberOfTrips: Int, maybePersonId: Option[Int] = None) = { + val allHov = Set("HOV2", "HOV3", "hov2", "hov3") + val modes = (1 to (numberOfTrips / 4 + 3)).flatMap(_ => allHov).take(numberOfTrips) + maybePersonId match { + case Some(personId) => modes.flatMap(mode => newTrip(personId, 1, mode)) + case None => modes.zipWithIndex.flatMap { case (mode, personId) => newTrip(personId, 1, mode) } + } + } + + test("hov2 / hov3 legs if car available should be transformed into car_hov / hov_teleportation") { + val plansBefore = getNumberOfHOVTrips(302) + + val plansAfter = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plansBefore) + val modesAfter = plansAfter.filter(plan => plan.legMode.nonEmpty).map(_.legMode.get.toLowerCase).toSet + + Seq("hov2", "hov3").foreach { mode => + modesAfter shouldNot contain(mode) + } + + Seq(CAR_HOV2, CAR_HOV3, HOV2_TELEPORTATION, HOV3_TELEPORTATION) + .map(_.value.toLowerCase) + .foreach { mode => + modesAfter should contain(mode) + } + } + + test("separation into trips should work") { + val plansBefore = getNumberOfHOVTrips(100) + val trips = HOVModeTransformer.splitToTrips(plansBefore) + trips.size shouldBe 100 + } + + test("Plans after split and join should have the same length as original plans") { + val plansBefore = Seq( + newActivity(1, 1, Act("Home", -97.88378875069999, 30.2216674426)), + newLeg(1, 2, "car"), + newActivity(1, 3, Act("escort", -97.96989530443756, 30.35731823073682)), + newLeg(1, 4, "car"), + newActivity(1, 5, Act("Home", -97.88378875069999, 30.2216674426)), + newLeg(1, 6, "car"), + newActivity(1, 7, Act("work", -97.79891452443114, 30.246216356094088)), + newLeg(1, 8, "car"), + newActivity(1, 9, Act("Home", -97.88378875069999, 30.2216674426)) + ) + + val trips = HOVModeTransformer.splitToTrips(plansBefore) + trips.size shouldBe 2 + + val plansAfter = HOVModeTransformer.joinTripsIntoPlans(trips) + plansAfter.size shouldBe plansBefore.size + } + + test("separation into trips should not change plans length") { + val modeMap = Map( + "SHARED2PAY" -> "car", + "SHARED2FREE" -> "car", + "WALK_COM" -> "walk_transit", + "DRIVEALONEFREE" -> "car", + "WALK_LOC" -> "walk_transit", + "DRIVE_EXP" -> "drive_transit", + "TNC_SINGLE" -> "ride_hail", + "WALK" -> "walk", + "DRIVE_HVY" -> "drive_transit", + "SHARED3FREE" -> "car", + "WALK_LRF" -> "walk_transit", + "TAXI" -> "ride_hail", + "TNC_SHARED" -> "ride_hail", + "DRIVE_COM" -> "drive_transit", + "DRIVEALONEPAY" -> "car", + "DRIVE_LRF" -> "drive_transit", + "SHARED3PAY" -> "car", + "BIKE" -> "bike", + "WALK_HVY" -> "walk_transit", + "WALK_EXP" -> "walk_transit", + "DRIVE_LOC" -> "drive_transit" + ) + + val pathToPlans = "test/test-resources/plans-transformation-test-data/plans.csv.gz" + + val merger = new PlanMerger(modeMap) + val planReader = new PlanReader(pathToPlans) + + val originalPlans: Iterable[PlanElement] = + try { + merger + .merge(planReader.iterator()) + .toList + } finally { + planReader.close() + } + + HOVModeTransformer.reseedRandomGenerator(42) + val transformedPlans: Iterable[PlanElement] = + HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(originalPlans) + + val personToPlanOriginal: Map[PersonId, Iterable[PlanElement]] = originalPlans.groupBy(plan => plan.personId) + val personToPlanTransformed: Map[PersonId, Iterable[PlanElement]] = + transformedPlans.groupBy(plan => plan.personId) + + personToPlanOriginal.keySet.foreach { personId => + val originalPersonPlans: Iterable[PlanElement] = personToPlanOriginal(personId) + val transformedPersonPlans = personToPlanTransformed(personId) + + assert( + originalPersonPlans.size == transformedPersonPlans.size, + s"Length of plans for person $personId was changed during transformation" + ) + } + + assert(personToPlanOriginal.size == personToPlanTransformed.size, "Size of plans is different") + personToPlanOriginal.keys.foreach { personId => + val personOriginalPlans = personToPlanOriginal(personId) + val personTransformedPlans = personToPlanTransformed(personId) + assert( + personOriginalPlans.size == personTransformedPlans.size, + s"Size of plans for person $personId is different" + ) + } + } + + test("separation into trips should work for complicated trips") { + val inputPlans = newTrip( + 1, + 1, + modes = Seq("HOV2", "HOV2", "HOV2", "WALK", "WALK", "CAR", "CAR"), + activities = Seq( + Act("Home", 1.1, 1.1), + Act("Shopping"), + Act("Other"), + Act("Work"), + Act("Meal"), + Act("Work"), + Act("Shopping"), + Act("Home", 1.1, 1.1) + ) + ) ++ newTrip( + 1, + 1, + modes = Seq("HOV2", "HOV2", "HOV2", "CAR", "CAR"), + activities = + Seq(Act("Home", 1.1, 1.1), Act("Shopping"), Act("Other"), Act("Work"), Act("Shopping"), Act("Home", 1.1, 1.1)) + ) ++ newTrip( + 1, + 1, + modes = Seq("CAR", "CAR"), + activities = Seq(Act("Home", 1.1, 1.1), Act("Work"), Act("Home", 1.1, 1.1)) + ) ++ newTrip( + 1, + 1, + modes = Seq(WALK_TRANSIT.value, WALK.value, WALK.value), + activities = Seq(Act("Home", 1.1, 1.1), Act("Work"), Act("Shopping"), Act("Home", 1.1, 1.1)) + ) + + val trips = HOVModeTransformer.splitToTrips(inputPlans) + trips.size shouldBe 4 + } + + test("separation into trips should work for trips going home several times") { + val inputPlans = newTrip( + 1, + 1, + modes = Seq("HOV2", "HOV2", "HOV2", "WALK"), + activities = Seq( + Act("Home", 1.1, 1.1), + Act("Shopping"), + Act("Home", 1.1, 1.1), + Act("Work"), + Act("Home", 1.1, 1.1) + ) + ) + + val trips = HOVModeTransformer.splitToTrips(inputPlans) + trips.size shouldBe 2 + } + + test("if plans do not start and end with home it should not be split to trips") { + val inputPlans = newTrip( + 1, + 1, + modes = Seq("HOV2", "HOV2", "HOV2", "WALK", "WALK", "CAR", "CAR"), + activities = Seq( + Act("Work", 1.1, 1.1), + Act("Home"), + Act("Work", 1.1, 1.2) + ) + ) ++ newTrip( + 1, + 1, + modes = Seq(WALK_TRANSIT.value, WALK.value, WALK.value), + activities = Seq(Act("Home", 1.1, 1.1), Act("Work"), Act("Shopping"), Act("Home", 1.1, 1.1)) + ) + + val trips = HOVModeTransformer.splitToTrips(inputPlans) + trips.size shouldBe 1 + } + + test("trip without car and hov legs should not contain hov_car after transformation") { + val fewPlans: Seq[PlanElement] = Seq( + WALK, + WALK_TRANSIT, + BIKE, + BIKE_TRANSIT, + BUS, + CABLE_CAR, + FERRY, + DRIVE_TRANSIT, + RAIL, + RIDE_HAIL, + RIDE_HAIL_POOLED, + RIDE_HAIL_TRANSIT, + TRAM + ).flatMap { mode => + newTrip( + 1, + 1, + modes = Seq("hov2", "hov2", "hov3", mode.value, mode.value, "hov3", "hov3"), + activities = Seq( + Act("Home", 1.1, 1.1), + Act("Shopping"), + Act("Other"), + Act("Work"), + Act("Meal"), + Act("Other"), + Act("Shopping"), + Act("Home", 1.1, 1.1) + ) + ) + } + + val manyPlans = (1 to 50).flatMap(_ => fewPlans) + + val processedPlans = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(manyPlans) + + val modes = processedPlans.flatMap(_.legMode).map(_.toLowerCase).toSet + + modes shouldNot contain("hov2") + modes shouldNot contain("hov3") + + modes should contain(HOV2_TELEPORTATION.value.toLowerCase) + modes should contain(HOV3_TELEPORTATION.value.toLowerCase) + + modes shouldNot contain(CAR_HOV2.value.toLowerCase) + modes shouldNot contain(CAR_HOV3.value.toLowerCase) + } + + test("trips with both hov and car must be forced to hov car") { + val plans = newTrip( + 1, + 1, + modes = Seq("HOV3", "HOV3", "HOV3", "CAR", "CAR"), + activities = + Seq(Act("Home", 1.1, 1.1), Act("Shopping"), Act("Other"), Act("Work"), Act("Shopping"), Act("Home", 1.1, 1.1)) + ) + + val processedPlans = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plans) + val processedTrips = HOVModeTransformer.splitToTrips(processedPlans).toArray + + val tripsModes = processedTrips.map(_.flatMap(_.legMode)) + + tripsModes.head shouldBe Seq("car_hov3", "car_hov3", "car_hov3", "CAR", "CAR") + } + + test("trips with both hov and car must be forced to hov car, when car was left at some location and then picked up") { + val plans = newTrip( + 1, + 1, + modes = Seq("HOV2", "HOV2", "HOV2", "WALK", "WALK", "CAR", "CAR"), + activities = Seq( + Act("Home", 1.1, 1.1), + Act("Shopping"), + Act("Other"), + Act("Work", 1.2, 1.2), + Act("Meal"), + Act("Work", 1.2, 1.2), + Act("Shopping"), + Act("Home", 1.1, 1.1) + ) + ) + + val processedPlans = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plans) + val processedTrips = HOVModeTransformer.splitToTrips(processedPlans).toArray + + val tripsModes = processedTrips.map(_.flatMap(_.legMode)) + + tripsModes.head shouldBe Seq("car_hov2", "car_hov2", "car_hov2", "WALK", "WALK", "CAR", "CAR") + } + + test("trip must not contain hov_car when car is lost on the go") { + val plans = newTrip( + 1, + 1, + modes = Seq("HOV2", "HOV2", "HOV3", "WALK", "WALK", "CAR", "CAR"), + activities = Seq( + Act("Home", 1.1, 1.1), + Act("Shopping"), + Act("Other"), + Act("Work", 1.2, 1.2), + Act("Meal"), + Act("Other", 1.3, 1.3), + Act("Shopping"), + Act("Home", 1.1, 1.1) + ) + ) + + val processedPlans = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plans) + val processedTrips = HOVModeTransformer.splitToTrips(processedPlans).toArray + + val tripsModes = processedTrips.map(_.flatMap(_.legMode)) + tripsModes.head shouldBe Seq( + "hov2_teleportation", + "hov2_teleportation", + "hov3_teleportation", + "WALK", + "WALK", + "CAR", + "CAR" + ) + } + + test("must correctly handle two persons from one household with driver being a second one") { + val activities = Seq(Act("Home", 1.1, 1.1), Act("Shopping"), Act("Work", 1.2, 1.2), Act("Home", 1.1, 1.1)) + val plans = + newTrip(1, 1, modes = Seq("HOV2", "WALK", "HOV2"), activities = activities) ++ + newTrip(2, 1, modes = Seq("HOV2", "CAR", "HOV2"), activities = activities) + + val processedPlans = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plans) + processedPlans.flatMap(_.legMode).toList shouldBe List( + "hov2_teleportation", + "WALK", + "hov2_teleportation", + "car_hov2", + "CAR", + "car_hov2" + ) + } + + test("balance teleportation and car modes") { + val plans = newTrip( + 1, + 1, + modes = Seq("HOV3", "HOV3", "WALK"), + activities = Seq(Act("Home", 1.1, 1.1), Act("Shopping", 2.0, 2.0), Act("Work", 1.2, 1.2), Act("Home", 1.1, 1.1)) + ) ++ newTrip( + 2, + 1, + modes = Seq("HOV3", "HOV3", "WALK"), + activities = Seq(Act("Home", 1.1, 1.1), Act("Shopping", 2.0, 2.0), Act("Work", 1.2, 1.2), Act("Home", 1.1, 1.1)) + ) ++ newTrip( + 3, + 1, + modes = Seq("HOV3", "HOV3", "CAR"), + activities = Seq(Act("Home", 1.1, 1.1), Act("Shopping", 2.0, 2.0), Act("Work", 1.2, 1.2), Act("Home", 1.1, 1.1)) + ) + + val processedPlans = HOVModeTransformer.transformHOVtoHOVCARorHOVTeleportation(plans) + processedPlans.flatMap(_.legMode).toList shouldBe List( + "hov3_teleportation", + "hov3_teleportation", + "WALK", + "hov3_teleportation", + "hov3_teleportation", + "WALK", + "car_hov3", + "car_hov3", + "CAR" + ) + } +} + +object HOVModeTransformerTest { + + private val random = new Random() +// +// def newPerson(personId: Int, householdId: Int): PersonInfo = +// PersonInfo(PersonId(personId.toString), HouseholdId(householdId.toString), 0, 33, List(), isFemale = false, 42.0) +// +// def newHousehold(householdId: Int, numberOfCars: Int): HouseholdInfo = +// HouseholdInfo(HouseholdId(householdId.toString), numberOfCars, 90000.0, 10000.0, 20000.0) + + def newTrip( + personId: Int, + startIndex: Int, + mode: String, + activity1: Act = Act("Home"), + activity2: Act = Act("Shopping") + ): Iterable[PlanElement] = Seq( + newActivity(personId, startIndex, activity1), + newLeg(personId, startIndex + 1, mode), + newActivity(personId, startIndex + 2, activity2), + newLeg(personId, startIndex + 3, mode), + newActivity(personId, startIndex + 4, activity1) + ) + + def newTrip( + personId: Int, + startIndex: Int, + modes: Iterable[String], + activities: Iterable[Act] + ): Iterable[PlanElement] = { + val firstActivity: PlanElement = newActivity(personId, startIndex, activities.head) + val theRest = modes + .zip(activities.tail) + .flatMap { case (mode, act) => + Seq(newLeg(personId, startIndex + 1, mode), newActivity(personId, startIndex + 2, act)) + } + .toSeq + + firstActivity +: theRest + } + + def newLeg(personId: Int, planIndex: Int, mode: String): PlanElement = PlanElement( + PersonId(personId.toString), + 0, + 0.0, + planSelected = true, + PlanElement.Leg, + planIndex, + None, + None, + None, + None, + Some(mode), + None, + None, + None, + None, + None, + None, + None, + List(), + None + ) + + def newActivity(personId: Int, planIndex: Int, act: Act): PlanElement = + PlanElement( + PersonId(personId.toString), + 0, + 0.0, + planSelected = true, + PlanElement.Activity, + planIndex, + Some(act.activity), + Some(act.locationX), + Some(act.locationY), + Some(10.0), + None, + None, + None, + None, + None, + None, + None, + None, + List(), + None + ) + + case class Act(activity: String, locationX: Double = random.nextDouble(), locationY: Double = random.nextDouble()) +} diff --git a/test/input/beamville/beam.conf b/test/input/beamville/beam.conf index e04ada0fe7b..071ba4ed9ff 100755 --- a/test/input/beamville/beam.conf +++ b/test/input/beamville/beam.conf @@ -218,6 +218,32 @@ beam.physsim.linkStatsWriteInterval = 0 # The remaining params customize how events are written to output files beam.outputs.events.fileOutputFormats = "csv,xml" # valid options: xml(.gz) , csv(.gz), none - DEFAULT: csv.gz +beam.agentsim.chargingNetworkManager { + timeStepInSeconds = 300 + chargingPointCountScalingFactor = 1.0 + chargingPointCostScalingFactor = 1.0 + scaleUp { + enabled = true + expansionFactor_home_activity = 10.0 + expansionFactor_work_activity = 10.0 + expansionFactor_charge_activity = 10.0 + expansionFactor_wherever_activity = 10.0 + expansionFactor_init_activity = 10.0 + } + helics { + connectionEnabled = false + feedbackEnabled = false + coreInitString = "--federates=1 --broker_address=tcp://127.0.0.1" + coreType = "zmq" + timeDeltaProperty = 1.0 + intLogLevel = 1 + federateName = "beamFederate" + dataOutStreamPoint = "chargingLoad" + dataInStreamPoint = "beam_to_pydss_federate/pubs_power_limit_and_lpm_control" + bufferSize = 10000000 + } +} + # Events Writing Logging Levels: beam.outputs.events.eventsToWrite = "PersonDepartureEvent,PersonArrivalEvent,ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent" beam.outputs.stats.binSize = 3600 diff --git a/test/input/beamville/vehicleTypes.csv b/test/input/beamville/vehicleTypes.csv index ce833be49f3..2978643caf8 100644 --- a/test/input/beamville/vehicleTypes.csv +++ b/test/input/beamville/vehicleTypes.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7f292bb40133827a8d38e6cca73843158560e928f9725d8831c188af7baef1a7 -size 1955 +oid sha256:798c32e7d58c7e7ee6923da484f90c02a55fd23b8da2cb796c3a5cbe781f2ac3 +size 2027 From b9041ecd5da52e2aca25e72ca0d86db25d2c03eb Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 16 Nov 2021 22:19:44 -0800 Subject: [PATCH 003/307] another merge with develop --- .gitignore | 2 - .gitmodules | 16 ++++ AMI_Cleanup.py | 2 +- aws/build.gradle | 8 +- .../python/beam_lambda/lambda_function.py | 90 ++++++++++++++++--- .../main/python/runPilates/lambda_function.py | 22 ++++- build.gradle | 8 +- docs/developers.rst | 67 +++++++++----- nersc/build.gradle | 4 +- nersc/src/main/bash/run_beam_on_nersc.sh | 4 + nersc/src/main/docker/entrypoint.sh | 12 +++ .../python/gemini/beam_pydss_processing.py | 2 +- 12 files changed, 193 insertions(+), 44 deletions(-) create mode 100644 .gitmodules diff --git a/.gitignore b/.gitignore index 2ad8204ab42..2655be93f77 100755 --- a/.gitignore +++ b/.gitignore @@ -56,5 +56,3 @@ src/main/scala/beam/sandbox test/scala/beam/sandbox log-path_IS_UNDEFINED/ .Rproj.user -/prepare_for_pack/production/sfbay/gemini/ -/prepare_for_pack/production.zip diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..a34cbc61d00 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,16 @@ +[submodule "production/austin"] + path = production/austin + url = git@github.com:LBNL-UCB-STI/beam-data-austin.git + branch = develop +[submodule "production/sfbay"] + path = production/sfbay + url = git@github.com:LBNL-UCB-STI/beam-data-sfbay.git + branch = develop +[submodule "production/detroit"] + path = production/detroit + url = git@github.com:LBNL-UCB-STI/beam-data-detroit.git + branch = develop +[submodule "production/newyork"] + path = production/newyork + url = git@github.com:LBNL-UCB-STI/beam-data-newyork.git + branch = develop diff --git a/AMI_Cleanup.py b/AMI_Cleanup.py index 242cb872ba9..b55cd609379 100644 --- a/AMI_Cleanup.py +++ b/AMI_Cleanup.py @@ -40,7 +40,7 @@ def backup_and_retrieve_config_and_delete_old_backup(): def get_tagged_amis_along_with_most_recent(region): ec2 = get_ec2_for(region) - amis = ec2.describe_images(Owners=['self']) + amis = ec2.describe_images(Owners=['self'],Filters=[{'Name':'name','Values':['beam-automation-*']}]) allAMIs = [] newestAMI = None for ami in amis['Images']: diff --git a/aws/build.gradle b/aws/build.gradle index 2e732be7aa9..aebb918f27d 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -79,12 +79,14 @@ task deploy(type: AWSLambdaInvokeTask) { def tempInstanceType = "${ext.getParameterValue('instanceType') ?: (project.hasProperty('defaultInstanceType') ? defaultInstanceType : '')}" def finalInstanceType = tempInstanceType != "" ? tempInstanceType : null + def dataBranch = "${ext.getParameterValue('dataBranch') ?: 'develop'}" def pload = """{ "title": "${ext.getParameterValue('runName') + '_' + getCurrentGitUserEmail()}", "git_user_email": "${getCurrentGitUserEmail()}", "deploy_type_tag": "${ext.getParameterValue('deployTypeTag')}", "branch": "${ext.getParameterValue('beamBranch') ?: getCurrentGitBranch()}", + "dataBranch": "$dataBranch", "commit": "${ext.getParameterValue('beamCommit') ?: 'HEAD'}", "deploy_mode": "${ext.getParameterValue('deployMode')}", "configs": "${ext.getParameterValue('beamConfigs') ?: ext.getParameterValue(getCurrentGitBranch() + '.configs')}", @@ -110,6 +112,7 @@ task deploy(type: AWSLambdaInvokeTask) { "max_memory": ${ext.getParameterValue('maxMemory') ?: 0} }""" payload = pload + println "Using data branch $dataBranch" println payload println "Please note that if you set isSpot to true then it could take an excessive time period. In fact it could time out at 15 minutes and still complete later on. ALSO! volumes using spot instances must be MANUALLY deleted. This is done so you do not lose data in the case of a premature shutdown." functionName = "simulateBeam" @@ -144,13 +147,14 @@ task deployPilates(type: AWSLambdaInvokeTask) { defaultParamVals['region'] = defRegion defaultParamVals['dataRegion'] = defRegion defaultParamVals['beamBranch'] = getCurrentGitBranch() + defaultParamVals['dataBranch'] = 'develop' def paramMap = [:] def missing = [] // all possible parameters ['runName', 'pilatesScenarioName', - 'beamBranch', 'beamCommit', + 'beamBranch', 'dataBranch', 'beamCommit', 'beamConfig', 'startYear', 'countOfYears', 'beamItLen', 'urbansimItLen', 'initialS3UrbansimInput', 'initialS3UrbansimOutput', 'initialSkimPath', @@ -173,6 +177,8 @@ task deployPilates(type: AWSLambdaInvokeTask) { println("parameters wasn't specified: " + missing.join(', ')) + println "Using data branch ${paramMap['dataBranch']}" + // create a string with json object which contains all parameters def pload = "{\n" + paramMap.collect { key, val -> " \"$key\": \"$val\"" }.join(",\n") + "\n}" diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index cf9de560d94..18a2e19a6a2 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -7,6 +7,27 @@ import base64 from botocore.errorfactory import ClientError +HELICS_RUN = '''sudo /home/ubuntu/install-and-run-helics-scripts.sh + - cd /home/ubuntu/git/beam + - ''' + +HELICS_OUTPUT_MOVE_TO_BEAM_OUTPUT = ''' + - opth="output" + - echo $opth + - finalPath="" + - for file in $opth/*; do + - for path2 in $file/*; do + - finalPath="$path2"; + - done; + - done; + - finalPath="${finalPath}/helics_output" + - mkdir "$finalPath" + - sudo mv /home/ubuntu/git/beam/src/main/python/gemini/*.log "$finalPath" + - sudo mv /home/ubuntu/git/beam/src/main/python/gemini/recording_output.txt "$finalPath" + - cd "$finalPath" + - sudo gzip -9 * + - cd - ''' + CONFIG_SCRIPT = '''./gradlew --stacktrace :run -PappArgs="['--config', '$cf']" -PmaxRAM=$MAX_RAM -Pprofiler_type=$PROFILER''' CONFIG_SCRIPT_WITH_GRAFANA = '''sudo ./gradlew --stacktrace grafanaStart @@ -16,8 +37,6 @@ EXPERIMENT_SCRIPT = '''./bin/experiment.sh $cf cloud''' -HEALTH_ANALYSIS_SCRIPT = 'python3 src/main/python/general_analysis/simulation_health_analysis.py' - S3_PUBLISH_SCRIPT = ''' - sleep 10s - opth="output" @@ -42,6 +61,8 @@ BRANCH_DEFAULT = 'master' +DATA_BRANCH_DEFAULT = 'develop' + COMMIT_DEFAULT = 'HEAD' MAXRAM_DEFAULT = '2g' @@ -70,6 +91,28 @@ - content: | 0 * * * * curl -X POST -H "Content-type: application/json" --data '"'"'{"$(ec2metadata --instance-type) instance $(ec2metadata --instance-id) running... \\n Batch [$UID] completed and instance of type $(ec2metadata --instance-type) is still running in $REGION since last $(($(($(date +%s) - $(cat /tmp/.starttime))) / 3600)) Hour $(($(($(date +%s) - $(cat /tmp/.starttime))) / 60)) Minute."}'"'" path: /tmp/slack_notification + - content: | + #!/bin/bash + pip install helics==2.7.1 + pip install helics-apps==2.7.1 + cd /home/ubuntu/git/beam/src/main/python + sudo chown ubuntu:ubuntu -R gemini + cd - + cd /home/ubuntu/git/beam/src/main/python/gemini + now="$(date +"%Y_%m_%d_%I_%M_%p")" + python beam_pydss_broker.py > output_${now}_broker.log & + echo "broker started" + sleep 5s + python beam_to_pydss_federate.py > output_${now}_federate.log & + echo "federate started" + sleep 5s + helics_recorder beam_recorder.txt --output=recording_output.txt > output_${now}_recorder.log & + echo "recorder started" + sleep 5s + cd - + path: /home/ubuntu/install-and-run-helics-scripts.sh + + runcmd: - ln -sf /var/log/cloud-init-output.log /home/ubuntu/git/beam/cloud-init-output.log - echo "-------------------Starting Beam Sim----------------------" @@ -89,6 +132,7 @@ \\"host_name\\":\\"%s\\", \\"browser\\":\\"http://%s:8000\\", \\"branch\\":\\"$BRANCH\\", + \\"data_branch\\":\\"$DATA_BRANCH\\", \\"region\\":\\"$REGION\\", \\"batch\\":\\"$UID\\", \\"commit\\":\\"$COMMIT\\", @@ -102,6 +146,7 @@ }" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname)) - echo $start_json - chmod +x /tmp/slack.sh + - chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - echo "notification sent..." - echo "notification saved..." - crontab /tmp/slack_notification @@ -115,6 +160,20 @@ - echo "git checkout -qf ..." - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout -qf $COMMIT + - production_data_submodules=$(git submodule | awk '{ print $2 }') + - for i in $production_data_submodules + - do + - for cf in $CONFIG + - do + - case $cf in + - '*$i*)' + - echo "Loading remote production data for $i" + - git config submodule.$i.branch $DATA_BRANCH + - git submodule update --init --remote $i + - esac + - done + - done + - 'echo "gradlew assemble: $(date)"' - ./gradlew assemble - echo "looping config ..." @@ -133,11 +192,13 @@ - $RUN_SCRIPT - done - echo "-------------------running Health Analysis Script----------------------" - - $HEALTH_ANALYSIS_SCRIPT + - python3 src/main/python/general_analysis/simulation_health_analysis.py - while IFS="," read -r metric count - do - export $metric=$count - done < RunHealthAnalysis.txt + + - curl -H "Authorization:Bearer $SLACK_TOKEN" -F file=@RunHealthAnalysis.txt -F initial_comment="Beam Health Analysis" -F channels="$SLACK_CHANNEL" "https://slack.com/api/files.upload" - s3glip="" - if [ "$S3_PUBLISH" = "True" ] - then @@ -157,6 +218,7 @@ \\"host_name\\":\\"%s\\", \\"browser\\":\\"http://%s:8000\\", \\"branch\\":\\"$BRANCH\\", + \\"data_branch\\":\\"$DATA_BRANCH\\", \\"region\\":\\"$REGION\\", \\"batch\\":\\"$UID\\", \\"commit\\":\\"$COMMIT\\", @@ -201,7 +263,7 @@ 'r5d.large', 'r5d.xlarge', 'r5d.2xlarge', 'r5d.4xlarge', 'r5d.12xlarge', 'r5d.24xlarge', 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', 'z1d.large', 'z1d.xlarge', 'z1d.2xlarge', 'z1d.3xlarge', 'z1d.6xlarge', 'z1d.12xlarge', - 'x2gd.16xlarge', 'x2gd.metal'] + 'x2gd.metal', 'x2gd.16xlarge'] regions = ['us-east-1', 'us-east-2', 'us-west-2'] shutdown_behaviours = ['stop', 'terminate'] @@ -559,6 +621,7 @@ def get_param(param_name): return param_value branch = event.get('branch', BRANCH_DEFAULT) + data_branch = event.get('data_branch', DATA_BRANCH_DEFAULT) commit_id = event.get('commit', COMMIT_DEFAULT) deploy_mode = event.get('deploy_mode', 'config') configs = event.get('configs', CONFIG_DEFAULT) @@ -575,6 +638,7 @@ def get_param(param_name): google_api_key = event.get('google_api_key', os.environ['GOOGLE_API_KEY']) end_script = event.get('end_script', END_SCRIPT_DEFAULT) run_grafana = event.get('run_grafana', False) + run_helics = event.get('run_helics', False) profiler_type = event.get('profiler_type', 'null') git_user_email = get_param('git_user_email') @@ -603,11 +667,12 @@ def get_param(param_name): if volume_size < 64 or volume_size > 256: volume_size = 64 - selected_script = "" + selected_script = CONFIG_SCRIPT if run_grafana: selected_script = CONFIG_SCRIPT_WITH_GRAFANA - else: - selected_script = CONFIG_SCRIPT + + if run_helics: + selected_script = HELICS_RUN + selected_script + HELICS_OUTPUT_MOVE_TO_BEAM_OUTPUT params = configs if s3_publish: @@ -641,7 +706,7 @@ def get_param(param_name): if len(params) > 1: runName += "-" + `runNum` script = initscript.replace('$RUN_SCRIPT',selected_script).replace('$REGION',region).replace('$S3_REGION', os.environ['REGION']) \ - .replace('$BRANCH',branch).replace('$COMMIT', commit_id).replace('$CONFIG', arg) \ + .replace('$BRANCH', branch).replace('$DATA_BRANCH', data_branch).replace('$COMMIT', commit_id).replace('$CONFIG', arg) \ .replace('$MAIN_CLASS', execute_class).replace('$UID', uid).replace('$SHUTDOWN_WAIT', shutdown_wait) \ .replace('$TITLED', runName).replace('$MAX_RAM', max_ram).replace('$S3_PUBLISH', str(s3_publish)) \ .replace('$SIGOPT_CLIENT_ID', sigopt_client_id).replace('$SIGOPT_DEV_ID', sigopt_dev_id) \ @@ -649,6 +714,8 @@ def get_param(param_name): .replace('$PROFILER', profiler_type) \ .replace('$END_SCRIPT', end_script) \ .replace('$SLACK_HOOK_WITH_TOKEN', os.environ['SLACK_HOOK_WITH_TOKEN']) \ + .replace('$SLACK_TOKEN', os.environ['SLACK_TOKEN']) \ + .replace('$SLACK_CHANNEL', os.environ['SLACK_CHANNEL']) \ .replace('$SHEET_ID', os.environ['SHEET_ID']) if is_spot: min_cores = event.get('min_cores', 0) @@ -659,10 +726,13 @@ def get_param(param_name): else: instance_id = deploy(script, instance_type, region.replace("-", "_")+'_', shutdown_behaviour, runName, volume_size, git_user_email, deploy_type_tag) host = get_dns(instance_id) - txt = txt + 'Started batch: {batch} with run name: {titled} for branch/commit {branch}/{commit} at host {dns} (InstanceID: {instance_id}). '.format(branch=branch, titled=runName, commit=commit_id, dns=host, batch=uid, instance_id=instance_id) + txt += 'Started batch: {batch} with run name: {titled} for branch/commit {branch}/{commit} at host {dns} (InstanceID: {instance_id}). '.format(branch=branch, titled=runName, commit=commit_id, dns=host, batch=uid, instance_id=instance_id) if run_grafana: - txt = txt + 'Grafana will be available at http://{dns}:3003/d/dvib8mbWz/beam-simulation-global-view'.format(dns=host) + txt += ' Grafana will be available at http://{dns}:3003/d/dvib8mbWz/beam-simulation-global-view.'.format(dns=host) + + if run_helics: + txt += ' Helics scripts with recorder will be run in parallel with BEAM.' runNum += 1 else: diff --git a/aws/src/main/python/runPilates/lambda_function.py b/aws/src/main/python/runPilates/lambda_function.py index 92580c58511..4719d6c7139 100644 --- a/aws/src/main/python/runPilates/lambda_function.py +++ b/aws/src/main/python/runPilates/lambda_function.py @@ -37,6 +37,7 @@ # "data_region": s3 data region which is used when copying from s3 and writing to s3 buckets; # "branch": git branch; # "commit": git commit; +# "data_branch": data branch; # "s3_path": s3 path to output folder started with double slash; # "title": used as instance name only; # "start_year": pilates simulation start year; @@ -93,6 +94,7 @@ \\"data_region\\":\\"$S3_DATA_REGION\\", \\"branch\\":\\"$BRANCH\\", \\"commit\\":\\"$COMMIT\\", + \\"data_branch\\":\\"$DATA_BRANCH\\", \\"title\\":\\"$TITLED\\", \\"start_year\\":\\"$START_YEAR\\", \\"count_of_years\\":\\"$COUNT_OF_YEARS\\", @@ -143,6 +145,21 @@ - git fetch - echo "git checkout for branch $BRANCH ..." - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH + + - production_data_submodules=$(git submodule | awk '{ print $2 }') + - for i in $production_data_submodules + - do + - for cf in $CONFIG + - do + - case $cf in + - '*$i*)' + - echo "Loading remote production data for $i" + - git config submodule.$i.branch $DATA_BRANCH + - git submodule update --init --remote $i + - esac + - done + - done + - sudo git pull - sudo git lfs pull - echo "git checkout -qf for commit $COMMIT ..." @@ -225,8 +242,7 @@ 'r5.large', 'r5.xlarge', 'r5.2xlarge', 'r5.4xlarge', 'r5.12xlarge', 'r5.24xlarge', 'r5d.large', 'r5d.xlarge', 'r5d.2xlarge', 'r5d.4xlarge', 'r5d.12xlarge', 'r5d.24xlarge', 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', - 'z1d.large', 'z1d.xlarge', 'z1d.2xlarge', 'z1d.3xlarge', 'z1d.6xlarge', 'z1d.12xlarge', - 'x2gd.16xlarge', 'x2gd.metal'] + 'z1d.large', 'z1d.xlarge', 'z1d.2xlarge', 'z1d.3xlarge', 'z1d.6xlarge', 'z1d.12xlarge'] regions = ['us-east-1', 'us-east-2', 'us-west-2'] shutdown_behaviours = ['stop', 'terminate'] @@ -319,6 +335,7 @@ def get_param(param_name): initial_urbansim_input = get_param('initialS3UrbansimInput') branch = get_param('beamBranch') commit_id = get_param('beamCommit') + data_branch = get_param('dataBranch') start_year = get_param('startYear') count_of_years = get_param('countOfYears') @@ -406,6 +423,7 @@ def get_param(param_name): .replace('$IN_YEAR_OUTPUT', in_year_output) \ .replace('$PILATES_IMAGE_NAME', pilates_image_name) \ .replace('$BRANCH', branch).replace('$COMMIT', commit_id).replace('$CONFIG', config) \ + .replace('$DATA_BRANCH', data_branch) \ .replace('$SHUTDOWN_WAIT', shutdown_wait) \ .replace('$SHUTDOWN_BEHAVIOUR', shutdown_behaviour) \ .replace('$STORAGE_SIZE', str(volume_size)) \ diff --git a/build.gradle b/build.gradle index af7218c00d4..1e461143ec3 100755 --- a/build.gradle +++ b/build.gradle @@ -175,7 +175,7 @@ dependencies { implementation('com.github.LBNL-UCB-STI:or-tools-wrapper:7.5-0') { exclude group: 'com.google.protobuf', module: 'protobuf-java' } - implementation 'com.github.LBNL-UCB-STI:helics-wrapper:v2.6.1' + implementation 'com.github.LBNL-UCB-STI:helics-wrapper:v2.6.2' // GPLv3 implementation group: 'org.matsim.contrib', name: 'multimodal', version: '0.10.0' @@ -663,7 +663,6 @@ task createDockerfile(type: Dockerfile, dependsOn: dockerSyncBuildContext) { copyFile("resources", "resources") copyFile("classes", "classes") // Test scenarios - copyFile("production", "production") copyFile("test/input/common", "test/input/common") copyFile("test/input/dtd", "test/input/dtd") copyFile("test/input/beamville", "test/input/beamville") @@ -679,7 +678,7 @@ task buildImageWithoutTags(type: DockerBuildImage, dependsOn: createDockerfile) task buildImage(type: DockerTagImage, dependsOn: buildImageWithoutTags) { repository = "beammodel/beam" - tag = 'production-gemini-develop-4' + tag = version targetImageId buildImageWithoutTags.getImageId() } @@ -687,9 +686,6 @@ dockerSyncBuildContext { from('src/main/python') { into('src/main/python') } - from('production') { - into('production') - } from('test/input/common') { into('test/input/common') } diff --git a/docs/developers.rst b/docs/developers.rst index 6701b462009..140c61ed6b2 100755 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -103,46 +103,71 @@ Sometimes it is possible to face a timeout issue when trying to push huge files. #. Just push the files as usual -Keeping Production Data out of Master Branch +Production Data And Git Submodules ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Production versus test data. Any branch beginning with "production" or "application" will contain data in the "production/" subfolder. This data should stay in that branch and not be merged into master. To keep the data out, the easiest practice is to simply keep merges one-way from master into the production branch and not vice versa. +Production data is located in separate git repositories each scenario in its own repo. -However, sometimes troubleshooting / debugging / development happens on a production branch. The cleanest way to get changes to source code or other non-production files back into master is the following. +Separation of production data and code is needed for: -Checkout your production branch:: +1. Reducing the git repository size for developers +2. Easier addition or changing production data without merging back into develop code changes +3. Ability to use any production data with any code branch/commit without creation of yet another git production branch - git checkout production-branch -Bring branch even with master:: +These repositories have `beam-data-` prefix, e.g `beam-data-sfbay` - git merge master +They are linked back to the parent repo by `git submodules `_. For example sfbay is mapped to `production/sfbay`. -Resolve conflicts if needed +When you clone a parent project, by default you get the production data directories that contain submodules, but none of the files within them. +To fetch production data manually type:: -Capture the files that are different now between production and master:: + git submodule update --init --remote production/sfbay - git diff --name-only HEAD master > diff-with-master.txt +(replace `sfbay` with other scenario if needed) -You have created a file "diff-with-master.txt" containing a listing of every file that is different. +If you don't need the production data anymore and want to remove it locally you can run:: -IMPORTANT!!!! -- Edit the file diff-with-master.txt and remove all production-related data (this typically will be all files underneath "production" sub-directory. + git submodule deinit production/sfbay -Checkout master:: +or:: - git checkout master + git submodule deinit --all -Create a new branch off of master, this is where you will stage the files to then merge back into master:: +to remove all production data. - git checkout -b new-branch-with-changes-4ci +Note that if you locally fetch the submodule then it will update the submodule pointer to the latest submodule commit. +That will result in a git change. -Do a file by file checkout of all differing files from production branch onto master:: +for example, the output of `git status` will be something like that:: - cat diff-with-master.txt | xargs git checkout production-branch -- + Changes not staged for commit: + (use "git add ..." to update what will be committed) + (use "git restore ..." to discard changes in working directory) + modified: production/sfbay (new commits) -Note, if any of our diffs include the deletion of a file on your production branch, then you will need to remove (i.e. with "git remove" these before you do the above "checkout" step and you should also remove them from the diff-with-master.txt"). If you don't do this, you will see an error message ("did not match any file(s) known to git.") and the checkout command will not be completed. +It is safe to either add this change with `git add` and commit it or drop it with `git reset`. It doesn't matter since we +always fetch the latest commit in submodule. -Finally, commit the files that were checked out of the production branch, push, and go create your pull request! +Using old production data +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Old production data is still available at branches `production-gemini-develop`, `inm/merge-urbansim-with-detroit` etc. + +If for some reason you need to merge latest changes to these branches please note that there could be a conflict with the +same directory name for example `production/sfbay`. In that case you will need to rename this directory in production branch +to some other name before merging, commit this change and then merge the latest changes from develop. + +Adding new production scenario +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +First create a new repository for the data with beam-data- prefix. + +Then in the main repo type:: + + git submodule add -b develop git@github.com:LBNL-UCB-STI/beam-data-city.git production/city + +replacing `city` with a new scenario name, assuming that repo uses `develop` branch as default one. Automated Cloud Deployment @@ -165,6 +190,7 @@ The command will start an ec2 instance based on the provided configurations and * **runName**: to specify instance name. * **beamBranch**: To specify the branch for simulation, current source branch will be used as default branch. * **beamCommit**: The commit SHA to run simulation. use `HEAD` if you want to run with latest commit, default is `HEAD`. +* **dataBranch**: To specify the data branch (branch on production data repository) for simulation, 'develop' branch will be used as default data branch. * **deployMode**: to specify what type of deploy it will be: config | experiment | execute * **beamConfigs**: A comma `,` separated list of `beam.conf` files. It should be relative path under the project home. You can create branch level defaults by specifying the branch name with `.configs` suffix like `master.configs`. Branch level default will be used if `beamConfigs` is not present. * **beamExperiments**: A comma `,` separated list of `experiment.yml` files. It should be relative path under the project home.You can create branch level defaults same as configs by specifying the branch name with `.experiments` suffix like `master.experiments`. Branch level default will be used if `beamExperiments` is not present. `beamConfigs` has priority over this, in other words, if both are provided then `beamConfigs` will be used. @@ -207,6 +233,7 @@ You need to define the deploy properties that are similar to the ones for AWS de * **runName**: to specify instance name. * **beamBranch**: To specify the branch for simulation, current source branch will be used as default branch. * **beamCommit**: The commit SHA to run simulation. use `HEAD` if you want to run with latest commit, default is `HEAD`. +* **dataBranch**: To specify the branch for production data, 'develop' branch will be used as default branch. * **beamConfigs**: The `beam.conf` file. It should be relative path under the project home. * **s3Backup**: to specify if copying results to s3 bucket is needed, default is `true`. * **region**: Use this parameter to select the AWS region for the run, all instances would be created in specified region. Default `region` is `us-east-2`. diff --git a/nersc/build.gradle b/nersc/build.gradle index 2579677494b..d59596862e4 100644 --- a/nersc/build.gradle +++ b/nersc/build.gradle @@ -49,6 +49,7 @@ task deployToNersc { def runName = "${ext.getParameterValue('runName')}" def git_user_email = "${getCurrentGitUserEmail()}" def branch = "${ext.getParameterValue('beamBranch') ?: getCurrentGitBranch()}" + def dataBranch = "${ext.getParameterValue('dataBranch') ?: 'develop'}" def commit = "${ext.getParameterValue('beamCommit') ?: 'HEAD'}" def configs = "${ext.getParameterValue('beamConfigs') ?: ext.getParameterValue(getCurrentGitBranch() + '.configs')}" def max_ram = '100g' @@ -68,7 +69,7 @@ task deployToNersc { } doLast { - + println "Using data branch ${dataBranch}" ssh.run { session(remotes.nerscLoginNode) { put from: "${project.rootDir}/nersc/src/main/bash/run_beam_on_nersc.sh", into: "run_beam.sh" @@ -76,6 +77,7 @@ task deployToNersc { execute "chmod +x run_beam.sh shifter_job.sh" execute "./run_beam.sh \ --branch='$branch' \ + --data_branch='$dataBranch' \ --revision='$commit' \ --config='$configs' \ --max_ram=$max_ram \ diff --git a/nersc/src/main/bash/run_beam_on_nersc.sh b/nersc/src/main/bash/run_beam_on_nersc.sh index 1ac71ee836d..e9d2216a63f 100644 --- a/nersc/src/main/bash/run_beam_on_nersc.sh +++ b/nersc/src/main/bash/run_beam_on_nersc.sh @@ -7,6 +7,9 @@ while [ $# -gt 0 ]; do --branch=*) beam_branch_name="${1#*=}" ;; + --data_branch=*) + beam_data_branch_name="${1#*=}" + ;; --revision=*) beam_revision="${1#*=}" ;; @@ -39,6 +42,7 @@ while [ $# -gt 0 ]; do done export BEAM_BRANCH_NAME=$beam_branch_name \ +export BEAM_DATA_BRANCH_NAME=$beam_data_branch_name \ export BEAM_COMMIT_SHA=$beam_revision \ export BEAM_CONFIG=$beam_config \ export MAXRAM=$max_ram \ diff --git a/nersc/src/main/docker/entrypoint.sh b/nersc/src/main/docker/entrypoint.sh index bea7aaeae52..41257346b22 100644 --- a/nersc/src/main/docker/entrypoint.sh +++ b/nersc/src/main/docker/entrypoint.sh @@ -4,6 +4,18 @@ cd /app/sources git clone --single-branch --branch $BEAM_BRANCH_NAME https://github.com/LBNL-UCB-STI/beam.git cd ./beam git reset --hard $BEAM_COMMIT_SHA + +production_data_submodules=$(git submodule | awk '{ print $2 }') +for i in $production_data_submodules + do + case $BEAM_CONFIG in + '*$i*)' + echo "Loading remote production data for $i" + git config submodule.$i.branch $BEAM_DATA_BRANCH_NAME + git submodule update --init --remote $i + esac + done + git lfs pull #we shouldn't use the gradle daemon on NERSC, it seems that it's somehow shared within different nodes diff --git a/src/main/python/gemini/beam_pydss_processing.py b/src/main/python/gemini/beam_pydss_processing.py index 164808c49aa..c8288f4b184 100644 --- a/src/main/python/gemini/beam_pydss_processing.py +++ b/src/main/python/gemini/beam_pydss_processing.py @@ -1,6 +1,6 @@ import os -basefolder = "" +basefolder = "~/Data/GEMINI/2021March22/370k-warmstart/output" beamLog_out = "{}/beamLog.out".format(basefolder) beamLog_out_csv = "{}/beamLog.csv".format(basefolder) file1 = open(beamLog_out, 'r') From 3eeef9c40d7f74d925c0d69a834eb65ab3bcd516 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 16 Nov 2021 22:21:30 -0800 Subject: [PATCH 004/307] more merge --- gradle.deployPILATES.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle.deployPILATES.properties b/gradle.deployPILATES.properties index 31c13315c5c..67bb11052bb 100644 --- a/gradle.deployPILATES.properties +++ b/gradle.deployPILATES.properties @@ -15,8 +15,9 @@ beamConfig=production/sfbay/smart/smart-baseline-pilates-small-test.conf # git parameters # if branch not specified, then current branch be used -beamBranch=production-sfbay-develop +beamBranch=develop beamCommit=HEAD +dataBranch=develop instanceType=t2.small From 58c3de4b1eb1cd65df8551a9f9060da789f7614c Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 22 Nov 2021 17:44:54 -0800 Subject: [PATCH 005/307] fix data branch --- gradle.deploy.properties | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/gradle.deploy.properties b/gradle.deploy.properties index 598e77b847f..382016a9713 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -1,24 +1,18 @@ runName=gemini-scenario-4-unconstrained beamBranch=production-gemini-develop beamCommit=73d395d52fda28b60308ad07abbb40aa5bcd7b9e - +dataBranch=beam-data-sfbay beamConfigs=production/sfbay/gemini/gemini-2035-18k-FREIGHT.conf - instanceType=r5d.24xlarge -#instanceType=m5.24xlarge - -maxRAM=740g # shutdownBehaviour = stop | terminate shutdownBehaviour=terminate s3Backup=true -runHelics=false +maxRAM=740g # storageSize (in GiB) = any number between 64 and 256 storageSize=256 +runHelics=false - -#c5.18xlarge (72/144) -> 5 -> $3.06 per Hour -#m5.24xlarge (96/384) -> 2 -> $4.608 per Hour #r5.8xlarge (32/256) #c5.9xlarge (36/72) -> 5 instances -> $1.53 per Hour #m4.10xlarge (40/160) -> 5 -> $2.00 per Hour @@ -27,10 +21,12 @@ storageSize=256 #m4.16xlarge (64/256) -> 20 -> $3.20 per Hour #r5.12xlarge (48/384) -> 3 -> $3.024 per Hour +#c5.18xlarge (72/144) -> 5 -> $3.06 per Hour #c5d.18xlarge (72/144) -> 5 -> $3.456 per Hour #r5d.12xlarge (48/384) -> 3 -> $3.456 per Hour #h1.16xlarge (64/256) -> 1 -> $3.744 per Hour +#m5.24xlarge (96/384) -> 2 -> $4.608 per Hour #i3.16xlarge (64/488) -> 1 -> $4.992 per Hour #i3.metal (72/512) -> 5 -> $4.992 per Hour From 98ca46b2ac41c7d5f711dcea7818f103625aa530 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 24 Dec 2021 00:37:58 -0800 Subject: [PATCH 006/307] charging at start of iteration in Residential stalls for households --- .../agents/household/HouseholdActor.scala | 5 +- .../household/HouseholdFleetManager.scala | 44 ++++++-- .../InfrastructureFunctions.scala | 1 + .../infrastructure/ParkingStall.scala | 8 +- .../infrastructure/parking/ParkingZone.scala | 6 +- .../parking/ParkingZoneSearch.scala | 1 + .../scala/beam/integration/ChargingSpec.scala | 100 ++++++++++++------ 7 files changed, 118 insertions(+), 47 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index 130d1e28d47..9085a6a8a56 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -25,6 +25,7 @@ import beam.agentsim.agents.vehicles.{ VehicleManager } import beam.agentsim.events.SpaceTime +import beam.agentsim.infrastructure.ChargingNetworkManager._ import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.HasTriggerId @@ -193,10 +194,10 @@ object HouseholdActor { case TriggerWithId(InitializeTrigger(tick), triggerId) => val vehiclesByCategory = vehicles.filter(_._2.beamVehicleType.automationLevel <= 3).groupBy(_._2.beamVehicleType.vehicleCategory) - val fleetManagers = vehiclesByCategory.map { case (category, vs) => + val fleetManagers = vehiclesByCategory.map { case (category, vehiclesInCategory) => val fleetManager = context.actorOf( - Props(new HouseholdFleetManager(parkingManager, vs, homeCoord, beamServices.beamConfig.beam.debug)), + Props(new HouseholdFleetManager(parkingManager, chargingNetworkManager, household, vehiclesInCategory, homeCoord, beamServices.beamConfig.beam.debug)), category.toString ) context.watch(fleetManager) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 827ae354bfd..ed2b998b75f 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -1,5 +1,5 @@ package beam.agentsim.agents.household - +import beam.agentsim.infrastructure.ChargingNetworkManager.ChargingPlugRequest import java.util.concurrent.TimeUnit import akka.actor.Status.{Failure, Success} import akka.actor.ActorRef @@ -18,7 +18,7 @@ import beam.agentsim.agents.household.HouseholdActor.{ } import beam.agentsim.agents.household.HouseholdFleetManager.ResolvedParkingResponses import beam.agentsim.agents.modalbehaviors.DrivesVehicle.ActualVehicle -import beam.agentsim.agents.vehicles.BeamVehicle +import beam.agentsim.agents.vehicles.{BeamVehicle,VehicleManager} import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.CompletionNotice @@ -28,11 +28,14 @@ import beam.sim.config.BeamConfig.Beam.Debug import beam.utils.logging.{ExponentialLazyLogging, LoggingMessageActor} import beam.utils.logging.pattern.ask import org.matsim.api.core.v01.{Coord, Id} +import org.matsim.households.Household import scala.concurrent.{ExecutionContext, Future} class HouseholdFleetManager( parkingManager: ActorRef, + chargingNetworkManager: ActorRef, + household: Household, vehicles: Map[Id[BeamVehicle], BeamVehicle], homeCoord: Coord, implicit val debug: Debug @@ -54,19 +57,44 @@ class HouseholdFleetManager( veh.spaceTime = SpaceTime(homeCoord.getX, homeCoord.getY, 0) veh.setMustBeDrivenHome(true) veh.useParkingStall(resp.stall) + if (resp.stall.chargingPointType.isDefined) { + chargingNetworkManager ! ChargingPlugRequest( + 0, veh, resp.stall, + // use first household member id as stand-in. + household.getMemberIds().get(0), + triggerId + ) + } + self ! ReleaseVehicleAndReply(veh, triggerId = triggerId) } triggerSender.foreach(actorRef => actorRef ! CompletionNotice(triggerId, Vector())) case TriggerWithId(InitializeTrigger(_), triggerId) => triggerSender = Some(sender()) - val listOfFutures: List[Future[(Id[BeamVehicle], ParkingInquiryResponse)]] = vehicles.toList.map { case (id, _) => - (parkingManager ? ParkingInquiry.init(SpaceTime(homeCoord, 0), "init", triggerId = triggerId)) - .mapTo[ParkingInquiryResponse] - .map { r => - (id, r) + + val listOfFutures: + List[Future[(Id[BeamVehicle], ParkingInquiryResponse)]] = + // Request that all household vehicles be parked at the home coordinate. If the vehicle is an EV, + // send the request to the charging manager. Otherwise send request to the parking manager. + vehicles.toList.map { case (id, vehicle) => + if (vehicle.isBEV | vehicle.isPHEV) { + (chargingNetworkManager ? ParkingInquiry.init(SpaceTime(homeCoord, 0), + "init", + VehicleManager.getReservedFor(vehicle.vehicleManagerId.get).get, + beamVehicle = Option(vehicle), triggerId = triggerId)) + .mapTo[ParkingInquiryResponse] + .map ( r => + (id, r) + ) + } else { + (parkingManager ? ParkingInquiry.init(SpaceTime(homeCoord, 0), "init", triggerId = triggerId)) + .mapTo[ParkingInquiryResponse] + .map { r => + (id, r) + } + } } - } val futureOfList = Future.sequence(listOfFutures) val response = futureOfList.map(ResolvedParkingResponses(triggerId, _)) response.pipeTo(self) diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 9932dd35cb2..1f4c1dc8a19 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -161,6 +161,7 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( val result = processParkingZoneSearchResult( inquiry, ParkingZoneSearch.incrementalParkingZoneSearch( + // inquiry, parkingZoneSearchConfiguration, parkingZoneSearchParams, parkingZoneFilterFunction, diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingStall.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingStall.scala index 107d4e7103d..5584b9110c4 100755 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingStall.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingStall.scala @@ -107,14 +107,16 @@ object ParkingStall { */ def defaultResidentialStall( locationUTM: Location, - defaultGeoId: Id[_] + defaultGeoId: Id[_], + parkingZoneId: Id[ParkingZoneId] = Id.create("default", classOf[ParkingZoneId]), + chargingPointType: Option[ChargingPointType] = None ): ParkingStall = ParkingStall( geoId = defaultGeoId, tazId = TAZ.DefaultTAZId, - parkingZoneId = ParkingZone.DefaultParkingZoneId, + parkingZoneId = parkingZoneId, locationUTM = locationUTM, costInDollars = 0.0, - chargingPointType = None, + chargingPointType = chargingPointType, pricingModel = Some { PricingModel.FlatFee(0) }, parkingType = ParkingType.Residential, reservedFor = VehicleManager.AnyManager diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZone.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZone.scala index df32043d130..0ed25d49cd5 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZone.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZone.scala @@ -122,14 +122,16 @@ object ParkingZone extends LazyLogging { def defaultInit[GEO]( geoId: Id[GEO], parkingType: ParkingType, - numStalls: Int + numStalls: Int, + chargingPointType: Option[ChargingPointType] = None ): ParkingZone[GEO] = { init[GEO]( Some(DefaultParkingZoneId), geoId, parkingType, VehicleManager.AnyManager, - numStalls + numStalls, + chargingPointType = chargingPointType ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index ccb77e40faf..67d81d25646 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -2,6 +2,7 @@ package beam.agentsim.infrastructure.parking import beam.agentsim.agents.choice.logit.MultinomialLogit import beam.agentsim.infrastructure.ParkingStall +import beam.agentsim.infrastructure.parking.ParkingZone._ import beam.agentsim.infrastructure.charging._ import beam.agentsim.infrastructure.taz.TAZ import beam.router.BeamRouter.Location diff --git a/src/test/scala/beam/integration/ChargingSpec.scala b/src/test/scala/beam/integration/ChargingSpec.scala index f38222d72f1..641e9762b11 100644 --- a/src/test/scala/beam/integration/ChargingSpec.scala +++ b/src/test/scala/beam/integration/ChargingSpec.scala @@ -5,6 +5,7 @@ import beam.agentsim.agents.vehicles.FuelType.Electricity import beam.agentsim.events._ import beam.agentsim.infrastructure.ScaleUpCharging import beam.agentsim.infrastructure.charging.ChargingPointType +import beam.agentsim.infrastructure.ParkingStall import beam.router.Modes.BeamMode import beam.sim.config.{BeamConfig, MatSimBeamConfigBuilder} import beam.sim.population.DefaultPopulationAdjustment @@ -29,6 +30,29 @@ import scala.collection.mutable.ArrayBuffer class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { + private val beamVilleCarId = Id.create("beamVilleCar", classOf[BeamVehicleType]) + private val vehicleId = Id.create(2, classOf[Vehicle]) + private val filesPath = s"${System.getenv("PWD")}/test/test-resources/beam/input" + + private val nIter = 1 + private val lastIter = nIter - 1 + val config: Config = ConfigFactory + .parseString( + s"""|beam.outputs.events.fileOutputFormats = csv + |beam.physsim.skipPhysSim = true + |beam.agentsim.lastIteration = $lastIter + |beam.agentsim.tuning.transitCapacity = 0.0 + |beam.agentsim.agents.rideHail.initialization.procedural.fractionOfInitialVehicleFleet = 0 + |beam.agentsim.agents.vehicles.sharedFleets = [] + |beam.agentsim.agents.vehicles.vehiclesFilePath = $filesPath"/vehicles-simple.csv" + |beam.agentsim.agents.vehicles.vehicleTypesFilePath = $filesPath"/vehicleTypes-simple.csv" + |beam.agentsim.taz.parkingFilePath = $filesPath"/taz-parking-ac-only.csv" + | + """.stripMargin + ) + .withFallback(testConfig("test/input/beamville/beam.conf")) + .resolve() + "Running a single person car-only scenario and scale up charging events" must "catch charging events and measure virtual power greater or equal than real power" in { val beamVilleCarId = Id.create("beamVilleCar", classOf[BeamVehicleType]) val vehicleId = Id.create(2, classOf[Vehicle]) @@ -77,9 +101,18 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { val scenario = ScenarioUtils.loadScenario(matsimConfig).asInstanceOf[MutableScenario] scenario.setNetwork(beamScenario.network) - val chargingPlugInEvents: ArrayBuffer[Double] = new ArrayBuffer[Double]() - val chargingPlugOutEvents: ArrayBuffer[Double] = new ArrayBuffer[Double]() - val refuelSessionEvents: ArrayBuffer[(Double, Long, Double)] = new ArrayBuffer[(Double, Long, Double)]() + // Initialize array to track when the single car plugs in and unplugs. + val chargingPlugInEvents: ArrayBuffer[(Double, Double)] = + new ArrayBuffer[(Double, Double)]() + val chargingPlugOutEvents: ArrayBuffer[(Double, Double)] = + new ArrayBuffer[(Double, Double)]() + + // Initialize array to track refueling events. Should this be empty at + // the end of a simulation since the only car is an electric car (see + // vehicleTypes-simple.csv for beamVilleCar, which seems to be the one + // tested here. + val refuelSessionEvents: ArrayBuffer[(Double, Double, Long, Double)] = + new ArrayBuffer[(Double, Double, Long, Double)]() var energyConsumed: Double = 0.0 var totVirtualPower = 0.0 var totRealPower = 0.0 @@ -91,28 +124,26 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { addEventHandlerBinding().toInstance(new BasicEventHandler { override def handleEvent(event: Event): Unit = { event match { - case ChargingPlugInEvent(_, _, _, `vehicleId`, fuelLevel, _) => chargingPlugInEvents += fuelLevel - case ChargingPlugOutEvent(_, _, `vehicleId`, fuelLevel, _) => chargingPlugOutEvents += fuelLevel - case RefuelSessionEvent( - _, - stall, - energyInJoules, - _, - sessionDuration, - `vehicleId`, - _, - _, - _, - _ - ) => - refuelSessionEvents += ( - ( - energyInJoules, - sessionDuration.toLong, - ChargingPointType.getChargingPointInstalledPowerInKw(stall.chargingPointType.get) + case ChargingPlugInEvent(tick, stall, _, `vehicleId`, fuelLevel, _) + => chargingPlugInEvents += ((tick, fuelLevel)) + + case ChargingPlugOutEvent(tick, stall, `vehicleId`, fuelLevel, _) + => chargingPlugOutEvents += ((tick, fuelLevel)) + + case RefuelSessionEvent(tick, stall, + energyInJoules, _, + sessionDuration, `vehicleId`, + _, _, _, _) + => refuelSessionEvents += ( + ( + tick, + energyInJoules, + sessionDuration.toLong, + ChargingPointType.getChargingPointInstalledPowerInKw( + stall.chargingPointType.get + ) + ) ) - ) - totRealPower += ScaleUpCharging.toPowerInKW(energyInJoules, sessionDuration.toInt) case e: PathTraversalEvent if e.vehicleId == vehicleId => energyConsumed += e.primaryFuelConsumed case e: RefuelSessionEvent if e.vehId.toString.startsWith(ScaleUpCharging.VIRTUAL_CAR_ALIAS) => @@ -133,10 +164,11 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { val services = injector.getInstance(classOf[BeamServices]) val transportNetwork = injector.getInstance(classOf[TransportNetwork]) - // 3 person in a single household in the town + // Limit population to 3 in a single household in Beamville by removing + // person 4 to 50... val population = scenario.getPopulation (4 to 50).map(Id.create(_, classOf[Person])).foreach(population.removePerson) - + // ...and by removing all households but household 1. val households = scenario.getHouseholds (2 to 21).map(Id.create(_, classOf[Household])).foreach(households.getHouseholds.remove) @@ -161,8 +193,8 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { val chargingPlugInEventsAmount = chargingPlugInEvents.size val chargingPlugOutEventsAmount = chargingPlugOutEvents.size - val totalEnergyInJoules = refuelSessionEvents.map(_._1).sum - val totalSessionDuration = refuelSessionEvents.map(_._2).sum + val totalEnergyInJoules = refuelSessionEvents.map(_._2).sum + val totalSessionDuration = refuelSessionEvents.map(_._3).sum assume(totalEnergyInJoules > 0, "totalEnergyInJoules should be non zero") assume(totalSessionDuration > 0, "totalSessionDuration should be non zero") @@ -173,13 +205,17 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { chargingPlugInEventsAmount should equal(chargingPlugOutEventsAmount) // ensure each refuel event is difference of amounts of fuel before and after charging - refuelSessionEvents.zipWithIndex foreach { case ((energyAdded, _, _), id) => - chargingPlugInEvents(id) + energyAdded shouldBe chargingPlugOutEvents(id) + refuelSessionEvents.zipWithIndex foreach { case ((_, energyAdded, _, _), id) => + chargingPlugInEvents(id)._2 + energyAdded shouldBe chargingPlugOutEvents(id)._2 } - val energyChargedInKWh = refuelSessionEvents.map(_._1).sum / 3.6e+6 - val powerPerTime = refuelSessionEvents.map(s => s._2 / 3600.0 * s._3).sum + val energyChargedInKWh = refuelSessionEvents.map(_._2).sum / 3.6e+6 + val powerPerTime = refuelSessionEvents.map(s => (s._3 / 3600.0) * s._4).sum energyChargedInKWh shouldBe (powerPerTime +- 0.01) + // + // Check that there is a charging event for start of simulation for both iterations. + val fuelSeshsAtTick0 = chargingPlugInEvents.filter(event => event._1 == 0) + fuelSeshsAtTick0.length shouldBe nIter // consumed energy should be more or less equal total added energy // TODO Hard to test this without ensuring an energy conservation mechanism // totalEnergyInJoules shouldBe (energyConsumed +- 1000) From 83c5a5cf4e7b981c8f32064aa62aeaace47db0d7 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 13 Jan 2022 12:22:52 -0800 Subject: [PATCH 007/307] removed unused code --- .../agentsim/infrastructure/InfrastructureFunctions.scala | 1 - .../scala/beam/agentsim/infrastructure/ParkingStall.scala | 8 +++----- .../agentsim/infrastructure/parking/ParkingZone.scala | 6 ++---- .../infrastructure/parking/ParkingZoneSearch.scala | 1 - 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 1f4c1dc8a19..9932dd35cb2 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -161,7 +161,6 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( val result = processParkingZoneSearchResult( inquiry, ParkingZoneSearch.incrementalParkingZoneSearch( - // inquiry, parkingZoneSearchConfiguration, parkingZoneSearchParams, parkingZoneFilterFunction, diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingStall.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingStall.scala index 5584b9110c4..107d4e7103d 100755 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingStall.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingStall.scala @@ -107,16 +107,14 @@ object ParkingStall { */ def defaultResidentialStall( locationUTM: Location, - defaultGeoId: Id[_], - parkingZoneId: Id[ParkingZoneId] = Id.create("default", classOf[ParkingZoneId]), - chargingPointType: Option[ChargingPointType] = None + defaultGeoId: Id[_] ): ParkingStall = ParkingStall( geoId = defaultGeoId, tazId = TAZ.DefaultTAZId, - parkingZoneId = parkingZoneId, + parkingZoneId = ParkingZone.DefaultParkingZoneId, locationUTM = locationUTM, costInDollars = 0.0, - chargingPointType = chargingPointType, + chargingPointType = None, pricingModel = Some { PricingModel.FlatFee(0) }, parkingType = ParkingType.Residential, reservedFor = VehicleManager.AnyManager diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZone.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZone.scala index 0ed25d49cd5..df32043d130 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZone.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZone.scala @@ -122,16 +122,14 @@ object ParkingZone extends LazyLogging { def defaultInit[GEO]( geoId: Id[GEO], parkingType: ParkingType, - numStalls: Int, - chargingPointType: Option[ChargingPointType] = None + numStalls: Int ): ParkingZone[GEO] = { init[GEO]( Some(DefaultParkingZoneId), geoId, parkingType, VehicleManager.AnyManager, - numStalls, - chargingPointType = chargingPointType + numStalls ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 67d81d25646..ccb77e40faf 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -2,7 +2,6 @@ package beam.agentsim.infrastructure.parking import beam.agentsim.agents.choice.logit.MultinomialLogit import beam.agentsim.infrastructure.ParkingStall -import beam.agentsim.infrastructure.parking.ParkingZone._ import beam.agentsim.infrastructure.charging._ import beam.agentsim.infrastructure.taz.TAZ import beam.router.BeamRouter.Location From 55c3453ebfc6ae495264292310fbe6116838ea83 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 13 Jan 2022 13:33:45 -0800 Subject: [PATCH 008/307] updated ChargingSpec according to HL comments on PR --- .../scala/beam/integration/ChargingSpec.scala | 26 +++---------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/test/scala/beam/integration/ChargingSpec.scala b/src/test/scala/beam/integration/ChargingSpec.scala index 641e9762b11..552aa4d87fd 100644 --- a/src/test/scala/beam/integration/ChargingSpec.scala +++ b/src/test/scala/beam/integration/ChargingSpec.scala @@ -34,25 +34,6 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { private val vehicleId = Id.create(2, classOf[Vehicle]) private val filesPath = s"${System.getenv("PWD")}/test/test-resources/beam/input" - private val nIter = 1 - private val lastIter = nIter - 1 - val config: Config = ConfigFactory - .parseString( - s"""|beam.outputs.events.fileOutputFormats = csv - |beam.physsim.skipPhysSim = true - |beam.agentsim.lastIteration = $lastIter - |beam.agentsim.tuning.transitCapacity = 0.0 - |beam.agentsim.agents.rideHail.initialization.procedural.fractionOfInitialVehicleFleet = 0 - |beam.agentsim.agents.vehicles.sharedFleets = [] - |beam.agentsim.agents.vehicles.vehiclesFilePath = $filesPath"/vehicles-simple.csv" - |beam.agentsim.agents.vehicles.vehicleTypesFilePath = $filesPath"/vehicleTypes-simple.csv" - |beam.agentsim.taz.parkingFilePath = $filesPath"/taz-parking-ac-only.csv" - | - """.stripMargin - ) - .withFallback(testConfig("test/input/beamville/beam.conf")) - .resolve() - "Running a single person car-only scenario and scale up charging events" must "catch charging events and measure virtual power greater or equal than real power" in { val beamVilleCarId = Id.create("beamVilleCar", classOf[BeamVehicleType]) val vehicleId = Id.create(2, classOf[Vehicle]) @@ -68,6 +49,7 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { |beam.agentsim.agents.vehicles.vehiclesFilePath = $filesPath"/vehicles-simple.csv" |beam.agentsim.agents.vehicles.vehicleTypesFilePath = $filesPath"/vehicleTypes-simple.csv" |beam.agentsim.taz.parkingFilePath = $filesPath"/taz-parking-ac-only.csv" + |beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC = 0.2 |beam.agentsim.chargingNetworkManager { | timeStepInSeconds = 300 | chargingPointCountScalingFactor = 1.0 @@ -212,10 +194,10 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { val energyChargedInKWh = refuelSessionEvents.map(_._2).sum / 3.6e+6 val powerPerTime = refuelSessionEvents.map(s => (s._3 / 3600.0) * s._4).sum energyChargedInKWh shouldBe (powerPerTime +- 0.01) - // - // Check that there is a charging event for start of simulation for both iterations. + + // Check that there is a charging event for start of iteration. val fuelSeshsAtTick0 = chargingPlugInEvents.filter(event => event._1 == 0) - fuelSeshsAtTick0.length shouldBe nIter + assume(fuelSeshsAtTick0.length > 0) // consumed energy should be more or less equal total added energy // TODO Hard to test this without ensuring an energy conservation mechanism // totalEnergyInJoules shouldBe (energyConsumed +- 1000) From b1fcbfd989533bfb31afa0a8739671c2a256e756 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 28 Jan 2022 19:04:54 -0800 Subject: [PATCH 009/307] fix compilation --- .../beam/agentsim/agents/PersonAgent.scala | 58 - .../agents/modalbehaviors/ChoosesMode.scala | 100 +- src/main/scala/beam/router/Modes.scala | 2 +- .../scala/beam/router/RoutingWorker.scala | 10 +- .../scala/beam/router/cch/CchWrapper.scala | 12 +- .../graphhopper/GraphHopperWrapper.scala | 5 +- .../scala/beam/router/r5/R5Parameters.scala | 2 +- .../beam/router/r5/WorkerParameters.scala | 2 +- .../router/skim/ActivitySimPathType.scala | 1 + src/main/scala/beam/sim/BeamHelper.scala | 6 +- .../scala/beam/sim/config/BeamConfig.scala | 5418 +++++++++++------ .../scala/beam/utils/Network2ShapeFile.scala | 189 + .../data/synthpop/ScenarioGenerator.scala | 26 +- .../beam/utils/Network2ShapeFileTest.scala | 51 + .../urbansim/HOVModeTransformerTest.scala | 1 - 15 files changed, 3785 insertions(+), 2098 deletions(-) create mode 100644 src/main/scala/beam/utils/Network2ShapeFile.scala create mode 100644 src/test/scala/beam/utils/Network2ShapeFileTest.scala diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index ccd20f8a767..04fc0887517 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -611,64 +611,6 @@ class PersonAgent( } - when(Teleporting) { - case Event( - TriggerWithId(PersonDepartureTrigger(tick), triggerId), - data @ BasePersonData(_, Some(currentTrip), _, _, _, _, _, _, false, _, _, _) - ) => - assert(currentActivity(data).getLinkId != null) - - // We end our activity when we actually leave, not when we decide to leave, i.e. when we look for a bus or - // hail a ride. We stay at the party until our Uber is there. - eventsManager.processEvent( - new ActivityEndEvent( - tick, - id, - currentActivity(data).getLinkId, - currentActivity(data).getFacilityId, - currentActivity(data).getType - ) - ) - - eventsManager.processEvent( - new PersonDepartureEvent( - tick, - id, - currentActivity(data).getLinkId, - currentTrip.tripClassifier.value - ) - ) - - val arrivalTime = tick + currentTrip.totalTravelTimeInSecs - scheduler ! CompletionNotice( - triggerId, - Vector(ScheduleTrigger(TeleportationEndsTrigger(arrivalTime), self)) - ) - - stay() using data.copy(hasDeparted = true) - - case Event( - TriggerWithId(TeleportationEndsTrigger(tick), triggerId), - data @ BasePersonData(_, Some(currentTrip), _, _, maybeCurrentTourMode, _, _, _, true, _, _, _) - ) => - holdTickAndTriggerId(tick, triggerId) - - val teleportationEvent = new TeleportationEvent( - time = tick, - person = id, - departureTime = currentTrip.legs.head.beamLeg.startTime, - arrivalTime = tick, - startX = currentTrip.legs.head.beamLeg.travelPath.startPoint.loc.getX, - startY = currentTrip.legs.head.beamLeg.travelPath.startPoint.loc.getY, - endX = currentTrip.legs.last.beamLeg.travelPath.endPoint.loc.getX, - endY = currentTrip.legs.last.beamLeg.travelPath.endPoint.loc.getY, - currentTourMode = maybeCurrentTourMode.map(_.value) - ) - eventsManager.processEvent(teleportationEvent) - - goto(ProcessingNextLegOrStartActivity) using data.copy(hasDeparted = true) - } - when(WaitingForDeparture) { /** diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index 8a1d81eb27e..c1330e99053 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -183,46 +183,6 @@ trait ChoosesMode { _ ) => self ! MobilityStatusResponse(Vector(beamVehicles(vehicle)), getCurrentTriggerIdOrGenerate) - // If we don't know the mode in advance we'll see what's out there - case ChoosesModeData( - BasePersonData( - _, - _, - _, - _, - Some(HOV2_TELEPORTATION | HOV3_TELEPORTATION), - _, - _, - _, - _, - _, - _, - _ - ), - currentLocation, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _ - ) => - val teleportationVehicle = createSharedTeleportationVehicle(currentLocation) - val vehicles = Vector(ActualVehicle(teleportationVehicle)) - self ! MobilityStatusResponse(vehicles, getCurrentTriggerIdOrGenerate) // Only need to get available street vehicles if our mode requires such a vehicle case ChoosesModeData( BasePersonData( @@ -270,7 +230,7 @@ trait ChoosesMode { _, _, _, - None, + None | Some(CAR | BIKE | DRIVE_TRANSIT | BIKE_TRANSIT), _, _, _, @@ -306,55 +266,6 @@ trait ChoosesMode { currentLocation, _experiencedBeamPlan.activities(currentActivityIndex) ) pipeTo self - // If we know the mode in advance we need to make sure a vehicle exists - case ChoosesModeData( - BasePersonData( - currentActivityIndex, - _, - _, - _, - Some(mode @ (CAR | BIKE | DRIVE_TRANSIT | BIKE_TRANSIT | CAR_HOV2 | CAR_HOV3)), - _, - _, - _, - _, - _, - _, - _ - ), - currentLocation, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _, - _ - ) => - implicit val executionContext: ExecutionContext = context.system.dispatcher - val requireVehicleCategoryAvailable = mode match { - case CAR | DRIVE_TRANSIT | CAR_HOV2 | CAR_HOV3 => Some(VehicleCategory.Car) - case BIKE_TRANSIT | BIKE => Some(VehicleCategory.Bike) - case _ => None - } - requestAvailableVehicles( - vehicleFleets, - currentLocation, - _experiencedBeamPlan.activities(currentActivityIndex), - requireVehicleCategoryAvailable - ) pipeTo self // Otherwise, send empty list to self case _ => self ! MobilityStatusResponse(Vector(), getCurrentTriggerIdOrGenerate) @@ -573,11 +484,7 @@ trait ChoosesMode { ) responsePlaceholders = makeResponsePlaceholders(withRouting = true) case _ => - makeRequestWith( - withTransit = false, - Vector(bodyStreetVehicle) - ) - logger.error("If the agent has this trip in their plans, we should have created a vehicle for them") + makeRequestWith(withTransit = false, Vector(bodyStreetVehicle)) responsePlaceholders = makeResponsePlaceholders(withRouting = true) } case _ => @@ -1462,11 +1369,10 @@ trait ChoosesMode { body.toStreetVehicle, geo ) - val dataForNextStep = choosesModeData.copy( + goto(FinishingModeChoice) using choosesModeData.copy( pendingChosenTrip = Some(bushwhackingTrip), availableAlternatives = availableAlts ) - goto(FinishingModeChoice) using dataForNextStep } case _ => // Bad things happen but we want them to continue their day, so we signal to downstream that trip should be made to be expensive diff --git a/src/main/scala/beam/router/Modes.scala b/src/main/scala/beam/router/Modes.scala index a30d7986f63..2d7b811c635 100755 --- a/src/main/scala/beam/router/Modes.scala +++ b/src/main/scala/beam/router/Modes.scala @@ -1,6 +1,6 @@ package beam.router -import beam.router.Modes.BeamMode.{BIKE, CAR, CAV, WALK} +import beam.router.Modes.BeamMode.{BIKE, CAR, CAR_HOV2, CAR_HOV3, CAV, WALK} import com.conveyal.r5.api.util.{LegMode, TransitModes} import com.conveyal.r5.profile.StreetMode import enumeratum.values._ diff --git a/src/main/scala/beam/router/RoutingWorker.scala b/src/main/scala/beam/router/RoutingWorker.scala index 77b58456ec2..c207fabb4ab 100755 --- a/src/main/scala/beam/router/RoutingWorker.scala +++ b/src/main/scala/beam/router/RoutingWorker.scala @@ -391,9 +391,15 @@ class RoutingWorker(workerParams: R5Parameters) extends Actor with ActorLogging val definedResponses = responses.flatten (definedResponses, r5ResponseOption) match { case (head +: _, Some(r5Resp)) => - head.copy(itineraries = definedResponses.flatMap(_.itineraries) ++ r5Resp.itineraries) + head.copy( + itineraries = r5Resp.itineraries ++ definedResponses.flatMap(_.itineraries), + searchedModes = r5Resp.searchedModes ++ definedResponses.flatMap(_.searchedModes) + ) case (head +: _, None) => - head.copy(itineraries = definedResponses.flatMap(_.itineraries)) + head.copy( + itineraries = definedResponses.flatMap(_.itineraries), + searchedModes = definedResponses.flatMap(_.searchedModes).toSet + ) case (Seq(), Some(r5Resp)) => r5Resp case (Seq(), None) => r5.calcRoute(request) diff --git a/src/main/scala/beam/router/cch/CchWrapper.scala b/src/main/scala/beam/router/cch/CchWrapper.scala index fe0b2e22d07..e67b5155f12 100644 --- a/src/main/scala/beam/router/cch/CchWrapper.scala +++ b/src/main/scala/beam/router/cch/CchWrapper.scala @@ -138,10 +138,18 @@ class CchWrapper(workerParams: R5Parameters) extends Router { req.requestId, Some(req), isEmbodyWithCurrentTravelTime = false, - triggerId = req.triggerId + triggerId = req.triggerId, + searchedModes = Set(alternative.tripClassifier) ) } else - RoutingResponse(Seq(), req.requestId, Some(req), isEmbodyWithCurrentTravelTime = false, triggerId = req.triggerId) + RoutingResponse( + Seq(), + req.requestId, + Some(req), + isEmbodyWithCurrentTravelTime = false, + triggerId = req.triggerId, + searchedModes = req.streetVehicles.map(_.mode).toSet + ) } def rebuildNativeCCHWeights(newTravelTime: TravelTime): Unit = { diff --git a/src/main/scala/beam/router/graphhopper/GraphHopperWrapper.scala b/src/main/scala/beam/router/graphhopper/GraphHopperWrapper.scala index 1ff9f8a6695..e7ed8116c71 100644 --- a/src/main/scala/beam/router/graphhopper/GraphHopperWrapper.scala +++ b/src/main/scala/beam/router/graphhopper/GraphHopperWrapper.scala @@ -95,7 +95,10 @@ abstract class GraphHopperWrapper( routingRequest.requestId, Some(routingRequest), isEmbodyWithCurrentTravelTime = false, - triggerId = routingRequest.triggerId + triggerId = routingRequest.triggerId, + searchedModes = + if (alternatives.isEmpty) routingRequest.streetVehicles.map(_.mode).toSet + else (alternatives.map(_.tripClassifier).toSet) ) } diff --git a/src/main/scala/beam/router/r5/R5Parameters.scala b/src/main/scala/beam/router/r5/R5Parameters.scala index 02f9c13e500..dafd30ce98c 100644 --- a/src/main/scala/beam/router/r5/R5Parameters.scala +++ b/src/main/scala/beam/router/r5/R5Parameters.scala @@ -53,7 +53,7 @@ object R5Parameters { ZonedDateTime.parse(beamConfig.beam.routing.baseDate) ) val geo = new GeoUtilsImpl(beamConfig) - val vehicleTypes = readBeamVehicleTypeFile(beamConfig.beam.agentsim.agents.vehicles.vehicleTypesFilePath) + val vehicleTypes = readBeamVehicleTypeFile(beamConfig) val fuelTypePrices = readFuelTypeFile(beamConfig.beam.agentsim.agents.vehicles.fuelTypesFilePath).toMap val ptFares = PtFares(beamConfig.beam.agentsim.agents.ptFare.filePath) val fareCalculator = new FareCalculator(beamConfig) diff --git a/src/main/scala/beam/router/r5/WorkerParameters.scala b/src/main/scala/beam/router/r5/WorkerParameters.scala index 33f3d41de1e..ec0824012a5 100644 --- a/src/main/scala/beam/router/r5/WorkerParameters.scala +++ b/src/main/scala/beam/router/r5/WorkerParameters.scala @@ -53,7 +53,7 @@ object WorkerParameters { ZonedDateTime.parse(beamConfig.beam.routing.baseDate) ) val geo = new GeoUtilsImpl(beamConfig) - val vehicleTypes = readBeamVehicleTypeFile(beamConfig.beam.agentsim.agents.vehicles.vehicleTypesFilePath) + val vehicleTypes = readBeamVehicleTypeFile(beamConfig) val fuelTypePrices = readFuelTypeFile(beamConfig.beam.agentsim.agents.vehicles.fuelTypesFilePath).toMap val ptFares = PtFares(beamConfig.beam.agentsim.agents.ptFare.filePath) val fareCalculator = new FareCalculator(beamConfig) diff --git a/src/main/scala/beam/router/skim/ActivitySimPathType.scala b/src/main/scala/beam/router/skim/ActivitySimPathType.scala index 2fad276589c..dfae6fd2970 100644 --- a/src/main/scala/beam/router/skim/ActivitySimPathType.scala +++ b/src/main/scala/beam/router/skim/ActivitySimPathType.scala @@ -164,6 +164,7 @@ object ActivitySimPathType { private def isWalkTransit(beamMode: BeamMode): Boolean = beamMode match { case BeamMode.BUS | BeamMode.FERRY | BeamMode.RAIL | BeamMode.SUBWAY | BeamMode.TRAM | BeamMode.CABLE_CAR => true + case BeamMode.CAR | BeamMode.CAV | BeamMode.RIDE_HAIL | BeamMode.RIDE_HAIL_POOLED | BeamMode.FUNICULAR | BeamMode.GONDOLA | BeamMode.WALK | BeamMode.BIKE | BeamMode.BIKE_TRANSIT | BeamMode.TRANSIT | BeamMode.WALK_TRANSIT | BeamMode.DRIVE_TRANSIT | BeamMode.RIDE_HAIL_TRANSIT | BeamMode.CAR_HOV2 | diff --git a/src/main/scala/beam/sim/BeamHelper.scala b/src/main/scala/beam/sim/BeamHelper.scala index 8c020f70ebf..c29bf19ea34 100755 --- a/src/main/scala/beam/sim/BeamHelper.scala +++ b/src/main/scala/beam/sim/BeamHelper.scala @@ -267,10 +267,7 @@ trait BeamHelper extends LazyLogging { } def loadScenario(beamConfig: BeamConfig): BeamScenario = { - val vehicleTypes = maybeScaleTransit( - beamConfig, - readBeamVehicleTypeFile(beamConfig.beam.agentsim.agents.vehicles.vehicleTypesFilePath) - ) + val vehicleTypes = maybeScaleTransit(beamConfig, readBeamVehicleTypeFile(beamConfig)) val vehicleCsvReader = new VehicleCsvReader(beamConfig) val baseFilePath = Paths.get(beamConfig.beam.agentsim.agents.vehicles.vehicleTypesFilePath).getParent @@ -957,7 +954,6 @@ trait BeamHelper extends LazyLogging { val errors = InputConsistencyCheck.checkConsistency(beamConfig) if (errors.nonEmpty) { logger.error("Input consistency check failed:\n" + errors.mkString("\n")) - throw new RuntimeException("Input consistency check failed") } level = beamConfig.beam.metrics.level diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index f6d25d5d9bf..25f27aa7187 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,3474 +3,5048 @@ package beam.sim.config case class BeamConfig( - beam : BeamConfig.Beam, - matsim : BeamConfig.Matsim + beam: BeamConfig.Beam, + matsim: BeamConfig.Matsim ) + object BeamConfig { + case class Beam( - actorSystemName : java.lang.String, - agentsim : BeamConfig.Beam.Agentsim, - calibration : BeamConfig.Beam.Calibration, - cluster : BeamConfig.Beam.Cluster, - debug : BeamConfig.Beam.Debug, - exchange : BeamConfig.Beam.Exchange, - experimental : BeamConfig.Beam.Experimental, - input : BeamConfig.Beam.Input, - inputDirectory : java.lang.String, - logger : BeamConfig.Beam.Logger, - metrics : BeamConfig.Beam.Metrics, - output : BeamConfig.Beam.Output, - outputs : BeamConfig.Beam.Outputs, - physsim : BeamConfig.Beam.Physsim, - replanning : BeamConfig.Beam.Replanning, - router : BeamConfig.Beam.Router, - routing : BeamConfig.Beam.Routing, - sim : BeamConfig.Beam.Sim, - spatial : BeamConfig.Beam.Spatial, - urbansim : BeamConfig.Beam.Urbansim, - useLocalWorker : scala.Boolean, - warmStart : BeamConfig.Beam.WarmStart + actorSystemName: java.lang.String, + agentsim: BeamConfig.Beam.Agentsim, + calibration: BeamConfig.Beam.Calibration, + cluster: BeamConfig.Beam.Cluster, + debug: BeamConfig.Beam.Debug, + exchange: BeamConfig.Beam.Exchange, + experimental: BeamConfig.Beam.Experimental, + input: BeamConfig.Beam.Input, + inputDirectory: java.lang.String, + logger: BeamConfig.Beam.Logger, + metrics: BeamConfig.Beam.Metrics, + output: BeamConfig.Beam.Output, + outputs: BeamConfig.Beam.Outputs, + physsim: BeamConfig.Beam.Physsim, + replanning: BeamConfig.Beam.Replanning, + router: BeamConfig.Beam.Router, + routing: BeamConfig.Beam.Routing, + sim: BeamConfig.Beam.Sim, + spatial: BeamConfig.Beam.Spatial, + urbansim: BeamConfig.Beam.Urbansim, + useLocalWorker: scala.Boolean, + warmStart: BeamConfig.Beam.WarmStart ) + object Beam { + case class Agentsim( - agentSampleSizeAsFractionOfPopulation : scala.Double, - agents : BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime : java.lang.String, - firstIteration : scala.Int, - fractionOfPlansWithSingleActivity : scala.Double, - h3taz : BeamConfig.Beam.Agentsim.H3taz, - lastIteration : scala.Int, - populationAdjustment : java.lang.String, - scenarios : BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow : scala.Int, - simulationName : java.lang.String, - taz : BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters : scala.Int, - thresholdForWalkingInMeters : scala.Int, - timeBinSize : scala.Int, - toll : BeamConfig.Beam.Agentsim.Toll, - tuning : BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation: scala.Double, + agents: BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime: java.lang.String, + firstIteration: scala.Int, + fractionOfPlansWithSingleActivity: scala.Double, + h3taz: BeamConfig.Beam.Agentsim.H3taz, + lastIteration: scala.Int, + populationAdjustment: java.lang.String, + scenarios: BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow: scala.Int, + simulationName: java.lang.String, + taz: BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters: scala.Int, + thresholdForWalkingInMeters: scala.Int, + timeBinSize: scala.Int, + toll: BeamConfig.Beam.Agentsim.Toll, + tuning: BeamConfig.Beam.Agentsim.Tuning ) + object Agentsim { + case class Agents( - activities : BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType : java.lang.String, - freight : BeamConfig.Beam.Agentsim.Agents.Freight, - households : BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking : BeamConfig.Beam.Agentsim.Agents.Parking, - plans : BeamConfig.Beam.Agentsim.Agents.Plans, - population : BeamConfig.Beam.Agentsim.Agents.Population, - ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles + activities: BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType: java.lang.String, + freight: BeamConfig.Beam.Agentsim.Agents.Freight, + households: BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking: BeamConfig.Beam.Agentsim.Agents.Parking, + plans: BeamConfig.Beam.Agentsim.Agents.Plans, + population: BeamConfig.Beam.Agentsim.Agents.Population, + ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles ) + object Agents { + case class Activities( - activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] ) + object Activities { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None + activityTypeToFixedDurationMap = + if (c.hasPathOrNull("activityTypeToFixedDurationMap")) + scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) + else None ) } } - + case class Freight( - carrierParkingFilePath : scala.Option[java.lang.String], - carriersFilePath : java.lang.String, - convertWgs2Utm : scala.Boolean, - enabled : scala.Boolean, - generateFixedActivitiesDurations : scala.Boolean, - name : java.lang.String, - plansFilePath : java.lang.String, - reader : java.lang.String, - replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath : java.lang.String + carrierParkingFilePath: scala.Option[java.lang.String], + carriersFilePath: java.lang.String, + convertWgs2Utm: scala.Boolean, + enabled: scala.Boolean, + generateFixedActivitiesDurations: scala.Boolean, + name: java.lang.String, + plansFilePath: java.lang.String, + reader: java.lang.String, + replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath: java.lang.String ) + object Freight { + case class Replanning( - departureTime : scala.Int, - disableAfterIteration : scala.Int, - strategy : java.lang.String + departureTime: scala.Int, + disableAfterIteration: scala.Int, + strategy: java.lang.String ) + object Replanning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", - reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = + if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = + if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") + else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = + c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = + if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") + else "/test/input/beamville/freight/payload-plans.csv", + reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + toursFilePath = + if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") + else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath : java.lang.String, - inputHouseholdAttributesFilePath : java.lang.String + inputFilePath: java.lang.String, + inputHouseholdAttributesFilePath: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = + if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") + else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = + if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") + else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime : scala.Double, - highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts : scala.Int, - minimumValueOfTime : scala.Double, - modeChoiceClass : java.lang.String, - modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT : scala.Boolean, - overrideAutomationLevel : scala.Int, - poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier + defaultValueOfTime: scala.Double, + highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts: scala.Int, + minimumValueOfTime: scala.Double, + modeChoiceClass: java.lang.String, + modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT: scala.Boolean, + overrideAutomationLevel: scala.Int, + poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier ) + object ModalBehaviors { + case class HighTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) + object HighTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class Lccm( - filePath : java.lang.String + filePath: java.lang.String ) + object Lccm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) + object LowTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class ModeVotMultiplier( - CAV : scala.Double, - bike : scala.Double, - drive : scala.Double, - rideHail : scala.Double, - rideHailPooled : scala.Double, - rideHailTransit : scala.Double, - transit : scala.Double, - waiting : scala.Double, - walk : scala.Double + CAV: scala.Double, + bike: scala.Double, + drive: scala.Double, + rideHail: scala.Double, + rideHailPooled: scala.Double, + rideHailTransit: scala.Double, + transit: scala.Double, + waiting: scala.Double, + walk: scala.Double ) + object ModeVotMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor : scala.Double + params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor: scala.Double ) + object MulitnomialLogit { + case class Params( - bike_intercept : scala.Double, - bike_transit_intercept : scala.Double, - car_intercept : scala.Double, - cav_intercept : scala.Double, - drive_transit_intercept : scala.Double, - ride_hail_intercept : scala.Double, - ride_hail_pooled_intercept : scala.Double, - ride_hail_transit_intercept : scala.Double, - transfer : scala.Double, - transit_crowding : scala.Double, - transit_crowding_percentile : scala.Double, - walk_intercept : scala.Double, - walk_transit_intercept : scala.Double + bike_intercept: scala.Double, + bike_transit_intercept: scala.Double, + car_intercept: scala.Double, + cav_intercept: scala.Double, + drive_transit_intercept: scala.Double, + ride_hail_intercept: scala.Double, + ride_hail_pooled_intercept: scala.Double, + ride_hail_transit_intercept: scala.Double, + transfer: scala.Double, + transit_crowding: scala.Double, + transit_crowding_percentile: scala.Double, + walk_intercept: scala.Double, + walk_transit_intercept: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, - ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, - transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, - walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = + if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = + if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = + if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = + if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") + else 0.0, + ride_hail_transit_intercept = + if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") + else 0.0, + transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_percentile = + if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") + else 90.0, + walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = + if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), - utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ), + utility_scale_factor = + if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object PoolingMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), - maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, - minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")) - ) - } - } - + defaultValueOfTime = + if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( + if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") + ), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( + if (c.hasPathOrNull("lccm")) c.getConfig("lccm") + else com.typesafe.config.ConfigFactory.parseString("lccm{}") + ), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( + if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") + ), + maximumNumberOfReplanningAttempts = + if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") + else 3, + minimumValueOfTime = + if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = + if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") + else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( + if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") + else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + overrideAutomationForVOTT = + c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = + if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( + if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") + else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") + ) + ) + } + } + case class ModeIncentive( - filePath : java.lang.String + filePath: java.lang.String ) + object ModeIncentive { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - maxSearchRadius : scala.Double, - minSearchRadius : scala.Double, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - rangeAnxietyBuffer : scala.Double + maxSearchRadius: scala.Double, + minSearchRadius: scala.Double, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + rangeAnxietyBuffer: scala.Double ) + object Parking { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - distanceMultiplier : scala.Double, - homeActivityPrefersResidentialParkingMultiplier : scala.Double, - parkingPriceMultiplier : scala.Double, - rangeAnxietyMultiplier : scala.Double + distanceMultiplier: scala.Double, + homeActivityPrefersResidentialParkingMultiplier: scala.Double, + parkingPriceMultiplier: scala.Double, + rangeAnxietyMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, - parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = + if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + homeActivityPrefersResidentialParkingMultiplier = + if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) + c.getDouble("homeActivityPrefersResidentialParkingMultiplier") + else 1.0, + parkingPriceMultiplier = + if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = + if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0 + maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + rangeAnxietyBuffer = + if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0 ) } } - + case class Plans( - inputPersonAttributesFilePath : java.lang.String, - inputPlansFilePath : java.lang.String, - merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath: java.lang.String, + inputPlansFilePath: java.lang.String, + merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) + object Plans { + case class Merge( - fraction : scala.Double + fraction: scala.Double ) + object Merge { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) + inputPersonAttributesFilePath = + if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") + else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = + if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") + else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( + if (c.hasPathOrNull("merge")) c.getConfig("merge") + else com.typesafe.config.ConfigFactory.parseString("merge{}") + ) ) } } - + case class Population( - useVehicleSampling : scala.Boolean + useVehicleSampling: scala.Boolean ) + object Population { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath : java.lang.String + filePath: java.lang.String ) + object PtFare { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost : scala.Double, - defaultCostPerMile : scala.Double, - defaultCostPerMinute : scala.Double, - human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations : scala.Boolean, - name : java.lang.String, - pooledBaseCost : scala.Double, - pooledCostPerMile : scala.Double, - pooledCostPerMinute : scala.Double, - pooledToRegularRideCostRatio : scala.Double, - rangeBufferForDispatchInMeters : scala.Int, - refuelLocationType : java.lang.String, - refuelThresholdInMeters : scala.Double, - repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost: scala.Double, + defaultCostPerMile: scala.Double, + defaultCostPerMinute: scala.Double, + human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations: scala.Boolean, + name: java.lang.String, + pooledBaseCost: scala.Double, + pooledCostPerMile: scala.Double, + pooledCostPerMinute: scala.Double, + pooledToRegularRideCostRatio: scala.Double, + rangeBufferForDispatchInMeters: scala.Int, + refuelLocationType: java.lang.String, + refuelThresholdInMeters: scala.Double, + repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) + object RideHail { + case class AllocationManager( - alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm : java.lang.String, - maxExcessRideTime : scala.Double, - maxWaitingTimeInSec : scala.Int, - name : java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, - repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds : scala.Int + alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm: java.lang.String, + maxExcessRideTime: scala.Double, + maxWaitingTimeInSec: scala.Int, + name: java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, + repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds: scala.Int ) + object AllocationManager { + case class AlonsoMora( - maxRequestsPerVehicle : scala.Int + maxRequestsPerVehicle: scala.Int ) + object AlonsoMora { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = + if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, - demandWeight : scala.Double, - distanceWeight : scala.Double, - keepMaxTopNScores : scala.Int, - minDemandPercentageInRadius : scala.Double, - minScoreThresholdForRepositioning : scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, - percentageOfVehiclesToReposition : scala.Double, - produceDebugImages : scala.Boolean, - repositionCircleRadiusInMeters : scala.Double, - repositioningMethod : java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, - waitingTimeWeight : scala.Double + allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, + demandWeight: scala.Double, + distanceWeight: scala.Double, + keepMaxTopNScores: scala.Int, + minDemandPercentageInRadius: scala.Double, + minScoreThresholdForRepositioning: scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, + percentageOfVehiclesToReposition: scala.Double, + produceDebugImages: scala.Boolean, + repositionCircleRadiusInMeters: scala.Double, + repositioningMethod: java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, + waitingTimeWeight: scala.Double ) + object RepositionLowWaitingTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, - minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, - percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, - repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, - waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( + "allowIncreasingRadiusIfDemandInRadiusLow" + ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = + if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") + else 0.1, + minScoreThresholdForRepositioning = + if (c.hasPathOrNull("minScoreThresholdForRepositioning")) + c.getDouble("minScoreThresholdForRepositioning") + else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = + if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) + c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") + else 1, + percentageOfVehiclesToReposition = + if (c.hasPathOrNull("percentageOfVehiclesToReposition")) + c.getDouble("percentageOfVehiclesToReposition") + else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = + if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") + else 3000, + repositioningMethod = + if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = + if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) + c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") + else 1200, + waitingTimeWeight = + if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), - matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, - repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), - requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( + if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") + else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") + ), + matchingAlgorithm = + if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") + else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = + if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = + if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) + c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") + else 1, + repositionLowWaitingTimes = + BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( + if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") + else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") + ), + requestBufferTimeoutInSeconds = + if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Int ) + object Cav { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 16090, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) + object Charging { + case class VehicleChargingManager( - defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, - name : java.lang.String + defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, + name: java.lang.String ) + object VehicleChargingManager { + case class DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging : scala.Double, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, - noChargingThresholdExpirationTimeInS : scala.Int + fractionAvailableThresholdToFavorFasterCharging: scala.Double, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, + noChargingThresholdExpirationTimeInS: scala.Int ) + object DefaultVehicleChargingManager { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - chargingTimeMultiplier : scala.Double, - drivingTimeMultiplier : scala.Double, - insufficientRangeMultiplier : scala.Double, - queueingTimeMultiplier : scala.Double + chargingTimeMultiplier: scala.Double, + drivingTimeMultiplier: scala.Double, + insufficientRangeMultiplier: scala.Double, + queueingTimeMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( - chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, - drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, - insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, - queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + chargingTimeMultiplier = + if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") + else -0.01666667, + drivingTimeMultiplier = + if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") + else -0.01666667, + insufficientRangeMultiplier = + if (c.hasPathOrNull("insufficientRangeMultiplier")) + c.getDouble("insufficientRangeMultiplier") + else -60.0, + queueingTimeMultiplier = + if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") + else -0.01666667 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + params = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging = if(c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) c.getDouble("fractionAvailableThresholdToFavorFasterCharging") else 1.01, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - noChargingThresholdExpirationTimeInS = if(c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) c.getInt("noChargingThresholdExpirationTimeInS") else 0 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + fractionAvailableThresholdToFavorFasterCharging = + if (c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) + c.getDouble("fractionAvailableThresholdToFavorFasterCharging") + else 1.01, + mulitnomialLogit = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + noChargingThresholdExpirationTimeInS = + if (c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) + c.getInt("noChargingThresholdExpirationTimeInS") + else 0 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" + defaultVehicleChargingManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + if (c.hasPathOrNull("defaultVehicleChargingManager")) + c.getConfig("defaultVehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( + if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") + ) ) } } - + case class Human( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Double + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Double ) + object Human { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 ) } } - + case class Initialization( - filePath : java.lang.String, - initType : java.lang.String, - parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath: java.lang.String, + initType: java.lang.String, + parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) + object Initialization { + case class Parking( - filePath : java.lang.String + filePath: java.lang.String ) + object Parking { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet : scala.Double, - initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId : java.lang.String, - vehicleTypePrefix : java.lang.String + fractionOfInitialVehicleFleet: scala.Double, + initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId: java.lang.String, + vehicleTypePrefix: java.lang.String ) + object Procedural { + case class InitialLocation( - home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name : java.lang.String + home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name: java.lang.String ) + object InitialLocation { + case class Home( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object Home { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( + if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") + else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") + ), + vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = + if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( + if (c.hasPathOrNull("procedural")) c.getConfig("procedural") + else com.typesafe.config.ConfigFactory.parseString("procedural{}") + ) ) } } - + case class IterationStats( - timeBinSizeInSec : scala.Double + timeBinSizeInSec: scala.Double ) + object IterationStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name : java.lang.String, - timeout : scala.Int + demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name: java.lang.String, + timeout: scala.Int ) + object RepositioningManager { + case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider : scala.Double, - horizon : scala.Int, - numberOfClustersForDemand : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDemandForCAVs : scala.Double + fractionOfClosestClustersToConsider: scala.Double, + horizon: scala.Int, + numberOfClustersForDemand: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDemandForCAVs: scala.Double ) + object DemandFollowingRepositioningManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, - horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, - sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 + fractionOfClosestClustersToConsider = + if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) + c.getDouble("fractionOfClosestClustersToConsider") + else 0.2, + horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = + if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 1, + sensitivityOfRepositioningToDemandForCAVs = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) + c.getDouble("sensitivityOfRepositioningToDemandForCAVs") + else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDistance : scala.Double + predictionHorizon: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDistance: scala.Double ) + object InverseSquareDistanceRepositioningFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, - sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 + predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 0.4, + sensitivityOfRepositioningToDistance = + if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) + c.getDouble("sensitivityOfRepositioningToDistance") + else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( + if (c.hasPathOrNull("demandFollowingRepositioningManager")) + c.getConfig("demandFollowingRepositioningManager") + else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") + ), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager + .InverseSquareDistanceRepositioningFactor( + if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) + c.getConfig("inverseSquareDistanceRepositioningFactor") + else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object RideHailManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel : scala.Double, - numberOfCategories : scala.Int, - priceAdjustmentStrategy : java.lang.String, - surgeLevelAdaptionStep : scala.Double + minimumSurgeLevel: scala.Double, + numberOfCategories: scala.Int, + priceAdjustmentStrategy: java.lang.String, + surgeLevelAdaptionStep: scala.Double ) + object SurgePricing { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = + if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") + else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = + if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), - defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), - linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - pooledToRegularRideCostRatio = if(c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") else 0.6, - rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, - refuelLocationType = if(c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", - refuelThresholdInMeters = if(c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( + if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") + else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") + ), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( + if (c.hasPathOrNull("cav")) c.getConfig("cav") + else com.typesafe.config.ConfigFactory.parseString("cav{}") + ), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( + if (c.hasPathOrNull("charging")) c.getConfig("charging") + else com.typesafe.config.ConfigFactory.parseString("charging{}") + ), + defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = + if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = + if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( + if (c.hasPathOrNull("human")) c.getConfig("human") + else com.typesafe.config.ConfigFactory.parseString("human{}") + ), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( + if (c.hasPathOrNull("initialization")) c.getConfig("initialization") + else com.typesafe.config.ConfigFactory.parseString("initialization{}") + ), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( + if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") + else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") + ), + linkFleetStateAcrossIterations = + c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = + if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + pooledToRegularRideCostRatio = + if (c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") + else 0.6, + rangeBufferForDispatchInMeters = + if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") + else 10000, + refuelLocationType = + if (c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", + refuelThresholdInMeters = + if (c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( + if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") + else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") + ), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( + if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") + else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") + ), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( + if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") + else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") + ) + ) + } + } + case class RideHailTransit( - modesToConsider : java.lang.String + modesToConsider: java.lang.String ) + object RideHailTransit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) + object TripBehaviors { + case class CarUsage( - minDistanceToTrainStop : scala.Double + minDistanceToTrainStop: scala.Double ) + object CarUsage { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = + if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path : java.lang.String, - additional_trip_utility : scala.Double, - destination_nest_scale_factor : scala.Double, - generate_secondary_activities : scala.Boolean, - intercept_file_path : java.lang.String, - max_destination_choice_set_size : scala.Int, - max_destination_distance_meters : scala.Double, - mode_nest_scale_factor : scala.Double, - trip_nest_scale_factor : scala.Double + activity_file_path: java.lang.String, + additional_trip_utility: scala.Double, + destination_nest_scale_factor: scala.Double, + generate_secondary_activities: scala.Boolean, + intercept_file_path: java.lang.String, + max_destination_choice_set_size: scala.Int, + max_destination_distance_meters: scala.Double, + mode_nest_scale_factor: scala.Double, + trip_nest_scale_factor: scala.Double ) + object MulitnomialLogit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, - generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, - max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, - mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = + if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = + if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = + if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") + else 1.0, + generate_secondary_activities = + c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = + if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = + if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") + else 20, + max_destination_distance_meters = + if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") + else 32000, + mode_nest_scale_factor = + if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = + if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( + if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") + else com.typesafe.config.ConfigFactory.parseString("carUsage{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ) ) } } - + case class Vehicles( - downsamplingMethod : java.lang.String, - dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - fractionOfInitialVehicleFleet : scala.Double, - fractionOfPeopleWithBicycle : scala.Double, - fuelTypesFilePath : java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, - linkSocAcrossIterations : scala.Boolean, - linkToGradePercentFilePath : java.lang.String, - meanPrivateVehicleStartingSOC : scala.Double, - meanRidehailVehicleStartingSOC : scala.Double, - sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile : java.lang.String, - vehicleAdjustmentMethod : java.lang.String, - vehicleTypesFilePath : java.lang.String, - vehiclesFilePath : java.lang.String + downsamplingMethod: java.lang.String, + dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + fractionOfInitialVehicleFleet: scala.Double, + fractionOfPeopleWithBicycle: scala.Double, + fuelTypesFilePath: java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, + linkSocAcrossIterations: scala.Boolean, + linkToGradePercentFilePath: java.lang.String, + meanPrivateVehicleStartingSOC: scala.Double, + meanRidehailVehicleStartingSOC: scala.Double, + sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile: java.lang.String, + vehicleAdjustmentMethod: java.lang.String, + vehicleTypesFilePath: java.lang.String, + vehiclesFilePath: java.lang.String ) + object Vehicles { + case class DummySharedBike( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedBike { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedCar { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class SharedFleets$Elm( - fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], - fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], - inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], - managerType : java.lang.String, - name : java.lang.String, - parkingFilePath : java.lang.String, - reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving + ], + fixed_non_reserving_fleet_by_taz: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz + ], + inexhaustible_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving + ], + managerType: java.lang.String, + name: java.lang.String, + parkingFilePath: java.lang.String, + reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) + object SharedFleets$Elm { + case class FixedNonReserving( - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String ) + object FixedNonReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize : scala.Int, - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String, - vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] + fleetSize: scala.Int, + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String, + vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] ) + object FixedNonReservingFleetByTaz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None + fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = + if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) + else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object InexhaustibleReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], - name : java.lang.String, - repositionTimeBin : scala.Int, - statTimeBin : scala.Int + min_availability_undersupply_algorithm: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm + ], + name: java.lang.String, + repositionTimeBin: scala.Int, + statTimeBin: scala.Int ) + object Reposition { + case class MinAvailabilityUndersupplyAlgorithm( - matchLimit : scala.Int + matchLimit: scala.Int ) + object MinAvailabilityUndersupplyAlgorithm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( - matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm( + matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = + if (c.hasPathOrNull("min-availability-undersupply-algorithm")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) + ) + else None, + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, - fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, - inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, - managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None + fixed_non_reserving = + if (c.hasPathOrNull("fixed-non-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReserving(c.getConfig("fixed-non-reserving")) + ) + else None, + fixed_non_reserving_fleet_by_taz = + if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) + ) + else None, + inexhaustible_reserving = + if (c.hasPathOrNull("inexhaustible-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) + ) + else None, + managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = + if (c.hasPathOrNull("reposition")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) + ) + else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, - fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, - meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", - vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" - ) - } - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = + if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") + else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( + if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") + else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") + ), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( + if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") + else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") + ), + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 1.0, + fractionOfPeopleWithBicycle = + if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = + if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") + else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( + "generateEmergencyHouseholdVehicleWhenPlansRequireIt" + ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = + c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = + if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = + if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") + else 1.0, + meanRidehailVehicleStartingSOC = + if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") + else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = + if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") + else "", + vehicleAdjustmentMethod = + if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = + if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") + else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = + if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") + else "/test/input/beamville/vehicles.csv" + ) + } + + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Agentsim.Agents.Vehicles + .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), - bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), - households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), - parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities( + if (c.hasPathOrNull("activities")) c.getConfig("activities") + else com.typesafe.config.ConfigFactory.parseString("activities{}") + ), + bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight( + if (c.hasPathOrNull("freight")) c.getConfig("freight") + else com.typesafe.config.ConfigFactory.parseString("freight{}") + ), + households = BeamConfig.Beam.Agentsim.Agents.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( + if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") + else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") + ), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( + if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") + else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") + ), + parking = BeamConfig.Beam.Agentsim.Agents.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + plans = BeamConfig.Beam.Agentsim.Agents.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + population = BeamConfig.Beam.Agentsim.Agents.Population( + if (c.hasPathOrNull("population")) c.getConfig("population") + else com.typesafe.config.ConfigFactory.parseString("population{}") + ), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( + if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") + else com.typesafe.config.ConfigFactory.parseString("ptFare{}") + ), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( + if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") + else com.typesafe.config.ConfigFactory.parseString("rideHail{}") + ), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( + if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") + else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") + ), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( + if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") + else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") + ), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor : scala.Double, - chargingPointCountScalingFactor : scala.Double, - chargingPointFilePath : java.lang.String, - helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds : scala.Int + chargingPointCostScalingFactor: scala.Double, + chargingPointCountScalingFactor: scala.Double, + chargingPointFilePath: java.lang.String, + helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds: scala.Int ) + object ChargingNetworkManager { + case class Helics( - bufferSize : scala.Int, - connectionEnabled : scala.Boolean, - coreInitString : java.lang.String, - coreType : java.lang.String, - dataInStreamPoint : java.lang.String, - dataOutStreamPoint : java.lang.String, - federateName : java.lang.String, - feedbackEnabled : scala.Boolean, - intLogLevel : scala.Int, - timeDeltaProperty : scala.Double + bufferSize: scala.Int, + connectionEnabled: scala.Boolean, + coreInitString: java.lang.String, + coreType: java.lang.String, + dataInStreamPoint: java.lang.String, + dataOutStreamPoint: java.lang.String, + federateName: java.lang.String, + feedbackEnabled: scala.Boolean, + intLogLevel: scala.Int, + timeDeltaProperty: scala.Double ) + object Helics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", - dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = + if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") + else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = + if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") + else "GridFed/PhysicalBounds", + dataOutStreamPoint = + if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled : scala.Boolean, - expansionFactor_charge_activity : scala.Double, - expansionFactor_home_activity : scala.Double, - expansionFactor_init_activity : scala.Double, - expansionFactor_wherever_activity : scala.Double, - expansionFactor_work_activity : scala.Double + enabled: scala.Boolean, + expansionFactor_charge_activity: scala.Double, + expansionFactor_home_activity: scala.Double, + expansionFactor_init_activity: scala.Double, + expansionFactor_wherever_activity: scala.Double, + expansionFactor_work_activity: scala.Double ) + object ScaleUp { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, - expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, - expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, - expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, - expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = + if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") + else 1.0, + expansionFactor_home_activity = + if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") + else 1.0, + expansionFactor_init_activity = + if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") + else 1.0, + expansionFactor_wherever_activity = + if (c.hasPathOrNull("expansionFactor_wherever_activity")) + c.getDouble("expansionFactor_wherever_activity") + else 1.0, + expansionFactor_work_activity = + if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") + else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, - chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, - chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), - timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = + if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") + else 1.0, + chargingPointCountScalingFactor = + if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") + else 1.0, + chargingPointFilePath = + if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( + if (c.hasPathOrNull("helics")) c.getConfig("helics") + else com.typesafe.config.ConfigFactory.parseString("helics{}") + ), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( + if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") + else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") + ), + timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution : scala.Int, - upperBoundResolution : scala.Int + lowerBoundResolution: scala.Int, + upperBoundResolution: scala.Int ) + object H3taz { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile : java.lang.String + frequencyAdjustmentFile: java.lang.String ) + object Scenarios { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = + if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") + else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay : scala.Int, - interval : scala.Int + initialDelay: scala.Int, + interval: scala.Int ) + object ScheduleMonitorTask { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath : java.lang.String, - parkingCostScalingFactor : scala.Double, - parkingFilePath : java.lang.String, - parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor : scala.Double + filePath: java.lang.String, + parkingCostScalingFactor: scala.Double, + parkingFilePath: java.lang.String, + parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor: scala.Double ) + object Taz { + case class ParkingManager( - displayPerformanceTimings : scala.Boolean, - level : java.lang.String, - method : java.lang.String, - parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings: scala.Boolean, + level: java.lang.String, + method: java.lang.String, + parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) + object ParkingManager { + case class Parallel( - numberOfClusters : scala.Int + numberOfClusters: scala.Int ) + object Parallel { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - level = if(c.hasPathOrNull("level")) c.getString("level") else "TAZ", - method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + level = if (c.hasPathOrNull("level")) c.getString("level") else "TAZ", + method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( + if (c.hasPathOrNull("parallel")) c.getConfig("parallel") + else com.typesafe.config.ConfigFactory.parseString("parallel{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), - parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = + if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( + if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") + else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") + ), + parkingStallCountScalingFactor = + if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") + else 1.0 ) } } - + case class Toll( - filePath : java.lang.String + filePath: java.lang.String ) + object Toll { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules : scala.Double, - rideHailPrice : scala.Double, - tollPrice : scala.Double, - transitCapacity : scala.Option[scala.Double], - transitPrice : scala.Double + fuelCapacityInJoules: scala.Double, + rideHailPrice: scala.Double, + tollPrice: scala.Double, + transitCapacity: scala.Option[scala.Double], + transitPrice: scala.Double ) + object Tuning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = + if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), - schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), - thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, - thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), - tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) + agentSampleSizeAsFractionOfPopulation = + if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) + c.getDouble("agentSampleSizeAsFractionOfPopulation") + else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents( + if (c.hasPathOrNull("agents")) c.getConfig("agents") + else com.typesafe.config.ConfigFactory.parseString("agents{}") + ), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( + if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") + else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") + ), + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = + if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") + else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz( + if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") + else com.typesafe.config.ConfigFactory.parseString("h3taz{}") + ), + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = + if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + scenarios = BeamConfig.Beam.Agentsim.Scenarios( + if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") + else com.typesafe.config.ConfigFactory.parseString("scenarios{}") + ), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( + if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") + else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") + ), + schedulerParallelismWindow = + if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + taz = BeamConfig.Beam.Agentsim.Taz( + if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") + ), + thresholdForMakingParkingChoiceInMeters = + if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) + c.getInt("thresholdForMakingParkingChoiceInMeters") + else 100, + thresholdForWalkingInMeters = + if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll( + if (c.hasPathOrNull("toll")) c.getConfig("toll") + else com.typesafe.config.ConfigFactory.parseString("toll{}") + ), + tuning = BeamConfig.Beam.Agentsim.Tuning( + if (c.hasPathOrNull("tuning")) c.getConfig("tuning") + else com.typesafe.config.ConfigFactory.parseString("tuning{}") + ) ) } } - + case class Calibration( - counts : BeamConfig.Beam.Calibration.Counts, - google : BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio : scala.Double, - mode : BeamConfig.Beam.Calibration.Mode, - objectiveFunction : java.lang.String, - roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, - studyArea : BeamConfig.Beam.Calibration.StudyArea + counts: BeamConfig.Beam.Calibration.Counts, + google: BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio: scala.Double, + mode: BeamConfig.Beam.Calibration.Mode, + objectiveFunction: java.lang.String, + roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, + studyArea: BeamConfig.Beam.Calibration.StudyArea ) + object Calibration { + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Int, - inputCountsFile : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Int, + inputCountsFile: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes ) + object Google { + case class TravelTimes( - enable : scala.Boolean, - iterationInterval : scala.Int, - minDistanceInMeters : scala.Double, - numDataPointsOver24Hours : scala.Int, - offPeakEnabled : scala.Boolean, - queryDate : java.lang.String, - tolls : scala.Boolean + enable: scala.Boolean, + iterationInterval: scala.Int, + minDistanceInMeters: scala.Double, + numDataPointsOver24Hours: scala.Int, + offPeakEnabled: scala.Boolean, + queryDate: java.lang.String, + tolls: scala.Boolean ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = + if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = + if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class Mode( - benchmarkFilePath : java.lang.String + benchmarkFilePath: java.lang.String ) + object Mode { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) + object RoadNetwork { + case class TravelTimes( - zoneBoundariesFilePath : java.lang.String, - zoneODTravelTimesFilePath : java.lang.String + zoneBoundariesFilePath: java.lang.String, + zoneODTravelTimesFilePath: java.lang.String ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = + if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = + if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class StudyArea( - enabled : scala.Boolean, - lat : scala.Double, - lon : scala.Double, - radius : scala.Double + enabled: scala.Boolean, + lat: scala.Double, + lon: scala.Double, + radius: scala.Double ) + object StudyArea { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), - meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), - objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), - studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) + counts = BeamConfig.Beam.Calibration.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + google = BeamConfig.Beam.Calibration.Google( + if (c.hasPathOrNull("google")) c.getConfig("google") + else com.typesafe.config.ConfigFactory.parseString("google{}") + ), + meanToCountsWeightRatio = + if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode( + if (c.hasPathOrNull("mode")) c.getConfig("mode") + else com.typesafe.config.ConfigFactory.parseString("mode{}") + ), + objectiveFunction = + if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") + else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( + if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") + else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") + ), + studyArea = BeamConfig.Beam.Calibration.StudyArea( + if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") + else com.typesafe.config.ConfigFactory.parseString("studyArea{}") + ) ) } } - + case class Cluster( - clusterType : scala.Option[java.lang.String], - enabled : scala.Boolean + clusterType: scala.Option[java.lang.String], + enabled: scala.Boolean ) + object Cluster { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor : BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval : scala.Int, - clearRoutedOutstandingWorkEnabled : scala.Boolean, - debugActorTimerIntervalInSec : scala.Int, - debugEnabled : scala.Boolean, - memoryConsumptionDisplayTimeoutInSec : scala.Int, - messageLogging : scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork : scala.Int, - stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation : BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives : scala.Boolean, - writeRealizedModeChoiceFile : scala.Boolean + actor: BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval: scala.Int, + clearRoutedOutstandingWorkEnabled: scala.Boolean, + debugActorTimerIntervalInSec: scala.Int, + debugEnabled: scala.Boolean, + memoryConsumptionDisplayTimeoutInSec: scala.Int, + messageLogging: scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork: scala.Int, + stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation: BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives: scala.Boolean, + writeRealizedModeChoiceFile: scala.Boolean ) + object Debug { + case class Actor( - logDepth : scala.Int + logDepth: scala.Int ) + object Actor { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs : scala.Long, - checkMaxNumberOfMessagesEnabled : scala.Boolean, - defaultTimeoutMs : scala.Long, - enabled : scala.Boolean, - overallSimulationTimeoutMs : scala.Long, - thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs: scala.Long, + checkMaxNumberOfMessagesEnabled: scala.Boolean, + defaultTimeoutMs: scala.Long, + enabled: scala.Boolean, + overallSimulationTimeoutMs: scala.Long, + thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) + object StuckAgentDetection { + case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs : scala.Long, - triggerType : java.lang.String + actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs: scala.Long, + triggerType: java.lang.String ) + object Thresholds$Elm { + case class ActorTypeToMaxNumberOfMessages( - population : scala.Option[scala.Int], - rideHailAgent : scala.Option[scala.Int], - rideHailManager : scala.Option[scala.Int], - transitDriverAgent : scala.Option[scala.Int] + population: scala.Option[scala.Int], + rideHailAgent: scala.Option[scala.Int], + rideHailManager: scala.Option[scala.Int], + transitDriverAgent: scala.Option[scala.Int] ) + object ActorTypeToMaxNumberOfMessages { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = + if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), - markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, - triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = + BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( + if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") + else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") + ), + markAsStuckAfterMs = + if (c.hasPathOrNull("markAsStuckAfterMs")) + c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 20000, + triggerType = + if (c.hasPathOrNull("triggerType")) c.getString("triggerType") + else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, - checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = + if (c.hasPathOrNull("checkIntervalMs")) + c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 200, + checkMaxNumberOfMessagesEnabled = + !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = + if (c.hasPathOrNull("defaultTimeoutMs")) + c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = + if (c.hasPathOrNull("overallSimulationTimeoutMs")) + c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Debug.StuckAgentDetection + .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class TriggerMeasurer( - enabled : scala.Boolean, - writeStuckAgentDetectionConfig : scala.Boolean + enabled: scala.Boolean, + writeStuckAgentDetectionConfig: scala.Boolean ) + object TriggerMeasurer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = + !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram : scala.Boolean + createGCClassHistogram: scala.Boolean ) + object VmInformation { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), - agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), - vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), - writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor( + if (c.hasPathOrNull("actor")) c.getConfig("actor") + else com.typesafe.config.ConfigFactory.parseString("actor{}") + ), + agentTripScoresInterval = + if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = + c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = + if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = + if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) + c.getInt("memoryConsumptionDisplayTimeoutInSec") + else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = + if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) + c.getInt("secondsToWaitToClearRoutedOutstandingWork") + else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( + if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") + else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") + ), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( + if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") + else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") + ), + vmInformation = BeamConfig.Beam.Debug.VmInformation( + if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") + else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") + ), + writeModeChoiceAlternatives = + c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = + c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output : BeamConfig.Beam.Exchange.Output, - scenario : BeamConfig.Beam.Exchange.Scenario + output: BeamConfig.Beam.Exchange.Output, + scenario: BeamConfig.Beam.Exchange.Scenario ) + object Exchange { + case class Output( - activitySimSkimsEnabled : scala.Boolean, - geo : BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled: scala.Boolean, + geo: BeamConfig.Beam.Exchange.Output.Geo ) + object Output { + case class Geo( - filePath : scala.Option[java.lang.String] + filePath: scala.Option[java.lang.String] ) + object Geo { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) + activitySimSkimsEnabled = + c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo( + if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") + ) ) } } - + case class Scenario( - convertWgs2Utm : scala.Boolean, - fileFormat : java.lang.String, - folder : java.lang.String, - modeMap : scala.Option[scala.List[java.lang.String]], - source : java.lang.String, - urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm: scala.Boolean, + fileFormat: java.lang.String, + folder: java.lang.String, + modeMap: scala.Option[scala.List[java.lang.String]], + source: java.lang.String, + urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim ) + object Scenario { + case class Urbansim( - activitySimEnabled : scala.Boolean + activitySimEnabled: scala.Boolean ) + object Urbansim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) + fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) + output = BeamConfig.Beam.Exchange.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + scenario = BeamConfig.Beam.Exchange.Scenario( + if (c.hasPathOrNull("scenario")) c.getConfig("scenario") + else com.typesafe.config.ConfigFactory.parseString("scenario{}") + ) ) } } - + case class Experimental( - optimizer : BeamConfig.Beam.Experimental.Optimizer + optimizer: BeamConfig.Beam.Experimental.Optimizer ) + object Experimental { + case class Optimizer( - enabled : scala.Boolean + enabled: scala.Boolean ) + object Optimizer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) + optimizer = BeamConfig.Beam.Experimental.Optimizer( + if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") + else com.typesafe.config.ConfigFactory.parseString("optimizer{}") + ) ) } } - + case class Input( - lastBaseOutputDir : java.lang.String, - simulationPrefix : java.lang.String + lastBaseOutputDir: java.lang.String, + simulationPrefix: java.lang.String ) + object Input { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn : scala.Boolean + keepConsoleAppenderOn: scala.Boolean ) + object Logger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level : java.lang.String + level: java.lang.String ) + object Metrics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation : scala.Boolean + writePlansAndStopSimulation: scala.Boolean ) + object Output { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = + c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory : scala.Boolean, - baseOutputDirectory : java.lang.String, - collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, - defaultWriteInterval : scala.Int, - displayPerformanceTimings : scala.Boolean, - events : BeamConfig.Beam.Outputs.Events, - generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval : scala.Int, - matsim : BeamConfig.Beam.Outputs.Matsim, - stats : BeamConfig.Beam.Outputs.Stats, - writeAnalysis : scala.Boolean, - writeEventsInterval : scala.Int, - writeGraphs : scala.Boolean, - writeLinkTraversalInterval : scala.Int, - writePlansInterval : scala.Int, - writeR5RoutesInterval : scala.Int + addTimestampToOutputDirectory: scala.Boolean, + baseOutputDirectory: java.lang.String, + collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, + defaultWriteInterval: scala.Int, + displayPerformanceTimings: scala.Boolean, + events: BeamConfig.Beam.Outputs.Events, + generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval: scala.Int, + matsim: BeamConfig.Beam.Outputs.Matsim, + stats: BeamConfig.Beam.Outputs.Stats, + writeAnalysis: scala.Boolean, + writeEventsInterval: scala.Int, + writeGraphs: scala.Boolean, + writeLinkTraversalInterval: scala.Int, + writePlansInterval: scala.Int, + writeR5RoutesInterval: scala.Int ) + object Outputs { + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime : scala.Int, - startTime : scala.Int + endTime: scala.Int, + startTime: scala.Int ) + object GeneralizedLinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles : java.lang.String, - deleteRootFolderFiles : java.lang.String + deleteITERSFolderFiles: java.lang.String, + deleteRootFolderFiles: java.lang.String ) + object Matsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = + if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = + if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize : scala.Int + binSize: scala.Int ) + object Stats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), - defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), - generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), - stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writeLinkTraversalInterval = if(c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = + !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = + if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = + !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( + "collectAndCreateBeamAnalysisAndGraphs" + ), + defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( + if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") + else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") + ), + generalizedLinkStatsInterval = + if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ), + stats = BeamConfig.Beam.Outputs.Stats( + if (c.hasPathOrNull("stats")) c.getConfig("stats") + else com.typesafe.config.ConfigFactory.parseString("stats{}") + ), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writeLinkTraversalInterval = + if (c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim : BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager : BeamConfig.Beam.Physsim.EventManager, - events : BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia : scala.Boolean, - eventsSampling : scala.Double, - flowCapacityFactor : scala.Double, - initializeRouterWithFreeFlowTimes : scala.Boolean, - inputNetworkFilePath : java.lang.String, - jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize : scala.Int, - linkStatsWriteInterval : scala.Int, - name : java.lang.String, - network : BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath : java.lang.String, - parbprsim : BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize : scala.Double, - quick_fix_minCarSpeedInMetersPerSecond : scala.Double, - relaxation : BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim : scala.Boolean, - speedScalingFactor : scala.Double, - storageCapacityFactor : scala.Double, - writeEventsInterval : scala.Int, - writeMATSimNetwork : scala.Boolean, - writePlansInterval : scala.Int, - writeRouteHistoryInterval : scala.Int + bprsim: BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager: BeamConfig.Beam.Physsim.EventManager, + events: BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia: scala.Boolean, + eventsSampling: scala.Double, + flowCapacityFactor: scala.Double, + initializeRouterWithFreeFlowTimes: scala.Boolean, + inputNetworkFilePath: java.lang.String, + jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize: scala.Int, + linkStatsWriteInterval: scala.Int, + name: java.lang.String, + network: BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath: java.lang.String, + parbprsim: BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize: scala.Double, + quick_fix_minCarSpeedInMetersPerSecond: scala.Double, + relaxation: BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim: scala.Boolean, + speedScalingFactor: scala.Double, + storageCapacityFactor: scala.Double, + writeEventsInterval: scala.Int, + writeMATSimNetwork: scala.Boolean, + writePlansInterval: scala.Int, + writeRouteHistoryInterval: scala.Int ) + object Physsim { + case class Bprsim( - inFlowAggregationTimeWindowInSeconds : scala.Int, - minFlowToUseBPRFunction : scala.Int, - travelTimeFunction : java.lang.String + inFlowAggregationTimeWindowInSeconds: scala.Int, + minFlowToUseBPRFunction: scala.Int, + travelTimeFunction: java.lang.String ) + object Bprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, - minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = + if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) + c.getInt("inFlowAggregationTimeWindowInSeconds") + else 900, + minFlowToUseBPRFunction = + if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor : scala.Double + congestionFactor: scala.Double ) + object CchRoutingAssignment { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax : scala.Int, - departureTimeShiftMin : scala.Int, - fractionOfEventsToDuplicate : scala.Double + departureTimeShiftMax: scala.Int, + departureTimeShiftMin: scala.Int, + fractionOfEventsToDuplicate: scala.Double ) + object DuplicatePTE { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = + if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = + if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = + if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads : scala.Int, - `type` : java.lang.String + numberOfThreads: scala.Int, + `type`: java.lang.String ) + object EventManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) + object Jdeqsim { + case class AgentSimPhysSimInterfaceDebugger( - enabled : scala.Boolean + enabled: scala.Boolean ) + object AgentSimPhysSimInterfaceDebugger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, - capacityPlansWriteInterval : scala.Int, - enabled : scala.Boolean, - minRoadCapacity : scala.Int, - minSpeedMetersPerSec : scala.Int, - speedAdjustmentFactor : scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, + capacityPlansWriteInterval: scala.Int, + enabled: scala.Boolean, + minRoadCapacity: scala.Int, + minSpeedMetersPerSec: scala.Int, + speedAdjustmentFactor: scala.Double ) + object Cacc { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, - capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = + if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) + c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") + else 1.3, + capacityPlansWriteInterval = + if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = + if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = + if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( + if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") + else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") + ), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( + if (c.hasPathOrNull("cacc")) c.getConfig("cacc") + else com.typesafe.config.ConfigFactory.parseString("cacc{}") + ) ) } } - + case class Network( - maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) + object Network { + case class MaxSpeedInference( - enabled : scala.Boolean, - `type` : java.lang.String + enabled: scala.Boolean, + `type`: java.lang.String ) + object MaxSpeedInference { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled : scala.Boolean, - livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled: scala.Boolean, + livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) + object OverwriteRoadTypeProperties { + case class LivingStreet( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object LivingStreet { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Minor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Motorway { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object MotorwayLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Primary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object PrimaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Residential { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Secondary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object SecondaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Tertiary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TertiaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Trunk { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TrunkLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Unclassified { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( + if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") + else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") + ), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( + if (c.hasPathOrNull("minor")) c.getConfig("minor") + else com.typesafe.config.ConfigFactory.parseString("minor{}") + ), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( + if (c.hasPathOrNull("motorway")) c.getConfig("motorway") + else com.typesafe.config.ConfigFactory.parseString("motorway{}") + ), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( + if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") + else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") + ), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( + if (c.hasPathOrNull("primary")) c.getConfig("primary") + else com.typesafe.config.ConfigFactory.parseString("primary{}") + ), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( + if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") + else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") + ), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( + if (c.hasPathOrNull("residential")) c.getConfig("residential") + else com.typesafe.config.ConfigFactory.parseString("residential{}") + ), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( + if (c.hasPathOrNull("secondary")) c.getConfig("secondary") + else com.typesafe.config.ConfigFactory.parseString("secondary{}") + ), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( + if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") + else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") + ), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( + if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") + else com.typesafe.config.ConfigFactory.parseString("tertiary{}") + ), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( + if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") + else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") + ), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( + if (c.hasPathOrNull("trunk")) c.getConfig("trunk") + else com.typesafe.config.ConfigFactory.parseString("trunk{}") + ), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( + if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") + else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") + ), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( + if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") + else com.typesafe.config.ConfigFactory.parseString("unclassified{}") + ) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( + if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") + else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") + ), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( + if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") + else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") + ) ) } } - + case class Parbprsim( - numberOfClusters : scala.Int, - syncInterval : scala.Int + numberOfClusters: scala.Int, + syncInterval: scala.Int ) + object Parbprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier : scala.Double, - enabled : scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime : scala.Int + additionalTravelTimeMultiplier: scala.Double, + enabled: scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime: scala.Int ) + object PickUpDropOffAnalysis { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 + additionalTravelTimeMultiplier = + if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") + else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = + if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) + c.getInt("secondsFromPickUpPropOffToAffectTravelTime") + else 600 ) } } - + case class Relaxation( - experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type` : java.lang.String + experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type`: java.lang.String ) + object Relaxation { + case class Experiment20( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment20 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment21 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment30 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment40 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment50 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment51 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment52 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( + if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") + else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") + ), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( + if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") + else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") + ), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( + if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") + else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") + ), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( + if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") + else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") + ), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( + if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") + else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") + ), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( + if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") + else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") + ), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( + if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") + else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") + ), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), - eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), - events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), - linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), - ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim( + if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") + else com.typesafe.config.ConfigFactory.parseString("bprsim{}") + ), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( + if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") + else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") + ), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( + if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") + else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") + ), + eventManager = BeamConfig.Beam.Physsim.EventManager( + if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") + else com.typesafe.config.ConfigFactory.parseString("eventManager{}") + ), + events = BeamConfig.Beam.Physsim.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + eventsForFullVersionOfVia = + !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = + !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = + if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") + else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( + if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") + else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") + ), + linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = + if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + overwriteLinkParamPath = + if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim( + if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") + else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") + ), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( + if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") + else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") + ), + ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = + if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) + c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") + else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation( + if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") + else com.typesafe.config.ConfigFactory.parseString("relaxation{}") + ), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = + if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = + if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1 : scala.Double, - ModuleProbability_2 : scala.Double, - ModuleProbability_3 : scala.Double, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - clearModes : BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation : scala.Double, - maxAgentPlanMemorySize : scala.Int + ModuleProbability_1: scala.Double, + ModuleProbability_2: scala.Double, + ModuleProbability_3: scala.Double, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + clearModes: BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation: scala.Double, + maxAgentPlanMemorySize: scala.Int ) + object Replanning { + case class ClearModes( - iteration : scala.Int, - modes : scala.Option[scala.List[java.lang.String]], - strategy : java.lang.String + iteration: scala.Int, + modes: scala.Option[scala.List[java.lang.String]], + strategy: java.lang.String ) + object ClearModes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes( + if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") + else com.typesafe.config.ConfigFactory.parseString("clearModes{}") + ), + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getDouble("fractionOfIterationsToDisableInnovation") + else Double.PositiveInfinity, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim : BeamConfig.Beam.Router.Skim + skim: BeamConfig.Beam.Router.Skim ) + object Router { + case class Skim( - activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims : scala.Int, - origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval : scala.Int, - writeSkimsInterval : scala.Int + activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims: scala.Int, + origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval: scala.Int, + writeSkimsInterval: scala.Int ) + object Skim { + case class ActivitySimSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object ActivitySimSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object DriveTimeSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", - name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") + else "skimsTravelTimeObservedVsSimulated", + name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String, - poolingTravelTimeOveheadFactor : scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, - writeFullSkimsInterval : scala.Int + fileBaseName: java.lang.String, + name: java.lang.String, + poolingTravelTimeOveheadFactor: scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, + writeFullSkimsInterval: scala.Int ) + object OriginDestinationSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, - writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = + if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") + else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = + if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) + c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") + else 0, + writeFullSkimsInterval = + if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName : java.lang.String, - geoHierarchy : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + geoHierarchy: java.lang.String, + name: java.lang.String ) + object TazSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object TransitCrowdingSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), - keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), - writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( + if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") + else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") + ), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( + if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") + else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") + ), + keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( + if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") + else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") + ), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( + if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") + else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") + ), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( + if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") + else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") + ), + writeAggregatedSkimsInterval = + if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) + skim = BeamConfig.Beam.Router.Skim( + if (c.hasPathOrNull("skim")) c.getConfig("skim") + else com.typesafe.config.ConfigFactory.parseString("skim{}") + ) ) } } - + case class Routing( - baseDate : java.lang.String, - carRouter : java.lang.String, - gh : BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS : scala.Int, - overrideNetworkTravelTimesUsingSkims : scala.Boolean, - r5 : BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor : scala.Double, - startingIterationForTravelTimesMSA : scala.Int, - transitOnStreetNetwork : scala.Boolean, - writeRoutingStatistic : scala.Boolean + baseDate: java.lang.String, + carRouter: java.lang.String, + gh: BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS: scala.Int, + overrideNetworkTravelTimesUsingSkims: scala.Boolean, + r5: BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor: scala.Double, + startingIterationForTravelTimesMSA: scala.Int, + transitOnStreetNetwork: scala.Boolean, + writeRoutingStatistic: scala.Boolean ) + object Routing { + case class Gh( - useAlternativeRoutes : scala.Boolean + useAlternativeRoutes: scala.Boolean ) + object Gh { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath : java.lang.String, - bikeLaneScaleFactor : scala.Double, - departureWindow : scala.Double, - directory : java.lang.String, - linkRadiusMeters : scala.Double, - mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples : scala.Int, - osmFile : java.lang.String, - osmMapdbFile : java.lang.String, - travelTimeNoiseFraction : scala.Double + bikeLaneLinkIdsFilePath: java.lang.String, + bikeLaneScaleFactor: scala.Double, + departureWindow: scala.Double, + directory: java.lang.String, + linkRadiusMeters: scala.Double, + mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples: scala.Int, + osmFile: java.lang.String, + osmMapdbFile: java.lang.String, + travelTimeNoiseFraction: scala.Double ) + object R5 { + case class MNetBuilder( - fromCRS : java.lang.String, - toCRS : java.lang.String + fromCRS: java.lang.String, + toCRS: java.lang.String ) + object MNetBuilder { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike : scala.Int + bike: scala.Int ) + object MaxDistanceLimitByModeInMeters { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), - numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", - osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = + if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = + if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( + if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") + else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") + ), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( + if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") + ), + numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmFile = + if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", + osmMapdbFile = + if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") + else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = + if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), - minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, - overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), - r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), - skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh( + if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") + ), + minimumPossibleSkimBasedTravelTimeInS = + if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) + c.getInt("minimumPossibleSkimBasedTravelTimeInS") + else 60, + overrideNetworkTravelTimesUsingSkims = + c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( + "overrideNetworkTravelTimesUsingSkims" + ), + r5 = BeamConfig.Beam.Routing.R5( + if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") + ), + skimTravelTimesScalingFactor = + if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = + if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") + else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric : BeamConfig.Beam.Sim.Metric, - termination : BeamConfig.Beam.Sim.Termination + metric: BeamConfig.Beam.Sim.Metric, + termination: BeamConfig.Beam.Sim.Termination ) + object Sim { + case class Metric( - collector : BeamConfig.Beam.Sim.Metric.Collector + collector: BeamConfig.Beam.Sim.Metric.Collector ) + object Metric { + case class Collector( - influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics : java.lang.String + influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics: java.lang.String ) + object Collector { + case class InfluxDbSimulationMetricCollector( - connectionString : java.lang.String, - database : java.lang.String + connectionString: java.lang.String, + database: java.lang.String ) + object InfluxDbSimulationMetricCollector { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = + if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), - metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = + BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( + if (c.hasPathOrNull("influxDbSimulationMetricCollector")) + c.getConfig("influxDbSimulationMetricCollector") + else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") + ), + metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) + collector = BeamConfig.Beam.Sim.Metric.Collector( + if (c.hasPathOrNull("collector")) c.getConfig("collector") + else com.typesafe.config.ConfigFactory.parseString("collector{}") + ) ) } } - + case class Termination( - criterionName : java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName: java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) + object Termination { + case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration : scala.Int, - minLastIteration : scala.Int, - relativeTolerance : scala.Double + maxLastIteration: scala.Int, + minLastIteration: scala.Int, + relativeTolerance: scala.Double ) + object TerminateAtRideHailFleetStoredElectricityConvergence { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) + criterionName = + if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = + BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( + if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) + c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") + else + com.typesafe.config.ConfigFactory + .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), - termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) + metric = BeamConfig.Beam.Sim.Metric( + if (c.hasPathOrNull("metric")) c.getConfig("metric") + else com.typesafe.config.ConfigFactory.parseString("metric{}") + ), + termination = BeamConfig.Beam.Sim.Termination( + if (c.hasPathOrNull("termination")) c.getConfig("termination") + else com.typesafe.config.ConfigFactory.parseString("termination{}") + ) ) } } - + case class Spatial( - boundingBoxBuffer : scala.Int, - localCRS : java.lang.String + boundingBoxBuffer: scala.Int, + localCRS: java.lang.String ) + object Spatial { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear ) + object Urbansim { + case class BackgroundODSkimsCreator( - calculationTimeoutHours : scala.Int, - enabled : scala.Boolean, - maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes : scala.Int, - peakHours : scala.Option[scala.List[scala.Double]], - routerType : java.lang.String, - skimsGeoType : java.lang.String, - skimsKind : java.lang.String + calculationTimeoutHours: scala.Int, + enabled: scala.Boolean, + maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes: scala.Int, + peakHours: scala.Option[scala.List[scala.Double]], + routerType: java.lang.String, + skimsGeoType: java.lang.String, + skimsKind: java.lang.String ) + object BackgroundODSkimsCreator { + case class MaxTravelDistanceInMeters( - bike : scala.Int, - walk : scala.Int + bike: scala.Int, + walk: scala.Int ) + object MaxTravelDistanceInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive : scala.Boolean, - transit : scala.Boolean, - walk : scala.Boolean + drive: scala.Boolean, + transit: scala.Boolean, + walk: scala.Boolean ) + object ModesToBuild { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), - numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = + if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( + if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") + ), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( + if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") + else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") + ), + numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes : scala.Double, - bike : scala.Double, - car : scala.Double, - drive_transit : scala.Double, - walk : scala.Double, - walk_transit : scala.Double + allModes: scala.Double, + bike: scala.Double, + car: scala.Double, + drive_transit: scala.Double, + walk: scala.Double, + walk_transit: scala.Double ) + object FractionOfModesToClear { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( + if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") + else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") + ), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( + if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") + else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") + ) ) } } - + case class WarmStart( - path : java.lang.String, - prepareData : scala.Boolean, - samplePopulationIntegerFlag : scala.Int, - skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type` : java.lang.String + path: java.lang.String, + prepareData: scala.Boolean, + samplePopulationIntegerFlag: scala.Int, + skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type`: java.lang.String ) + object WarmStart { + case class SkimsFilePaths$Elm( - skimType : java.lang.String, - skimsFilePath : java.lang.String + skimType: java.lang.String, + skimsFilePath: java.lang.String ) + object SkimsFilePaths$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if(c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if (c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = + if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = + if (c.hasPathOrNull("skimsFilePaths")) + scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) + else None, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), - calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), - cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), - debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), - exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), - experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), - input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), - inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), - metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), - output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), - physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), - replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), - routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), - sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), - spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), - urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) + actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim( + if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") + else com.typesafe.config.ConfigFactory.parseString("agentsim{}") + ), + calibration = BeamConfig.Beam.Calibration( + if (c.hasPathOrNull("calibration")) c.getConfig("calibration") + else com.typesafe.config.ConfigFactory.parseString("calibration{}") + ), + cluster = BeamConfig.Beam.Cluster( + if (c.hasPathOrNull("cluster")) c.getConfig("cluster") + else com.typesafe.config.ConfigFactory.parseString("cluster{}") + ), + debug = BeamConfig.Beam.Debug( + if (c.hasPathOrNull("debug")) c.getConfig("debug") + else com.typesafe.config.ConfigFactory.parseString("debug{}") + ), + exchange = BeamConfig.Beam.Exchange( + if (c.hasPathOrNull("exchange")) c.getConfig("exchange") + else com.typesafe.config.ConfigFactory.parseString("exchange{}") + ), + experimental = BeamConfig.Beam.Experimental( + if (c.hasPathOrNull("experimental")) c.getConfig("experimental") + else com.typesafe.config.ConfigFactory.parseString("experimental{}") + ), + input = BeamConfig.Beam.Input( + if (c.hasPathOrNull("input")) c.getConfig("input") + else com.typesafe.config.ConfigFactory.parseString("input{}") + ), + inputDirectory = + if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger( + if (c.hasPathOrNull("logger")) c.getConfig("logger") + else com.typesafe.config.ConfigFactory.parseString("logger{}") + ), + metrics = BeamConfig.Beam.Metrics( + if (c.hasPathOrNull("metrics")) c.getConfig("metrics") + else com.typesafe.config.ConfigFactory.parseString("metrics{}") + ), + output = BeamConfig.Beam.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + outputs = BeamConfig.Beam.Outputs( + if (c.hasPathOrNull("outputs")) c.getConfig("outputs") + else com.typesafe.config.ConfigFactory.parseString("outputs{}") + ), + physsim = BeamConfig.Beam.Physsim( + if (c.hasPathOrNull("physsim")) c.getConfig("physsim") + else com.typesafe.config.ConfigFactory.parseString("physsim{}") + ), + replanning = BeamConfig.Beam.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + router = BeamConfig.Beam.Router( + if (c.hasPathOrNull("router")) c.getConfig("router") + else com.typesafe.config.ConfigFactory.parseString("router{}") + ), + routing = BeamConfig.Beam.Routing( + if (c.hasPathOrNull("routing")) c.getConfig("routing") + else com.typesafe.config.ConfigFactory.parseString("routing{}") + ), + sim = BeamConfig.Beam.Sim( + if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") + ), + spatial = BeamConfig.Beam.Spatial( + if (c.hasPathOrNull("spatial")) c.getConfig("spatial") + else com.typesafe.config.ConfigFactory.parseString("spatial{}") + ), + urbansim = BeamConfig.Beam.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart( + if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") + else com.typesafe.config.ConfigFactory.parseString("warmStart{}") + ) ) } } - + case class Matsim( - conversion : BeamConfig.Matsim.Conversion, - modules : BeamConfig.Matsim.Modules + conversion: BeamConfig.Matsim.Conversion, + modules: BeamConfig.Matsim.Modules ) + object Matsim { + case class Conversion( - defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles : scala.Boolean, - matsimNetworkFile : java.lang.String, - osmFile : java.lang.String, - populationFile : java.lang.String, - scenarioDirectory : java.lang.String, - shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile : java.lang.String + defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles: scala.Boolean, + matsimNetworkFile: java.lang.String, + osmFile: java.lang.String, + populationFile: java.lang.String, + scenarioDirectory: java.lang.String, + shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile: java.lang.String ) + object Conversion { + case class DefaultHouseholdIncome( - currency : java.lang.String, - period : java.lang.String, - value : scala.Int + currency: java.lang.String, + period: java.lang.String, + value: scala.Int ) + object DefaultHouseholdIncome { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if(c.hasPathOrNull("period")) c.getString("period") else "year", - value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if (c.hasPathOrNull("period")) c.getString("period") else "year", + value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile : java.lang.String, - tazIdFieldName : java.lang.String + shapeFile: java.lang.String, + tazIdFieldName: java.lang.String ) + object ShapeConfig { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( + if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") + else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") + ), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = + if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = + if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = + if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") + else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( + if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") + else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") + ), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode : BeamConfig.Matsim.Modules.ChangeMode, - controler : BeamConfig.Matsim.Modules.Controler, - counts : BeamConfig.Matsim.Modules.Counts, - global : BeamConfig.Matsim.Modules.Global, - households : BeamConfig.Matsim.Modules.Households, - linkStats : BeamConfig.Matsim.Modules.LinkStats, - network : BeamConfig.Matsim.Modules.Network, - parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, - plans : BeamConfig.Matsim.Modules.Plans, - qsim : BeamConfig.Matsim.Modules.Qsim, - strategy : BeamConfig.Matsim.Modules.Strategy, - transit : BeamConfig.Matsim.Modules.Transit, - vehicles : BeamConfig.Matsim.Modules.Vehicles + changeMode: BeamConfig.Matsim.Modules.ChangeMode, + controler: BeamConfig.Matsim.Modules.Controler, + counts: BeamConfig.Matsim.Modules.Counts, + global: BeamConfig.Matsim.Modules.Global, + households: BeamConfig.Matsim.Modules.Households, + linkStats: BeamConfig.Matsim.Modules.LinkStats, + network: BeamConfig.Matsim.Modules.Network, + parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, + plans: BeamConfig.Matsim.Modules.Plans, + qsim: BeamConfig.Matsim.Modules.Qsim, + strategy: BeamConfig.Matsim.Modules.Strategy, + transit: BeamConfig.Matsim.Modules.Transit, + vehicles: BeamConfig.Matsim.Modules.Vehicles ) + object Modules { + case class ChangeMode( - modes : java.lang.String + modes: java.lang.String ) + object ChangeMode { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat : java.lang.String, - firstIteration : scala.Int, - lastIteration : scala.Int, - mobsim : java.lang.String, - outputDirectory : java.lang.String, - overwriteFiles : java.lang.String + eventsFileFormat: java.lang.String, + firstIteration: scala.Int, + lastIteration: scala.Int, + mobsim: java.lang.String, + outputDirectory: java.lang.String, + overwriteFiles: java.lang.String ) + object Controler { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = + if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Double, - inputCountsFile : java.lang.String, - outputformat : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Double, + inputCountsFile: java.lang.String, + outputformat: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem : java.lang.String, - randomSeed : scala.Int + coordinateSystem: java.lang.String, + randomSeed: scala.Int ) + object Global { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile : java.lang.String, - inputHouseholdAttributesFile : java.lang.String + inputFile: java.lang.String, + inputHouseholdAttributesFile: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" + inputFile = + if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = + if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") + else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations : scala.Int, - writeLinkStatsInterval : scala.Int + averageLinkStatsOverIterations: scala.Int, + writeLinkStatsInterval: scala.Int ) + object LinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = + if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = + if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile : java.lang.String + inputNetworkFile: java.lang.String ) + object Network { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = + if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") + else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents : scala.Int, - numberOfThreads : scala.Int, - oneThreadPerHandler : scala.Boolean, - synchronizeOnSimSteps : scala.Boolean + estimatedNumberOfEvents: scala.Int, + numberOfThreads: scala.Int, + oneThreadPerHandler: scala.Boolean, + synchronizeOnSimSteps: scala.Boolean ) + object ParallelEventHandling { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = + if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta : scala.Long, - earlyDeparture : scala.Long, - lateArrival : scala.Long, - learningRate : scala.Long, - parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing : scala.Long, - traveling : scala.Long, - waiting : scala.Long, - writeExperiencedPlans : scala.Boolean + BrainExpBeta: scala.Long, + earlyDeparture: scala.Long, + lateArrival: scala.Long, + learningRate: scala.Long, + parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing: scala.Long, + traveling: scala.Long, + waiting: scala.Long, + writeExperiencedPlans: scala.Boolean ) + object PlanCalcScore { + case class Parameterset$Elm( - activityType : java.lang.String, - priority : scala.Int, - scoringThisActivityAtAll : scala.Boolean, - `type` : java.lang.String, - typicalDuration : java.lang.String, - typicalDurationScoreComputation : java.lang.String + activityType: java.lang.String, + priority: scala.Int, + scoringThisActivityAtAll: scala.Boolean, + `type`: java.lang.String, + typicalDuration: java.lang.String, + typicalDurationScoreComputation: java.lang.String ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" + activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = + !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = + if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") + else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, - earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, - lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, - learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, - traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, - waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + BrainExpBeta = + if (c.hasPathOrNull("BrainExpBeta")) + c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) + else 2, + earlyDeparture = + if (c.hasPathOrNull("earlyDeparture")) + c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, + lateArrival = + if (c.hasPathOrNull("lateArrival")) + c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) + else -18, + learningRate = + if (c.hasPathOrNull("learningRate")) + c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) + else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = + if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) + else 6, + traveling = + if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) + else -6, + waiting = + if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.PlanCalcScore + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Plans( - inputPersonAttributesFile : java.lang.String, - inputPlansFile : java.lang.String + inputPersonAttributesFile: java.lang.String, + inputPlansFile: java.lang.String ) + object Plans { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" + inputPersonAttributesFile = + if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") + else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = + if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") + else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime : java.lang.String, - snapshotperiod : java.lang.String, - startTime : java.lang.String + endTime: java.lang.String, + snapshotperiod: java.lang.String, + startTime: java.lang.String ) + object Qsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1 : scala.Int, - ModuleProbability_2 : scala.Int, - ModuleProbability_3 : scala.Int, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - fractionOfIterationsToDisableInnovation : scala.Int, - maxAgentPlanMemorySize : scala.Int, - parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval : java.lang.String + ModuleProbability_1: scala.Int, + ModuleProbability_2: scala.Int, + ModuleProbability_3: scala.Int, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + fractionOfIterationsToDisableInnovation: scala.Int, + maxAgentPlanMemorySize: scala.Int, + parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval: java.lang.String ) + object Strategy { + case class Parameterset$Elm( - disableAfterIteration : scala.Int, - strategyName : java.lang.String, - `type` : java.lang.String, - weight : scala.Int + disableAfterIteration: scala.Int, + strategyName: java.lang.String, + `type`: java.lang.String, + weight: scala.Int ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" - ) - } - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getInt("fractionOfIterationsToDisableInnovation") + else 999999, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = + if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") + else "WorstPlanForRemovalSelector" + ) + } + + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.Strategy + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Transit( - transitModes : java.lang.String, - useTransit : scala.Boolean, - vehiclesFile : java.lang.String + transitModes: java.lang.String, + useTransit: scala.Boolean, + vehiclesFile: java.lang.String ) + object Transit { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile : java.lang.String + vehiclesFile: java.lang.String ) + object Vehicles { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), - controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), - counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), - households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), - network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), - plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), - strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), - transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), - vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + changeMode = BeamConfig.Matsim.Modules.ChangeMode( + if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") + else com.typesafe.config.ConfigFactory.parseString("changeMode{}") + ), + controler = BeamConfig.Matsim.Modules.Controler( + if (c.hasPathOrNull("controler")) c.getConfig("controler") + else com.typesafe.config.ConfigFactory.parseString("controler{}") + ), + counts = BeamConfig.Matsim.Modules.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + global = BeamConfig.Matsim.Modules.Global( + if (c.hasPathOrNull("global")) c.getConfig("global") + else com.typesafe.config.ConfigFactory.parseString("global{}") + ), + households = BeamConfig.Matsim.Modules.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + linkStats = BeamConfig.Matsim.Modules.LinkStats( + if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") + else com.typesafe.config.ConfigFactory.parseString("linkStats{}") + ), + network = BeamConfig.Matsim.Modules.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( + if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") + else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") + ), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( + if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") + else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") + ), + plans = BeamConfig.Matsim.Modules.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + qsim = BeamConfig.Matsim.Modules.Qsim( + if (c.hasPathOrNull("qsim")) c.getConfig("qsim") + else com.typesafe.config.ConfigFactory.parseString("qsim{}") + ), + strategy = BeamConfig.Matsim.Modules.Strategy( + if (c.hasPathOrNull("strategy")) c.getConfig("strategy") + else com.typesafe.config.ConfigFactory.parseString("strategy{}") + ), + transit = BeamConfig.Matsim.Modules.Transit( + if (c.hasPathOrNull("transit")) c.getConfig("transit") + else com.typesafe.config.ConfigFactory.parseString("transit{}") + ), + vehicles = BeamConfig.Matsim.Modules.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), - modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) + conversion = BeamConfig.Matsim.Conversion( + if (c.hasPathOrNull("conversion")) c.getConfig("conversion") + else com.typesafe.config.ConfigFactory.parseString("conversion{}") + ), + modules = BeamConfig.Matsim.Modules( + if (c.hasPathOrNull("modules")) c.getConfig("modules") + else com.typesafe.config.ConfigFactory.parseString("modules{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), - matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) + beam = BeamConfig.Beam( + if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") + ), + matsim = BeamConfig.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ) ) } - private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + + private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { + + private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") + if ( + (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number] + ) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { + + private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException(cv.origin.lineNumber + + new java.lang.RuntimeException( + cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) + ) } - private def $_str(cv:com.typesafe.config.ConfigValue) = + + private def $_str(cv: com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } - diff --git a/src/main/scala/beam/utils/Network2ShapeFile.scala b/src/main/scala/beam/utils/Network2ShapeFile.scala new file mode 100644 index 00000000000..8f4b26c143f --- /dev/null +++ b/src/main/scala/beam/utils/Network2ShapeFile.scala @@ -0,0 +1,189 @@ +package beam.utils + +import beam.sim.common.GeoUtils +import com.typesafe.scalalogging.LazyLogging +import com.vividsolutions.jts.geom.{Coordinate, Envelope, GeometryFactory, LineString} +import org.geotools.feature.simple.{SimpleFeatureBuilder, SimpleFeatureTypeBuilder} +import org.matsim.api.core.v01.network.{Link, Node} +import org.matsim.core.network.NetworkUtils +import org.matsim.core.network.io.NetworkReaderMatsimV2 +import org.matsim.core.utils.geometry.geotools.MGC +import org.matsim.core.utils.gis.ShapeFileWriter +import org.opengis.feature.simple.SimpleFeature +import org.opengis.referencing.crs.CoordinateReferenceSystem + +import scala.collection.JavaConverters._ +import scala.util.Try + +object Network2ShapeFile extends LazyLogging { + + /* Link attributes to be written into SHP file */ + case class NetworkLink( + fromNode: Node, + toNode: Node, + id: String, + modes: String, + origId: String, + roadType: String, + length: Double, + freeSpeed: Double, + capacity: Double, + lanes: Double + ) { + + /* Coordinate of toNode in com.vividsolutions format */ + def vividCoordTo: Coordinate = new Coordinate(toNode.getCoord.getX, toNode.getCoord.getY) + + /* Coordinate of fromNode in com.vividsolutions format */ + def vividCoordFrom: Coordinate = new Coordinate(fromNode.getCoord.getX, fromNode.getCoord.getY) + + /* returns SimpleFeature for shapefile writer */ + def toFeature( + geometryFactory: GeometryFactory, + featureBuilder: SimpleFeatureBuilder + ): Option[SimpleFeature] = { + val nodeCoordinates = Seq(fromNode, toNode) + .map(node => new Coordinate(node.getCoord.getX, node.getCoord.getY)) + .toArray + val lineString: LineString = geometryFactory.createLineString(nodeCoordinates) + + val attributes = lineString +: attributesArray + + try { + Some(featureBuilder.buildFeature(null, attributes)) + } catch { + case exception: Throwable => + logger.error(s"Can not create simple feature from Link. Exception: $exception") + None + } + } + + /* returns link attributes as Array[Object] to generate SimpleFeature + the order should match fields order in NetworkLink.nameToType */ + private def attributesArray: Array[Object] = { + Array( + id, + fromNode.getId.toString, + toNode.getId.toString, + modes, + origId, + roadType, + length, + freeSpeed, + capacity, + lanes + ).map(_.asInstanceOf[Object]) + } + } + + object NetworkLink { + + /* returns map of field name to field type + required for SimpleFeatureTypeBuilder + the order should match values order in NetworkLink.attributesArray */ + val nameToType = IndexedSeq( + "ID" -> classOf[java.lang.String], + "fromID" -> classOf[java.lang.String], + "toID" -> classOf[java.lang.String], + "modes" -> classOf[java.lang.String], + "origid" -> classOf[java.lang.String], + "roadType" -> classOf[java.lang.String], + "length" -> classOf[java.lang.Double], + "freespeed" -> classOf[java.lang.Double], + "capacity" -> classOf[java.lang.Double], + "lanes" -> classOf[java.lang.Double] + ) + + /* creates a NetworkLink object from Link object */ + def apply(link: Link): NetworkLink = { + val linkType = NetworkUtils.getType(link) + val modes: String = Try(link.getAllowedModes.asScala.mkString(",")) getOrElse "" + val origId: String = Try(link.getAttributes.getAttribute("origid").toString) getOrElse "" + + NetworkLink( + fromNode = link.getFromNode, + toNode = link.getToNode, + id = link.getId.toString, + modes = modes, + origId = origId, + roadType = linkType, + length = link.getLength, + freeSpeed = link.getFreespeed, + capacity = link.getCapacity, + lanes = link.getNumberOfLanes + ) + } + } + + /* create a SimpleFeatureBuilder with NetworkLink fields and types */ + private def createFeatureBuilder(crs: CoordinateReferenceSystem): SimpleFeatureBuilder = { + val typeBuilder = new SimpleFeatureTypeBuilder() + typeBuilder.setName("link") + typeBuilder.setCRS(crs) + + typeBuilder.add("the_geom", classOf[LineString]) + NetworkLink.nameToType.foreach { case (name, memberType) => + typeBuilder.add(name, memberType) + } + + new SimpleFeatureBuilder(typeBuilder.buildFeatureType()) + } + + /* the main function to convert matSim network file to shapefile with filtering of links */ + def networkToShapeFile( + matsimNetworkPath: String, + outputShapeFilePath: String, + crs: CoordinateReferenceSystem, + networkFilter: NetworkLink => Boolean + ): Unit = { + val network = NetworkUtils.createNetwork() + val reader = new NetworkReaderMatsimV2(network) + reader.readFile(matsimNetworkPath) + logger.info(s"Read $matsimNetworkPath"); + + val featureBuilder = createFeatureBuilder(crs) + val geometryFactory = new GeometryFactory() + val networkLinks = NetworkUtils.getSortedLinks(network).map(link => NetworkLink(link)) + logger.info(s"Read ${networkLinks.length} network links from network file") + + val features = networkLinks + .filter(networkFilter) + .flatMap(_.toFeature(geometryFactory, featureBuilder)) + logger.info(s"Got ${features.length} features to write to shape file") + + logger.info("Writing features to shape file $outputShapeFilePath ..."); + ShapeFileWriter.writeGeometries(features.toSeq.asJava, outputShapeFilePath); + logger.info("Done"); + } + + def runConversionWithFiltering(matsimNetworkFilePath: String, outputShapeFilePath: String): Unit = { + val crsString = "epsg:26910" + val crs = MGC.getCRS(crsString) + + val geoUtils = new GeoUtils { + override def localCRS: String = crsString + } + + val envelopeWGS = new Envelope(-122.48632, -122.41355, 37.77463, 37.74184) + val envelopeUTM = geoUtils.wgs2Utm(envelopeWGS) + + def filter(networkLink: NetworkLink): Boolean = { + envelopeUTM.contains(networkLink.vividCoordTo) || envelopeUTM.contains(networkLink.vividCoordFrom) + } + + networkToShapeFile(matsimNetworkFilePath, outputShapeFilePath, crs, filter) + } + + /* the main method to run transformation from matSim network into SHP file */ + def main(args: Array[String]): Unit = { + if (args.length != 2) { + throw new IllegalArgumentException( + s"Got ${args.length} arguments, but expected two: <1:path to input physSim network file> <2:path to output shapefile>" + ) + } else { + val matsimNetworkPath = args(0) + val outputShapeFilePath = args(1) + runConversionWithFiltering(matsimNetworkPath, outputShapeFilePath) + } + } +} diff --git a/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala b/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala index d904dc77229..81bc646260f 100644 --- a/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala +++ b/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala @@ -1,5 +1,9 @@ package beam.utils.data.synthpop +import java.io.File +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.util.concurrent.atomic.AtomicInteger import beam.agentsim.infrastructure.geozone._ import beam.sim.common.GeoUtils import beam.sim.population.PopulationAdjustment @@ -9,19 +13,27 @@ import beam.utils.csv.CsvWriter import beam.utils.data.ctpp.models.ResidenceToWorkplaceFlowGeography import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} import beam.utils.data.synthpop.GeoService.CheckResult -import beam.utils.data.synthpop.generators.{RandomWorkDestinationGenerator, TimeLeavingHomeGenerator, TimeLeavingHomeGeneratorImpl, WorkedDurationGeneratorImpl} +import beam.utils.data.synthpop.generators.{ + RandomWorkDestinationGenerator, + TimeLeavingHomeGenerator, + TimeLeavingHomeGeneratorImpl, + WorkedDurationGeneratorImpl +} import beam.utils.data.synthpop.models.Models -import beam.utils.data.synthpop.models.Models._ +import beam.utils.data.synthpop.models.Models.{BlockGroupGeoId, County, Gender, GenericGeoId, State, TazGeoId} import beam.utils.scenario._ -import beam.utils.scenario.generic.writers._ +import beam.utils.scenario.generic.readers.{CsvHouseholdInfoReader, CsvPersonInfoReader, CsvPlanElementReader} +import beam.utils.scenario.generic.writers.{ + CsvBlocksInfoWriter, + CsvHouseholdInfoWriter, + CsvParkingInfoWriter, + CsvPersonInfoWriter, + CsvPlanElementWriter +} import com.typesafe.scalalogging.StrictLogging import org.apache.commons.math3.random.{MersenneTwister, RandomGenerator} import org.matsim.api.core.v01.Coord -import java.io.File -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter -import java.util.concurrent.atomic.AtomicInteger import scala.collection.mutable import scala.util.{Random, Try} diff --git a/src/test/scala/beam/utils/Network2ShapeFileTest.scala b/src/test/scala/beam/utils/Network2ShapeFileTest.scala new file mode 100644 index 00000000000..64773e76271 --- /dev/null +++ b/src/test/scala/beam/utils/Network2ShapeFileTest.scala @@ -0,0 +1,51 @@ +package beam.utils + +import beam.utils.Network2ShapeFile.networkToShapeFile +import beam.utils.map.ShapefileReader +import org.matsim.core.network.NetworkUtils +import org.matsim.core.network.io.NetworkReaderMatsimV2 +import org.matsim.core.utils.geometry.geotools.MGC +import org.opengis.feature.simple.SimpleFeature +import org.opengis.referencing.operation.MathTransform +import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike + +import scala.jdk.CollectionConverters.collectionAsScalaIterableConverter + +class Network2ShapeFileTest extends AnyWordSpecLike with Matchers { + "Network2ShapeFile transformation" should { + "generate the same number of features" in { + val beamvilleNetwork = "test/test-resources/beam/beamville-physsim-network.xml" + val outputShapeFile = "output/beamville-network.shp" + + val crsString = "epsg:32631" + val crs = MGC.getCRS(crsString) + + // write out shapefile + networkToShapeFile(beamvilleNetwork, outputShapeFile, crs, _ => true) + + // read network agaim + val network = NetworkUtils.createNetwork() + val reader = new NetworkReaderMatsimV2(network) + reader.readFile(beamvilleNetwork) + + @SuppressWarnings(Array("UnusedMethodParameter")) + def mapToID2AllProperties(mathTransform: MathTransform, feature: SimpleFeature): (String, Map[String, AnyRef]) = { + val featureId = feature.getAttribute("ID").toString + val allProps = + feature.getProperties.asScala.map(property => property.getName.toString -> property.getValue).toMap + + featureId -> allProps + } + + // read all features from shp file + val shpFeatures = ShapefileReader.read(crsString, outputShapeFile, _ => true, mapToID2AllProperties).toMap + + // compare the lengths + val originalNumberOfLinks = network.getLinks.size() + val resultCount = shpFeatures.size + + resultCount shouldBe originalNumberOfLinks + } + } +} diff --git a/src/test/scala/beam/utils/scenario/urbansim/HOVModeTransformerTest.scala b/src/test/scala/beam/utils/scenario/urbansim/HOVModeTransformerTest.scala index bbb2e25aab3..aa7cfdac4f1 100644 --- a/src/test/scala/beam/utils/scenario/urbansim/HOVModeTransformerTest.scala +++ b/src/test/scala/beam/utils/scenario/urbansim/HOVModeTransformerTest.scala @@ -440,7 +440,6 @@ class HOVModeTransformerTest extends AnyFunSuite with Matchers { } object HOVModeTransformerTest { - private val random = new Random() def newTrip( From 360a0e6dd136cf70f6622c33505d39ff75d59638 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 28 Jan 2022 19:19:00 -0800 Subject: [PATCH 010/307] fix template --- src/main/resources/beam-template.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 6eae4a4dfa6..65568afa567 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -298,6 +298,7 @@ beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC = "double | 1.0" beam.agentsim.agents.vehicles.linkSocAcrossIterations = "boolean | false" beam.agentsim.agents.vehicles.meanRidehailVehicleStartingSOC = "double | 1.0" beam.agentsim.agents.vehicles.transitVehicleTypesByRouteFile = "" +beam.agentsim.agents.vehicles.generateEmergencyHouseholdVehicleWhenPlansRequireIt = "boolean | false" # these must be one of the shared vehicle types beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId = "sharedVehicle-sharedCar" beam.agentsim.agents.vehicles.dummySharedBike.vehicleTypeId = "sharedVehicle-sharedBike" From 0c64e35dd0c8889cb86f6e1416c91d432fde4248 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 8 Feb 2022 23:33:20 -0800 Subject: [PATCH 011/307] addressing @JustinPihony --- .../agents/household/HouseholdActor.scala | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index a8868bce111..ecb93566833 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -188,8 +188,10 @@ object HouseholdActor { private var cavPassengerSchedules: Map[BeamVehicle, PassengerSchedule] = Map() private var personAndActivityToCav: Map[(Id[Person], Activity), BeamVehicle] = Map() private var personAndActivityToLegs: Map[(Id[Person], Activity), List[BeamLeg]] = Map() - private var householdMembersAndTheirLocation: Map[Id[Person], (String, Coord)] = Map() + private var householdMembersToLocationTypeAndLocation: Map[Id[Person], (String, Coord)] = Map() private val trackingVehicleAssignmentAtInitialization = mutable.HashMap.empty[Id[BeamVehicle], Id[Person]] + private val vehicleCategories = List(Car, Bike) + private val mainActivities = List("Home", "Work") private val realDistribution: UniformRealDistribution = new UniformRealDistribution() realDistribution.reseedRandomGenerator(beamScenario.beamConfig.matsim.modules.global.randomSeed) @@ -197,24 +199,24 @@ object HouseholdActor { override def loggedReceive: Receive = { case TriggerWithId(InitializeTrigger(tick), triggerId) => - householdMembersAndTheirLocation = household.members + householdMembersToLocationTypeAndLocation = household.members .flatMap(person => person.getSelectedPlan.getPlanElements.asScala.headOption .flatMap { - case act: Activity if List("Home", "Work").contains(act.getType) => + case act: Activity if mainActivities.contains(act.getType) => Some(person.getId -> (act.getType, act.getCoord)) case _ => None } ) .toMap - if (!householdMembersAndTheirLocation.exists(_._2._1 == "Home")) - householdMembersAndTheirLocation ++= Map(Id.createPersonId("") -> ("Home", fallbackHomeCoord)) + if (!householdMembersToLocationTypeAndLocation.exists(_._2._1 == "Home")) + householdMembersToLocationTypeAndLocation ++= Map(Id.createPersonId("") -> ("Home", fallbackHomeCoord)) val vehiclesByCategory = vehicles.filter(_._2.beamVehicleType.automationLevel <= 3).groupBy(_._2.beamVehicleType.vehicleCategory) //We should create a vehicle manager for cars and bikes for all households in case they are generated during the simulation - val vehiclesByAllCategories = List(Car, Bike) + val vehiclesByAllCategories = vehicleCategories .map(cat => cat -> vehiclesByCategory.getOrElse(cat, Map[Id[BeamVehicle], BeamVehicle]())) .toMap val fleetManagers = vehiclesByAllCategories.map { case (category, vehiclesInCategory) => @@ -227,7 +229,7 @@ object HouseholdActor { parkingManager, chargingNetworkManager, vehiclesInCategory, - householdMembersAndTheirLocation, + householdMembersToLocationTypeAndLocation, Some(emergencyGenerator) ) ), @@ -242,7 +244,7 @@ object HouseholdActor { var cavs = vehicles.values.filter(_.beamVehicleType.automationLevel > 3).toList if (cavs.nonEmpty) { - val workingPersonsList = householdMembersAndTheirLocation.filter(_._2._1 == "Work").keys.toBuffer + val workingPersonsList = householdMembersToLocationTypeAndLocation.filter(_._2._1 == "Work").keys.toBuffer // log.debug("Household {} has {} CAVs and will do some planning", household.getId, cavs.size) cavs.foreach { cav => val cavDriverRef: ActorRef = context.actorOf( @@ -267,12 +269,12 @@ object HouseholdActor { val personId: Id[Person] = if (workingPersonsList.nonEmpty) workingPersonsList.remove(0) else - householdMembersAndTheirLocation + householdMembersToLocationTypeAndLocation .find(_._2._1 == "Home") .map(_._1) - .getOrElse(householdMembersAndTheirLocation.keys.head) + .getOrElse(householdMembersToLocationTypeAndLocation.keys.head) trackingVehicleAssignmentAtInitialization.put(cav.id, personId) - cav.spaceTime = SpaceTime(householdMembersAndTheirLocation(personId)._2, 0) + cav.spaceTime = SpaceTime(householdMembersToLocationTypeAndLocation(personId)._2, 0) schedulerRef ! ScheduleTrigger(InitializeTrigger(0), cavDriverRef) cav.setManager(Some(self)) cav.becomeDriver(cavDriverRef) @@ -548,7 +550,7 @@ object HouseholdActor { def sendParkingOrChargingInquiry(vehicle: BeamVehicle, triggerId: Long): Future[Any] = { val personId = trackingVehicleAssignmentAtInitialization(vehicle.id) val inquiry = ParkingInquiry.init( - SpaceTime(householdMembersAndTheirLocation(personId)._2, 0), + SpaceTime(householdMembersToLocationTypeAndLocation(personId)._2, 0), "init", VehicleManager.getReservedFor(vehicle.vehicleManagerId.get).get, beamVehicle = Option(vehicle), From 3a973c42a45a64ab3d87f9676e79311b33c1ff66 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 8 Feb 2022 23:41:10 -0800 Subject: [PATCH 012/307] adding a TODO --- .../agentsim/agents/PersonWithPersonalVehiclePlanSpec.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/scala/beam/agentsim/agents/PersonWithPersonalVehiclePlanSpec.scala b/src/test/scala/beam/agentsim/agents/PersonWithPersonalVehiclePlanSpec.scala index 5f040ab28dc..c589eb2c796 100644 --- a/src/test/scala/beam/agentsim/agents/PersonWithPersonalVehiclePlanSpec.scala +++ b/src/test/scala/beam/agentsim/agents/PersonWithPersonalVehiclePlanSpec.scala @@ -677,6 +677,8 @@ class PersonWithPersonalVehiclePlanSpec personEntersVehicleEvents.expectMsgType[PersonEntersVehicleEvent] expectMsgType[CompletionNotice] + + // TODO: Testing last resort vehicle creation } it("should walk to a car that is far away (if told so by the router") { From f643f59b13300196c9e785344e24c96a7f04fbef Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 22 Feb 2022 00:30:26 -0800 Subject: [PATCH 013/307] some changes that need to be checked --- .../scala/beam/sim/config/BeamConfig.scala | 5468 +++++++++++------ .../urbansim/HOVModeTransformer.scala | 4 +- 2 files changed, 3533 insertions(+), 1939 deletions(-) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 28f8f5a836d..93db97cbb63 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,3497 +3,5091 @@ package beam.sim.config case class BeamConfig( - beam : BeamConfig.Beam, - matsim : BeamConfig.Matsim + beam: BeamConfig.Beam, + matsim: BeamConfig.Matsim ) + object BeamConfig { + case class Beam( - actorSystemName : java.lang.String, - agentsim : BeamConfig.Beam.Agentsim, - calibration : BeamConfig.Beam.Calibration, - cluster : BeamConfig.Beam.Cluster, - debug : BeamConfig.Beam.Debug, - exchange : BeamConfig.Beam.Exchange, - experimental : BeamConfig.Beam.Experimental, - input : BeamConfig.Beam.Input, - inputDirectory : java.lang.String, - logger : BeamConfig.Beam.Logger, - metrics : BeamConfig.Beam.Metrics, - output : BeamConfig.Beam.Output, - outputs : BeamConfig.Beam.Outputs, - physsim : BeamConfig.Beam.Physsim, - replanning : BeamConfig.Beam.Replanning, - router : BeamConfig.Beam.Router, - routing : BeamConfig.Beam.Routing, - sim : BeamConfig.Beam.Sim, - spatial : BeamConfig.Beam.Spatial, - urbansim : BeamConfig.Beam.Urbansim, - useLocalWorker : scala.Boolean, - warmStart : BeamConfig.Beam.WarmStart + actorSystemName: java.lang.String, + agentsim: BeamConfig.Beam.Agentsim, + calibration: BeamConfig.Beam.Calibration, + cluster: BeamConfig.Beam.Cluster, + debug: BeamConfig.Beam.Debug, + exchange: BeamConfig.Beam.Exchange, + experimental: BeamConfig.Beam.Experimental, + input: BeamConfig.Beam.Input, + inputDirectory: java.lang.String, + logger: BeamConfig.Beam.Logger, + metrics: BeamConfig.Beam.Metrics, + output: BeamConfig.Beam.Output, + outputs: BeamConfig.Beam.Outputs, + physsim: BeamConfig.Beam.Physsim, + replanning: BeamConfig.Beam.Replanning, + router: BeamConfig.Beam.Router, + routing: BeamConfig.Beam.Routing, + sim: BeamConfig.Beam.Sim, + spatial: BeamConfig.Beam.Spatial, + urbansim: BeamConfig.Beam.Urbansim, + useLocalWorker: scala.Boolean, + warmStart: BeamConfig.Beam.WarmStart ) + object Beam { + case class Agentsim( - agentSampleSizeAsFractionOfPopulation : scala.Double, - agents : BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime : java.lang.String, - firstIteration : scala.Int, - fractionOfPlansWithSingleActivity : scala.Double, - h3taz : BeamConfig.Beam.Agentsim.H3taz, - lastIteration : scala.Int, - populationAdjustment : java.lang.String, - scenarios : BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow : scala.Int, - simulationName : java.lang.String, - taz : BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters : scala.Int, - thresholdForWalkingInMeters : scala.Int, - timeBinSize : scala.Int, - toll : BeamConfig.Beam.Agentsim.Toll, - tuning : BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation: scala.Double, + agents: BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime: java.lang.String, + firstIteration: scala.Int, + fractionOfPlansWithSingleActivity: scala.Double, + h3taz: BeamConfig.Beam.Agentsim.H3taz, + lastIteration: scala.Int, + populationAdjustment: java.lang.String, + scenarios: BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow: scala.Int, + simulationName: java.lang.String, + taz: BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters: scala.Int, + thresholdForWalkingInMeters: scala.Int, + timeBinSize: scala.Int, + toll: BeamConfig.Beam.Agentsim.Toll, + tuning: BeamConfig.Beam.Agentsim.Tuning ) + object Agentsim { + case class Agents( - activities : BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType : java.lang.String, - freight : BeamConfig.Beam.Agentsim.Agents.Freight, - households : BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking : BeamConfig.Beam.Agentsim.Agents.Parking, - plans : BeamConfig.Beam.Agentsim.Agents.Plans, - population : BeamConfig.Beam.Agentsim.Agents.Population, - ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles + activities: BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType: java.lang.String, + freight: BeamConfig.Beam.Agentsim.Agents.Freight, + households: BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking: BeamConfig.Beam.Agentsim.Agents.Parking, + plans: BeamConfig.Beam.Agentsim.Agents.Plans, + population: BeamConfig.Beam.Agentsim.Agents.Population, + ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles ) + object Agents { + case class Activities( - activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] ) + object Activities { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None + activityTypeToFixedDurationMap = + if (c.hasPathOrNull("activityTypeToFixedDurationMap")) + scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) + else None ) } } - + case class Freight( - carrierParkingFilePath : scala.Option[java.lang.String], - carriersFilePath : java.lang.String, - convertWgs2Utm : scala.Boolean, - enabled : scala.Boolean, - generateFixedActivitiesDurations : scala.Boolean, - name : java.lang.String, - plansFilePath : java.lang.String, - reader : java.lang.String, - replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath : java.lang.String + carrierParkingFilePath: scala.Option[java.lang.String], + carriersFilePath: java.lang.String, + convertWgs2Utm: scala.Boolean, + enabled: scala.Boolean, + generateFixedActivitiesDurations: scala.Boolean, + name: java.lang.String, + plansFilePath: java.lang.String, + reader: java.lang.String, + replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath: java.lang.String ) + object Freight { + case class Replanning( - departureTime : scala.Int, - disableAfterIteration : scala.Int, - strategy : java.lang.String + departureTime: scala.Int, + disableAfterIteration: scala.Int, + strategy: java.lang.String ) + object Replanning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", - reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = + if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = + if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") + else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = + c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = + if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") + else "/test/input/beamville/freight/payload-plans.csv", + reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + toursFilePath = + if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") + else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath : java.lang.String, - inputHouseholdAttributesFilePath : java.lang.String + inputFilePath: java.lang.String, + inputHouseholdAttributesFilePath: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = + if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") + else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = + if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") + else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime : scala.Double, - highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts : scala.Int, - minimumValueOfTime : scala.Double, - modeChoiceClass : java.lang.String, - modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT : scala.Boolean, - overrideAutomationLevel : scala.Int, - poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier + defaultValueOfTime: scala.Double, + highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts: scala.Int, + minimumValueOfTime: scala.Double, + modeChoiceClass: java.lang.String, + modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT: scala.Boolean, + overrideAutomationLevel: scala.Int, + poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier ) + object ModalBehaviors { + case class HighTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) + object HighTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class Lccm( - filePath : java.lang.String + filePath: java.lang.String ) + object Lccm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) + object LowTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class ModeVotMultiplier( - CAV : scala.Double, - bike : scala.Double, - drive : scala.Double, - rideHail : scala.Double, - rideHailPooled : scala.Double, - rideHailTransit : scala.Double, - transit : scala.Double, - waiting : scala.Double, - walk : scala.Double + CAV: scala.Double, + bike: scala.Double, + drive: scala.Double, + rideHail: scala.Double, + rideHailPooled: scala.Double, + rideHailTransit: scala.Double, + transit: scala.Double, + waiting: scala.Double, + walk: scala.Double ) + object ModeVotMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor : scala.Double + params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor: scala.Double ) + object MulitnomialLogit { + case class Params( - bike_intercept : scala.Double, - bike_transit_intercept : scala.Double, - car_intercept : scala.Double, - cav_intercept : scala.Double, - drive_transit_intercept : scala.Double, - ride_hail_intercept : scala.Double, - ride_hail_pooled_intercept : scala.Double, - ride_hail_transit_intercept : scala.Double, - transfer : scala.Double, - transit_crowding : scala.Double, - transit_crowding_percentile : scala.Double, - walk_intercept : scala.Double, - walk_transit_intercept : scala.Double + bike_intercept: scala.Double, + bike_transit_intercept: scala.Double, + car_intercept: scala.Double, + cav_intercept: scala.Double, + drive_transit_intercept: scala.Double, + ride_hail_intercept: scala.Double, + ride_hail_pooled_intercept: scala.Double, + ride_hail_transit_intercept: scala.Double, + transfer: scala.Double, + transit_crowding: scala.Double, + transit_crowding_percentile: scala.Double, + walk_intercept: scala.Double, + walk_transit_intercept: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, - ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, - transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, - walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = + if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = + if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = + if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = + if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") + else 0.0, + ride_hail_transit_intercept = + if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") + else 0.0, + transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_percentile = + if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") + else 90.0, + walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = + if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), - utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ), + utility_scale_factor = + if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object PoolingMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), - maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, - minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")) - ) - } - } - + defaultValueOfTime = + if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( + if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") + ), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( + if (c.hasPathOrNull("lccm")) c.getConfig("lccm") + else com.typesafe.config.ConfigFactory.parseString("lccm{}") + ), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( + if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") + ), + maximumNumberOfReplanningAttempts = + if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") + else 3, + minimumValueOfTime = + if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = + if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") + else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( + if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") + else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + overrideAutomationForVOTT = + c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = + if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( + if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") + else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") + ) + ) + } + } + case class ModeIncentive( - filePath : java.lang.String + filePath: java.lang.String ) + object ModeIncentive { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - maxSearchRadius : scala.Double, - minSearchRadius : scala.Double, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - rangeAnxietyBuffer : scala.Double, - searchMaxDistanceRelativeToEllipseFoci : scala.Double + maxSearchRadius: scala.Double, + minSearchRadius: scala.Double, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + rangeAnxietyBuffer: scala.Double, + searchMaxDistanceRelativeToEllipseFoci: scala.Double ) + object Parking { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - distanceMultiplier : scala.Double, - enrouteDetourMultiplier : scala.Double, - homeActivityPrefersResidentialParkingMultiplier : scala.Double, - parkingPriceMultiplier : scala.Double, - rangeAnxietyMultiplier : scala.Double + distanceMultiplier: scala.Double, + enrouteDetourMultiplier: scala.Double, + homeActivityPrefersResidentialParkingMultiplier: scala.Double, + parkingPriceMultiplier: scala.Double, + rangeAnxietyMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, - parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = + if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = + if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = + if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) + c.getDouble("homeActivityPrefersResidentialParkingMultiplier") + else 1.0, + parkingPriceMultiplier = + if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = + if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 + maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + rangeAnxietyBuffer = + if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = + if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) + c.getDouble("searchMaxDistanceRelativeToEllipseFoci") + else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath : java.lang.String, - inputPlansFilePath : java.lang.String, - merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath: java.lang.String, + inputPlansFilePath: java.lang.String, + merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) + object Plans { + case class Merge( - fraction : scala.Double + fraction: scala.Double ) + object Merge { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) + inputPersonAttributesFilePath = + if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") + else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = + if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") + else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( + if (c.hasPathOrNull("merge")) c.getConfig("merge") + else com.typesafe.config.ConfigFactory.parseString("merge{}") + ) ) } } - + case class Population( - useVehicleSampling : scala.Boolean + useVehicleSampling: scala.Boolean ) + object Population { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath : java.lang.String + filePath: java.lang.String ) + object PtFare { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost : scala.Double, - defaultCostPerMile : scala.Double, - defaultCostPerMinute : scala.Double, - human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations : scala.Boolean, - name : java.lang.String, - pooledBaseCost : scala.Double, - pooledCostPerMile : scala.Double, - pooledCostPerMinute : scala.Double, - pooledToRegularRideCostRatio : scala.Double, - rangeBufferForDispatchInMeters : scala.Int, - refuelLocationType : java.lang.String, - refuelThresholdInMeters : scala.Double, - repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost: scala.Double, + defaultCostPerMile: scala.Double, + defaultCostPerMinute: scala.Double, + human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations: scala.Boolean, + name: java.lang.String, + pooledBaseCost: scala.Double, + pooledCostPerMile: scala.Double, + pooledCostPerMinute: scala.Double, + pooledToRegularRideCostRatio: scala.Double, + rangeBufferForDispatchInMeters: scala.Int, + refuelLocationType: java.lang.String, + refuelThresholdInMeters: scala.Double, + repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) + object RideHail { + case class AllocationManager( - alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm : java.lang.String, - maxExcessRideTime : scala.Double, - maxWaitingTimeInSec : scala.Int, - name : java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, - repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds : scala.Int + alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm: java.lang.String, + maxExcessRideTime: scala.Double, + maxWaitingTimeInSec: scala.Int, + name: java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, + repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds: scala.Int ) + object AllocationManager { + case class AlonsoMora( - maxRequestsPerVehicle : scala.Int + maxRequestsPerVehicle: scala.Int ) + object AlonsoMora { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = + if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, - demandWeight : scala.Double, - distanceWeight : scala.Double, - keepMaxTopNScores : scala.Int, - minDemandPercentageInRadius : scala.Double, - minScoreThresholdForRepositioning : scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, - percentageOfVehiclesToReposition : scala.Double, - produceDebugImages : scala.Boolean, - repositionCircleRadiusInMeters : scala.Double, - repositioningMethod : java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, - waitingTimeWeight : scala.Double + allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, + demandWeight: scala.Double, + distanceWeight: scala.Double, + keepMaxTopNScores: scala.Int, + minDemandPercentageInRadius: scala.Double, + minScoreThresholdForRepositioning: scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, + percentageOfVehiclesToReposition: scala.Double, + produceDebugImages: scala.Boolean, + repositionCircleRadiusInMeters: scala.Double, + repositioningMethod: java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, + waitingTimeWeight: scala.Double ) + object RepositionLowWaitingTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, - minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, - percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, - repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, - waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( + "allowIncreasingRadiusIfDemandInRadiusLow" + ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = + if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") + else 0.1, + minScoreThresholdForRepositioning = + if (c.hasPathOrNull("minScoreThresholdForRepositioning")) + c.getDouble("minScoreThresholdForRepositioning") + else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = + if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) + c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") + else 1, + percentageOfVehiclesToReposition = + if (c.hasPathOrNull("percentageOfVehiclesToReposition")) + c.getDouble("percentageOfVehiclesToReposition") + else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = + if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") + else 3000, + repositioningMethod = + if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = + if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) + c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") + else 1200, + waitingTimeWeight = + if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), - matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, - repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), - requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( + if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") + else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") + ), + matchingAlgorithm = + if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") + else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = + if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = + if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) + c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") + else 1, + repositionLowWaitingTimes = + BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( + if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") + else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") + ), + requestBufferTimeoutInSeconds = + if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Int ) + object Cav { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 16090, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) + object Charging { + case class VehicleChargingManager( - defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, - name : java.lang.String + defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, + name: java.lang.String ) + object VehicleChargingManager { + case class DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging : scala.Double, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, - noChargingThresholdExpirationTimeInS : scala.Int + fractionAvailableThresholdToFavorFasterCharging: scala.Double, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, + noChargingThresholdExpirationTimeInS: scala.Int ) + object DefaultVehicleChargingManager { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - chargingTimeMultiplier : scala.Double, - drivingTimeMultiplier : scala.Double, - insufficientRangeMultiplier : scala.Double, - queueingTimeMultiplier : scala.Double + chargingTimeMultiplier: scala.Double, + drivingTimeMultiplier: scala.Double, + insufficientRangeMultiplier: scala.Double, + queueingTimeMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( - chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, - drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, - insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, - queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + chargingTimeMultiplier = + if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") + else -0.01666667, + drivingTimeMultiplier = + if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") + else -0.01666667, + insufficientRangeMultiplier = + if (c.hasPathOrNull("insufficientRangeMultiplier")) + c.getDouble("insufficientRangeMultiplier") + else -60.0, + queueingTimeMultiplier = + if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") + else -0.01666667 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + params = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging = if(c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) c.getDouble("fractionAvailableThresholdToFavorFasterCharging") else 1.01, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - noChargingThresholdExpirationTimeInS = if(c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) c.getInt("noChargingThresholdExpirationTimeInS") else 0 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + fractionAvailableThresholdToFavorFasterCharging = + if (c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) + c.getDouble("fractionAvailableThresholdToFavorFasterCharging") + else 1.01, + mulitnomialLogit = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + noChargingThresholdExpirationTimeInS = + if (c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) + c.getInt("noChargingThresholdExpirationTimeInS") + else 0 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" + defaultVehicleChargingManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + if (c.hasPathOrNull("defaultVehicleChargingManager")) + c.getConfig("defaultVehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( + if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") + ) ) } } - + case class Human( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Double + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Double ) + object Human { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 ) } } - + case class Initialization( - filePath : java.lang.String, - initType : java.lang.String, - parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath: java.lang.String, + initType: java.lang.String, + parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) + object Initialization { + case class Parking( - filePath : java.lang.String + filePath: java.lang.String ) + object Parking { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet : scala.Double, - initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId : java.lang.String, - vehicleTypePrefix : java.lang.String + fractionOfInitialVehicleFleet: scala.Double, + initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId: java.lang.String, + vehicleTypePrefix: java.lang.String ) + object Procedural { + case class InitialLocation( - home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name : java.lang.String + home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name: java.lang.String ) + object InitialLocation { + case class Home( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object Home { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( + if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") + else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") + ), + vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = + if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( + if (c.hasPathOrNull("procedural")) c.getConfig("procedural") + else com.typesafe.config.ConfigFactory.parseString("procedural{}") + ) ) } } - + case class IterationStats( - timeBinSizeInSec : scala.Double + timeBinSizeInSec: scala.Double ) + object IterationStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name : java.lang.String, - timeout : scala.Int + demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name: java.lang.String, + timeout: scala.Int ) + object RepositioningManager { + case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider : scala.Double, - horizon : scala.Int, - numberOfClustersForDemand : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDemandForCAVs : scala.Double + fractionOfClosestClustersToConsider: scala.Double, + horizon: scala.Int, + numberOfClustersForDemand: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDemandForCAVs: scala.Double ) + object DemandFollowingRepositioningManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, - horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, - sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 + fractionOfClosestClustersToConsider = + if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) + c.getDouble("fractionOfClosestClustersToConsider") + else 0.2, + horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = + if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 1, + sensitivityOfRepositioningToDemandForCAVs = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) + c.getDouble("sensitivityOfRepositioningToDemandForCAVs") + else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDistance : scala.Double + predictionHorizon: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDistance: scala.Double ) + object InverseSquareDistanceRepositioningFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, - sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 + predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 0.4, + sensitivityOfRepositioningToDistance = + if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) + c.getDouble("sensitivityOfRepositioningToDistance") + else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( + if (c.hasPathOrNull("demandFollowingRepositioningManager")) + c.getConfig("demandFollowingRepositioningManager") + else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") + ), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager + .InverseSquareDistanceRepositioningFactor( + if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) + c.getConfig("inverseSquareDistanceRepositioningFactor") + else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object RideHailManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel : scala.Double, - numberOfCategories : scala.Int, - priceAdjustmentStrategy : java.lang.String, - surgeLevelAdaptionStep : scala.Double + minimumSurgeLevel: scala.Double, + numberOfCategories: scala.Int, + priceAdjustmentStrategy: java.lang.String, + surgeLevelAdaptionStep: scala.Double ) + object SurgePricing { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = + if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") + else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = + if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), - defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), - linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - pooledToRegularRideCostRatio = if(c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") else 0.6, - rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, - refuelLocationType = if(c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", - refuelThresholdInMeters = if(c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( + if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") + else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") + ), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( + if (c.hasPathOrNull("cav")) c.getConfig("cav") + else com.typesafe.config.ConfigFactory.parseString("cav{}") + ), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( + if (c.hasPathOrNull("charging")) c.getConfig("charging") + else com.typesafe.config.ConfigFactory.parseString("charging{}") + ), + defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = + if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = + if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( + if (c.hasPathOrNull("human")) c.getConfig("human") + else com.typesafe.config.ConfigFactory.parseString("human{}") + ), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( + if (c.hasPathOrNull("initialization")) c.getConfig("initialization") + else com.typesafe.config.ConfigFactory.parseString("initialization{}") + ), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( + if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") + else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") + ), + linkFleetStateAcrossIterations = + c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = + if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + pooledToRegularRideCostRatio = + if (c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") + else 0.6, + rangeBufferForDispatchInMeters = + if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") + else 10000, + refuelLocationType = + if (c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", + refuelThresholdInMeters = + if (c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( + if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") + else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") + ), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( + if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") + else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") + ), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( + if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") + else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") + ) + ) + } + } + case class RideHailTransit( - modesToConsider : java.lang.String + modesToConsider: java.lang.String ) + object RideHailTransit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) + object TripBehaviors { + case class CarUsage( - minDistanceToTrainStop : scala.Double + minDistanceToTrainStop: scala.Double ) + object CarUsage { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = + if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path : java.lang.String, - additional_trip_utility : scala.Double, - destination_nest_scale_factor : scala.Double, - generate_secondary_activities : scala.Boolean, - intercept_file_path : java.lang.String, - max_destination_choice_set_size : scala.Int, - max_destination_distance_meters : scala.Double, - mode_nest_scale_factor : scala.Double, - trip_nest_scale_factor : scala.Double + activity_file_path: java.lang.String, + additional_trip_utility: scala.Double, + destination_nest_scale_factor: scala.Double, + generate_secondary_activities: scala.Boolean, + intercept_file_path: java.lang.String, + max_destination_choice_set_size: scala.Int, + max_destination_distance_meters: scala.Double, + mode_nest_scale_factor: scala.Double, + trip_nest_scale_factor: scala.Double ) + object MulitnomialLogit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, - generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, - max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, - mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = + if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = + if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = + if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") + else 1.0, + generate_secondary_activities = + c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = + if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = + if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") + else 20, + max_destination_distance_meters = + if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") + else 32000, + mode_nest_scale_factor = + if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = + if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( + if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") + else com.typesafe.config.ConfigFactory.parseString("carUsage{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ) ) } } - + case class Vehicles( - downsamplingMethod : java.lang.String, - dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet : scala.Double, - fractionOfPeopleWithBicycle : scala.Double, - fuelTypesFilePath : java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, - linkSocAcrossIterations : scala.Boolean, - linkToGradePercentFilePath : java.lang.String, - meanPrivateVehicleStartingSOC : scala.Double, - meanRidehailVehicleStartingSOC : scala.Double, - sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile : java.lang.String, - vehicleAdjustmentMethod : java.lang.String, - vehicleTypesFilePath : java.lang.String, - vehiclesFilePath : java.lang.String + downsamplingMethod: java.lang.String, + dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet: scala.Double, + fractionOfPeopleWithBicycle: scala.Double, + fuelTypesFilePath: java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, + linkSocAcrossIterations: scala.Boolean, + linkToGradePercentFilePath: java.lang.String, + meanPrivateVehicleStartingSOC: scala.Double, + meanRidehailVehicleStartingSOC: scala.Double, + sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile: java.lang.String, + vehicleAdjustmentMethod: java.lang.String, + vehicleTypesFilePath: java.lang.String, + vehiclesFilePath: java.lang.String ) + object Vehicles { + case class DummySharedBike( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedBike { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedCar { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond : scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, - noRefuelThresholdOffsetInMeters : scala.Double, - remainingDistanceWrtBatteryCapacityThreshold : scala.Int + estimateOfMeanChargingDurationInSecond: scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, + noRefuelThresholdOffsetInMeters: scala.Double, + remainingDistanceWrtBatteryCapacityThreshold: scala.Int ) + object Enroute { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, - noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, - remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 + estimateOfMeanChargingDurationInSecond = + if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) + c.getInt("estimateOfMeanChargingDurationInSecond") + else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = + if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) + c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") + else 500, + noRefuelThresholdOffsetInMeters = + if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") + else 32186.9, + remainingDistanceWrtBatteryCapacityThreshold = + if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) + c.getInt("remainingDistanceWrtBatteryCapacityThreshold") + else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], - fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], - inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], - managerType : java.lang.String, - name : java.lang.String, - parkingFilePath : java.lang.String, - reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving + ], + fixed_non_reserving_fleet_by_taz: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz + ], + inexhaustible_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving + ], + managerType: java.lang.String, + name: java.lang.String, + parkingFilePath: java.lang.String, + reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) + object SharedFleets$Elm { + case class FixedNonReserving( - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String ) + object FixedNonReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize : scala.Int, - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String, - vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] + fleetSize: scala.Int, + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String, + vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] ) + object FixedNonReservingFleetByTaz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None + fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = + if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) + else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object InexhaustibleReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], - name : java.lang.String, - repositionTimeBin : scala.Int, - statTimeBin : scala.Int + min_availability_undersupply_algorithm: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm + ], + name: java.lang.String, + repositionTimeBin: scala.Int, + statTimeBin: scala.Int ) + object Reposition { + case class MinAvailabilityUndersupplyAlgorithm( - matchLimit : scala.Int + matchLimit: scala.Int ) + object MinAvailabilityUndersupplyAlgorithm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( - matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm( + matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = + if (c.hasPathOrNull("min-availability-undersupply-algorithm")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) + ) + else None, + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, - fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, - inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, - managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None + fixed_non_reserving = + if (c.hasPathOrNull("fixed-non-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReserving(c.getConfig("fixed-non-reserving")) + ) + else None, + fixed_non_reserving_fleet_by_taz = + if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) + ) + else None, + inexhaustible_reserving = + if (c.hasPathOrNull("inexhaustible-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) + ) + else None, + managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = + if (c.hasPathOrNull("reposition")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) + ) + else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, - fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, - meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", - vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" - ) - } - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = + if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") + else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( + if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") + else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") + ), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( + if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") + else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") + ), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( + if (c.hasPathOrNull("enroute")) c.getConfig("enroute") + else com.typesafe.config.ConfigFactory.parseString("enroute{}") + ), + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 1.0, + fractionOfPeopleWithBicycle = + if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = + if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") + else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( + "generateEmergencyHouseholdVehicleWhenPlansRequireIt" + ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = + c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = + if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = + if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") + else 1.0, + meanRidehailVehicleStartingSOC = + if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") + else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = + if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") + else "", + vehicleAdjustmentMethod = + if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = + if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") + else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = + if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") + else "/test/input/beamville/vehicles.csv" + ) + } + + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Agentsim.Agents.Vehicles + .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), - bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), - households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), - parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities( + if (c.hasPathOrNull("activities")) c.getConfig("activities") + else com.typesafe.config.ConfigFactory.parseString("activities{}") + ), + bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight( + if (c.hasPathOrNull("freight")) c.getConfig("freight") + else com.typesafe.config.ConfigFactory.parseString("freight{}") + ), + households = BeamConfig.Beam.Agentsim.Agents.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( + if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") + else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") + ), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( + if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") + else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") + ), + parking = BeamConfig.Beam.Agentsim.Agents.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + plans = BeamConfig.Beam.Agentsim.Agents.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + population = BeamConfig.Beam.Agentsim.Agents.Population( + if (c.hasPathOrNull("population")) c.getConfig("population") + else com.typesafe.config.ConfigFactory.parseString("population{}") + ), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( + if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") + else com.typesafe.config.ConfigFactory.parseString("ptFare{}") + ), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( + if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") + else com.typesafe.config.ConfigFactory.parseString("rideHail{}") + ), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( + if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") + else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") + ), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( + if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") + else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") + ), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor : scala.Double, - chargingPointCountScalingFactor : scala.Double, - chargingPointFilePath : java.lang.String, - helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds : scala.Int + chargingPointCostScalingFactor: scala.Double, + chargingPointCountScalingFactor: scala.Double, + chargingPointFilePath: java.lang.String, + helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds: scala.Int ) + object ChargingNetworkManager { + case class Helics( - bufferSize : scala.Int, - connectionEnabled : scala.Boolean, - coreInitString : java.lang.String, - coreType : java.lang.String, - dataInStreamPoint : java.lang.String, - dataOutStreamPoint : java.lang.String, - federateName : java.lang.String, - feedbackEnabled : scala.Boolean, - intLogLevel : scala.Int, - timeDeltaProperty : scala.Double + bufferSize: scala.Int, + connectionEnabled: scala.Boolean, + coreInitString: java.lang.String, + coreType: java.lang.String, + dataInStreamPoint: java.lang.String, + dataOutStreamPoint: java.lang.String, + federateName: java.lang.String, + feedbackEnabled: scala.Boolean, + intLogLevel: scala.Int, + timeDeltaProperty: scala.Double ) + object Helics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", - dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = + if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") + else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = + if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") + else "GridFed/PhysicalBounds", + dataOutStreamPoint = + if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled : scala.Boolean, - expansionFactor_charge_activity : scala.Double, - expansionFactor_home_activity : scala.Double, - expansionFactor_init_activity : scala.Double, - expansionFactor_wherever_activity : scala.Double, - expansionFactor_work_activity : scala.Double + enabled: scala.Boolean, + expansionFactor_charge_activity: scala.Double, + expansionFactor_home_activity: scala.Double, + expansionFactor_init_activity: scala.Double, + expansionFactor_wherever_activity: scala.Double, + expansionFactor_work_activity: scala.Double ) + object ScaleUp { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, - expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, - expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, - expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, - expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = + if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") + else 1.0, + expansionFactor_home_activity = + if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") + else 1.0, + expansionFactor_init_activity = + if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") + else 1.0, + expansionFactor_wherever_activity = + if (c.hasPathOrNull("expansionFactor_wherever_activity")) + c.getDouble("expansionFactor_wherever_activity") + else 1.0, + expansionFactor_work_activity = + if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") + else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, - chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, - chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), - timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = + if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") + else 1.0, + chargingPointCountScalingFactor = + if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") + else 1.0, + chargingPointFilePath = + if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( + if (c.hasPathOrNull("helics")) c.getConfig("helics") + else com.typesafe.config.ConfigFactory.parseString("helics{}") + ), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( + if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") + else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") + ), + timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution : scala.Int, - upperBoundResolution : scala.Int + lowerBoundResolution: scala.Int, + upperBoundResolution: scala.Int ) + object H3taz { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile : java.lang.String + frequencyAdjustmentFile: java.lang.String ) + object Scenarios { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = + if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") + else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay : scala.Int, - interval : scala.Int + initialDelay: scala.Int, + interval: scala.Int ) + object ScheduleMonitorTask { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath : java.lang.String, - parkingCostScalingFactor : scala.Double, - parkingFilePath : java.lang.String, - parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor : scala.Double + filePath: java.lang.String, + parkingCostScalingFactor: scala.Double, + parkingFilePath: java.lang.String, + parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor: scala.Double ) + object Taz { + case class ParkingManager( - displayPerformanceTimings : scala.Boolean, - level : java.lang.String, - method : java.lang.String, - parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings: scala.Boolean, + level: java.lang.String, + method: java.lang.String, + parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) + object ParkingManager { + case class Parallel( - numberOfClusters : scala.Int + numberOfClusters: scala.Int ) + object Parallel { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - level = if(c.hasPathOrNull("level")) c.getString("level") else "TAZ", - method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + level = if (c.hasPathOrNull("level")) c.getString("level") else "TAZ", + method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( + if (c.hasPathOrNull("parallel")) c.getConfig("parallel") + else com.typesafe.config.ConfigFactory.parseString("parallel{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), - parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = + if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( + if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") + else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") + ), + parkingStallCountScalingFactor = + if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") + else 1.0 ) } } - + case class Toll( - filePath : java.lang.String + filePath: java.lang.String ) + object Toll { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules : scala.Double, - rideHailPrice : scala.Double, - tollPrice : scala.Double, - transitCapacity : scala.Option[scala.Double], - transitPrice : scala.Double + fuelCapacityInJoules: scala.Double, + rideHailPrice: scala.Double, + tollPrice: scala.Double, + transitCapacity: scala.Option[scala.Double], + transitPrice: scala.Double ) + object Tuning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = + if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), - schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), - thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, - thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), - tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) + agentSampleSizeAsFractionOfPopulation = + if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) + c.getDouble("agentSampleSizeAsFractionOfPopulation") + else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents( + if (c.hasPathOrNull("agents")) c.getConfig("agents") + else com.typesafe.config.ConfigFactory.parseString("agents{}") + ), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( + if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") + else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") + ), + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = + if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") + else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz( + if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") + else com.typesafe.config.ConfigFactory.parseString("h3taz{}") + ), + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = + if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + scenarios = BeamConfig.Beam.Agentsim.Scenarios( + if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") + else com.typesafe.config.ConfigFactory.parseString("scenarios{}") + ), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( + if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") + else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") + ), + schedulerParallelismWindow = + if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + taz = BeamConfig.Beam.Agentsim.Taz( + if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") + ), + thresholdForMakingParkingChoiceInMeters = + if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) + c.getInt("thresholdForMakingParkingChoiceInMeters") + else 100, + thresholdForWalkingInMeters = + if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll( + if (c.hasPathOrNull("toll")) c.getConfig("toll") + else com.typesafe.config.ConfigFactory.parseString("toll{}") + ), + tuning = BeamConfig.Beam.Agentsim.Tuning( + if (c.hasPathOrNull("tuning")) c.getConfig("tuning") + else com.typesafe.config.ConfigFactory.parseString("tuning{}") + ) ) } } - + case class Calibration( - counts : BeamConfig.Beam.Calibration.Counts, - google : BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio : scala.Double, - mode : BeamConfig.Beam.Calibration.Mode, - objectiveFunction : java.lang.String, - roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, - studyArea : BeamConfig.Beam.Calibration.StudyArea + counts: BeamConfig.Beam.Calibration.Counts, + google: BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio: scala.Double, + mode: BeamConfig.Beam.Calibration.Mode, + objectiveFunction: java.lang.String, + roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, + studyArea: BeamConfig.Beam.Calibration.StudyArea ) + object Calibration { + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Int, - inputCountsFile : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Int, + inputCountsFile: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes ) + object Google { + case class TravelTimes( - enable : scala.Boolean, - iterationInterval : scala.Int, - minDistanceInMeters : scala.Double, - numDataPointsOver24Hours : scala.Int, - offPeakEnabled : scala.Boolean, - queryDate : java.lang.String, - tolls : scala.Boolean + enable: scala.Boolean, + iterationInterval: scala.Int, + minDistanceInMeters: scala.Double, + numDataPointsOver24Hours: scala.Int, + offPeakEnabled: scala.Boolean, + queryDate: java.lang.String, + tolls: scala.Boolean ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = + if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = + if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class Mode( - benchmarkFilePath : java.lang.String + benchmarkFilePath: java.lang.String ) + object Mode { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) + object RoadNetwork { + case class TravelTimes( - zoneBoundariesFilePath : java.lang.String, - zoneODTravelTimesFilePath : java.lang.String + zoneBoundariesFilePath: java.lang.String, + zoneODTravelTimesFilePath: java.lang.String ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = + if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = + if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class StudyArea( - enabled : scala.Boolean, - lat : scala.Double, - lon : scala.Double, - radius : scala.Double + enabled: scala.Boolean, + lat: scala.Double, + lon: scala.Double, + radius: scala.Double ) + object StudyArea { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), - meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), - objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), - studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) + counts = BeamConfig.Beam.Calibration.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + google = BeamConfig.Beam.Calibration.Google( + if (c.hasPathOrNull("google")) c.getConfig("google") + else com.typesafe.config.ConfigFactory.parseString("google{}") + ), + meanToCountsWeightRatio = + if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode( + if (c.hasPathOrNull("mode")) c.getConfig("mode") + else com.typesafe.config.ConfigFactory.parseString("mode{}") + ), + objectiveFunction = + if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") + else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( + if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") + else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") + ), + studyArea = BeamConfig.Beam.Calibration.StudyArea( + if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") + else com.typesafe.config.ConfigFactory.parseString("studyArea{}") + ) ) } } - + case class Cluster( - clusterType : scala.Option[java.lang.String], - enabled : scala.Boolean + clusterType: scala.Option[java.lang.String], + enabled: scala.Boolean ) + object Cluster { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor : BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval : scala.Int, - clearRoutedOutstandingWorkEnabled : scala.Boolean, - debugActorTimerIntervalInSec : scala.Int, - debugEnabled : scala.Boolean, - memoryConsumptionDisplayTimeoutInSec : scala.Int, - messageLogging : scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork : scala.Int, - stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation : BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives : scala.Boolean, - writeRealizedModeChoiceFile : scala.Boolean + actor: BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval: scala.Int, + clearRoutedOutstandingWorkEnabled: scala.Boolean, + debugActorTimerIntervalInSec: scala.Int, + debugEnabled: scala.Boolean, + memoryConsumptionDisplayTimeoutInSec: scala.Int, + messageLogging: scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork: scala.Int, + stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation: BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives: scala.Boolean, + writeRealizedModeChoiceFile: scala.Boolean ) + object Debug { + case class Actor( - logDepth : scala.Int + logDepth: scala.Int ) + object Actor { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs : scala.Long, - checkMaxNumberOfMessagesEnabled : scala.Boolean, - defaultTimeoutMs : scala.Long, - enabled : scala.Boolean, - overallSimulationTimeoutMs : scala.Long, - thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs: scala.Long, + checkMaxNumberOfMessagesEnabled: scala.Boolean, + defaultTimeoutMs: scala.Long, + enabled: scala.Boolean, + overallSimulationTimeoutMs: scala.Long, + thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) + object StuckAgentDetection { + case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs : scala.Long, - triggerType : java.lang.String + actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs: scala.Long, + triggerType: java.lang.String ) + object Thresholds$Elm { + case class ActorTypeToMaxNumberOfMessages( - population : scala.Option[scala.Int], - rideHailAgent : scala.Option[scala.Int], - rideHailManager : scala.Option[scala.Int], - transitDriverAgent : scala.Option[scala.Int] + population: scala.Option[scala.Int], + rideHailAgent: scala.Option[scala.Int], + rideHailManager: scala.Option[scala.Int], + transitDriverAgent: scala.Option[scala.Int] ) + object ActorTypeToMaxNumberOfMessages { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = + if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), - markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, - triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = + BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( + if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") + else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") + ), + markAsStuckAfterMs = + if (c.hasPathOrNull("markAsStuckAfterMs")) + c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 20000, + triggerType = + if (c.hasPathOrNull("triggerType")) c.getString("triggerType") + else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, - checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = + if (c.hasPathOrNull("checkIntervalMs")) + c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 200, + checkMaxNumberOfMessagesEnabled = + !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = + if (c.hasPathOrNull("defaultTimeoutMs")) + c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = + if (c.hasPathOrNull("overallSimulationTimeoutMs")) + c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Debug.StuckAgentDetection + .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class TriggerMeasurer( - enabled : scala.Boolean, - writeStuckAgentDetectionConfig : scala.Boolean + enabled: scala.Boolean, + writeStuckAgentDetectionConfig: scala.Boolean ) + object TriggerMeasurer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = + !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram : scala.Boolean + createGCClassHistogram: scala.Boolean ) + object VmInformation { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), - agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), - vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), - writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor( + if (c.hasPathOrNull("actor")) c.getConfig("actor") + else com.typesafe.config.ConfigFactory.parseString("actor{}") + ), + agentTripScoresInterval = + if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = + c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = + if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = + if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) + c.getInt("memoryConsumptionDisplayTimeoutInSec") + else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = + if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) + c.getInt("secondsToWaitToClearRoutedOutstandingWork") + else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( + if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") + else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") + ), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( + if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") + else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") + ), + vmInformation = BeamConfig.Beam.Debug.VmInformation( + if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") + else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") + ), + writeModeChoiceAlternatives = + c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = + c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output : BeamConfig.Beam.Exchange.Output, - scenario : BeamConfig.Beam.Exchange.Scenario + output: BeamConfig.Beam.Exchange.Output, + scenario: BeamConfig.Beam.Exchange.Scenario ) + object Exchange { + case class Output( - activitySimSkimsEnabled : scala.Boolean, - geo : BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled: scala.Boolean, + geo: BeamConfig.Beam.Exchange.Output.Geo ) + object Output { + case class Geo( - filePath : scala.Option[java.lang.String] + filePath: scala.Option[java.lang.String] ) + object Geo { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) + activitySimSkimsEnabled = + c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo( + if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") + ) ) } } - + case class Scenario( - convertWgs2Utm : scala.Boolean, - fileFormat : java.lang.String, - folder : java.lang.String, - modeMap : scala.Option[scala.List[java.lang.String]], - source : java.lang.String, - urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm: scala.Boolean, + fileFormat: java.lang.String, + folder: java.lang.String, + modeMap: scala.Option[scala.List[java.lang.String]], + source: java.lang.String, + urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim ) + object Scenario { + case class Urbansim( - activitySimEnabled : scala.Boolean + activitySimEnabled: scala.Boolean ) + object Urbansim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) + fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) + output = BeamConfig.Beam.Exchange.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + scenario = BeamConfig.Beam.Exchange.Scenario( + if (c.hasPathOrNull("scenario")) c.getConfig("scenario") + else com.typesafe.config.ConfigFactory.parseString("scenario{}") + ) ) } } - + case class Experimental( - optimizer : BeamConfig.Beam.Experimental.Optimizer + optimizer: BeamConfig.Beam.Experimental.Optimizer ) + object Experimental { + case class Optimizer( - enabled : scala.Boolean + enabled: scala.Boolean ) + object Optimizer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) + optimizer = BeamConfig.Beam.Experimental.Optimizer( + if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") + else com.typesafe.config.ConfigFactory.parseString("optimizer{}") + ) ) } } - + case class Input( - lastBaseOutputDir : java.lang.String, - simulationPrefix : java.lang.String + lastBaseOutputDir: java.lang.String, + simulationPrefix: java.lang.String ) + object Input { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn : scala.Boolean + keepConsoleAppenderOn: scala.Boolean ) + object Logger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level : java.lang.String + level: java.lang.String ) + object Metrics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation : scala.Boolean + writePlansAndStopSimulation: scala.Boolean ) + object Output { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = + c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory : scala.Boolean, - baseOutputDirectory : java.lang.String, - collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, - defaultWriteInterval : scala.Int, - displayPerformanceTimings : scala.Boolean, - events : BeamConfig.Beam.Outputs.Events, - generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval : scala.Int, - matsim : BeamConfig.Beam.Outputs.Matsim, - stats : BeamConfig.Beam.Outputs.Stats, - writeAnalysis : scala.Boolean, - writeEventsInterval : scala.Int, - writeGraphs : scala.Boolean, - writeLinkTraversalInterval : scala.Int, - writePlansInterval : scala.Int, - writeR5RoutesInterval : scala.Int + addTimestampToOutputDirectory: scala.Boolean, + baseOutputDirectory: java.lang.String, + collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, + defaultWriteInterval: scala.Int, + displayPerformanceTimings: scala.Boolean, + events: BeamConfig.Beam.Outputs.Events, + generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval: scala.Int, + matsim: BeamConfig.Beam.Outputs.Matsim, + stats: BeamConfig.Beam.Outputs.Stats, + writeAnalysis: scala.Boolean, + writeEventsInterval: scala.Int, + writeGraphs: scala.Boolean, + writeLinkTraversalInterval: scala.Int, + writePlansInterval: scala.Int, + writeR5RoutesInterval: scala.Int ) + object Outputs { + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime : scala.Int, - startTime : scala.Int + endTime: scala.Int, + startTime: scala.Int ) + object GeneralizedLinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles : java.lang.String, - deleteRootFolderFiles : java.lang.String + deleteITERSFolderFiles: java.lang.String, + deleteRootFolderFiles: java.lang.String ) + object Matsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = + if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = + if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize : scala.Int + binSize: scala.Int ) + object Stats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), - defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), - generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), - stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writeLinkTraversalInterval = if(c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = + !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = + if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = + !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( + "collectAndCreateBeamAnalysisAndGraphs" + ), + defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( + if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") + else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") + ), + generalizedLinkStatsInterval = + if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ), + stats = BeamConfig.Beam.Outputs.Stats( + if (c.hasPathOrNull("stats")) c.getConfig("stats") + else com.typesafe.config.ConfigFactory.parseString("stats{}") + ), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writeLinkTraversalInterval = + if (c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim : BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager : BeamConfig.Beam.Physsim.EventManager, - events : BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia : scala.Boolean, - eventsSampling : scala.Double, - flowCapacityFactor : scala.Double, - initializeRouterWithFreeFlowTimes : scala.Boolean, - inputNetworkFilePath : java.lang.String, - jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize : scala.Int, - linkStatsWriteInterval : scala.Int, - name : java.lang.String, - network : BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath : java.lang.String, - parbprsim : BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize : scala.Double, - quick_fix_minCarSpeedInMetersPerSecond : scala.Double, - relaxation : BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim : scala.Boolean, - speedScalingFactor : scala.Double, - storageCapacityFactor : scala.Double, - writeEventsInterval : scala.Int, - writeMATSimNetwork : scala.Boolean, - writePlansInterval : scala.Int, - writeRouteHistoryInterval : scala.Int + bprsim: BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager: BeamConfig.Beam.Physsim.EventManager, + events: BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia: scala.Boolean, + eventsSampling: scala.Double, + flowCapacityFactor: scala.Double, + initializeRouterWithFreeFlowTimes: scala.Boolean, + inputNetworkFilePath: java.lang.String, + jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize: scala.Int, + linkStatsWriteInterval: scala.Int, + name: java.lang.String, + network: BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath: java.lang.String, + parbprsim: BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize: scala.Double, + quick_fix_minCarSpeedInMetersPerSecond: scala.Double, + relaxation: BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim: scala.Boolean, + speedScalingFactor: scala.Double, + storageCapacityFactor: scala.Double, + writeEventsInterval: scala.Int, + writeMATSimNetwork: scala.Boolean, + writePlansInterval: scala.Int, + writeRouteHistoryInterval: scala.Int ) + object Physsim { + case class Bprsim( - inFlowAggregationTimeWindowInSeconds : scala.Int, - minFlowToUseBPRFunction : scala.Int, - travelTimeFunction : java.lang.String + inFlowAggregationTimeWindowInSeconds: scala.Int, + minFlowToUseBPRFunction: scala.Int, + travelTimeFunction: java.lang.String ) + object Bprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, - minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = + if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) + c.getInt("inFlowAggregationTimeWindowInSeconds") + else 900, + minFlowToUseBPRFunction = + if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor : scala.Double + congestionFactor: scala.Double ) + object CchRoutingAssignment { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax : scala.Int, - departureTimeShiftMin : scala.Int, - fractionOfEventsToDuplicate : scala.Double + departureTimeShiftMax: scala.Int, + departureTimeShiftMin: scala.Int, + fractionOfEventsToDuplicate: scala.Double ) + object DuplicatePTE { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = + if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = + if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = + if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads : scala.Int, - `type` : java.lang.String + numberOfThreads: scala.Int, + `type`: java.lang.String ) + object EventManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) + object Jdeqsim { + case class AgentSimPhysSimInterfaceDebugger( - enabled : scala.Boolean + enabled: scala.Boolean ) + object AgentSimPhysSimInterfaceDebugger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, - capacityPlansWriteInterval : scala.Int, - enabled : scala.Boolean, - minRoadCapacity : scala.Int, - minSpeedMetersPerSec : scala.Int, - speedAdjustmentFactor : scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, + capacityPlansWriteInterval: scala.Int, + enabled: scala.Boolean, + minRoadCapacity: scala.Int, + minSpeedMetersPerSec: scala.Int, + speedAdjustmentFactor: scala.Double ) + object Cacc { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, - capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = + if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) + c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") + else 1.3, + capacityPlansWriteInterval = + if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = + if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = + if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( + if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") + else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") + ), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( + if (c.hasPathOrNull("cacc")) c.getConfig("cacc") + else com.typesafe.config.ConfigFactory.parseString("cacc{}") + ) ) } } - + case class Network( - maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) + object Network { + case class MaxSpeedInference( - enabled : scala.Boolean, - `type` : java.lang.String + enabled: scala.Boolean, + `type`: java.lang.String ) + object MaxSpeedInference { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled : scala.Boolean, - livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled: scala.Boolean, + livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) + object OverwriteRoadTypeProperties { + case class LivingStreet( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object LivingStreet { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Minor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Motorway { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object MotorwayLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Primary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object PrimaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Residential { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Secondary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object SecondaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Tertiary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TertiaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Trunk { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TrunkLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Unclassified { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( + if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") + else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") + ), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( + if (c.hasPathOrNull("minor")) c.getConfig("minor") + else com.typesafe.config.ConfigFactory.parseString("minor{}") + ), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( + if (c.hasPathOrNull("motorway")) c.getConfig("motorway") + else com.typesafe.config.ConfigFactory.parseString("motorway{}") + ), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( + if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") + else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") + ), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( + if (c.hasPathOrNull("primary")) c.getConfig("primary") + else com.typesafe.config.ConfigFactory.parseString("primary{}") + ), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( + if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") + else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") + ), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( + if (c.hasPathOrNull("residential")) c.getConfig("residential") + else com.typesafe.config.ConfigFactory.parseString("residential{}") + ), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( + if (c.hasPathOrNull("secondary")) c.getConfig("secondary") + else com.typesafe.config.ConfigFactory.parseString("secondary{}") + ), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( + if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") + else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") + ), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( + if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") + else com.typesafe.config.ConfigFactory.parseString("tertiary{}") + ), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( + if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") + else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") + ), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( + if (c.hasPathOrNull("trunk")) c.getConfig("trunk") + else com.typesafe.config.ConfigFactory.parseString("trunk{}") + ), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( + if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") + else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") + ), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( + if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") + else com.typesafe.config.ConfigFactory.parseString("unclassified{}") + ) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( + if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") + else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") + ), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( + if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") + else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") + ) ) } } - + case class Parbprsim( - numberOfClusters : scala.Int, - syncInterval : scala.Int + numberOfClusters: scala.Int, + syncInterval: scala.Int ) + object Parbprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier : scala.Double, - enabled : scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime : scala.Int + additionalTravelTimeMultiplier: scala.Double, + enabled: scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime: scala.Int ) + object PickUpDropOffAnalysis { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 + additionalTravelTimeMultiplier = + if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") + else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = + if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) + c.getInt("secondsFromPickUpPropOffToAffectTravelTime") + else 600 ) } } - + case class Relaxation( - experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type` : java.lang.String + experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type`: java.lang.String ) + object Relaxation { + case class Experiment20( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment20 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment21 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment30 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment40 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment50 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment51 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment52 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( + if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") + else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") + ), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( + if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") + else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") + ), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( + if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") + else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") + ), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( + if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") + else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") + ), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( + if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") + else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") + ), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( + if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") + else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") + ), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( + if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") + else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") + ), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), - eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), - events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), - linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), - ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim( + if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") + else com.typesafe.config.ConfigFactory.parseString("bprsim{}") + ), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( + if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") + else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") + ), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( + if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") + else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") + ), + eventManager = BeamConfig.Beam.Physsim.EventManager( + if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") + else com.typesafe.config.ConfigFactory.parseString("eventManager{}") + ), + events = BeamConfig.Beam.Physsim.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + eventsForFullVersionOfVia = + !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = + !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = + if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") + else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( + if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") + else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") + ), + linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = + if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + overwriteLinkParamPath = + if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim( + if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") + else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") + ), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( + if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") + else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") + ), + ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = + if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) + c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") + else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation( + if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") + else com.typesafe.config.ConfigFactory.parseString("relaxation{}") + ), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = + if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = + if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1 : scala.Double, - ModuleProbability_2 : scala.Double, - ModuleProbability_3 : scala.Double, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - clearModes : BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation : scala.Double, - maxAgentPlanMemorySize : scala.Int + ModuleProbability_1: scala.Double, + ModuleProbability_2: scala.Double, + ModuleProbability_3: scala.Double, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + clearModes: BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation: scala.Double, + maxAgentPlanMemorySize: scala.Int ) + object Replanning { + case class ClearModes( - iteration : scala.Int, - modes : scala.Option[scala.List[java.lang.String]], - strategy : java.lang.String + iteration: scala.Int, + modes: scala.Option[scala.List[java.lang.String]], + strategy: java.lang.String ) + object ClearModes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes( + if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") + else com.typesafe.config.ConfigFactory.parseString("clearModes{}") + ), + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getDouble("fractionOfIterationsToDisableInnovation") + else Double.PositiveInfinity, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim : BeamConfig.Beam.Router.Skim + skim: BeamConfig.Beam.Router.Skim ) + object Router { + case class Skim( - activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims : scala.Int, - origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval : scala.Int, - writeSkimsInterval : scala.Int + activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims: scala.Int, + origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval: scala.Int, + writeSkimsInterval: scala.Int ) + object Skim { + case class ActivitySimSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object ActivitySimSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object DriveTimeSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", - name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") + else "skimsTravelTimeObservedVsSimulated", + name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String, - poolingTravelTimeOveheadFactor : scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, - writeFullSkimsInterval : scala.Int + fileBaseName: java.lang.String, + name: java.lang.String, + poolingTravelTimeOveheadFactor: scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, + writeFullSkimsInterval: scala.Int ) + object OriginDestinationSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, - writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = + if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") + else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = + if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) + c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") + else 0, + writeFullSkimsInterval = + if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName : java.lang.String, - geoHierarchy : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + geoHierarchy: java.lang.String, + name: java.lang.String ) + object TazSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object TransitCrowdingSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), - keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), - writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( + if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") + else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") + ), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( + if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") + else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") + ), + keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( + if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") + else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") + ), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( + if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") + else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") + ), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( + if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") + else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") + ), + writeAggregatedSkimsInterval = + if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) + skim = BeamConfig.Beam.Router.Skim( + if (c.hasPathOrNull("skim")) c.getConfig("skim") + else com.typesafe.config.ConfigFactory.parseString("skim{}") + ) ) } } - + case class Routing( - baseDate : java.lang.String, - carRouter : java.lang.String, - gh : BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS : scala.Int, - overrideNetworkTravelTimesUsingSkims : scala.Boolean, - r5 : BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor : scala.Double, - startingIterationForTravelTimesMSA : scala.Int, - transitOnStreetNetwork : scala.Boolean, - writeRoutingStatistic : scala.Boolean + baseDate: java.lang.String, + carRouter: java.lang.String, + gh: BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS: scala.Int, + overrideNetworkTravelTimesUsingSkims: scala.Boolean, + r5: BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor: scala.Double, + startingIterationForTravelTimesMSA: scala.Int, + transitOnStreetNetwork: scala.Boolean, + writeRoutingStatistic: scala.Boolean ) + object Routing { + case class Gh( - useAlternativeRoutes : scala.Boolean + useAlternativeRoutes: scala.Boolean ) + object Gh { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath : java.lang.String, - bikeLaneScaleFactor : scala.Double, - departureWindow : scala.Double, - directory : java.lang.String, - linkRadiusMeters : scala.Double, - mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples : scala.Int, - osmFile : java.lang.String, - osmMapdbFile : java.lang.String, - travelTimeNoiseFraction : scala.Double + bikeLaneLinkIdsFilePath: java.lang.String, + bikeLaneScaleFactor: scala.Double, + departureWindow: scala.Double, + directory: java.lang.String, + linkRadiusMeters: scala.Double, + mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples: scala.Int, + osmFile: java.lang.String, + osmMapdbFile: java.lang.String, + travelTimeNoiseFraction: scala.Double ) + object R5 { + case class MNetBuilder( - fromCRS : java.lang.String, - toCRS : java.lang.String + fromCRS: java.lang.String, + toCRS: java.lang.String ) + object MNetBuilder { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike : scala.Int + bike: scala.Int ) + object MaxDistanceLimitByModeInMeters { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), - numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", - osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = + if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = + if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( + if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") + else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") + ), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( + if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") + ), + numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmFile = + if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", + osmMapdbFile = + if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") + else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = + if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), - minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, - overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), - r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), - skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh( + if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") + ), + minimumPossibleSkimBasedTravelTimeInS = + if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) + c.getInt("minimumPossibleSkimBasedTravelTimeInS") + else 60, + overrideNetworkTravelTimesUsingSkims = + c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( + "overrideNetworkTravelTimesUsingSkims" + ), + r5 = BeamConfig.Beam.Routing.R5( + if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") + ), + skimTravelTimesScalingFactor = + if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = + if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") + else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric : BeamConfig.Beam.Sim.Metric, - termination : BeamConfig.Beam.Sim.Termination + metric: BeamConfig.Beam.Sim.Metric, + termination: BeamConfig.Beam.Sim.Termination ) + object Sim { + case class Metric( - collector : BeamConfig.Beam.Sim.Metric.Collector + collector: BeamConfig.Beam.Sim.Metric.Collector ) + object Metric { + case class Collector( - influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics : java.lang.String + influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics: java.lang.String ) + object Collector { + case class InfluxDbSimulationMetricCollector( - connectionString : java.lang.String, - database : java.lang.String + connectionString: java.lang.String, + database: java.lang.String ) + object InfluxDbSimulationMetricCollector { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = + if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), - metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = + BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( + if (c.hasPathOrNull("influxDbSimulationMetricCollector")) + c.getConfig("influxDbSimulationMetricCollector") + else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") + ), + metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) + collector = BeamConfig.Beam.Sim.Metric.Collector( + if (c.hasPathOrNull("collector")) c.getConfig("collector") + else com.typesafe.config.ConfigFactory.parseString("collector{}") + ) ) } } - + case class Termination( - criterionName : java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName: java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) + object Termination { + case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration : scala.Int, - minLastIteration : scala.Int, - relativeTolerance : scala.Double + maxLastIteration: scala.Int, + minLastIteration: scala.Int, + relativeTolerance: scala.Double ) + object TerminateAtRideHailFleetStoredElectricityConvergence { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) + criterionName = + if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = + BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( + if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) + c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") + else + com.typesafe.config.ConfigFactory + .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), - termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) + metric = BeamConfig.Beam.Sim.Metric( + if (c.hasPathOrNull("metric")) c.getConfig("metric") + else com.typesafe.config.ConfigFactory.parseString("metric{}") + ), + termination = BeamConfig.Beam.Sim.Termination( + if (c.hasPathOrNull("termination")) c.getConfig("termination") + else com.typesafe.config.ConfigFactory.parseString("termination{}") + ) ) } } - + case class Spatial( - boundingBoxBuffer : scala.Int, - localCRS : java.lang.String + boundingBoxBuffer: scala.Int, + localCRS: java.lang.String ) + object Spatial { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear ) + object Urbansim { + case class BackgroundODSkimsCreator( - calculationTimeoutHours : scala.Int, - enabled : scala.Boolean, - maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes : scala.Int, - peakHours : scala.Option[scala.List[scala.Double]], - routerType : java.lang.String, - skimsGeoType : java.lang.String, - skimsKind : java.lang.String + calculationTimeoutHours: scala.Int, + enabled: scala.Boolean, + maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes: scala.Int, + peakHours: scala.Option[scala.List[scala.Double]], + routerType: java.lang.String, + skimsGeoType: java.lang.String, + skimsKind: java.lang.String ) + object BackgroundODSkimsCreator { + case class MaxTravelDistanceInMeters( - bike : scala.Int, - walk : scala.Int + bike: scala.Int, + walk: scala.Int ) + object MaxTravelDistanceInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive : scala.Boolean, - transit : scala.Boolean, - walk : scala.Boolean + drive: scala.Boolean, + transit: scala.Boolean, + walk: scala.Boolean ) + object ModesToBuild { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), - numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = + if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( + if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") + ), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( + if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") + else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") + ), + numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes : scala.Double, - bike : scala.Double, - car : scala.Double, - drive_transit : scala.Double, - walk : scala.Double, - walk_transit : scala.Double + allModes: scala.Double, + bike: scala.Double, + car: scala.Double, + drive_transit: scala.Double, + walk: scala.Double, + walk_transit: scala.Double ) + object FractionOfModesToClear { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( + if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") + else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") + ), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( + if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") + else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") + ) ) } } - + case class WarmStart( - path : java.lang.String, - prepareData : scala.Boolean, - samplePopulationIntegerFlag : scala.Int, - skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type` : java.lang.String + path: java.lang.String, + prepareData: scala.Boolean, + samplePopulationIntegerFlag: scala.Int, + skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type`: java.lang.String ) + object WarmStart { + case class SkimsFilePaths$Elm( - skimType : java.lang.String, - skimsFilePath : java.lang.String + skimType: java.lang.String, + skimsFilePath: java.lang.String ) + object SkimsFilePaths$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if(c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if (c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = + if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = + if (c.hasPathOrNull("skimsFilePaths")) + scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) + else None, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), - calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), - cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), - debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), - exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), - experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), - input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), - inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), - metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), - output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), - physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), - replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), - routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), - sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), - spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), - urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) + actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim( + if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") + else com.typesafe.config.ConfigFactory.parseString("agentsim{}") + ), + calibration = BeamConfig.Beam.Calibration( + if (c.hasPathOrNull("calibration")) c.getConfig("calibration") + else com.typesafe.config.ConfigFactory.parseString("calibration{}") + ), + cluster = BeamConfig.Beam.Cluster( + if (c.hasPathOrNull("cluster")) c.getConfig("cluster") + else com.typesafe.config.ConfigFactory.parseString("cluster{}") + ), + debug = BeamConfig.Beam.Debug( + if (c.hasPathOrNull("debug")) c.getConfig("debug") + else com.typesafe.config.ConfigFactory.parseString("debug{}") + ), + exchange = BeamConfig.Beam.Exchange( + if (c.hasPathOrNull("exchange")) c.getConfig("exchange") + else com.typesafe.config.ConfigFactory.parseString("exchange{}") + ), + experimental = BeamConfig.Beam.Experimental( + if (c.hasPathOrNull("experimental")) c.getConfig("experimental") + else com.typesafe.config.ConfigFactory.parseString("experimental{}") + ), + input = BeamConfig.Beam.Input( + if (c.hasPathOrNull("input")) c.getConfig("input") + else com.typesafe.config.ConfigFactory.parseString("input{}") + ), + inputDirectory = + if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger( + if (c.hasPathOrNull("logger")) c.getConfig("logger") + else com.typesafe.config.ConfigFactory.parseString("logger{}") + ), + metrics = BeamConfig.Beam.Metrics( + if (c.hasPathOrNull("metrics")) c.getConfig("metrics") + else com.typesafe.config.ConfigFactory.parseString("metrics{}") + ), + output = BeamConfig.Beam.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + outputs = BeamConfig.Beam.Outputs( + if (c.hasPathOrNull("outputs")) c.getConfig("outputs") + else com.typesafe.config.ConfigFactory.parseString("outputs{}") + ), + physsim = BeamConfig.Beam.Physsim( + if (c.hasPathOrNull("physsim")) c.getConfig("physsim") + else com.typesafe.config.ConfigFactory.parseString("physsim{}") + ), + replanning = BeamConfig.Beam.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + router = BeamConfig.Beam.Router( + if (c.hasPathOrNull("router")) c.getConfig("router") + else com.typesafe.config.ConfigFactory.parseString("router{}") + ), + routing = BeamConfig.Beam.Routing( + if (c.hasPathOrNull("routing")) c.getConfig("routing") + else com.typesafe.config.ConfigFactory.parseString("routing{}") + ), + sim = BeamConfig.Beam.Sim( + if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") + ), + spatial = BeamConfig.Beam.Spatial( + if (c.hasPathOrNull("spatial")) c.getConfig("spatial") + else com.typesafe.config.ConfigFactory.parseString("spatial{}") + ), + urbansim = BeamConfig.Beam.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart( + if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") + else com.typesafe.config.ConfigFactory.parseString("warmStart{}") + ) ) } } - + case class Matsim( - conversion : BeamConfig.Matsim.Conversion, - modules : BeamConfig.Matsim.Modules + conversion: BeamConfig.Matsim.Conversion, + modules: BeamConfig.Matsim.Modules ) + object Matsim { + case class Conversion( - defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles : scala.Boolean, - matsimNetworkFile : java.lang.String, - osmFile : java.lang.String, - populationFile : java.lang.String, - scenarioDirectory : java.lang.String, - shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile : java.lang.String + defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles: scala.Boolean, + matsimNetworkFile: java.lang.String, + osmFile: java.lang.String, + populationFile: java.lang.String, + scenarioDirectory: java.lang.String, + shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile: java.lang.String ) + object Conversion { + case class DefaultHouseholdIncome( - currency : java.lang.String, - period : java.lang.String, - value : scala.Int + currency: java.lang.String, + period: java.lang.String, + value: scala.Int ) + object DefaultHouseholdIncome { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if(c.hasPathOrNull("period")) c.getString("period") else "year", - value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if (c.hasPathOrNull("period")) c.getString("period") else "year", + value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile : java.lang.String, - tazIdFieldName : java.lang.String + shapeFile: java.lang.String, + tazIdFieldName: java.lang.String ) + object ShapeConfig { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( + if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") + else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") + ), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = + if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = + if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = + if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") + else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( + if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") + else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") + ), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode : BeamConfig.Matsim.Modules.ChangeMode, - controler : BeamConfig.Matsim.Modules.Controler, - counts : BeamConfig.Matsim.Modules.Counts, - global : BeamConfig.Matsim.Modules.Global, - households : BeamConfig.Matsim.Modules.Households, - linkStats : BeamConfig.Matsim.Modules.LinkStats, - network : BeamConfig.Matsim.Modules.Network, - parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, - plans : BeamConfig.Matsim.Modules.Plans, - qsim : BeamConfig.Matsim.Modules.Qsim, - strategy : BeamConfig.Matsim.Modules.Strategy, - transit : BeamConfig.Matsim.Modules.Transit, - vehicles : BeamConfig.Matsim.Modules.Vehicles + changeMode: BeamConfig.Matsim.Modules.ChangeMode, + controler: BeamConfig.Matsim.Modules.Controler, + counts: BeamConfig.Matsim.Modules.Counts, + global: BeamConfig.Matsim.Modules.Global, + households: BeamConfig.Matsim.Modules.Households, + linkStats: BeamConfig.Matsim.Modules.LinkStats, + network: BeamConfig.Matsim.Modules.Network, + parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, + plans: BeamConfig.Matsim.Modules.Plans, + qsim: BeamConfig.Matsim.Modules.Qsim, + strategy: BeamConfig.Matsim.Modules.Strategy, + transit: BeamConfig.Matsim.Modules.Transit, + vehicles: BeamConfig.Matsim.Modules.Vehicles ) + object Modules { + case class ChangeMode( - modes : java.lang.String + modes: java.lang.String ) + object ChangeMode { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat : java.lang.String, - firstIteration : scala.Int, - lastIteration : scala.Int, - mobsim : java.lang.String, - outputDirectory : java.lang.String, - overwriteFiles : java.lang.String + eventsFileFormat: java.lang.String, + firstIteration: scala.Int, + lastIteration: scala.Int, + mobsim: java.lang.String, + outputDirectory: java.lang.String, + overwriteFiles: java.lang.String ) + object Controler { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = + if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Double, - inputCountsFile : java.lang.String, - outputformat : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Double, + inputCountsFile: java.lang.String, + outputformat: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem : java.lang.String, - randomSeed : scala.Int + coordinateSystem: java.lang.String, + randomSeed: scala.Int ) + object Global { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile : java.lang.String, - inputHouseholdAttributesFile : java.lang.String + inputFile: java.lang.String, + inputHouseholdAttributesFile: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" + inputFile = + if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = + if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") + else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations : scala.Int, - writeLinkStatsInterval : scala.Int + averageLinkStatsOverIterations: scala.Int, + writeLinkStatsInterval: scala.Int ) + object LinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = + if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = + if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile : java.lang.String + inputNetworkFile: java.lang.String ) + object Network { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = + if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") + else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents : scala.Int, - numberOfThreads : scala.Int, - oneThreadPerHandler : scala.Boolean, - synchronizeOnSimSteps : scala.Boolean + estimatedNumberOfEvents: scala.Int, + numberOfThreads: scala.Int, + oneThreadPerHandler: scala.Boolean, + synchronizeOnSimSteps: scala.Boolean ) + object ParallelEventHandling { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = + if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta : scala.Long, - earlyDeparture : scala.Long, - lateArrival : scala.Long, - learningRate : scala.Long, - parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing : scala.Long, - traveling : scala.Long, - waiting : scala.Long, - writeExperiencedPlans : scala.Boolean + BrainExpBeta: scala.Long, + earlyDeparture: scala.Long, + lateArrival: scala.Long, + learningRate: scala.Long, + parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing: scala.Long, + traveling: scala.Long, + waiting: scala.Long, + writeExperiencedPlans: scala.Boolean ) + object PlanCalcScore { + case class Parameterset$Elm( - activityType : java.lang.String, - priority : scala.Int, - scoringThisActivityAtAll : scala.Boolean, - `type` : java.lang.String, - typicalDuration : java.lang.String, - typicalDurationScoreComputation : java.lang.String + activityType: java.lang.String, + priority: scala.Int, + scoringThisActivityAtAll: scala.Boolean, + `type`: java.lang.String, + typicalDuration: java.lang.String, + typicalDurationScoreComputation: java.lang.String ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" + activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = + !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = + if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") + else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, - earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, - lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, - learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, - traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, - waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + BrainExpBeta = + if (c.hasPathOrNull("BrainExpBeta")) + c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) + else 2, + earlyDeparture = + if (c.hasPathOrNull("earlyDeparture")) + c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, + lateArrival = + if (c.hasPathOrNull("lateArrival")) + c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) + else -18, + learningRate = + if (c.hasPathOrNull("learningRate")) + c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) + else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = + if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) + else 6, + traveling = + if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) + else -6, + waiting = + if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.PlanCalcScore + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Plans( - inputPersonAttributesFile : java.lang.String, - inputPlansFile : java.lang.String + inputPersonAttributesFile: java.lang.String, + inputPlansFile: java.lang.String ) + object Plans { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" + inputPersonAttributesFile = + if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") + else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = + if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") + else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime : java.lang.String, - snapshotperiod : java.lang.String, - startTime : java.lang.String + endTime: java.lang.String, + snapshotperiod: java.lang.String, + startTime: java.lang.String ) + object Qsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1 : scala.Int, - ModuleProbability_2 : scala.Int, - ModuleProbability_3 : scala.Int, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - fractionOfIterationsToDisableInnovation : scala.Int, - maxAgentPlanMemorySize : scala.Int, - parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval : java.lang.String + ModuleProbability_1: scala.Int, + ModuleProbability_2: scala.Int, + ModuleProbability_3: scala.Int, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + fractionOfIterationsToDisableInnovation: scala.Int, + maxAgentPlanMemorySize: scala.Int, + parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval: java.lang.String ) + object Strategy { + case class Parameterset$Elm( - disableAfterIteration : scala.Int, - strategyName : java.lang.String, - `type` : java.lang.String, - weight : scala.Int + disableAfterIteration: scala.Int, + strategyName: java.lang.String, + `type`: java.lang.String, + weight: scala.Int ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" - ) - } - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getInt("fractionOfIterationsToDisableInnovation") + else 999999, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = + if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") + else "WorstPlanForRemovalSelector" + ) + } + + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.Strategy + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Transit( - transitModes : java.lang.String, - useTransit : scala.Boolean, - vehiclesFile : java.lang.String + transitModes: java.lang.String, + useTransit: scala.Boolean, + vehiclesFile: java.lang.String ) + object Transit { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile : java.lang.String + vehiclesFile: java.lang.String ) + object Vehicles { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), - controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), - counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), - households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), - network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), - plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), - strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), - transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), - vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + changeMode = BeamConfig.Matsim.Modules.ChangeMode( + if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") + else com.typesafe.config.ConfigFactory.parseString("changeMode{}") + ), + controler = BeamConfig.Matsim.Modules.Controler( + if (c.hasPathOrNull("controler")) c.getConfig("controler") + else com.typesafe.config.ConfigFactory.parseString("controler{}") + ), + counts = BeamConfig.Matsim.Modules.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + global = BeamConfig.Matsim.Modules.Global( + if (c.hasPathOrNull("global")) c.getConfig("global") + else com.typesafe.config.ConfigFactory.parseString("global{}") + ), + households = BeamConfig.Matsim.Modules.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + linkStats = BeamConfig.Matsim.Modules.LinkStats( + if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") + else com.typesafe.config.ConfigFactory.parseString("linkStats{}") + ), + network = BeamConfig.Matsim.Modules.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( + if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") + else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") + ), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( + if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") + else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") + ), + plans = BeamConfig.Matsim.Modules.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + qsim = BeamConfig.Matsim.Modules.Qsim( + if (c.hasPathOrNull("qsim")) c.getConfig("qsim") + else com.typesafe.config.ConfigFactory.parseString("qsim{}") + ), + strategy = BeamConfig.Matsim.Modules.Strategy( + if (c.hasPathOrNull("strategy")) c.getConfig("strategy") + else com.typesafe.config.ConfigFactory.parseString("strategy{}") + ), + transit = BeamConfig.Matsim.Modules.Transit( + if (c.hasPathOrNull("transit")) c.getConfig("transit") + else com.typesafe.config.ConfigFactory.parseString("transit{}") + ), + vehicles = BeamConfig.Matsim.Modules.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), - modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) + conversion = BeamConfig.Matsim.Conversion( + if (c.hasPathOrNull("conversion")) c.getConfig("conversion") + else com.typesafe.config.ConfigFactory.parseString("conversion{}") + ), + modules = BeamConfig.Matsim.Modules( + if (c.hasPathOrNull("modules")) c.getConfig("modules") + else com.typesafe.config.ConfigFactory.parseString("modules{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), - matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) + beam = BeamConfig.Beam( + if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") + ), + matsim = BeamConfig.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ) ) } - private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + + private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { + + private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") + if ( + (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number] + ) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { + + private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException(cv.origin.lineNumber + + new java.lang.RuntimeException( + cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) + ) } - private def $_str(cv:com.typesafe.config.ConfigValue) = + + private def $_str(cv: com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } - diff --git a/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala b/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala index b8a12725701..aad7bdeb093 100644 --- a/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala +++ b/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala @@ -225,9 +225,9 @@ object HOVModeTransformer extends LazyLogging { if (cantSplitTripsForPersons.nonEmpty) { logger.info( - "Cannot split plans to trips because plans does not start and end by Home activity for {} persons: {}", + "Cannot split plans to trips because plans does not start and end by Home activity for {} persons including: {}", cantSplitTripsForPersons.size, - cantSplitTripsForPersons.mkString(",") + cantSplitTripsForPersons.take(10).mkString(",") ) } From 569a5f00f120dcbc59f622ba547a3552210abd20 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 2 Mar 2022 00:23:14 -0800 Subject: [PATCH 014/307] trying a fix to large infrastructure file --- .../infrastructure/ChargingFunctions.scala | 4 +- .../InfrastructureFunctions.scala | 56 ++++++++++++++++--- .../infrastructure/ParkingFunctions.scala | 24 ++++---- .../parking/ParkingZoneSearch.scala | 44 +++++++++++---- 4 files changed, 96 insertions(+), 32 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index d219e1a36a9..6d07e2473a0 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -53,7 +53,7 @@ class ChargingFunctions[GEO: GeoLevel]( * @return */ def ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { - inquiry.reservedFor match { + inquiry.reservedFor.managerType match { case VehicleManager.TypeEnum.RideHail if inquiry.parkingDuration <= 3600 => ChargingPointType.isFastCharger(zone.chargingPointType.get) case _ => @@ -104,7 +104,7 @@ class ChargingFunctions[GEO: GeoLevel]( ): Boolean = { if (zone.chargingPointType.isEmpty) throw new RuntimeException("ChargingFunctions expect only stalls with charging points") - val isEV: Boolean = inquiry.beamVehicle.forall(v => v.isBEV || v.isPHEV) + val isEV: Boolean = inquiry.beamVehicle.forall(_.isEV) val rideHailFastChargingOnly: Boolean = ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone, inquiry) val enrouteFastChargingOnly: Boolean = ifEnrouteThenFastChargingOnly(zone, inquiry) val validChargingCapability: Boolean = hasValidChargingCapability(zone, inquiry.beamVehicle) diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 89893cd29de..29be375652a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -1,7 +1,8 @@ package beam.agentsim.infrastructure import beam.agentsim.agents.choice.logit.UtilityFunctionOperation -import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} +import beam.agentsim.agents.vehicles.VehicleManager +import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.ParkingZone.UbiqiutousParkingAvailability import beam.agentsim.infrastructure.parking.ParkingZoneSearch.{ @@ -33,11 +34,47 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( seed: Int ) extends StrictLogging { - protected val zoneSearchTree: ParkingZoneSearch.ZoneSearchTree[GEO] = - ParkingZoneFileUtils.createZoneSearchTree(parkingZones.values.toSeq) + protected val ( + parkingZonesAggregated: Map[Id[ParkingZoneId], ParkingZone[GEO]], + aggregatedZonesToAllZones: Map[Id[ParkingZoneId], Id[ParkingZoneId]] + ) = { + val groupedZones = parkingZones + .map { + case (_, parkingZone) if parkingZone.reservedFor.managerType == VehicleManager.TypeEnum.Household => + (parkingZone, VehicleManager.createOrGetReservedFor("generic-hh", VehicleManager.TypeEnum.Household)) + case (_, parkingZone) => (parkingZone, parkingZone.reservedFor) + } + .groupBy { case (parkingZone, reservedFor) => + ( + parkingZone.geoId, + parkingZone.parkingType, + parkingZone.chargingPointType, + parkingZone.pricingModel, + reservedFor + ) + } + .map { case ((geoId, parkingType, chargingPointType, pricingModel, reservedFor), zones) => + val zone = ParkingZone.init( + None, + geoId, + parkingType, + reservedFor, + zones.map(_._1.maxStalls).sum, + chargingPointType, + pricingModel + ) + (zone, zones) + } + val aggregatedZones = groupedZones.map { case (zone, _) => zone.parkingZoneId -> zone } + val mappedZones = groupedZones.map { case (zone, zones) => zone.parkingZoneId -> zones.map(_._1.parkingZoneId) } + (aggregatedZones, mappedZones) + } protected val mnlMultiplierParameters: Map[ParkingMNL.Parameters, UtilityFunctionOperation] + protected lazy val zoneSearchTree: ParkingZoneSearch.ZoneSearchTree[GEO] = + ParkingZoneFileUtils.createZoneSearchTree(parkingZonesAggregated.values.toSeq) + /** * Generic method for updating MNL Parameters * @param parkingAlternative ParkingAlternative @@ -123,10 +160,14 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( inquiry.searchMode, mnlMultiplierParameters, zoneSearchTree, - parkingZones, + parkingZonesAggregated, + parkingZonesAggregated.map { case (zoneId, _) => + zoneId -> aggregatedZonesToAllZones(zoneId).map(parkingZones).toArray + }, geoQuadTree, new Random(seed), - inquiry.departureLocation + inquiry.departureLocation, + inquiry.reservedFor ) val closestZone = @@ -143,10 +184,7 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( // filters out ParkingZones which do not apply to this agent // TODO: check for conflicts between variables here - is it always false? val parkingZoneFilterFunction: ParkingZone[GEO] => Boolean = - (zone: ParkingZone[GEO]) => { - val searchFilterPredicates = setupSearchFilterPredicates(zone, inquiry) - searchFilterPredicates - } + (zone: ParkingZone[GEO]) => setupSearchFilterPredicates(zone, inquiry) // generates a coordinate for an embodied ParkingStall from a ParkingZone val parkingZoneLocSamplingFunction: ParkingZone[GEO] => Coord = diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 96603ea2957..e60a2bc284b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -218,21 +218,25 @@ class ParkingFunctions[GEO: GeoLevel]( inquiry: ParkingInquiry, preferredParkingTypes: Set[ParkingType] ): Boolean = { - val hasAvailability: Boolean = parkingZones(zone.parkingZoneId).stallsAvailable > 0 + val originalZones = aggregatedZonesToAllZones(zone.parkingZoneId).map(parkingZones) - val validParkingType: Boolean = preferredParkingTypes.contains(zone.parkingType) + val isValidVehicleManager = zone.reservedFor.managerType match { + case VehicleManager.TypeEnum.Default => !inquiry.beamVehicle.exists(_.isCAV) + case VehicleManager.TypeEnum.NoManager => false + case _ => originalZones.exists(_.reservedFor == inquiry.reservedFor) + } - val isValidTime = inquiry.beamVehicle.forall(vehicle => - zone.timeRestrictions - .get(vehicle.beamVehicleType.vehicleCategory) - .forall(_.contains(inquiry.destinationUtm.time % (24 * 3600))) - ) + val isValidParkingType: Boolean = preferredParkingTypes.contains(zone.parkingType) - val isValidVehicleManager = inquiry.beamVehicle.forall { vehicle => - zone.reservedFor.managerType == VehicleManager.TypeEnum.Default || zone.reservedFor.managerId == inquiry.reservedFor.managerId + val hasAvailability = originalZones.exists { z => + z.stallsAvailable > 0 && inquiry.beamVehicle.forall(vehicle => + z.timeRestrictions + .get(vehicle.beamVehicleType.vehicleCategory) + .forall(_.contains(inquiry.destinationUtm.time % (24 * 3600))) + ) } - hasAvailability & validParkingType & isValidTime & isValidVehicleManager + hasAvailability & isValidParkingType & isValidVehicleManager } /** diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 7749313afe3..0cc83830ab2 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -1,6 +1,8 @@ package beam.agentsim.infrastructure.parking import beam.agentsim.agents.choice.logit.MultinomialLogit +import beam.agentsim.agents.vehicles.VehicleManager +import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode import beam.agentsim.infrastructure.ParkingStall import beam.agentsim.infrastructure.charging._ @@ -58,7 +60,7 @@ object ParkingZoneSearch { * @param parkingDuration duration of the activity agent wants to park for * @param parkingMNLConfig utility function which evaluates [[ParkingAlternative]]s * @param zoneSearchTree a nested map lookup of [[ParkingZone]]s - * @param parkingZones the stored state of all [[ParkingZone]]s + * @param aggregatedParkingZones the stored state of all [[ParkingZone]]s * @param zoneQuadTree [[ParkingZone]]s are associated with a TAZ, which are themselves stored in this Quad Tree * @param random random number generator * @param parkingTypes the list of acceptable parking types allowed for this search @@ -69,10 +71,12 @@ object ParkingZoneSearch { searchMode: ParkingSearchMode, parkingMNLConfig: ParkingMNL.ParkingMNLConfig, zoneSearchTree: ZoneSearchTree[GEO], - parkingZones: Map[Id[ParkingZoneId], ParkingZone[GEO]], + aggregatedParkingZones: Map[Id[ParkingZoneId], ParkingZone[GEO]], + aggregatedToAllZones: Map[Id[ParkingZoneId], Array[ParkingZone[GEO]]], zoneQuadTree: QuadTree[GEO], random: Random, originUTM: Option[Location], + reservedFor: ReservedFor, parkingTypes: Seq[ParkingType] = ParkingType.AllTypes ) @@ -159,11 +163,10 @@ object ParkingZoneSearch { parkingType <- params.parkingTypes parkingZoneIds <- parkingTypesSubtree.get(parkingType).toList parkingZoneId <- parkingZoneIds - parkingZone <- ParkingZone.getParkingZone(params.parkingZones, parkingZoneId) + parkingZone <- ParkingZone.getParkingZone(params.aggregatedParkingZones, parkingZoneId) if parkingZoneFilterFunction(parkingZone) } yield { - // wrap ParkingZone in a ParkingAlternative - val stallLocation: Coord = parkingZoneLocSamplingFunction(parkingZone) + val stallPriceInDollars: Double = parkingZone.pricingModel match { case None => 0 @@ -172,14 +175,33 @@ object ParkingZoneSearch { case Some(pricingModel) => PricingModel.evaluateParkingTicket(pricingModel, params.parkingDuration.toInt) } + + // wrap "original" ParkingZones in a ParkingAlternative + // as the aggregated ParkingZones serve as higher level of abstraction to speed up the search + val Some((originalZone, stallLocation, distance)) = params + .aggregatedToAllZones(parkingZone.parkingZoneId) + .foldLeft[Option[(ParkingZone[GEO], Location, Double)]](None) { case (acc, z) => + val stallLocation: Coord = parkingZoneLocSamplingFunction(parkingZone) + val distance: Double = config.distanceFunction(params.destinationUTM, stallLocation) + val validManagerType = + z.reservedFor.managerType == VehicleManager.TypeEnum.Default || z.reservedFor == params.reservedFor + if (z.stallsAvailable > 0 && validManagerType && (acc.isEmpty || acc.exists(_._3 > distance))) + Some((z, stallLocation, distance)) + else acc + } + val parkingAlternative: ParkingAlternative[GEO] = - ParkingAlternative(zone, parkingZone.parkingType, parkingZone, stallLocation, stallPriceInDollars) - val parkingAlternativeUtility: Map[ParkingMNL.Parameters, Double] = - parkingZoneMNLParamsFunction(parkingAlternative) - ParkingSearchAlternative( - parkingAlternative, - parkingAlternativeUtility + ParkingAlternative( + zone, + originalZone.parkingType, + originalZone, + stallLocation, + stallPriceInDollars + ) + val parkingAlternativeUtility: Map[ParkingMNL.Parameters, Double] = parkingZoneMNLParamsFunction( + parkingAlternative ) + ParkingSearchAlternative(parkingAlternative, parkingAlternativeUtility) } } From d944aa78bff2a3280ae3f41c94d915889aac2d20 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 2 Mar 2022 00:44:22 -0800 Subject: [PATCH 015/307] fixing the fix --- .../agentsim/infrastructure/InfrastructureFunctions.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 29be375652a..8344edaf025 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -36,7 +36,7 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( protected val ( parkingZonesAggregated: Map[Id[ParkingZoneId], ParkingZone[GEO]], - aggregatedZonesToAllZones: Map[Id[ParkingZoneId], Id[ParkingZoneId]] + aggregatedZonesToAllZones: Map[Id[ParkingZoneId], Array[Id[ParkingZoneId]]] ) = { val groupedZones = parkingZones .map { @@ -66,7 +66,9 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( (zone, zones) } val aggregatedZones = groupedZones.map { case (zone, _) => zone.parkingZoneId -> zone } - val mappedZones = groupedZones.map { case (zone, zones) => zone.parkingZoneId -> zones.map(_._1.parkingZoneId) } + val mappedZones = groupedZones.map { case (zone, zones) => + zone.parkingZoneId -> zones.map(_._1.parkingZoneId).toArray + } (aggregatedZones, mappedZones) } @@ -162,7 +164,7 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( zoneSearchTree, parkingZonesAggregated, parkingZonesAggregated.map { case (zoneId, _) => - zoneId -> aggregatedZonesToAllZones(zoneId).map(parkingZones).toArray + zoneId -> aggregatedZonesToAllZones(zoneId).map(parkingZones(_)) }, geoQuadTree, new Random(seed), From ae34a758c65ffac5168703b914a02239bd24bff5 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 6 Mar 2022 18:46:07 -0800 Subject: [PATCH 016/307] run to debug --- .../agentsim/infrastructure/ParkingFunctions.scala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index dad6af3c6bc..ab4f588c4fa 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -115,7 +115,17 @@ class ParkingFunctions[GEO: GeoLevel]( parkingZoneSearchResult: Option[ParkingZoneSearchResult[GEO]] ): Option[ParkingZoneSearchResult[GEO]] = { val output = parkingZoneSearchResult match { - case Some(result) => result + case Some(result) => + result.parkingZonesSampled.foreach { case (parkingZoneId, chargingPointTypeMaybe, parkingType, costInDollars) => + logger.info( + s"SAMPLED: ${parkingZoneId},${chargingPointTypeMaybe.getOrElse("NoCharger")},${parkingType},${costInDollars}" + ) + } + logger.info( + s"CHOSEN: ${result.parkingStall.parkingZoneId},${result.parkingStall.chargingPointType + .getOrElse("NoCharger")},${result.parkingStall.parkingType},${result.parkingStall.costInDollars}" + ) + result case _ => inquiry.parkingActivityType match { case ParkingActivityType.Init | ParkingActivityType.Home => From ec1933ddc71646b2d9e0164620b1d8db7dd3dfa8 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 6 Mar 2022 20:18:39 -0800 Subject: [PATCH 017/307] debugging chargingFunctions --- src/main/python/gemini/debugging.py | 16 +++ src/main/python/gemini/helper.py | 7 ++ .../nrel_to_beam_charging_infrastruture.py | 111 ++++++++++++++++++ .../infrastructure/ChargingFunctions.scala | 17 ++- .../infrastructure/ParkingFunctions.scala | 12 +- 5 files changed, 151 insertions(+), 12 deletions(-) create mode 100644 src/main/python/gemini/debugging.py create mode 100644 src/main/python/gemini/helper.py create mode 100644 src/main/python/gemini/nrel_to_beam_charging_infrastruture.py diff --git a/src/main/python/gemini/debugging.py b/src/main/python/gemini/debugging.py new file mode 100644 index 00000000000..ca8783a8e01 --- /dev/null +++ b/src/main/python/gemini/debugging.py @@ -0,0 +1,16 @@ +import helper +import os + +mnl_lines = ["parkingZoneId,chargingPointType,parkingType,costInDollars\n"] +output_log_file = os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/beamLog.out.txt') +with open(output_log_file) as infile: + for line in infile: + if "SAMPLED: " in line: + mnl_lines.append(line.split("SAMPLED: ")[1]) + elif "CHOSEN: " in line: + mnl_lines.append(line.split("CHOSEN: ")[1]) + +mnl_output_log_file = os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-beamLog.csv') +with open(mnl_output_log_file, 'w') as f: + f.writelines(mnl_lines) +print("END") \ No newline at end of file diff --git a/src/main/python/gemini/helper.py b/src/main/python/gemini/helper.py new file mode 100644 index 00000000000..78ee1545f72 --- /dev/null +++ b/src/main/python/gemini/helper.py @@ -0,0 +1,7 @@ +import pandas as pd + +def read_file(filename): + compression = None + if filename.endswith(".gz"): + compression = 'gzip' + return pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) \ No newline at end of file diff --git a/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py b/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py new file mode 100644 index 00000000000..3c9b3c71cc5 --- /dev/null +++ b/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py @@ -0,0 +1,111 @@ +import pandas as pd +import os +import random +from tqdm import tqdm + +nrel_file_input = os.path.expanduser('~/Data/GEMINI/2022Feb/siting/init1-7_2022_Feb_03_wgs84.csv') +smart_file_input = os.path.expanduser("~/Data/GEMINI/stations/taz-parking-sparse-fast-limited-l2-150-lowtech-b.csv") +nrel_file_converted_input = os.path.expanduser(nrel_file_input.split(".")[0] + "_converted.csv") +smart_file_updated_input = os.path.expanduser(smart_file_input.split(".")[0] + "_updated.csv") +smart_file_with_fees_input = os.path.expanduser(nrel_file_input.split(".")[0] + "_withFees.csv.gz") + + +def read_file(filename): + compression = None + if filename.endswith(".gz"): + compression = 'gzip' + return pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) + + +def convert_nrel_data(nrel_file, nrel_file_converted): + if not os.path.exists(nrel_file_converted): + data = read_file(nrel_file) + data2 = data[["subSpace", "pType", "chrgType", "field_1", "household_id", "X", "Y", "housingTypes", "propertytype", "propertysubtype", "county"]] + data2 = data2.rename(columns={ + "chrgType": "chargingPointType", + "pType": "parkingType", + "subSpace": "taz", + "X": "locationX", + "Y": "locationY", + "housingTypes": "housingType", + "propertytype": "propertyType", + "propertysubtype": "propertySubType", + "county": "county" + }) + data2["parkingZoneId"] = "" + data2["reservedFor"] = "Any" + data2["pricingModel"] = "Block" + data2["feeInCents"] = 0 + data2["numStalls"] = 1 + data2.loc[data2["household_id"].notna(), ['reservedFor']] = data2.loc[data2["household_id"].notna()].apply( + lambda row1: "household(" + str(int(row1["household_id"])) + ")", axis=1) + data2.loc[data2["field_1"].notna(), ['parkingZoneId']] = data2.loc[data2["field_1"].notna()].apply( + lambda row2: "PEV-" + str(int(row2["taz"])) + "-" + str(int(row2["field_1"])), axis=1) + nrel_data = data2.drop(columns=['household_id', 'field_1']) + nrel_data.to_csv(nrel_file_converted, index=False) + print("Reading nrel infrastructure done!") + return nrel_data + else: + return read_file(nrel_file_converted) + + +# Reading fees +def reading_sf_bay_fees(smart_file, smart_file_updated): + if not os.path.exists(smart_file_updated): + smart_data = read_file(smart_file) + smart_data["chargingPointType"] = "NoCharger" + smart_data.loc[(smart_data["chargingType"] == "WorkLevel2(7.2|AC)") & (smart_data["parkingType"] == "Public"), ['chargingPointType']] = "publiclevel2(7.2|AC)" + smart_data.loc[(smart_data["chargingType"] == "WorkLevel2(7.2|AC)") & (smart_data["parkingType"] == "Workplace"), ['chargingPointType']] = "worklevel2(7.2|AC)" + smart_data.loc[smart_data["chargingType"] == "Custom(150.0|DC)", ['chargingPointType']] = "publicfc(150.0|DC)" + smart_data.loc[smart_data["chargingType"] == "HomeLevel2(7.2|AC)", ['chargingPointType']] = "homelevel2(7.2|AC)" + smart_data.loc[smart_data["chargingType"] == "HomeLevel1(1.8|AC)", ['chargingPointType']] = "homelevel1(1.8|AC)" + smart_data = smart_data.drop(columns=["chargingType"]) + smart_data = smart_data.rename(columns={"ReservedFor": "reservedFor"}) + smart_data.to_csv(smart_file_updated, index=False) + print("Reading Fees done!") + return smart_data + else: + return read_file(smart_file_updated) + + +def assign_fees_to_infrastructure(nrel_data, fees_data, smart_file_with_fees): + df_dict = nrel_data.to_dict('records') + for row in tqdm(df_dict): + charging_type_arg = row["chargingPointType"] + if "fc" in charging_type_arg: + charging_type_arg = "publicfc(150.0|DC)" + filtered = fees_data.loc[(fees_data["taz"] == row["taz"]) & + (fees_data["parkingType"] == row["parkingType"]) & + (fees_data["chargingPointType"] == charging_type_arg)] + if len(filtered.index) == 0: + filtered = fees_data.loc[(fees_data["parkingType"] == row["parkingType"]) & + (fees_data["chargingPointType"] == charging_type_arg)] + pd.options.mode.chained_assignment = None + filtered.loc[:, "numStalls"] = filtered.loc[:, "numStalls"].astype('int') + tot_stalls = filtered["numStalls"].sum() + cumulated = 0.0 + memorized_fee = 0.0 + rd_prob = random.uniform(0, 1) + for row2 in filtered.itertuples(): + memorized_fee = row2.feeInCents + cumulated = cumulated + float(row2.numStalls) / float(tot_stalls) + if cumulated >= rd_prob: + break + if "(150.0|DC)" in row["chargingPointType"]: + memorized_fee = memorized_fee * 1.6 + elif "(250.0|DC)" in row["chargingPointType"]: + memorized_fee = memorized_fee * 2.2 + elif "(400.0|DC)" in row["chargingPointType"]: + memorized_fee = memorized_fee * 3.1 + row["feeInCents"] = memorized_fee + output = pd.DataFrame.from_dict(df_dict) + output.reset_index(drop=True, inplace=True) + output.to_csv(smart_file_with_fees, index=False) + + +nrel_data_output = convert_nrel_data(nrel_file_input, nrel_file_converted_input) +print("convert_nrel_data done!") +fees_data_output = reading_sf_bay_fees(smart_file_input, smart_file_updated_input) +print("reading_sf_bay_fees done!") +assign_fees_to_infrastructure(nrel_data_output, fees_data_output, smart_file_with_fees_input) +print("END") diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 72bc30a423a..494da547132 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -149,7 +149,22 @@ class ChargingFunctions[GEO: GeoLevel]( override protected def processParkingZoneSearchResult( inquiry: ParkingInquiry, parkingZoneSearchResult: Option[ParkingZoneSearchResult[GEO]] - ): Option[ParkingZoneSearchResult[GEO]] = parkingZoneSearchResult + ): Option[ParkingZoneSearchResult[GEO]] = { + parkingZoneSearchResult match { + case Some(result) => + result.parkingZonesSampled.foreach { case (parkingZoneId, chargingPointTypeMaybe, parkingType, costInDollars) => + logger.info( + s"SAMPLED: ${parkingZoneId},${chargingPointTypeMaybe.getOrElse("NoCharger")},${parkingType},${costInDollars}" + ) + } + logger.info( + s"CHOSEN: ${result.parkingStall.parkingZoneId},${result.parkingStall.chargingPointType + .getOrElse("NoCharger")},${result.parkingStall.parkingType},${result.parkingStall.costInDollars}" + ) + case _ => + } + parkingZoneSearchResult + } /** * sample location of a parking stall with a GEO area diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index ab4f588c4fa..dad6af3c6bc 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -115,17 +115,7 @@ class ParkingFunctions[GEO: GeoLevel]( parkingZoneSearchResult: Option[ParkingZoneSearchResult[GEO]] ): Option[ParkingZoneSearchResult[GEO]] = { val output = parkingZoneSearchResult match { - case Some(result) => - result.parkingZonesSampled.foreach { case (parkingZoneId, chargingPointTypeMaybe, parkingType, costInDollars) => - logger.info( - s"SAMPLED: ${parkingZoneId},${chargingPointTypeMaybe.getOrElse("NoCharger")},${parkingType},${costInDollars}" - ) - } - logger.info( - s"CHOSEN: ${result.parkingStall.parkingZoneId},${result.parkingStall.chargingPointType - .getOrElse("NoCharger")},${result.parkingStall.parkingType},${result.parkingStall.costInDollars}" - ) - result + case Some(result) => result case _ => inquiry.parkingActivityType match { case ParkingActivityType.Init | ParkingActivityType.Home => From d18c20c8825c8c2262e89fb2474bb2240abb334f Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 6 Mar 2022 21:59:07 -0800 Subject: [PATCH 018/307] logging more of MNL --- src/main/python/gemini/debugging.py | 8 ++--- .../infrastructure/ChargingFunctions.scala | 34 ++++++++++++++++++- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/main/python/gemini/debugging.py b/src/main/python/gemini/debugging.py index ca8783a8e01..de7fdb9cf89 100644 --- a/src/main/python/gemini/debugging.py +++ b/src/main/python/gemini/debugging.py @@ -1,16 +1,16 @@ import helper import os -mnl_lines = ["parkingZoneId,chargingPointType,parkingType,costInDollars\n"] +mnl_lines = ["mnlStatus,parkingZoneId,chargingPointType,parkingType,costInDollars\n"] output_log_file = os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/beamLog.out.txt') with open(output_log_file) as infile: for line in infile: if "SAMPLED: " in line: - mnl_lines.append(line.split("SAMPLED: ")[1]) + mnl_lines.append("sampled,"+line.split("SAMPLED: ")[1]) elif "CHOSEN: " in line: - mnl_lines.append(line.split("CHOSEN: ")[1]) + mnl_lines.append("chosen,"+line.split("CHOSEN: ")[1]) mnl_output_log_file = os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-beamLog.csv') with open(mnl_output_log_file, 'w') as f: f.writelines(mnl_lines) -print("END") \ No newline at end of file +print("END") diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 494da547132..0cd9ab39e5a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -85,8 +85,30 @@ class ChargingFunctions[GEO: GeoLevel]( val validChargingCapability: Boolean = hasValidChargingCapability(zone, inquiry.beamVehicle) val preferredParkingTypes = getPreferredParkingTypes(inquiry) - val canCarParkHere: Boolean = canThisCarParkHere(zone, inquiry, preferredParkingTypes) + val hasAvailability: Boolean = parkingZones(zone.parkingZoneId).stallsAvailable > 0 + val validParkingType: Boolean = preferredParkingTypes.contains(zone.parkingType) + + val isValidTime = inquiry.beamVehicle.forall(vehicle => + zone.timeRestrictions + .get(vehicle.beamVehicleType.vehicleCategory) + .forall(_.contains(inquiry.destinationUtm.time % (24 * 3600))) + ) + + val isValidVehicleManager = inquiry.beamVehicle.forall { vehicle => + zone.reservedFor.managerType == VehicleManager.TypeEnum.Default || zone.reservedFor.managerId == vehicle.vehicleManagerId.get + } + + inquiry.beamVehicle.foreach { v => + logger.info( + s"SEARCH: ${zone.parkingZoneId},${zone.geoId},${zone.parkingType},${zone.chargingPointType.getOrElse("NoCharger")}," + + s"${zone.pricingModel.get},${zone.reservedFor},${zone.stallsAvailable},${zone.maxStalls},${v.id},${inquiry.parkingDuration}," + + s"${inquiry.activityType},${inquiry.valueOfTime},${isEV},${rideHailFastChargingOnly},${validChargingCapability}," + + s"${hasAvailability},${validParkingType},${isValidTime},${isValidVehicleManager}" + ) + } + + val canCarParkHere: Boolean = hasAvailability & validParkingType & isValidTime & isValidVehicleManager isEV && rideHailFastChargingOnly && validChargingCapability && canCarParkHere } @@ -139,6 +161,16 @@ class ChargingFunctions[GEO: GeoLevel]( value1 = rangeAnxietyFactor ) + inquiry.beamVehicle.foreach { v => + logger.info( + s"PARAM: ${parkingAlternative.parkingZone.parkingZoneId},${parkingAlternative.parkingZone.geoId},${parkingAlternative.parkingZone.parkingType}," + + s"${parkingAlternative.parkingZone.chargingPointType.getOrElse("NoCharger")},${parkingAlternative.parkingZone.pricingModel.get}," + + s"${parkingAlternative.parkingZone.reservedFor},${parkingAlternative.parkingZone.stallsAvailable},${parkingAlternative.parkingZone.maxStalls},${v.id},${inquiry.parkingDuration}," + + s"${inquiry.activityType},${inquiry.valueOfTime},${parkingAlternative.costInDollars},${params(ParkingMNL.Parameters.RangeAnxietyCost)}," + + s"${params(ParkingMNL.Parameters.WalkingEgressCost)},${params(ParkingMNL.Parameters.ParkingTicketCost)},${params(ParkingMNL.Parameters.HomeActivityPrefersResidentialParking)}" + ) + } + params } From d9ce8b3205c98df8cc6cf16f5708cec40858c229 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 6 Mar 2022 23:03:16 -0800 Subject: [PATCH 019/307] adding rquest id --- src/main/python/gemini/debugging.py | 17 +++++++++++++++-- .../infrastructure/ChargingFunctions.scala | 9 +++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/main/python/gemini/debugging.py b/src/main/python/gemini/debugging.py index de7fdb9cf89..d324a8ee98e 100644 --- a/src/main/python/gemini/debugging.py +++ b/src/main/python/gemini/debugging.py @@ -2,6 +2,12 @@ import os mnl_lines = ["mnlStatus,parkingZoneId,chargingPointType,parkingType,costInDollars\n"] +mnl_search_lines = ["parkingZoneId,geoId,parkingType,chargingPointType,pricingModel,reservedFor,stallsAvailable," + "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,isEV,rideHailFastChargingOnly," + "validChargingCapability,hasAvailability,validParkingType,isValidTime,isValidVehicleManager\n"] +mnl_param_lines = ["parkingZoneId,geoId,parkingType,chargingPointType,pricingModel,reservedFor,stallsAvailable," + "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,costInDollars,RangeAnxietyCost," + "WalkingEgressCost,ParkingTicketCost,HomeActivityPrefersResidentialParking\n"] output_log_file = os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/beamLog.out.txt') with open(output_log_file) as infile: for line in infile: @@ -9,8 +15,15 @@ mnl_lines.append("sampled,"+line.split("SAMPLED: ")[1]) elif "CHOSEN: " in line: mnl_lines.append("chosen,"+line.split("CHOSEN: ")[1]) + elif "SEARCH: " in line: + mnl_search_lines.append(line.split("SEARCH: ")[1]) + elif "PARAM: " in line: + mnl_param_lines.append(line.split("PARAM: ")[1]) -mnl_output_log_file = os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-beamLog.csv') -with open(mnl_output_log_file, 'w') as f: +with open(os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-beamLog.csv'), 'w') as f: f.writelines(mnl_lines) +with open(os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-search-beamLog.csv'), 'w') as f: + f.writelines(mnl_search_lines) +with open(os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-param-beamLog.csv'), 'w') as f: + f.writelines(mnl_param_lines) print("END") diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 0cd9ab39e5a..fafcd5a6972 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -103,7 +103,7 @@ class ChargingFunctions[GEO: GeoLevel]( logger.info( s"SEARCH: ${zone.parkingZoneId},${zone.geoId},${zone.parkingType},${zone.chargingPointType.getOrElse("NoCharger")}," + s"${zone.pricingModel.get},${zone.reservedFor},${zone.stallsAvailable},${zone.maxStalls},${v.id},${inquiry.parkingDuration}," + - s"${inquiry.activityType},${inquiry.valueOfTime},${isEV},${rideHailFastChargingOnly},${validChargingCapability}," + + s"${inquiry.activityType},${inquiry.valueOfTime},${inquiry.requestId},${isEV},${rideHailFastChargingOnly},${validChargingCapability}," + s"${hasAvailability},${validParkingType},${isValidTime},${isValidVehicleManager}" ) } @@ -166,7 +166,7 @@ class ChargingFunctions[GEO: GeoLevel]( s"PARAM: ${parkingAlternative.parkingZone.parkingZoneId},${parkingAlternative.parkingZone.geoId},${parkingAlternative.parkingZone.parkingType}," + s"${parkingAlternative.parkingZone.chargingPointType.getOrElse("NoCharger")},${parkingAlternative.parkingZone.pricingModel.get}," + s"${parkingAlternative.parkingZone.reservedFor},${parkingAlternative.parkingZone.stallsAvailable},${parkingAlternative.parkingZone.maxStalls},${v.id},${inquiry.parkingDuration}," + - s"${inquiry.activityType},${inquiry.valueOfTime},${parkingAlternative.costInDollars},${params(ParkingMNL.Parameters.RangeAnxietyCost)}," + + s"${inquiry.activityType},${inquiry.valueOfTime},${inquiry.requestId},${parkingAlternative.costInDollars},${params(ParkingMNL.Parameters.RangeAnxietyCost)}," + s"${params(ParkingMNL.Parameters.WalkingEgressCost)},${params(ParkingMNL.Parameters.ParkingTicketCost)},${params(ParkingMNL.Parameters.HomeActivityPrefersResidentialParking)}" ) } @@ -186,11 +186,12 @@ class ChargingFunctions[GEO: GeoLevel]( case Some(result) => result.parkingZonesSampled.foreach { case (parkingZoneId, chargingPointTypeMaybe, parkingType, costInDollars) => logger.info( - s"SAMPLED: ${parkingZoneId},${chargingPointTypeMaybe.getOrElse("NoCharger")},${parkingType},${costInDollars}" + s"SAMPLED: ${inquiry.requestId},${parkingZoneId},${chargingPointTypeMaybe + .getOrElse("NoCharger")},${parkingType},${costInDollars}" ) } logger.info( - s"CHOSEN: ${result.parkingStall.parkingZoneId},${result.parkingStall.chargingPointType + s"CHOSEN: ${inquiry.requestId},${result.parkingStall.parkingZoneId},${result.parkingStall.chargingPointType .getOrElse("NoCharger")},${result.parkingStall.parkingType},${result.parkingStall.costInDollars}" ) case _ => From ef4aaabda3b0bd464a346242d90401c4d69d2a06 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 6 Mar 2022 23:29:02 -0800 Subject: [PATCH 020/307] adding only defined vehicles --- src/main/python/gemini/debugging.py | 6 +++--- .../beam/agentsim/infrastructure/ChargingFunctions.scala | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/python/gemini/debugging.py b/src/main/python/gemini/debugging.py index d324a8ee98e..02608f320f1 100644 --- a/src/main/python/gemini/debugging.py +++ b/src/main/python/gemini/debugging.py @@ -1,12 +1,12 @@ import helper import os -mnl_lines = ["mnlStatus,parkingZoneId,chargingPointType,parkingType,costInDollars\n"] +mnl_lines = ["mnlStatus,requestId,parkingZoneId,chargingPointType,parkingType,costInDollars\n"] mnl_search_lines = ["parkingZoneId,geoId,parkingType,chargingPointType,pricingModel,reservedFor,stallsAvailable," - "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,isEV,rideHailFastChargingOnly," + "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,requestId,isEV,rideHailFastChargingOnly," "validChargingCapability,hasAvailability,validParkingType,isValidTime,isValidVehicleManager\n"] mnl_param_lines = ["parkingZoneId,geoId,parkingType,chargingPointType,pricingModel,reservedFor,stallsAvailable," - "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,costInDollars,RangeAnxietyCost," + "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,requestId,costInDollars,RangeAnxietyCost," "WalkingEgressCost,ParkingTicketCost,HomeActivityPrefersResidentialParking\n"] output_log_file = os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/beamLog.out.txt') with open(output_log_file) as infile: diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index fafcd5a6972..08ac4f49272 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -183,7 +183,7 @@ class ChargingFunctions[GEO: GeoLevel]( parkingZoneSearchResult: Option[ParkingZoneSearchResult[GEO]] ): Option[ParkingZoneSearchResult[GEO]] = { parkingZoneSearchResult match { - case Some(result) => + case Some(result) if inquiry.beamVehicle.isDefined => result.parkingZonesSampled.foreach { case (parkingZoneId, chargingPointTypeMaybe, parkingType, costInDollars) => logger.info( s"SAMPLED: ${inquiry.requestId},${parkingZoneId},${chargingPointTypeMaybe From 876c4633949e6916c9feea082e978e3c83272dcc Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 7 Mar 2022 01:46:19 -0800 Subject: [PATCH 021/307] removing logs --- .../infrastructure/ChargingFunctions.scala | 52 +------------------ 1 file changed, 2 insertions(+), 50 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 08ac4f49272..72bc30a423a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -85,30 +85,8 @@ class ChargingFunctions[GEO: GeoLevel]( val validChargingCapability: Boolean = hasValidChargingCapability(zone, inquiry.beamVehicle) val preferredParkingTypes = getPreferredParkingTypes(inquiry) - val hasAvailability: Boolean = parkingZones(zone.parkingZoneId).stallsAvailable > 0 + val canCarParkHere: Boolean = canThisCarParkHere(zone, inquiry, preferredParkingTypes) - val validParkingType: Boolean = preferredParkingTypes.contains(zone.parkingType) - - val isValidTime = inquiry.beamVehicle.forall(vehicle => - zone.timeRestrictions - .get(vehicle.beamVehicleType.vehicleCategory) - .forall(_.contains(inquiry.destinationUtm.time % (24 * 3600))) - ) - - val isValidVehicleManager = inquiry.beamVehicle.forall { vehicle => - zone.reservedFor.managerType == VehicleManager.TypeEnum.Default || zone.reservedFor.managerId == vehicle.vehicleManagerId.get - } - - inquiry.beamVehicle.foreach { v => - logger.info( - s"SEARCH: ${zone.parkingZoneId},${zone.geoId},${zone.parkingType},${zone.chargingPointType.getOrElse("NoCharger")}," + - s"${zone.pricingModel.get},${zone.reservedFor},${zone.stallsAvailable},${zone.maxStalls},${v.id},${inquiry.parkingDuration}," + - s"${inquiry.activityType},${inquiry.valueOfTime},${inquiry.requestId},${isEV},${rideHailFastChargingOnly},${validChargingCapability}," + - s"${hasAvailability},${validParkingType},${isValidTime},${isValidVehicleManager}" - ) - } - - val canCarParkHere: Boolean = hasAvailability & validParkingType & isValidTime & isValidVehicleManager isEV && rideHailFastChargingOnly && validChargingCapability && canCarParkHere } @@ -161,16 +139,6 @@ class ChargingFunctions[GEO: GeoLevel]( value1 = rangeAnxietyFactor ) - inquiry.beamVehicle.foreach { v => - logger.info( - s"PARAM: ${parkingAlternative.parkingZone.parkingZoneId},${parkingAlternative.parkingZone.geoId},${parkingAlternative.parkingZone.parkingType}," + - s"${parkingAlternative.parkingZone.chargingPointType.getOrElse("NoCharger")},${parkingAlternative.parkingZone.pricingModel.get}," + - s"${parkingAlternative.parkingZone.reservedFor},${parkingAlternative.parkingZone.stallsAvailable},${parkingAlternative.parkingZone.maxStalls},${v.id},${inquiry.parkingDuration}," + - s"${inquiry.activityType},${inquiry.valueOfTime},${inquiry.requestId},${parkingAlternative.costInDollars},${params(ParkingMNL.Parameters.RangeAnxietyCost)}," + - s"${params(ParkingMNL.Parameters.WalkingEgressCost)},${params(ParkingMNL.Parameters.ParkingTicketCost)},${params(ParkingMNL.Parameters.HomeActivityPrefersResidentialParking)}" - ) - } - params } @@ -181,23 +149,7 @@ class ChargingFunctions[GEO: GeoLevel]( override protected def processParkingZoneSearchResult( inquiry: ParkingInquiry, parkingZoneSearchResult: Option[ParkingZoneSearchResult[GEO]] - ): Option[ParkingZoneSearchResult[GEO]] = { - parkingZoneSearchResult match { - case Some(result) if inquiry.beamVehicle.isDefined => - result.parkingZonesSampled.foreach { case (parkingZoneId, chargingPointTypeMaybe, parkingType, costInDollars) => - logger.info( - s"SAMPLED: ${inquiry.requestId},${parkingZoneId},${chargingPointTypeMaybe - .getOrElse("NoCharger")},${parkingType},${costInDollars}" - ) - } - logger.info( - s"CHOSEN: ${inquiry.requestId},${result.parkingStall.parkingZoneId},${result.parkingStall.chargingPointType - .getOrElse("NoCharger")},${result.parkingStall.parkingType},${result.parkingStall.costInDollars}" - ) - case _ => - } - parkingZoneSearchResult - } + ): Option[ParkingZoneSearchResult[GEO]] = parkingZoneSearchResult /** * sample location of a parking stall with a GEO area From 290204ae6659f08eacfb1c07129c40eef6d80fda Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 7 Mar 2022 17:27:56 -0800 Subject: [PATCH 022/307] trying cost fix --- .../unlimited_charging_infrastructure.py | 22 +++++++++---------- .../infrastructure/ChargingFunctions.scala | 4 ++-- .../infrastructure/parking/PricingModel.scala | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/python/gemini/unlimited_charging_infrastructure.py b/src/main/python/gemini/unlimited_charging_infrastructure.py index d0936fe6dd6..b31c9661042 100644 --- a/src/main/python/gemini/unlimited_charging_infrastructure.py +++ b/src/main/python/gemini/unlimited_charging_infrastructure.py @@ -14,24 +14,24 @@ csv_writer.write(headerfile+"\n") for x in range(1, 1455): - csv_writer.write(f"{x},Residential,Block,HomeLevel1(1.8|AC),9999999,50,Any" + "\n") - csv_writer.write(f"{x},Residential,Block,HomeLevel2(7.2|AC),9999999,200,Any" + "\n") + csv_writer.write(f"{x},Residential,Block,HomeLevel1(1.8|AC),9999999,0.45,Any" + "\n") + csv_writer.write(f"{x},Residential,Block,HomeLevel2(7.2|AC),9999999,1.8,Any" + "\n") - csv_writer.write(f"{x},Workplace,Block,WorkLevel2(7.2|AC),9999999,200,Any" + "\n") + csv_writer.write(f"{x},Workplace,Block,WorkLevel2(7.2|AC),9999999,14.4,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicLevel2(7.2|AC),9999999,200,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicFC(50|DC),9999999,1600,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicFC(150|DC),9999999,4800,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicXFC(250|DC),9999999,9500,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicXFC(400|DC),9999999,15200,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicLevel2(7.2|AC),9999999,19.3,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicFC(50|DC),9999999,306.73,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicFC(150|DC),9999999,490.98,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicXFC(250|DC),9999999,675.05,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicXFC(400|DC),9999999,950.52,Any" + "\n") with open('gemini_taz_unlimited_depots.csv', mode='w') as csv_writer: csv_writer.write(headerfile+"\n") for x in range(1, 1455): - csv_writer.write(f"{x},Public,FlatFee,DepotFC(150.0|DC),9999999,4800,ridehail(GlobalRHM)" + "\n") - csv_writer.write(f"{x},Public,FlatFee,DepotXFC(250.0|DC),9999999,9500,ridehail(GlobalRHM)" + "\n") - csv_writer.write(f"{x},Public,FlatFee,DepotXFC(400.0|DC),9999999,15200,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotFC(150.0|DC),9999999,490.98,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotXFC(250.0|DC),9999999,675.05,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotXFC(400.0|DC),9999999,950.52,ridehail(GlobalRHM)" + "\n") diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 72bc30a423a..4e3034e0441 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -41,7 +41,7 @@ class ChargingFunctions[GEO: GeoLevel]( * @return */ def ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { - inquiry.reservedFor match { + inquiry.reservedFor.managerType match { case VehicleManager.TypeEnum.RideHail if inquiry.parkingDuration <= 3600 => ChargingPointType.isFastCharger(zone.chargingPointType.get) case _ => @@ -105,7 +105,7 @@ class ChargingFunctions[GEO: GeoLevel]( // end-of-day parking durations are set to zero, which will be mis-interpreted here val parkingDuration: Option[Int] = - if (inquiry.parkingDuration <= 0) None + if (inquiry.parkingDuration < 60) Some(60) // at least a minute of charging else Some(inquiry.parkingDuration.toInt) val addedEnergy: Double = diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala index f29bb7ac97d..691739e8a08 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala @@ -71,7 +71,7 @@ object PricingModel { pricingModel match { case FlatFee(costInDollars) => costInDollars case Block(costInDollars, intervalSeconds) => - (math.max(0.0, parkingDurationInSeconds.toDouble) / intervalSeconds.toDouble) * costInDollars + (math.max(60.0, parkingDurationInSeconds.toDouble) / intervalSeconds.toDouble) * costInDollars } } From ac2d2d80703c921de3f23e6e2c8e097b6f2c8217 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 7 Mar 2022 18:14:17 -0800 Subject: [PATCH 023/307] adding logs back --- .../infrastructure/ChargingFunctions.scala | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 4e3034e0441..3990fcc854a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -85,8 +85,30 @@ class ChargingFunctions[GEO: GeoLevel]( val validChargingCapability: Boolean = hasValidChargingCapability(zone, inquiry.beamVehicle) val preferredParkingTypes = getPreferredParkingTypes(inquiry) - val canCarParkHere: Boolean = canThisCarParkHere(zone, inquiry, preferredParkingTypes) + val hasAvailability: Boolean = parkingZones(zone.parkingZoneId).stallsAvailable > 0 + val validParkingType: Boolean = preferredParkingTypes.contains(zone.parkingType) + + val isValidTime = inquiry.beamVehicle.forall(vehicle => + zone.timeRestrictions + .get(vehicle.beamVehicleType.vehicleCategory) + .forall(_.contains(inquiry.destinationUtm.time % (24 * 3600))) + ) + + val isValidVehicleManager = inquiry.beamVehicle.forall { vehicle => + zone.reservedFor.managerType == VehicleManager.TypeEnum.Default || zone.reservedFor.managerId == vehicle.vehicleManagerId.get + } + + inquiry.beamVehicle.foreach { v => + logger.info( + s"SEARCH: ${zone.parkingZoneId},${zone.geoId},${zone.parkingType},${zone.chargingPointType.getOrElse("NoCharger")}," + + s"${zone.pricingModel.get},${zone.reservedFor},${zone.stallsAvailable},${zone.maxStalls},${v.id},${inquiry.parkingDuration}," + + s"${inquiry.activityType},${inquiry.valueOfTime},${inquiry.requestId},${isEV},${rideHailFastChargingOnly},${validChargingCapability}," + + s"${hasAvailability},${validParkingType},${isValidTime},${isValidVehicleManager}" + ) + } + + val canCarParkHere: Boolean = hasAvailability & validParkingType & isValidTime & isValidVehicleManager isEV && rideHailFastChargingOnly && validChargingCapability && canCarParkHere } @@ -139,6 +161,16 @@ class ChargingFunctions[GEO: GeoLevel]( value1 = rangeAnxietyFactor ) + inquiry.beamVehicle.foreach { v => + logger.info( + s"PARAM: ${parkingAlternative.parkingZone.parkingZoneId},${parkingAlternative.parkingZone.geoId},${parkingAlternative.parkingZone.parkingType}," + + s"${parkingAlternative.parkingZone.chargingPointType.getOrElse("NoCharger")},${parkingAlternative.parkingZone.pricingModel.get}," + + s"${parkingAlternative.parkingZone.reservedFor},${parkingAlternative.parkingZone.stallsAvailable},${parkingAlternative.parkingZone.maxStalls},${v.id},${inquiry.parkingDuration}," + + s"${inquiry.activityType},${inquiry.valueOfTime},${inquiry.requestId},${parkingAlternative.costInDollars},${params(ParkingMNL.Parameters.RangeAnxietyCost)}," + + s"${params(ParkingMNL.Parameters.WalkingEgressCost)},${params(ParkingMNL.Parameters.ParkingTicketCost)},${params(ParkingMNL.Parameters.HomeActivityPrefersResidentialParking)}" + ) + } + params } @@ -149,7 +181,23 @@ class ChargingFunctions[GEO: GeoLevel]( override protected def processParkingZoneSearchResult( inquiry: ParkingInquiry, parkingZoneSearchResult: Option[ParkingZoneSearchResult[GEO]] - ): Option[ParkingZoneSearchResult[GEO]] = parkingZoneSearchResult + ): Option[ParkingZoneSearchResult[GEO]] = { + parkingZoneSearchResult match { + case Some(result) if inquiry.beamVehicle.isDefined => + result.parkingZonesSampled.foreach { case (parkingZoneId, chargingPointTypeMaybe, parkingType, costInDollars) => + logger.info( + s"SAMPLED: ${inquiry.requestId},${parkingZoneId},${chargingPointTypeMaybe + .getOrElse("NoCharger")},${parkingType},${costInDollars}" + ) + } + logger.info( + s"CHOSEN: ${inquiry.requestId},${result.parkingStall.parkingZoneId},${result.parkingStall.chargingPointType + .getOrElse("NoCharger")},${result.parkingStall.parkingType},${result.parkingStall.costInDollars}" + ) + case _ => + } + parkingZoneSearchResult + } /** * sample location of a parking stall with a GEO area From 5c82f50f7f0a7e559e6f1c9e27b155d650477aa4 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 7 Mar 2022 22:43:50 -0800 Subject: [PATCH 024/307] remove public stall from home and work search --- .../scala/beam/agentsim/infrastructure/ParkingFunctions.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index dad6af3c6bc..493bcdb8002 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -205,9 +205,9 @@ class ParkingFunctions[GEO: GeoLevel]( protected def getPreferredParkingTypes(inquiry: ParkingInquiry): Set[ParkingType] = { // a lookup for valid parking types based on this inquiry inquiry.parkingActivityType match { - case ParkingActivityType.Home => Set(ParkingType.Residential, ParkingType.Public) + case ParkingActivityType.Home => Set(ParkingType.Residential) case ParkingActivityType.Init => Set(ParkingType.Residential, ParkingType.Public) - case ParkingActivityType.Work => Set(ParkingType.Workplace, ParkingType.Public) + case ParkingActivityType.Work => Set(ParkingType.Workplace) case ParkingActivityType.Charge => Set(ParkingType.Workplace, ParkingType.Public, ParkingType.Residential) case _ => Set(ParkingType.Public) } From 9e2373d871d007c840a343f40842bb468117d0ed Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 8 Mar 2022 01:02:47 -0800 Subject: [PATCH 025/307] back to public too --- .../scala/beam/agentsim/infrastructure/ParkingFunctions.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 493bcdb8002..dad6af3c6bc 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -205,9 +205,9 @@ class ParkingFunctions[GEO: GeoLevel]( protected def getPreferredParkingTypes(inquiry: ParkingInquiry): Set[ParkingType] = { // a lookup for valid parking types based on this inquiry inquiry.parkingActivityType match { - case ParkingActivityType.Home => Set(ParkingType.Residential) + case ParkingActivityType.Home => Set(ParkingType.Residential, ParkingType.Public) case ParkingActivityType.Init => Set(ParkingType.Residential, ParkingType.Public) - case ParkingActivityType.Work => Set(ParkingType.Workplace) + case ParkingActivityType.Work => Set(ParkingType.Workplace, ParkingType.Public) case ParkingActivityType.Charge => Set(ParkingType.Workplace, ParkingType.Public, ParkingType.Residential) case _ => Set(ParkingType.Public) } From cf6cff8270d1b9dcb237421497075211f93d7096 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 8 Mar 2022 13:05:25 -0800 Subject: [PATCH 026/307] adding minimum parking duration --- src/main/resources/beam-template.conf | 1 + .../DefaultRideHailDepotParkingManager.scala | 3 +- .../infrastructure/ChargingFunctions.scala | 9 +- .../infrastructure/ChargingNetwork.scala | 3 +- .../DefaultRidehailFunctions.scala | 6 +- .../HierarchicalParkingManager.scala | 8 +- .../InfrastructureFunctions.scala | 6 +- .../infrastructure/InfrastructureUtils.scala | 3 +- .../ParallelParkingManager.scala | 9 +- .../infrastructure/ParkingFunctions.scala | 6 +- .../ParkingManagerBenchmark.scala | 1 + .../infrastructure/ZonalParkingManager.scala | 12 +- .../parking/ParkingZoneSearch.scala | 7 +- .../infrastructure/parking/PricingModel.scala | 11 +- .../scala/beam/sim/config/BeamConfig.scala | 5420 ++++++----------- .../HierarchicalParkingManagerSpec.scala | 6 + .../ZonalParkingManagerSpec.scala | 3 +- .../parking/PricingModelSpec.scala | 7 +- 18 files changed, 1997 insertions(+), 3524 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 65568afa567..47c9a7c376d 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -156,6 +156,7 @@ beam.agentsim.agents.parking.mulitnomialLogit.params.homeActivityPrefersResident beam.agentsim.agents.parking.rangeAnxietyBuffer = "double | 20000.0" # if our remaining range exceeds our remaining tour plus this many meters, then we feel no anxiety; default 20k beam.agentsim.agents.parking.minSearchRadius = "double | 250.00" # something small enough that, on average, we see 2 orders of magnitude of samples at most beam.agentsim.agents.parking.maxSearchRadius = "double | 8046.72" # something large enough that we do not strand our drivers in an oasis +beam.agentsim.agents.parking.estimatedMinParkingDuration = "double | 60.0" # in seconds, something small enough but has meaningful impact on pricing #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" diff --git a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala index adafe6be961..c00fd789b7d 100644 --- a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala @@ -373,7 +373,8 @@ object DefaultRideHailDepotParkingManager { beamServices.beamConfig.matsim.modules.global.randomSeed, beamServices.beamScenario.fuelTypePrices, beamServices.beamConfig.beam.agentsim.agents.rideHail, - beamServices.skims + beamServices.skims, + beamServices.beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 3990fcc854a..a1443b1a2a7 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -20,7 +20,8 @@ class ChargingFunctions[GEO: GeoLevel]( maxSearchRadius: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ) extends ParkingFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -31,7 +32,8 @@ class ChargingFunctions[GEO: GeoLevel]( maxSearchRadius, boundingBox, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) { /** @@ -127,7 +129,8 @@ class ChargingFunctions[GEO: GeoLevel]( // end-of-day parking durations are set to zero, which will be mis-interpreted here val parkingDuration: Option[Int] = - if (inquiry.parkingDuration < 60) Some(60) // at least a minute of charging + if (inquiry.parkingDuration < estimatedMinParkingDuration) + Some(estimatedMinParkingDuration.toInt) // at least a minute of charging else Some(inquiry.parkingDuration.toInt) val addedEnergy: Double = diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 245ee4fc1f4..ead2911d042 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -177,7 +177,8 @@ object ChargingNetwork extends LazyLogging { maxSearchRadius, envelopeInUTM, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala index 59a15751854..a6aff44307c 100644 --- a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala @@ -33,7 +33,8 @@ class DefaultRidehailFunctions[GEO: GeoLevel]( seed: Int, fuelTypePrices: Map[FuelType, Double], rideHailConfig: BeamConfig.Beam.Agentsim.Agents.RideHail, - skims: Skims + skims: Skims, + estimatedMinParkingDuration: Double ) extends InfrastructureFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -43,7 +44,8 @@ class DefaultRidehailFunctions[GEO: GeoLevel]( minSearchRadius, maxSearchRadius, boundingBox, - seed + seed, + estimatedMinParkingDuration ) { private val vehicleIdToEndRefuelTick: mutable.Map[VehicleId, Int] = mutable.Map.empty[VehicleId, Int] diff --git a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala index 598286f6f0f..cfc62410da6 100644 --- a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala @@ -259,6 +259,7 @@ object HierarchicalParkingManager { boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork[Link] = { new HierarchicalParkingManager( @@ -281,7 +282,8 @@ object HierarchicalParkingManager { maxSearchRadius, boundingBox, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) ) } @@ -297,6 +299,7 @@ object HierarchicalParkingManager { boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork[Link] = HierarchicalParkingManager( @@ -309,6 +312,7 @@ object HierarchicalParkingManager { boundingBox, seed, mnlParkingConfig, + estimatedMinParkingDuration, checkThatNumberOfStallsMatch ) @@ -391,7 +395,7 @@ object HierarchicalParkingManager { } .filter { case (_, _, maxStalls) => maxStalls > 0 } .zipWithIndex - .map { case ((linkId, description, maxStalls), id) => + .map { case ((linkId, description, maxStalls), _) => val numStalls = Math.min(maxStalls, Int.MaxValue).toInt val parkingZone = ParkingZone.init[Link]( None, diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 5e26607e6ce..55a410afdf0 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -28,7 +28,8 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( minSearchRadius: Double, maxSearchRadius: Double, boundingBox: Envelope, - seed: Int + seed: Int, + estimatedMinParkingDuration: Double ) extends StrictLogging { protected val zoneSearchTree: ParkingZoneSearch.ZoneSearchTree[GEO] = @@ -94,7 +95,8 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( minSearchRadius, maxSearchRadius, boundingBox, - distanceFunction + distanceFunction, + estimatedMinParkingDuration ) def searchForParkingStall(inquiry: ParkingInquiry): Option[ParkingZoneSearch.ParkingZoneSearchResult[GEO]] = { diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala index e261ff6c806..39f9ca2f808 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala @@ -181,7 +181,8 @@ object InfrastructureUtils extends LazyLogging { beamConfig.beam.agentsim.agents.parking.maxSearchRadius, envelopeInUTM, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) case "PARALLEL" => ParallelParkingManager.init( diff --git a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala index 88c88c8ea8b..f44062f8339 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala @@ -39,7 +39,8 @@ class ParallelParkingManager( minSearchRadius: Double, maxSearchRadius: Double, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ) extends ParkingNetwork[TAZ](parkingZones) { override protected val searchFunctions: Option[InfrastructureFunctions[_]] = None @@ -73,7 +74,8 @@ class ParallelParkingManager( minSearchRadius, maxSearchRadius, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) Worker(parkingNetwork, cluster) } @@ -182,7 +184,8 @@ object ParallelParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index dad6af3c6bc..928642f7e0f 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -23,7 +23,8 @@ class ParkingFunctions[GEO: GeoLevel]( maxSearchRadius: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ) extends InfrastructureFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -33,7 +34,8 @@ class ParkingFunctions[GEO: GeoLevel]( minSearchRadius, maxSearchRadius, boundingBox, - seed + seed, + estimatedMinParkingDuration ) { override protected val mnlMultiplierParameters: Map[ParkingMNL.Parameters, UtilityFunctionOperation] = Map( diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala index f63247977d7..e27c2b83af5 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala @@ -227,6 +227,7 @@ object ParkingManagerBenchmark extends StrictLogging { boundingBox, seed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) parkingNetwork diff --git a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala index 5598e8fc341..1495e451430 100755 --- a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala @@ -46,7 +46,8 @@ object ZonalParkingManager extends LazyLogging { minSearchRadius: Double, maxSearchRadius: Double, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ): ZonalParkingManager[GEO] = { new ZonalParkingManager(parkingZones) { if (maxSearchRadius < minSearchRadius) { @@ -65,7 +66,8 @@ object ZonalParkingManager extends LazyLogging { maxSearchRadius, boundingBox, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) ) } @@ -95,7 +97,8 @@ object ZonalParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) } @@ -137,7 +140,8 @@ object ZonalParkingManager extends LazyLogging { minSearchRadius, maxSearchRadius, seed, - mnlParkingConfig + mnlParkingConfig, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index ccb77e40faf..0239f68399b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -44,6 +44,7 @@ object ParkingZoneSearch { searchMaxRadius: Double, boundingBox: Envelope, distanceFunction: (Coord, Coord) => Double, + estimatedMinParkingDuration: Double, searchExpansionFactor: Double = 2.0 ) @@ -170,7 +171,11 @@ object ParkingZoneSearch { parkingZone.pricingModel match { case None => 0 case Some(pricingModel) => - PricingModel.evaluateParkingTicket(pricingModel, params.parkingDuration.toInt) + PricingModel.evaluateParkingTicket( + pricingModel, + params.parkingDuration.toInt, + config.estimatedMinParkingDuration + ) } val parkingAlternative: ParkingAlternative[GEO] = ParkingAlternative(zone, parkingZone.parkingType, parkingZone, stallLocation, stallPriceInDollars) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala index 691739e8a08..62069062a61 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala @@ -67,11 +67,18 @@ object PricingModel { * @param parkingDurationInSeconds duration of parking in seconds * @return monetary cost of parking, in cents */ - def evaluateParkingTicket(pricingModel: PricingModel, parkingDurationInSeconds: Int): Double = { + def evaluateParkingTicket( + pricingModel: PricingModel, + parkingDurationInSeconds: Int, + estimatedMinParkingDuration: Double + ): Double = { pricingModel match { case FlatFee(costInDollars) => costInDollars case Block(costInDollars, intervalSeconds) => - (math.max(60.0, parkingDurationInSeconds.toDouble) / intervalSeconds.toDouble) * costInDollars + (math.max( + estimatedMinParkingDuration, + parkingDurationInSeconds.toDouble + ) / intervalSeconds.toDouble) * costInDollars } } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 25f27aa7187..9a6fe9888f2 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,5048 +3,3476 @@ package beam.sim.config case class BeamConfig( - beam: BeamConfig.Beam, - matsim: BeamConfig.Matsim + beam : BeamConfig.Beam, + matsim : BeamConfig.Matsim ) - object BeamConfig { - case class Beam( - actorSystemName: java.lang.String, - agentsim: BeamConfig.Beam.Agentsim, - calibration: BeamConfig.Beam.Calibration, - cluster: BeamConfig.Beam.Cluster, - debug: BeamConfig.Beam.Debug, - exchange: BeamConfig.Beam.Exchange, - experimental: BeamConfig.Beam.Experimental, - input: BeamConfig.Beam.Input, - inputDirectory: java.lang.String, - logger: BeamConfig.Beam.Logger, - metrics: BeamConfig.Beam.Metrics, - output: BeamConfig.Beam.Output, - outputs: BeamConfig.Beam.Outputs, - physsim: BeamConfig.Beam.Physsim, - replanning: BeamConfig.Beam.Replanning, - router: BeamConfig.Beam.Router, - routing: BeamConfig.Beam.Routing, - sim: BeamConfig.Beam.Sim, - spatial: BeamConfig.Beam.Spatial, - urbansim: BeamConfig.Beam.Urbansim, - useLocalWorker: scala.Boolean, - warmStart: BeamConfig.Beam.WarmStart + actorSystemName : java.lang.String, + agentsim : BeamConfig.Beam.Agentsim, + calibration : BeamConfig.Beam.Calibration, + cluster : BeamConfig.Beam.Cluster, + debug : BeamConfig.Beam.Debug, + exchange : BeamConfig.Beam.Exchange, + experimental : BeamConfig.Beam.Experimental, + input : BeamConfig.Beam.Input, + inputDirectory : java.lang.String, + logger : BeamConfig.Beam.Logger, + metrics : BeamConfig.Beam.Metrics, + output : BeamConfig.Beam.Output, + outputs : BeamConfig.Beam.Outputs, + physsim : BeamConfig.Beam.Physsim, + replanning : BeamConfig.Beam.Replanning, + router : BeamConfig.Beam.Router, + routing : BeamConfig.Beam.Routing, + sim : BeamConfig.Beam.Sim, + spatial : BeamConfig.Beam.Spatial, + urbansim : BeamConfig.Beam.Urbansim, + useLocalWorker : scala.Boolean, + warmStart : BeamConfig.Beam.WarmStart ) - object Beam { - case class Agentsim( - agentSampleSizeAsFractionOfPopulation: scala.Double, - agents: BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime: java.lang.String, - firstIteration: scala.Int, - fractionOfPlansWithSingleActivity: scala.Double, - h3taz: BeamConfig.Beam.Agentsim.H3taz, - lastIteration: scala.Int, - populationAdjustment: java.lang.String, - scenarios: BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow: scala.Int, - simulationName: java.lang.String, - taz: BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters: scala.Int, - thresholdForWalkingInMeters: scala.Int, - timeBinSize: scala.Int, - toll: BeamConfig.Beam.Agentsim.Toll, - tuning: BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation : scala.Double, + agents : BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime : java.lang.String, + firstIteration : scala.Int, + fractionOfPlansWithSingleActivity : scala.Double, + h3taz : BeamConfig.Beam.Agentsim.H3taz, + lastIteration : scala.Int, + populationAdjustment : java.lang.String, + scenarios : BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow : scala.Int, + simulationName : java.lang.String, + taz : BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters : scala.Int, + thresholdForWalkingInMeters : scala.Int, + timeBinSize : scala.Int, + toll : BeamConfig.Beam.Agentsim.Toll, + tuning : BeamConfig.Beam.Agentsim.Tuning ) - object Agentsim { - case class Agents( - activities: BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType: java.lang.String, - freight: BeamConfig.Beam.Agentsim.Agents.Freight, - households: BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking: BeamConfig.Beam.Agentsim.Agents.Parking, - plans: BeamConfig.Beam.Agentsim.Agents.Plans, - population: BeamConfig.Beam.Agentsim.Agents.Population, - ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles + activities : BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType : java.lang.String, + freight : BeamConfig.Beam.Agentsim.Agents.Freight, + households : BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking : BeamConfig.Beam.Agentsim.Agents.Parking, + plans : BeamConfig.Beam.Agentsim.Agents.Plans, + population : BeamConfig.Beam.Agentsim.Agents.Population, + ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles ) - object Agents { - case class Activities( - activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] ) - object Activities { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = - if (c.hasPathOrNull("activityTypeToFixedDurationMap")) - scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) - else None + activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None ) } } - + case class Freight( - carrierParkingFilePath: scala.Option[java.lang.String], - carriersFilePath: java.lang.String, - convertWgs2Utm: scala.Boolean, - enabled: scala.Boolean, - generateFixedActivitiesDurations: scala.Boolean, - name: java.lang.String, - plansFilePath: java.lang.String, - reader: java.lang.String, - replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath: java.lang.String + carrierParkingFilePath : scala.Option[java.lang.String], + carriersFilePath : java.lang.String, + convertWgs2Utm : scala.Boolean, + enabled : scala.Boolean, + generateFixedActivitiesDurations : scala.Boolean, + name : java.lang.String, + plansFilePath : java.lang.String, + reader : java.lang.String, + replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath : java.lang.String ) - object Freight { - case class Replanning( - departureTime: scala.Int, - disableAfterIteration: scala.Int, - strategy: java.lang.String + departureTime : scala.Int, + disableAfterIteration : scala.Int, + strategy : java.lang.String ) - object Replanning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = - if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = - if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") - else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = - c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = - if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") - else "/test/input/beamville/freight/payload-plans.csv", - reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - toursFilePath = - if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") - else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", + reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath: java.lang.String, - inputHouseholdAttributesFilePath: java.lang.String + inputFilePath : java.lang.String, + inputHouseholdAttributesFilePath : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = - if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") - else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = - if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") - else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime: scala.Double, - highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts: scala.Int, - minimumValueOfTime: scala.Double, - modeChoiceClass: java.lang.String, - modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT: scala.Boolean, - overrideAutomationLevel: scala.Int, - poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier + defaultValueOfTime : scala.Double, + highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts : scala.Int, + minimumValueOfTime : scala.Double, + modeChoiceClass : java.lang.String, + modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT : scala.Boolean, + overrideAutomationLevel : scala.Int, + poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier ) - object ModalBehaviors { - case class HighTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) - object HighTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class Lccm( - filePath: java.lang.String + filePath : java.lang.String ) - object Lccm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) - object LowTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class ModeVotMultiplier( - CAV: scala.Double, - bike: scala.Double, - drive: scala.Double, - rideHail: scala.Double, - rideHailPooled: scala.Double, - rideHailTransit: scala.Double, - transit: scala.Double, - waiting: scala.Double, - walk: scala.Double + CAV : scala.Double, + bike : scala.Double, + drive : scala.Double, + rideHail : scala.Double, + rideHailPooled : scala.Double, + rideHailTransit : scala.Double, + transit : scala.Double, + waiting : scala.Double, + walk : scala.Double ) - object ModeVotMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor: scala.Double + params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor : scala.Double ) - object MulitnomialLogit { - case class Params( - bike_intercept: scala.Double, - bike_transit_intercept: scala.Double, - car_intercept: scala.Double, - cav_intercept: scala.Double, - drive_transit_intercept: scala.Double, - ride_hail_intercept: scala.Double, - ride_hail_pooled_intercept: scala.Double, - ride_hail_transit_intercept: scala.Double, - transfer: scala.Double, - transit_crowding: scala.Double, - transit_crowding_percentile: scala.Double, - walk_intercept: scala.Double, - walk_transit_intercept: scala.Double + bike_intercept : scala.Double, + bike_transit_intercept : scala.Double, + car_intercept : scala.Double, + cav_intercept : scala.Double, + drive_transit_intercept : scala.Double, + ride_hail_intercept : scala.Double, + ride_hail_pooled_intercept : scala.Double, + ride_hail_transit_intercept : scala.Double, + transfer : scala.Double, + transit_crowding : scala.Double, + transit_crowding_percentile : scala.Double, + walk_intercept : scala.Double, + walk_transit_intercept : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = - if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = - if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = - if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = - if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") - else 0.0, - ride_hail_transit_intercept = - if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") - else 0.0, - transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_percentile = - if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") - else 90.0, - walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = - if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, + ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, + transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, + walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ), - utility_scale_factor = - if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), + utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object PoolingMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = - if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") - ), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - if (c.hasPathOrNull("lccm")) c.getConfig("lccm") - else com.typesafe.config.ConfigFactory.parseString("lccm{}") - ), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") - ), - maximumNumberOfReplanningAttempts = - if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") - else 3, - minimumValueOfTime = - if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = - if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") - else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") - else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - overrideAutomationForVOTT = - c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = - if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") - else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") - ) - ) - } - } - + defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), + maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, + minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")) + ) + } + } + case class ModeIncentive( - filePath: java.lang.String + filePath : java.lang.String ) - object ModeIncentive { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - maxSearchRadius: scala.Double, - minSearchRadius: scala.Double, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - rangeAnxietyBuffer: scala.Double + estimatedMinParkingDuration : scala.Double, + maxSearchRadius : scala.Double, + minSearchRadius : scala.Double, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + rangeAnxietyBuffer : scala.Double ) - object Parking { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - distanceMultiplier: scala.Double, - homeActivityPrefersResidentialParkingMultiplier: scala.Double, - parkingPriceMultiplier: scala.Double, - rangeAnxietyMultiplier: scala.Double + distanceMultiplier : scala.Double, + homeActivityPrefersResidentialParkingMultiplier : scala.Double, + parkingPriceMultiplier : scala.Double, + rangeAnxietyMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = - if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - homeActivityPrefersResidentialParkingMultiplier = - if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) - c.getDouble("homeActivityPrefersResidentialParkingMultiplier") - else 1.0, - parkingPriceMultiplier = - if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = - if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, + parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - rangeAnxietyBuffer = - if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0 + estimatedMinParkingDuration = if(c.hasPathOrNull("estimatedMinParkingDuration")) c.getDouble("estimatedMinParkingDuration") else 60.0, + maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0 ) } } - + case class Plans( - inputPersonAttributesFilePath: java.lang.String, - inputPlansFilePath: java.lang.String, - merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath : java.lang.String, + inputPlansFilePath : java.lang.String, + merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) - object Plans { - case class Merge( - fraction: scala.Double + fraction : scala.Double ) - object Merge { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = - if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") - else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = - if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") - else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - if (c.hasPathOrNull("merge")) c.getConfig("merge") - else com.typesafe.config.ConfigFactory.parseString("merge{}") - ) + inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) ) } } - + case class Population( - useVehicleSampling: scala.Boolean + useVehicleSampling : scala.Boolean ) - object Population { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath: java.lang.String + filePath : java.lang.String ) - object PtFare { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost: scala.Double, - defaultCostPerMile: scala.Double, - defaultCostPerMinute: scala.Double, - human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations: scala.Boolean, - name: java.lang.String, - pooledBaseCost: scala.Double, - pooledCostPerMile: scala.Double, - pooledCostPerMinute: scala.Double, - pooledToRegularRideCostRatio: scala.Double, - rangeBufferForDispatchInMeters: scala.Int, - refuelLocationType: java.lang.String, - refuelThresholdInMeters: scala.Double, - repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost : scala.Double, + defaultCostPerMile : scala.Double, + defaultCostPerMinute : scala.Double, + human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations : scala.Boolean, + name : java.lang.String, + pooledBaseCost : scala.Double, + pooledCostPerMile : scala.Double, + pooledCostPerMinute : scala.Double, + pooledToRegularRideCostRatio : scala.Double, + rangeBufferForDispatchInMeters : scala.Int, + refuelLocationType : java.lang.String, + refuelThresholdInMeters : scala.Double, + repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) - object RideHail { - case class AllocationManager( - alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm: java.lang.String, - maxExcessRideTime: scala.Double, - maxWaitingTimeInSec: scala.Int, - name: java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, - repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds: scala.Int + alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm : java.lang.String, + maxExcessRideTime : scala.Double, + maxWaitingTimeInSec : scala.Int, + name : java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, + repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds : scala.Int ) - object AllocationManager { - case class AlonsoMora( - maxRequestsPerVehicle: scala.Int + maxRequestsPerVehicle : scala.Int ) - object AlonsoMora { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = - if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, - demandWeight: scala.Double, - distanceWeight: scala.Double, - keepMaxTopNScores: scala.Int, - minDemandPercentageInRadius: scala.Double, - minScoreThresholdForRepositioning: scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, - percentageOfVehiclesToReposition: scala.Double, - produceDebugImages: scala.Boolean, - repositionCircleRadiusInMeters: scala.Double, - repositioningMethod: java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, - waitingTimeWeight: scala.Double + allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, + demandWeight : scala.Double, + distanceWeight : scala.Double, + keepMaxTopNScores : scala.Int, + minDemandPercentageInRadius : scala.Double, + minScoreThresholdForRepositioning : scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, + percentageOfVehiclesToReposition : scala.Double, + produceDebugImages : scala.Boolean, + repositionCircleRadiusInMeters : scala.Double, + repositioningMethod : java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, + waitingTimeWeight : scala.Double ) - object RepositionLowWaitingTimes { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( - "allowIncreasingRadiusIfDemandInRadiusLow" - ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = - if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") - else 0.1, - minScoreThresholdForRepositioning = - if (c.hasPathOrNull("minScoreThresholdForRepositioning")) - c.getDouble("minScoreThresholdForRepositioning") - else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = - if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) - c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") - else 1, - percentageOfVehiclesToReposition = - if (c.hasPathOrNull("percentageOfVehiclesToReposition")) - c.getDouble("percentageOfVehiclesToReposition") - else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = - if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") - else 3000, - repositioningMethod = - if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = - if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) - c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") - else 1200, - waitingTimeWeight = - if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, + minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, + percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, + repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, + waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") - else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") - ), - matchingAlgorithm = - if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") - else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = - if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = - if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) - c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") - else 1, - repositionLowWaitingTimes = - BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") - else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") - ), - requestBufferTimeoutInSeconds = - if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), + matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, + repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), + requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int, - valueOfTime: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int, + valueOfTime : scala.Int ) - object Cav { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 16090, - valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, + valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) - object Charging { - case class VehicleChargingManager( - defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, - name: java.lang.String + defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, + name : java.lang.String ) - object VehicleChargingManager { - case class DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging: scala.Double, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, - noChargingThresholdExpirationTimeInS: scala.Int + fractionAvailableThresholdToFavorFasterCharging : scala.Double, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, + noChargingThresholdExpirationTimeInS : scala.Int ) - object DefaultVehicleChargingManager { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - chargingTimeMultiplier: scala.Double, - drivingTimeMultiplier: scala.Double, - insufficientRangeMultiplier: scala.Double, - queueingTimeMultiplier: scala.Double + chargingTimeMultiplier : scala.Double, + drivingTimeMultiplier : scala.Double, + insufficientRangeMultiplier : scala.Double, + queueingTimeMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - chargingTimeMultiplier = - if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") - else -0.01666667, - drivingTimeMultiplier = - if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") - else -0.01666667, - insufficientRangeMultiplier = - if (c.hasPathOrNull("insufficientRangeMultiplier")) - c.getDouble("insufficientRangeMultiplier") - else -60.0, - queueingTimeMultiplier = - if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") - else -0.01666667 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( + chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, + drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, + insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, + queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - params = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging = - if (c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) - c.getDouble("fractionAvailableThresholdToFavorFasterCharging") - else 1.01, - mulitnomialLogit = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - noChargingThresholdExpirationTimeInS = - if (c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) - c.getInt("noChargingThresholdExpirationTimeInS") - else 0 - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( + fractionAvailableThresholdToFavorFasterCharging = if(c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) c.getDouble("fractionAvailableThresholdToFavorFasterCharging") else 1.01, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + noChargingThresholdExpirationTimeInS = if(c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) c.getInt("noChargingThresholdExpirationTimeInS") else 0 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - if (c.hasPathOrNull("defaultVehicleChargingManager")) - c.getConfig("defaultVehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" + defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") - ) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) ) } } - + case class Human( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int, - valueOfTime: scala.Double + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int, + valueOfTime : scala.Double ) - object Human { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180, - valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180, + valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 ) } } - + case class Initialization( - filePath: java.lang.String, - initType: java.lang.String, - parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath : java.lang.String, + initType : java.lang.String, + parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) - object Initialization { - case class Parking( - filePath: java.lang.String + filePath : java.lang.String ) - object Parking { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet: scala.Double, - initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId: java.lang.String, - vehicleTypePrefix: java.lang.String + fractionOfInitialVehicleFleet : scala.Double, + initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId : java.lang.String, + vehicleTypePrefix : java.lang.String ) - object Procedural { - case class InitialLocation( - home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name: java.lang.String + home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name : java.lang.String ) - object InitialLocation { - case class Home( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object Home { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - if (c.hasPathOrNull("home")) c.getConfig("home") - else com.typesafe.config.ConfigFactory.parseString("home{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") - else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") - ), - vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = - if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - if (c.hasPathOrNull("procedural")) c.getConfig("procedural") - else com.typesafe.config.ConfigFactory.parseString("procedural{}") - ) + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) ) } } - + case class IterationStats( - timeBinSizeInSec: scala.Double + timeBinSizeInSec : scala.Double ) - object IterationStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name: java.lang.String, - timeout: scala.Int + demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name : java.lang.String, + timeout : scala.Int ) - object RepositioningManager { - case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider: scala.Double, - horizon: scala.Int, - numberOfClustersForDemand: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDemandForCAVs: scala.Double + fractionOfClosestClustersToConsider : scala.Double, + horizon : scala.Int, + numberOfClustersForDemand : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDemandForCAVs : scala.Double ) - object DemandFollowingRepositioningManager { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = - if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) - c.getDouble("fractionOfClosestClustersToConsider") - else 0.2, - horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = - if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 1, - sensitivityOfRepositioningToDemandForCAVs = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) - c.getDouble("sensitivityOfRepositioningToDemandForCAVs") - else 1 + fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, + horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, + sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDistance: scala.Double + predictionHorizon : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDistance : scala.Double ) - object InverseSquareDistanceRepositioningFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 0.4, - sensitivityOfRepositioningToDistance = - if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) - c.getDouble("sensitivityOfRepositioningToDistance") - else 0.9 + predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, + sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - if (c.hasPathOrNull("demandFollowingRepositioningManager")) - c.getConfig("demandFollowingRepositioningManager") - else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") - ), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager - .InverseSquareDistanceRepositioningFactor( - if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) - c.getConfig("inverseSquareDistanceRepositioningFactor") - else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object RideHailManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel: scala.Double, - numberOfCategories: scala.Int, - priceAdjustmentStrategy: java.lang.String, - surgeLevelAdaptionStep: scala.Double + minimumSurgeLevel : scala.Double, + numberOfCategories : scala.Int, + priceAdjustmentStrategy : java.lang.String, + surgeLevelAdaptionStep : scala.Double ) - object SurgePricing { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = - if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") - else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = - if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") - else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") - ), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - if (c.hasPathOrNull("cav")) c.getConfig("cav") - else com.typesafe.config.ConfigFactory.parseString("cav{}") - ), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - if (c.hasPathOrNull("charging")) c.getConfig("charging") - else com.typesafe.config.ConfigFactory.parseString("charging{}") - ), - defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = - if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = - if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - if (c.hasPathOrNull("human")) c.getConfig("human") - else com.typesafe.config.ConfigFactory.parseString("human{}") - ), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - if (c.hasPathOrNull("initialization")) c.getConfig("initialization") - else com.typesafe.config.ConfigFactory.parseString("initialization{}") - ), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") - else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") - ), - linkFleetStateAcrossIterations = - c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = - if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - pooledToRegularRideCostRatio = - if (c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") - else 0.6, - rangeBufferForDispatchInMeters = - if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") - else 10000, - refuelLocationType = - if (c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", - refuelThresholdInMeters = - if (c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") - else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") - ), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") - else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") - ), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") - else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") - ) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), + defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), + linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + pooledToRegularRideCostRatio = if(c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") else 0.6, + rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, + refuelLocationType = if(c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", + refuelThresholdInMeters = if(c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) + ) + } + } + case class RideHailTransit( - modesToConsider: java.lang.String + modesToConsider : java.lang.String ) - object RideHailTransit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) - object TripBehaviors { - case class CarUsage( - minDistanceToTrainStop: scala.Double + minDistanceToTrainStop : scala.Double ) - object CarUsage { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = - if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path: java.lang.String, - additional_trip_utility: scala.Double, - destination_nest_scale_factor: scala.Double, - generate_secondary_activities: scala.Boolean, - intercept_file_path: java.lang.String, - max_destination_choice_set_size: scala.Int, - max_destination_distance_meters: scala.Double, - mode_nest_scale_factor: scala.Double, - trip_nest_scale_factor: scala.Double + activity_file_path : java.lang.String, + additional_trip_utility : scala.Double, + destination_nest_scale_factor : scala.Double, + generate_secondary_activities : scala.Boolean, + intercept_file_path : java.lang.String, + max_destination_choice_set_size : scala.Int, + max_destination_distance_meters : scala.Double, + mode_nest_scale_factor : scala.Double, + trip_nest_scale_factor : scala.Double ) - object MulitnomialLogit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = - if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = - if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = - if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") - else 1.0, - generate_secondary_activities = - c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = - if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = - if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") - else 20, - max_destination_distance_meters = - if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") - else 32000, - mode_nest_scale_factor = - if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = - if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, + generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, + max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, + mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") - else com.typesafe.config.ConfigFactory.parseString("carUsage{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) ) } } - + case class Vehicles( - downsamplingMethod: java.lang.String, - dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - fractionOfInitialVehicleFleet: scala.Double, - fractionOfPeopleWithBicycle: scala.Double, - fuelTypesFilePath: java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, - linkSocAcrossIterations: scala.Boolean, - linkToGradePercentFilePath: java.lang.String, - meanPrivateVehicleStartingSOC: scala.Double, - meanRidehailVehicleStartingSOC: scala.Double, - sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile: java.lang.String, - vehicleAdjustmentMethod: java.lang.String, - vehicleTypesFilePath: java.lang.String, - vehiclesFilePath: java.lang.String + downsamplingMethod : java.lang.String, + dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + fractionOfInitialVehicleFleet : scala.Double, + fractionOfPeopleWithBicycle : scala.Double, + fuelTypesFilePath : java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, + linkSocAcrossIterations : scala.Boolean, + linkToGradePercentFilePath : java.lang.String, + meanPrivateVehicleStartingSOC : scala.Double, + meanRidehailVehicleStartingSOC : scala.Double, + sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile : java.lang.String, + vehicleAdjustmentMethod : java.lang.String, + vehicleTypesFilePath : java.lang.String, + vehiclesFilePath : java.lang.String ) - object Vehicles { - case class DummySharedBike( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedBike { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedCar { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class SharedFleets$Elm( - fixed_non_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving - ], - fixed_non_reserving_fleet_by_taz: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz - ], - inexhaustible_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving - ], - managerType: java.lang.String, - name: java.lang.String, - parkingFilePath: java.lang.String, - reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], + fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], + inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], + managerType : java.lang.String, + name : java.lang.String, + parkingFilePath : java.lang.String, + reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) - object SharedFleets$Elm { - case class FixedNonReserving( - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String ) - object FixedNonReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize: scala.Int, - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String, - vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] + fleetSize : scala.Int, + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String, + vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] ) - object FixedNonReservingFleetByTaz { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = - if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) - else None + fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object InexhaustibleReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm - ], - name: java.lang.String, - repositionTimeBin: scala.Int, - statTimeBin: scala.Int + min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], + name : java.lang.String, + repositionTimeBin : scala.Int, + statTimeBin : scala.Int ) - object Reposition { - case class MinAvailabilityUndersupplyAlgorithm( - matchLimit: scala.Int + matchLimit : scala.Int ) - object MinAvailabilityUndersupplyAlgorithm { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm( - matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( + matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = - if (c.hasPathOrNull("min-availability-undersupply-algorithm")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) - ) - else None, - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = - if (c.hasPathOrNull("fixed-non-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReserving(c.getConfig("fixed-non-reserving")) - ) - else None, - fixed_non_reserving_fleet_by_taz = - if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) - ) - else None, - inexhaustible_reserving = - if (c.hasPathOrNull("inexhaustible-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) - ) - else None, - managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = - if (c.hasPathOrNull("reposition")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) - ) - else None + fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, + fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, + inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, + managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = - if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") - else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") - else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") - ), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") - else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") - ), - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 1.0, - fractionOfPeopleWithBicycle = - if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = - if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") - else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( - "generateEmergencyHouseholdVehicleWhenPlansRequireIt" - ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = - c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = - if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = - if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") - else 1.0, - meanRidehailVehicleStartingSOC = - if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") - else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = - if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") - else "", - vehicleAdjustmentMethod = - if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = - if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") - else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = - if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") - else "/test/input/beamville/vehicles.csv" - ) - } - - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, + fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, + meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", + vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" + ) + } + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Agentsim.Agents.Vehicles - .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities( - if (c.hasPathOrNull("activities")) c.getConfig("activities") - else com.typesafe.config.ConfigFactory.parseString("activities{}") - ), - bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight( - if (c.hasPathOrNull("freight")) c.getConfig("freight") - else com.typesafe.config.ConfigFactory.parseString("freight{}") - ), - households = BeamConfig.Beam.Agentsim.Agents.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") - else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") - ), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") - else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") - ), - parking = BeamConfig.Beam.Agentsim.Agents.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - plans = BeamConfig.Beam.Agentsim.Agents.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - population = BeamConfig.Beam.Agentsim.Agents.Population( - if (c.hasPathOrNull("population")) c.getConfig("population") - else com.typesafe.config.ConfigFactory.parseString("population{}") - ), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( - if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") - else com.typesafe.config.ConfigFactory.parseString("ptFare{}") - ), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( - if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") - else com.typesafe.config.ConfigFactory.parseString("rideHail{}") - ), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") - else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") - ), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") - else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") - ), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), + bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), + households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), + parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor: scala.Double, - chargingPointCountScalingFactor: scala.Double, - chargingPointFilePath: java.lang.String, - helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds: scala.Int + chargingPointCostScalingFactor : scala.Double, + chargingPointCountScalingFactor : scala.Double, + chargingPointFilePath : java.lang.String, + helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds : scala.Int ) - object ChargingNetworkManager { - case class Helics( - bufferSize: scala.Int, - connectionEnabled: scala.Boolean, - coreInitString: java.lang.String, - coreType: java.lang.String, - dataInStreamPoint: java.lang.String, - dataOutStreamPoint: java.lang.String, - federateName: java.lang.String, - feedbackEnabled: scala.Boolean, - intLogLevel: scala.Int, - timeDeltaProperty: scala.Double + bufferSize : scala.Int, + connectionEnabled : scala.Boolean, + coreInitString : java.lang.String, + coreType : java.lang.String, + dataInStreamPoint : java.lang.String, + dataOutStreamPoint : java.lang.String, + federateName : java.lang.String, + feedbackEnabled : scala.Boolean, + intLogLevel : scala.Int, + timeDeltaProperty : scala.Double ) - object Helics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = - if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") - else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = - if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") - else "GridFed/PhysicalBounds", - dataOutStreamPoint = - if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", + dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled: scala.Boolean, - expansionFactor_charge_activity: scala.Double, - expansionFactor_home_activity: scala.Double, - expansionFactor_init_activity: scala.Double, - expansionFactor_wherever_activity: scala.Double, - expansionFactor_work_activity: scala.Double + enabled : scala.Boolean, + expansionFactor_charge_activity : scala.Double, + expansionFactor_home_activity : scala.Double, + expansionFactor_init_activity : scala.Double, + expansionFactor_wherever_activity : scala.Double, + expansionFactor_work_activity : scala.Double ) - object ScaleUp { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = - if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") - else 1.0, - expansionFactor_home_activity = - if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") - else 1.0, - expansionFactor_init_activity = - if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") - else 1.0, - expansionFactor_wherever_activity = - if (c.hasPathOrNull("expansionFactor_wherever_activity")) - c.getDouble("expansionFactor_wherever_activity") - else 1.0, - expansionFactor_work_activity = - if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") - else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, + expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, + expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, + expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, + expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = - if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") - else 1.0, - chargingPointCountScalingFactor = - if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") - else 1.0, - chargingPointFilePath = - if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - if (c.hasPathOrNull("helics")) c.getConfig("helics") - else com.typesafe.config.ConfigFactory.parseString("helics{}") - ), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") - else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") - ), - timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, + chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, + chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), + timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution: scala.Int, - upperBoundResolution: scala.Int + lowerBoundResolution : scala.Int, + upperBoundResolution : scala.Int ) - object H3taz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile: java.lang.String + frequencyAdjustmentFile : java.lang.String ) - object Scenarios { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = - if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") - else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay: scala.Int, - interval: scala.Int + initialDelay : scala.Int, + interval : scala.Int ) - object ScheduleMonitorTask { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath: java.lang.String, - parkingCostScalingFactor: scala.Double, - parkingFilePath: java.lang.String, - parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor: scala.Double + filePath : java.lang.String, + parkingCostScalingFactor : scala.Double, + parkingFilePath : java.lang.String, + parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor : scala.Double ) - object Taz { - case class ParkingManager( - displayPerformanceTimings: scala.Boolean, - level: java.lang.String, - method: java.lang.String, - parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings : scala.Boolean, + level : java.lang.String, + method : java.lang.String, + parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) - object ParkingManager { - case class Parallel( - numberOfClusters: scala.Int + numberOfClusters : scala.Int ) - object Parallel { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - level = if (c.hasPathOrNull("level")) c.getString("level") else "TAZ", - method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - if (c.hasPathOrNull("parallel")) c.getConfig("parallel") - else com.typesafe.config.ConfigFactory.parseString("parallel{}") - ) + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + level = if(c.hasPathOrNull("level")) c.getString("level") else "TAZ", + method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = - if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( - if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") - else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") - ), - parkingStallCountScalingFactor = - if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") - else 1.0 + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), + parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 ) } } - + case class Toll( - filePath: java.lang.String + filePath : java.lang.String ) - object Toll { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules: scala.Double, - rideHailPrice: scala.Double, - tollPrice: scala.Double, - transitCapacity: scala.Option[scala.Double], - transitPrice: scala.Double + fuelCapacityInJoules : scala.Double, + rideHailPrice : scala.Double, + tollPrice : scala.Double, + transitCapacity : scala.Option[scala.Double], + transitPrice : scala.Double ) - object Tuning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = - if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = - if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) - c.getDouble("agentSampleSizeAsFractionOfPopulation") - else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents( - if (c.hasPathOrNull("agents")) c.getConfig("agents") - else com.typesafe.config.ConfigFactory.parseString("agents{}") - ), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( - if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") - else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") - ), - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = - if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") - else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz( - if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") - else com.typesafe.config.ConfigFactory.parseString("h3taz{}") - ), - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = - if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - scenarios = BeamConfig.Beam.Agentsim.Scenarios( - if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") - else com.typesafe.config.ConfigFactory.parseString("scenarios{}") - ), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") - else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") - ), - schedulerParallelismWindow = - if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - taz = BeamConfig.Beam.Agentsim.Taz( - if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") - ), - thresholdForMakingParkingChoiceInMeters = - if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) - c.getInt("thresholdForMakingParkingChoiceInMeters") - else 100, - thresholdForWalkingInMeters = - if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll( - if (c.hasPathOrNull("toll")) c.getConfig("toll") - else com.typesafe.config.ConfigFactory.parseString("toll{}") - ), - tuning = BeamConfig.Beam.Agentsim.Tuning( - if (c.hasPathOrNull("tuning")) c.getConfig("tuning") - else com.typesafe.config.ConfigFactory.parseString("tuning{}") - ) + agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), + schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), + thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, + thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), + tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) ) } } - + case class Calibration( - counts: BeamConfig.Beam.Calibration.Counts, - google: BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio: scala.Double, - mode: BeamConfig.Beam.Calibration.Mode, - objectiveFunction: java.lang.String, - roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, - studyArea: BeamConfig.Beam.Calibration.StudyArea + counts : BeamConfig.Beam.Calibration.Counts, + google : BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio : scala.Double, + mode : BeamConfig.Beam.Calibration.Mode, + objectiveFunction : java.lang.String, + roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, + studyArea : BeamConfig.Beam.Calibration.StudyArea ) - object Calibration { - case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Int, - inputCountsFile: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Int, + inputCountsFile : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes ) - object Google { - case class TravelTimes( - enable: scala.Boolean, - iterationInterval: scala.Int, - minDistanceInMeters: scala.Double, - numDataPointsOver24Hours: scala.Int, - offPeakEnabled: scala.Boolean, - queryDate: java.lang.String, - tolls: scala.Boolean + enable : scala.Boolean, + iterationInterval : scala.Int, + minDistanceInMeters : scala.Double, + numDataPointsOver24Hours : scala.Int, + offPeakEnabled : scala.Boolean, + queryDate : java.lang.String, + tolls : scala.Boolean ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = - if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = - if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class Mode( - benchmarkFilePath: java.lang.String + benchmarkFilePath : java.lang.String ) - object Mode { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) - object RoadNetwork { - case class TravelTimes( - zoneBoundariesFilePath: java.lang.String, - zoneODTravelTimesFilePath: java.lang.String + zoneBoundariesFilePath : java.lang.String, + zoneODTravelTimesFilePath : java.lang.String ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = - if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = - if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class StudyArea( - enabled: scala.Boolean, - lat: scala.Double, - lon: scala.Double, - radius: scala.Double + enabled : scala.Boolean, + lat : scala.Double, + lon : scala.Double, + radius : scala.Double ) - object StudyArea { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - google = BeamConfig.Beam.Calibration.Google( - if (c.hasPathOrNull("google")) c.getConfig("google") - else com.typesafe.config.ConfigFactory.parseString("google{}") - ), - meanToCountsWeightRatio = - if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode( - if (c.hasPathOrNull("mode")) c.getConfig("mode") - else com.typesafe.config.ConfigFactory.parseString("mode{}") - ), - objectiveFunction = - if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") - else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( - if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") - else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") - ), - studyArea = BeamConfig.Beam.Calibration.StudyArea( - if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") - else com.typesafe.config.ConfigFactory.parseString("studyArea{}") - ) + counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), + meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), + objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), + studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) ) } } - + case class Cluster( - clusterType: scala.Option[java.lang.String], - enabled: scala.Boolean + clusterType : scala.Option[java.lang.String], + enabled : scala.Boolean ) - object Cluster { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor: BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval: scala.Int, - clearRoutedOutstandingWorkEnabled: scala.Boolean, - debugActorTimerIntervalInSec: scala.Int, - debugEnabled: scala.Boolean, - memoryConsumptionDisplayTimeoutInSec: scala.Int, - messageLogging: scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork: scala.Int, - stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation: BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives: scala.Boolean, - writeRealizedModeChoiceFile: scala.Boolean + actor : BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval : scala.Int, + clearRoutedOutstandingWorkEnabled : scala.Boolean, + debugActorTimerIntervalInSec : scala.Int, + debugEnabled : scala.Boolean, + memoryConsumptionDisplayTimeoutInSec : scala.Int, + messageLogging : scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork : scala.Int, + stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation : BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives : scala.Boolean, + writeRealizedModeChoiceFile : scala.Boolean ) - object Debug { - case class Actor( - logDepth: scala.Int + logDepth : scala.Int ) - object Actor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs: scala.Long, - checkMaxNumberOfMessagesEnabled: scala.Boolean, - defaultTimeoutMs: scala.Long, - enabled: scala.Boolean, - overallSimulationTimeoutMs: scala.Long, - thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs : scala.Long, + checkMaxNumberOfMessagesEnabled : scala.Boolean, + defaultTimeoutMs : scala.Long, + enabled : scala.Boolean, + overallSimulationTimeoutMs : scala.Long, + thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) - object StuckAgentDetection { - case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs: scala.Long, - triggerType: java.lang.String + actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs : scala.Long, + triggerType : java.lang.String ) - object Thresholds$Elm { - case class ActorTypeToMaxNumberOfMessages( - population: scala.Option[scala.Int], - rideHailAgent: scala.Option[scala.Int], - rideHailManager: scala.Option[scala.Int], - transitDriverAgent: scala.Option[scala.Int] + population : scala.Option[scala.Int], + rideHailAgent : scala.Option[scala.Int], + rideHailManager : scala.Option[scala.Int], + transitDriverAgent : scala.Option[scala.Int] ) - object ActorTypeToMaxNumberOfMessages { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = - if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = - BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") - else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") - ), - markAsStuckAfterMs = - if (c.hasPathOrNull("markAsStuckAfterMs")) - c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 20000, - triggerType = - if (c.hasPathOrNull("triggerType")) c.getString("triggerType") - else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), + markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, + triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = - if (c.hasPathOrNull("checkIntervalMs")) - c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 200, - checkMaxNumberOfMessagesEnabled = - !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = - if (c.hasPathOrNull("defaultTimeoutMs")) - c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = - if (c.hasPathOrNull("overallSimulationTimeoutMs")) - c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, + checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Debug.StuckAgentDetection - .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class TriggerMeasurer( - enabled: scala.Boolean, - writeStuckAgentDetectionConfig: scala.Boolean + enabled : scala.Boolean, + writeStuckAgentDetectionConfig : scala.Boolean ) - object TriggerMeasurer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = - !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram: scala.Boolean + createGCClassHistogram : scala.Boolean ) - object VmInformation { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor( - if (c.hasPathOrNull("actor")) c.getConfig("actor") - else com.typesafe.config.ConfigFactory.parseString("actor{}") - ), - agentTripScoresInterval = - if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = - c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = - if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = - if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) - c.getInt("memoryConsumptionDisplayTimeoutInSec") - else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = - if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) - c.getInt("secondsToWaitToClearRoutedOutstandingWork") - else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( - if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") - else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") - ), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( - if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") - else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") - ), - vmInformation = BeamConfig.Beam.Debug.VmInformation( - if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") - else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") - ), - writeModeChoiceAlternatives = - c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = - c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), + agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), + vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), + writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output: BeamConfig.Beam.Exchange.Output, - scenario: BeamConfig.Beam.Exchange.Scenario + output : BeamConfig.Beam.Exchange.Output, + scenario : BeamConfig.Beam.Exchange.Scenario ) - object Exchange { - case class Output( - activitySimSkimsEnabled: scala.Boolean, - geo: BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled : scala.Boolean, + geo : BeamConfig.Beam.Exchange.Output.Geo ) - object Output { - case class Geo( - filePath: scala.Option[java.lang.String] + filePath : scala.Option[java.lang.String] ) - object Geo { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = - c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo( - if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") - ) + activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) ) } } - + case class Scenario( - convertWgs2Utm: scala.Boolean, - fileFormat: java.lang.String, - folder: java.lang.String, - modeMap: scala.Option[scala.List[java.lang.String]], - source: java.lang.String, - urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm : scala.Boolean, + fileFormat : java.lang.String, + folder : java.lang.String, + modeMap : scala.Option[scala.List[java.lang.String]], + source : java.lang.String, + urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim ) - object Scenario { - case class Urbansim( - activitySimEnabled: scala.Boolean + activitySimEnabled : scala.Boolean ) - object Urbansim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ) + fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - scenario = BeamConfig.Beam.Exchange.Scenario( - if (c.hasPathOrNull("scenario")) c.getConfig("scenario") - else com.typesafe.config.ConfigFactory.parseString("scenario{}") - ) + output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) ) } } - + case class Experimental( - optimizer: BeamConfig.Beam.Experimental.Optimizer + optimizer : BeamConfig.Beam.Experimental.Optimizer ) - object Experimental { - case class Optimizer( - enabled: scala.Boolean + enabled : scala.Boolean ) - object Optimizer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer( - if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") - else com.typesafe.config.ConfigFactory.parseString("optimizer{}") - ) + optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) ) } } - + case class Input( - lastBaseOutputDir: java.lang.String, - simulationPrefix: java.lang.String + lastBaseOutputDir : java.lang.String, + simulationPrefix : java.lang.String ) - object Input { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn: scala.Boolean + keepConsoleAppenderOn : scala.Boolean ) - object Logger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level: java.lang.String + level : java.lang.String ) - object Metrics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation: scala.Boolean + writePlansAndStopSimulation : scala.Boolean ) - object Output { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = - c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory: scala.Boolean, - baseOutputDirectory: java.lang.String, - collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, - defaultWriteInterval: scala.Int, - displayPerformanceTimings: scala.Boolean, - events: BeamConfig.Beam.Outputs.Events, - generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval: scala.Int, - matsim: BeamConfig.Beam.Outputs.Matsim, - stats: BeamConfig.Beam.Outputs.Stats, - writeAnalysis: scala.Boolean, - writeEventsInterval: scala.Int, - writeGraphs: scala.Boolean, - writeLinkTraversalInterval: scala.Int, - writePlansInterval: scala.Int, - writeR5RoutesInterval: scala.Int + addTimestampToOutputDirectory : scala.Boolean, + baseOutputDirectory : java.lang.String, + collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, + defaultWriteInterval : scala.Int, + displayPerformanceTimings : scala.Boolean, + events : BeamConfig.Beam.Outputs.Events, + generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval : scala.Int, + matsim : BeamConfig.Beam.Outputs.Matsim, + stats : BeamConfig.Beam.Outputs.Stats, + writeAnalysis : scala.Boolean, + writeEventsInterval : scala.Int, + writeGraphs : scala.Boolean, + writeLinkTraversalInterval : scala.Int, + writePlansInterval : scala.Int, + writeR5RoutesInterval : scala.Int ) - object Outputs { - case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime: scala.Int, - startTime: scala.Int + endTime : scala.Int, + startTime : scala.Int ) - object GeneralizedLinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles: java.lang.String, - deleteRootFolderFiles: java.lang.String + deleteITERSFolderFiles : java.lang.String, + deleteRootFolderFiles : java.lang.String ) - object Matsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = - if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = - if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize: scala.Int + binSize : scala.Int ) - object Stats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = - !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = - if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = - !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( - "collectAndCreateBeamAnalysisAndGraphs" - ), - defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( - if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") - else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") - ), - generalizedLinkStatsInterval = - if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ), - stats = BeamConfig.Beam.Outputs.Stats( - if (c.hasPathOrNull("stats")) c.getConfig("stats") - else com.typesafe.config.ConfigFactory.parseString("stats{}") - ), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writeLinkTraversalInterval = - if (c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), + defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), + generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), + stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writeLinkTraversalInterval = if(c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim: BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager: BeamConfig.Beam.Physsim.EventManager, - events: BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia: scala.Boolean, - eventsSampling: scala.Double, - flowCapacityFactor: scala.Double, - initializeRouterWithFreeFlowTimes: scala.Boolean, - inputNetworkFilePath: java.lang.String, - jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize: scala.Int, - linkStatsWriteInterval: scala.Int, - name: java.lang.String, - network: BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath: java.lang.String, - parbprsim: BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize: scala.Double, - quick_fix_minCarSpeedInMetersPerSecond: scala.Double, - relaxation: BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim: scala.Boolean, - speedScalingFactor: scala.Double, - storageCapacityFactor: scala.Double, - writeEventsInterval: scala.Int, - writeMATSimNetwork: scala.Boolean, - writePlansInterval: scala.Int, - writeRouteHistoryInterval: scala.Int + bprsim : BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager : BeamConfig.Beam.Physsim.EventManager, + events : BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia : scala.Boolean, + eventsSampling : scala.Double, + flowCapacityFactor : scala.Double, + initializeRouterWithFreeFlowTimes : scala.Boolean, + inputNetworkFilePath : java.lang.String, + jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize : scala.Int, + linkStatsWriteInterval : scala.Int, + name : java.lang.String, + network : BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath : java.lang.String, + parbprsim : BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize : scala.Double, + quick_fix_minCarSpeedInMetersPerSecond : scala.Double, + relaxation : BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim : scala.Boolean, + speedScalingFactor : scala.Double, + storageCapacityFactor : scala.Double, + writeEventsInterval : scala.Int, + writeMATSimNetwork : scala.Boolean, + writePlansInterval : scala.Int, + writeRouteHistoryInterval : scala.Int ) - object Physsim { - case class Bprsim( - inFlowAggregationTimeWindowInSeconds: scala.Int, - minFlowToUseBPRFunction: scala.Int, - travelTimeFunction: java.lang.String + inFlowAggregationTimeWindowInSeconds : scala.Int, + minFlowToUseBPRFunction : scala.Int, + travelTimeFunction : java.lang.String ) - object Bprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = - if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) - c.getInt("inFlowAggregationTimeWindowInSeconds") - else 900, - minFlowToUseBPRFunction = - if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, + minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor: scala.Double + congestionFactor : scala.Double ) - object CchRoutingAssignment { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax: scala.Int, - departureTimeShiftMin: scala.Int, - fractionOfEventsToDuplicate: scala.Double + departureTimeShiftMax : scala.Int, + departureTimeShiftMin : scala.Int, + fractionOfEventsToDuplicate : scala.Double ) - object DuplicatePTE { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = - if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = - if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = - if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads: scala.Int, - `type`: java.lang.String + numberOfThreads : scala.Int, + `type` : java.lang.String ) - object EventManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) - object Jdeqsim { - case class AgentSimPhysSimInterfaceDebugger( - enabled: scala.Boolean + enabled : scala.Boolean ) - object AgentSimPhysSimInterfaceDebugger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, - capacityPlansWriteInterval: scala.Int, - enabled: scala.Boolean, - minRoadCapacity: scala.Int, - minSpeedMetersPerSec: scala.Int, - speedAdjustmentFactor: scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, + capacityPlansWriteInterval : scala.Int, + enabled : scala.Boolean, + minRoadCapacity : scala.Int, + minSpeedMetersPerSec : scala.Int, + speedAdjustmentFactor : scala.Double ) - object Cacc { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = - if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) - c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") - else 1.3, - capacityPlansWriteInterval = - if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = - if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = - if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, + capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( - if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") - else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") - ), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - if (c.hasPathOrNull("cacc")) c.getConfig("cacc") - else com.typesafe.config.ConfigFactory.parseString("cacc{}") - ) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) ) } } - + case class Network( - maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) - object Network { - case class MaxSpeedInference( - enabled: scala.Boolean, - `type`: java.lang.String + enabled : scala.Boolean, + `type` : java.lang.String ) - object MaxSpeedInference { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled: scala.Boolean, - livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled : scala.Boolean, + livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) - object OverwriteRoadTypeProperties { - case class LivingStreet( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object LivingStreet { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Minor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Motorway { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object MotorwayLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Primary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object PrimaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Residential { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Secondary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object SecondaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Tertiary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TertiaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Trunk { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TrunkLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Unclassified { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") - else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") - ), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - if (c.hasPathOrNull("minor")) c.getConfig("minor") - else com.typesafe.config.ConfigFactory.parseString("minor{}") - ), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - if (c.hasPathOrNull("motorway")) c.getConfig("motorway") - else com.typesafe.config.ConfigFactory.parseString("motorway{}") - ), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") - else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") - ), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - if (c.hasPathOrNull("primary")) c.getConfig("primary") - else com.typesafe.config.ConfigFactory.parseString("primary{}") - ), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") - else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") - ), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - if (c.hasPathOrNull("residential")) c.getConfig("residential") - else com.typesafe.config.ConfigFactory.parseString("residential{}") - ), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - if (c.hasPathOrNull("secondary")) c.getConfig("secondary") - else com.typesafe.config.ConfigFactory.parseString("secondary{}") - ), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") - else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") - ), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") - else com.typesafe.config.ConfigFactory.parseString("tertiary{}") - ), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") - else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") - ), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - if (c.hasPathOrNull("trunk")) c.getConfig("trunk") - else com.typesafe.config.ConfigFactory.parseString("trunk{}") - ), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") - else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") - ), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") - else com.typesafe.config.ConfigFactory.parseString("unclassified{}") - ) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( - if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") - else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") - ), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") - else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") - ) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) ) } } - + case class Parbprsim( - numberOfClusters: scala.Int, - syncInterval: scala.Int + numberOfClusters : scala.Int, + syncInterval : scala.Int ) - object Parbprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier: scala.Double, - enabled: scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime: scala.Int + additionalTravelTimeMultiplier : scala.Double, + enabled : scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime : scala.Int ) - object PickUpDropOffAnalysis { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = - if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") - else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = - if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) - c.getInt("secondsFromPickUpPropOffToAffectTravelTime") - else 600 + additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 ) } } - + case class Relaxation( - experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type`: java.lang.String + experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type` : java.lang.String ) - object Relaxation { - case class Experiment20( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment20 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment21 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment30 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment40 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment50 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment51 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment52 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( - if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") - else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") - ), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( - if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") - else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") - ), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( - if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") - else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") - ), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( - if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") - else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") - ), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( - if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") - else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") - ), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( - if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") - else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") - ), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( - if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") - else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") - ), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim( - if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") - else com.typesafe.config.ConfigFactory.parseString("bprsim{}") - ), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( - if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") - else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") - ), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( - if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") - else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") - ), - eventManager = BeamConfig.Beam.Physsim.EventManager( - if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") - else com.typesafe.config.ConfigFactory.parseString("eventManager{}") - ), - events = BeamConfig.Beam.Physsim.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - eventsForFullVersionOfVia = - !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = - !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = - if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") - else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( - if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") - else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") - ), - linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = - if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - overwriteLinkParamPath = - if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim( - if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") - else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") - ), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") - else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") - ), - ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = - if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) - c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") - else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation( - if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") - else com.typesafe.config.ConfigFactory.parseString("relaxation{}") - ), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = - if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = - if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), + eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), + events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), + linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), + ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1: scala.Double, - ModuleProbability_2: scala.Double, - ModuleProbability_3: scala.Double, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - clearModes: BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation: scala.Double, - maxAgentPlanMemorySize: scala.Int + ModuleProbability_1 : scala.Double, + ModuleProbability_2 : scala.Double, + ModuleProbability_3 : scala.Double, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + clearModes : BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation : scala.Double, + maxAgentPlanMemorySize : scala.Int ) - object Replanning { - case class ClearModes( - iteration: scala.Int, - modes: scala.Option[scala.List[java.lang.String]], - strategy: java.lang.String + iteration : scala.Int, + modes : scala.Option[scala.List[java.lang.String]], + strategy : java.lang.String ) - object ClearModes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes( - if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") - else com.typesafe.config.ConfigFactory.parseString("clearModes{}") - ), - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getDouble("fractionOfIterationsToDisableInnovation") - else Double.PositiveInfinity, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim: BeamConfig.Beam.Router.Skim + skim : BeamConfig.Beam.Router.Skim ) - object Router { - case class Skim( - activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims: scala.Int, - origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval: scala.Int, - writeSkimsInterval: scala.Int + activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims : scala.Int, + origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval : scala.Int, + writeSkimsInterval : scala.Int ) - object Skim { - case class ActivitySimSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object ActivitySimSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object DriveTimeSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") - else "skimsTravelTimeObservedVsSimulated", - name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", + name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String, - poolingTravelTimeOveheadFactor: scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, - writeFullSkimsInterval: scala.Int + fileBaseName : java.lang.String, + name : java.lang.String, + poolingTravelTimeOveheadFactor : scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, + writeFullSkimsInterval : scala.Int ) - object OriginDestinationSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = - if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") - else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = - if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) - c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") - else 0, - writeFullSkimsInterval = - if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, + writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName: java.lang.String, - geoHierarchy: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + geoHierarchy : java.lang.String, + name : java.lang.String ) - object TazSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object TransitCrowdingSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") - else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") - ), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") - else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") - ), - keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") - else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") - ), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( - if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") - else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") - ), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") - else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") - ), - writeAggregatedSkimsInterval = - if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), + keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), + writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim( - if (c.hasPathOrNull("skim")) c.getConfig("skim") - else com.typesafe.config.ConfigFactory.parseString("skim{}") - ) + skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) ) } } - + case class Routing( - baseDate: java.lang.String, - carRouter: java.lang.String, - gh: BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS: scala.Int, - overrideNetworkTravelTimesUsingSkims: scala.Boolean, - r5: BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor: scala.Double, - startingIterationForTravelTimesMSA: scala.Int, - transitOnStreetNetwork: scala.Boolean, - writeRoutingStatistic: scala.Boolean + baseDate : java.lang.String, + carRouter : java.lang.String, + gh : BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS : scala.Int, + overrideNetworkTravelTimesUsingSkims : scala.Boolean, + r5 : BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor : scala.Double, + startingIterationForTravelTimesMSA : scala.Int, + transitOnStreetNetwork : scala.Boolean, + writeRoutingStatistic : scala.Boolean ) - object Routing { - case class Gh( - useAlternativeRoutes: scala.Boolean + useAlternativeRoutes : scala.Boolean ) - object Gh { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath: java.lang.String, - bikeLaneScaleFactor: scala.Double, - departureWindow: scala.Double, - directory: java.lang.String, - linkRadiusMeters: scala.Double, - mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples: scala.Int, - osmFile: java.lang.String, - osmMapdbFile: java.lang.String, - travelTimeNoiseFraction: scala.Double + bikeLaneLinkIdsFilePath : java.lang.String, + bikeLaneScaleFactor : scala.Double, + departureWindow : scala.Double, + directory : java.lang.String, + linkRadiusMeters : scala.Double, + mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples : scala.Int, + osmFile : java.lang.String, + osmMapdbFile : java.lang.String, + travelTimeNoiseFraction : scala.Double ) - object R5 { - case class MNetBuilder( - fromCRS: java.lang.String, - toCRS: java.lang.String + fromCRS : java.lang.String, + toCRS : java.lang.String ) - object MNetBuilder { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike: scala.Int + bike : scala.Int ) - object MaxDistanceLimitByModeInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = - if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = - if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( - if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") - else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") - ), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") - ), - numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmFile = - if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", - osmMapdbFile = - if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") - else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = - if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), + numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", + osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh( - if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") - ), - minimumPossibleSkimBasedTravelTimeInS = - if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) - c.getInt("minimumPossibleSkimBasedTravelTimeInS") - else 60, - overrideNetworkTravelTimesUsingSkims = - c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( - "overrideNetworkTravelTimesUsingSkims" - ), - r5 = BeamConfig.Beam.Routing.R5( - if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") - ), - skimTravelTimesScalingFactor = - if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = - if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") - else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), + minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, + overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), + r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), + skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric: BeamConfig.Beam.Sim.Metric, - termination: BeamConfig.Beam.Sim.Termination + metric : BeamConfig.Beam.Sim.Metric, + termination : BeamConfig.Beam.Sim.Termination ) - object Sim { - case class Metric( - collector: BeamConfig.Beam.Sim.Metric.Collector + collector : BeamConfig.Beam.Sim.Metric.Collector ) - object Metric { - case class Collector( - influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics: java.lang.String + influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics : java.lang.String ) - object Collector { - case class InfluxDbSimulationMetricCollector( - connectionString: java.lang.String, - database: java.lang.String + connectionString : java.lang.String, + database : java.lang.String ) - object InfluxDbSimulationMetricCollector { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = - if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = - BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - if (c.hasPathOrNull("influxDbSimulationMetricCollector")) - c.getConfig("influxDbSimulationMetricCollector") - else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") - ), - metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), + metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector( - if (c.hasPathOrNull("collector")) c.getConfig("collector") - else com.typesafe.config.ConfigFactory.parseString("collector{}") - ) + collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) ) } } - + case class Termination( - criterionName: java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName : java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) - object Termination { - case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration: scala.Int, - minLastIteration: scala.Int, - relativeTolerance: scala.Double + maxLastIteration : scala.Int, + minLastIteration : scala.Int, + relativeTolerance : scala.Double ) - object TerminateAtRideHailFleetStoredElectricityConvergence { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = - if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = - BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) - c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") - else - com.typesafe.config.ConfigFactory - .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") - ) + criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric( - if (c.hasPathOrNull("metric")) c.getConfig("metric") - else com.typesafe.config.ConfigFactory.parseString("metric{}") - ), - termination = BeamConfig.Beam.Sim.Termination( - if (c.hasPathOrNull("termination")) c.getConfig("termination") - else com.typesafe.config.ConfigFactory.parseString("termination{}") - ) + metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), + termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) ) } } - + case class Spatial( - boundingBoxBuffer: scala.Int, - localCRS: java.lang.String + boundingBoxBuffer : scala.Int, + localCRS : java.lang.String ) - object Spatial { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear ) - object Urbansim { - case class BackgroundODSkimsCreator( - calculationTimeoutHours: scala.Int, - enabled: scala.Boolean, - maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes: scala.Int, - peakHours: scala.Option[scala.List[scala.Double]], - routerType: java.lang.String, - skimsGeoType: java.lang.String, - skimsKind: java.lang.String + calculationTimeoutHours : scala.Int, + enabled : scala.Boolean, + maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes : scala.Int, + peakHours : scala.Option[scala.List[scala.Double]], + routerType : java.lang.String, + skimsGeoType : java.lang.String, + skimsKind : java.lang.String ) - object BackgroundODSkimsCreator { - case class MaxTravelDistanceInMeters( - bike: scala.Int, - walk: scala.Int + bike : scala.Int, + walk : scala.Int ) - object MaxTravelDistanceInMeters { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive: scala.Boolean, - transit: scala.Boolean, - walk: scala.Boolean + drive : scala.Boolean, + transit : scala.Boolean, + walk : scala.Boolean ) - object ModesToBuild { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = - if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") - ), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") - else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") - ), - numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), + numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes: scala.Double, - bike: scala.Double, - car: scala.Double, - drive_transit: scala.Double, - walk: scala.Double, - walk_transit: scala.Double + allModes : scala.Double, + bike : scala.Double, + car : scala.Double, + drive_transit : scala.Double, + walk : scala.Double, + walk_transit : scala.Double ) - object FractionOfModesToClear { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") - else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") - ), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( - if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") - else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") - ) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) ) } } - + case class WarmStart( - path: java.lang.String, - prepareData: scala.Boolean, - samplePopulationIntegerFlag: scala.Int, - skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type`: java.lang.String + path : java.lang.String, + prepareData : scala.Boolean, + samplePopulationIntegerFlag : scala.Int, + skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type` : java.lang.String ) - object WarmStart { - case class SkimsFilePaths$Elm( - skimType: java.lang.String, - skimsFilePath: java.lang.String + skimType : java.lang.String, + skimsFilePath : java.lang.String ) - object SkimsFilePaths$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if (c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = - if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = - if (c.hasPathOrNull("skimsFilePaths")) - scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) - else None, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if(c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim( - if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") - else com.typesafe.config.ConfigFactory.parseString("agentsim{}") - ), - calibration = BeamConfig.Beam.Calibration( - if (c.hasPathOrNull("calibration")) c.getConfig("calibration") - else com.typesafe.config.ConfigFactory.parseString("calibration{}") - ), - cluster = BeamConfig.Beam.Cluster( - if (c.hasPathOrNull("cluster")) c.getConfig("cluster") - else com.typesafe.config.ConfigFactory.parseString("cluster{}") - ), - debug = BeamConfig.Beam.Debug( - if (c.hasPathOrNull("debug")) c.getConfig("debug") - else com.typesafe.config.ConfigFactory.parseString("debug{}") - ), - exchange = BeamConfig.Beam.Exchange( - if (c.hasPathOrNull("exchange")) c.getConfig("exchange") - else com.typesafe.config.ConfigFactory.parseString("exchange{}") - ), - experimental = BeamConfig.Beam.Experimental( - if (c.hasPathOrNull("experimental")) c.getConfig("experimental") - else com.typesafe.config.ConfigFactory.parseString("experimental{}") - ), - input = BeamConfig.Beam.Input( - if (c.hasPathOrNull("input")) c.getConfig("input") - else com.typesafe.config.ConfigFactory.parseString("input{}") - ), - inputDirectory = - if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger( - if (c.hasPathOrNull("logger")) c.getConfig("logger") - else com.typesafe.config.ConfigFactory.parseString("logger{}") - ), - metrics = BeamConfig.Beam.Metrics( - if (c.hasPathOrNull("metrics")) c.getConfig("metrics") - else com.typesafe.config.ConfigFactory.parseString("metrics{}") - ), - output = BeamConfig.Beam.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - outputs = BeamConfig.Beam.Outputs( - if (c.hasPathOrNull("outputs")) c.getConfig("outputs") - else com.typesafe.config.ConfigFactory.parseString("outputs{}") - ), - physsim = BeamConfig.Beam.Physsim( - if (c.hasPathOrNull("physsim")) c.getConfig("physsim") - else com.typesafe.config.ConfigFactory.parseString("physsim{}") - ), - replanning = BeamConfig.Beam.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - router = BeamConfig.Beam.Router( - if (c.hasPathOrNull("router")) c.getConfig("router") - else com.typesafe.config.ConfigFactory.parseString("router{}") - ), - routing = BeamConfig.Beam.Routing( - if (c.hasPathOrNull("routing")) c.getConfig("routing") - else com.typesafe.config.ConfigFactory.parseString("routing{}") - ), - sim = BeamConfig.Beam.Sim( - if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") - ), - spatial = BeamConfig.Beam.Spatial( - if (c.hasPathOrNull("spatial")) c.getConfig("spatial") - else com.typesafe.config.ConfigFactory.parseString("spatial{}") - ), - urbansim = BeamConfig.Beam.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart( - if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") - else com.typesafe.config.ConfigFactory.parseString("warmStart{}") - ) + actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), + calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), + cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), + debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), + exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), + experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), + input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), + inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), + metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), + output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), + physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), + replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), + routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), + sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), + spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), + urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) ) } } - + case class Matsim( - conversion: BeamConfig.Matsim.Conversion, - modules: BeamConfig.Matsim.Modules + conversion : BeamConfig.Matsim.Conversion, + modules : BeamConfig.Matsim.Modules ) - object Matsim { - case class Conversion( - defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles: scala.Boolean, - matsimNetworkFile: java.lang.String, - osmFile: java.lang.String, - populationFile: java.lang.String, - scenarioDirectory: java.lang.String, - shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile: java.lang.String + defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles : scala.Boolean, + matsimNetworkFile : java.lang.String, + osmFile : java.lang.String, + populationFile : java.lang.String, + scenarioDirectory : java.lang.String, + shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile : java.lang.String ) - object Conversion { - case class DefaultHouseholdIncome( - currency: java.lang.String, - period: java.lang.String, - value: scala.Int + currency : java.lang.String, + period : java.lang.String, + value : scala.Int ) - object DefaultHouseholdIncome { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if (c.hasPathOrNull("period")) c.getString("period") else "year", - value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if(c.hasPathOrNull("period")) c.getString("period") else "year", + value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile: java.lang.String, - tazIdFieldName: java.lang.String + shapeFile : java.lang.String, + tazIdFieldName : java.lang.String ) - object ShapeConfig { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") - else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") - ), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = - if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = - if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = - if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") - else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( - if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") - else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") - ), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode: BeamConfig.Matsim.Modules.ChangeMode, - controler: BeamConfig.Matsim.Modules.Controler, - counts: BeamConfig.Matsim.Modules.Counts, - global: BeamConfig.Matsim.Modules.Global, - households: BeamConfig.Matsim.Modules.Households, - linkStats: BeamConfig.Matsim.Modules.LinkStats, - network: BeamConfig.Matsim.Modules.Network, - parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, - plans: BeamConfig.Matsim.Modules.Plans, - qsim: BeamConfig.Matsim.Modules.Qsim, - strategy: BeamConfig.Matsim.Modules.Strategy, - transit: BeamConfig.Matsim.Modules.Transit, - vehicles: BeamConfig.Matsim.Modules.Vehicles + changeMode : BeamConfig.Matsim.Modules.ChangeMode, + controler : BeamConfig.Matsim.Modules.Controler, + counts : BeamConfig.Matsim.Modules.Counts, + global : BeamConfig.Matsim.Modules.Global, + households : BeamConfig.Matsim.Modules.Households, + linkStats : BeamConfig.Matsim.Modules.LinkStats, + network : BeamConfig.Matsim.Modules.Network, + parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, + plans : BeamConfig.Matsim.Modules.Plans, + qsim : BeamConfig.Matsim.Modules.Qsim, + strategy : BeamConfig.Matsim.Modules.Strategy, + transit : BeamConfig.Matsim.Modules.Transit, + vehicles : BeamConfig.Matsim.Modules.Vehicles ) - object Modules { - case class ChangeMode( - modes: java.lang.String + modes : java.lang.String ) - object ChangeMode { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat: java.lang.String, - firstIteration: scala.Int, - lastIteration: scala.Int, - mobsim: java.lang.String, - outputDirectory: java.lang.String, - overwriteFiles: java.lang.String + eventsFileFormat : java.lang.String, + firstIteration : scala.Int, + lastIteration : scala.Int, + mobsim : java.lang.String, + outputDirectory : java.lang.String, + overwriteFiles : java.lang.String ) - object Controler { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = - if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Double, - inputCountsFile: java.lang.String, - outputformat: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Double, + inputCountsFile : java.lang.String, + outputformat : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem: java.lang.String, - randomSeed: scala.Int + coordinateSystem : java.lang.String, + randomSeed : scala.Int ) - object Global { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile: java.lang.String, - inputHouseholdAttributesFile: java.lang.String + inputFile : java.lang.String, + inputHouseholdAttributesFile : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = - if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = - if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") - else "/test/input/beamville/householdAttributes.xml" + inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations: scala.Int, - writeLinkStatsInterval: scala.Int + averageLinkStatsOverIterations : scala.Int, + writeLinkStatsInterval : scala.Int ) - object LinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = - if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = - if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile: java.lang.String + inputNetworkFile : java.lang.String ) - object Network { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = - if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") - else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents: scala.Int, - numberOfThreads: scala.Int, - oneThreadPerHandler: scala.Boolean, - synchronizeOnSimSteps: scala.Boolean + estimatedNumberOfEvents : scala.Int, + numberOfThreads : scala.Int, + oneThreadPerHandler : scala.Boolean, + synchronizeOnSimSteps : scala.Boolean ) - object ParallelEventHandling { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = - if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta: scala.Long, - earlyDeparture: scala.Long, - lateArrival: scala.Long, - learningRate: scala.Long, - parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing: scala.Long, - traveling: scala.Long, - waiting: scala.Long, - writeExperiencedPlans: scala.Boolean + BrainExpBeta : scala.Long, + earlyDeparture : scala.Long, + lateArrival : scala.Long, + learningRate : scala.Long, + parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing : scala.Long, + traveling : scala.Long, + waiting : scala.Long, + writeExperiencedPlans : scala.Boolean ) - object PlanCalcScore { - case class Parameterset$Elm( - activityType: java.lang.String, - priority: scala.Int, - scoringThisActivityAtAll: scala.Boolean, - `type`: java.lang.String, - typicalDuration: java.lang.String, - typicalDurationScoreComputation: java.lang.String + activityType : java.lang.String, + priority : scala.Int, + scoringThisActivityAtAll : scala.Boolean, + `type` : java.lang.String, + typicalDuration : java.lang.String, + typicalDurationScoreComputation : java.lang.String ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = - !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = - if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") - else "uniform" + activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = - if (c.hasPathOrNull("BrainExpBeta")) - c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) - else 2, - earlyDeparture = - if (c.hasPathOrNull("earlyDeparture")) - c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, - lateArrival = - if (c.hasPathOrNull("lateArrival")) - c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) - else -18, - learningRate = - if (c.hasPathOrNull("learningRate")) - c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) - else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = - if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) - else 6, - traveling = - if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) - else -6, - waiting = - if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, + BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, + earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, + learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, + traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, + waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.PlanCalcScore - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Plans( - inputPersonAttributesFile: java.lang.String, - inputPlansFile: java.lang.String + inputPersonAttributesFile : java.lang.String, + inputPlansFile : java.lang.String ) - object Plans { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = - if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") - else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = - if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") - else "/test/input/beamville/population.xml" + inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime: java.lang.String, - snapshotperiod: java.lang.String, - startTime: java.lang.String + endTime : java.lang.String, + snapshotperiod : java.lang.String, + startTime : java.lang.String ) - object Qsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1: scala.Int, - ModuleProbability_2: scala.Int, - ModuleProbability_3: scala.Int, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - fractionOfIterationsToDisableInnovation: scala.Int, - maxAgentPlanMemorySize: scala.Int, - parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval: java.lang.String + ModuleProbability_1 : scala.Int, + ModuleProbability_2 : scala.Int, + ModuleProbability_3 : scala.Int, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + fractionOfIterationsToDisableInnovation : scala.Int, + maxAgentPlanMemorySize : scala.Int, + parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval : java.lang.String ) - object Strategy { - case class Parameterset$Elm( - disableAfterIteration: scala.Int, - strategyName: java.lang.String, - `type`: java.lang.String, - weight: scala.Int + disableAfterIteration : scala.Int, + strategyName : java.lang.String, + `type` : java.lang.String, + weight : scala.Int ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getInt("fractionOfIterationsToDisableInnovation") - else 999999, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = - if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") - else "WorstPlanForRemovalSelector" - ) - } - - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" + ) + } + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.Strategy - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Transit( - transitModes: java.lang.String, - useTransit: scala.Boolean, - vehiclesFile: java.lang.String + transitModes : java.lang.String, + useTransit : scala.Boolean, + vehiclesFile : java.lang.String ) - object Transit { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile: java.lang.String + vehiclesFile : java.lang.String ) - object Vehicles { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode( - if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") - else com.typesafe.config.ConfigFactory.parseString("changeMode{}") - ), - controler = BeamConfig.Matsim.Modules.Controler( - if (c.hasPathOrNull("controler")) c.getConfig("controler") - else com.typesafe.config.ConfigFactory.parseString("controler{}") - ), - counts = BeamConfig.Matsim.Modules.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - global = BeamConfig.Matsim.Modules.Global( - if (c.hasPathOrNull("global")) c.getConfig("global") - else com.typesafe.config.ConfigFactory.parseString("global{}") - ), - households = BeamConfig.Matsim.Modules.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - linkStats = BeamConfig.Matsim.Modules.LinkStats( - if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") - else com.typesafe.config.ConfigFactory.parseString("linkStats{}") - ), - network = BeamConfig.Matsim.Modules.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( - if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") - else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") - ), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( - if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") - else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") - ), - plans = BeamConfig.Matsim.Modules.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - qsim = BeamConfig.Matsim.Modules.Qsim( - if (c.hasPathOrNull("qsim")) c.getConfig("qsim") - else com.typesafe.config.ConfigFactory.parseString("qsim{}") - ), - strategy = BeamConfig.Matsim.Modules.Strategy( - if (c.hasPathOrNull("strategy")) c.getConfig("strategy") - else com.typesafe.config.ConfigFactory.parseString("strategy{}") - ), - transit = BeamConfig.Matsim.Modules.Transit( - if (c.hasPathOrNull("transit")) c.getConfig("transit") - else com.typesafe.config.ConfigFactory.parseString("transit{}") - ), - vehicles = BeamConfig.Matsim.Modules.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) + changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), + controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), + counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), + households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), + network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), + plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), + strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), + transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), + vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion( - if (c.hasPathOrNull("conversion")) c.getConfig("conversion") - else com.typesafe.config.ConfigFactory.parseString("conversion{}") - ), - modules = BeamConfig.Matsim.Modules( - if (c.hasPathOrNull("modules")) c.getConfig("modules") - else com.typesafe.config.ConfigFactory.parseString("modules{}") - ) + conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), + modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam( - if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") - ), - matsim = BeamConfig.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ) + beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), + matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) ) } - private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - - private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - - private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { + private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ( - (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number] - ) throw $_expE(cv, "double") + if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - - private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { + private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException( - cv.origin.lineNumber + + new java.lang.RuntimeException(cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) - ) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) } - - private def $_str(cv: com.typesafe.config.ConfigValue) = + private def $_str(cv:com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } + diff --git a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala index 6e9f42fb58c..e823fbe113a 100644 --- a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala @@ -79,6 +79,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -121,6 +122,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) @@ -180,6 +182,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -254,6 +257,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -341,6 +345,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -395,6 +400,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index 1a802a6f45d..9542a0849c1 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -441,7 +441,8 @@ class ZonalParkingManagerSpec beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) assertParkingResponse( diff --git a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala index 077802adb18..c820b489620 100644 --- a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala @@ -18,7 +18,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { PricingModel("flatfee", inputCost.toString) match { case Some(PricingModel.FlatFee(cost)) => cost should equal(inputCost) - PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration) should equal( + PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration, 0.0) should equal( inputCost ) case _ => fail() @@ -31,7 +31,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { case Some(PricingModel.Block(cost, intervalInSeconds)) => cost should equal(100) intervalInSeconds should equal(PricingModel.DefaultPricingInterval) - PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration) should equal( + PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration, 0.0) should equal( inputCost * 2 ) case _ => fail() @@ -54,7 +54,8 @@ class PricingModelSpec extends AnyWordSpec with Matchers { inputCost.toDouble * (parkingDuration.toDouble / blockIntervalInSeconds.toDouble) PricingModel.evaluateParkingTicket( PricingModel.Block(cost, intervalInSeconds), - parkingDuration + parkingDuration, + 0.0 ) should equal( expectedTicketPrice ) From 8119b5608d1d00618061329e38035e78b22e2b47 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 8 Mar 2022 13:07:45 -0800 Subject: [PATCH 027/307] less HOV trace --- .../beam/utils/scenario/urbansim/HOVModeTransformer.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala b/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala index b8a12725701..aad7bdeb093 100644 --- a/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala +++ b/src/main/scala/beam/utils/scenario/urbansim/HOVModeTransformer.scala @@ -225,9 +225,9 @@ object HOVModeTransformer extends LazyLogging { if (cantSplitTripsForPersons.nonEmpty) { logger.info( - "Cannot split plans to trips because plans does not start and end by Home activity for {} persons: {}", + "Cannot split plans to trips because plans does not start and end by Home activity for {} persons including: {}", cantSplitTripsForPersons.size, - cantSplitTripsForPersons.mkString(",") + cantSplitTripsForPersons.take(10).mkString(",") ) } From 77d05689a5dec7f705b02ee7fe90ed1818bb8a7e Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 8 Mar 2022 14:23:08 -0800 Subject: [PATCH 028/307] moving away from Init to actual activities --- .../agents/household/HouseholdActor.scala | 29 ++++++++++++------- .../household/HouseholdFleetManager.scala | 12 ++++---- .../infrastructure/ParkingInquiry.scala | 12 ++++---- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index ecb93566833..a5d2f8cd971 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -22,6 +22,7 @@ import beam.agentsim.agents.vehicles.VehicleCategory.{Bike, Car, VehicleCategory import beam.agentsim.agents.vehicles._ import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.ChargingNetworkManager.ChargingPlugRequest +import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.HasTriggerId @@ -188,10 +189,9 @@ object HouseholdActor { private var cavPassengerSchedules: Map[BeamVehicle, PassengerSchedule] = Map() private var personAndActivityToCav: Map[(Id[Person], Activity), BeamVehicle] = Map() private var personAndActivityToLegs: Map[(Id[Person], Activity), List[BeamLeg]] = Map() - private var householdMembersToLocationTypeAndLocation: Map[Id[Person], (String, Coord)] = Map() + private var householdMembersToLocationTypeAndLocation: Map[Id[Person], (ParkingActivityType, String, Coord)] = Map() private val trackingVehicleAssignmentAtInitialization = mutable.HashMap.empty[Id[BeamVehicle], Id[Person]] private val vehicleCategories = List(Car, Bike) - private val mainActivities = List("Home", "Work") private val realDistribution: UniformRealDistribution = new UniformRealDistribution() realDistribution.reseedRandomGenerator(beamScenario.beamConfig.matsim.modules.global.randomSeed) @@ -203,14 +203,18 @@ object HouseholdActor { .flatMap(person => person.getSelectedPlan.getPlanElements.asScala.headOption .flatMap { - case act: Activity if mainActivities.contains(act.getType) => - Some(person.getId -> (act.getType, act.getCoord)) + case act: Activity => + Some( + person.getId -> (ParkingInquiry.activityTypeStringToEnum(act.getType), act.getType, act.getCoord) + ) case _ => None } ) .toMap - if (!householdMembersToLocationTypeAndLocation.exists(_._2._1 == "Home")) - householdMembersToLocationTypeAndLocation ++= Map(Id.createPersonId("") -> ("Home", fallbackHomeCoord)) + if (!householdMembersToLocationTypeAndLocation.exists(_._2._1 == ParkingActivityType.Home)) + householdMembersToLocationTypeAndLocation ++= Map( + Id.createPersonId("") -> (ParkingActivityType.Home, "Home", fallbackHomeCoord) + ) val vehiclesByCategory = vehicles.filter(_._2.beamVehicleType.automationLevel <= 3).groupBy(_._2.beamVehicleType.vehicleCategory) @@ -244,7 +248,8 @@ object HouseholdActor { var cavs = vehicles.values.filter(_.beamVehicleType.automationLevel > 3).toList if (cavs.nonEmpty) { - val workingPersonsList = householdMembersToLocationTypeAndLocation.filter(_._2._1 == "Work").keys.toBuffer + val workingPersonsList = + householdMembersToLocationTypeAndLocation.filter(_._2._1 == ParkingActivityType.Work).keys.toBuffer // log.debug("Household {} has {} CAVs and will do some planning", household.getId, cavs.size) cavs.foreach { cav => val cavDriverRef: ActorRef = context.actorOf( @@ -270,11 +275,12 @@ object HouseholdActor { if (workingPersonsList.nonEmpty) workingPersonsList.remove(0) else householdMembersToLocationTypeAndLocation - .find(_._2._1 == "Home") + .find(_._2._1 == ParkingActivityType.Home) .map(_._1) .getOrElse(householdMembersToLocationTypeAndLocation.keys.head) trackingVehicleAssignmentAtInitialization.put(cav.id, personId) - cav.spaceTime = SpaceTime(householdMembersToLocationTypeAndLocation(personId)._2, 0) + val (_, _, location) = householdMembersToLocationTypeAndLocation(personId) + cav.spaceTime = SpaceTime(location, 0) schedulerRef ! ScheduleTrigger(InitializeTrigger(0), cavDriverRef) cav.setManager(Some(self)) cav.becomeDriver(cavDriverRef) @@ -549,9 +555,10 @@ object HouseholdActor { def sendParkingOrChargingInquiry(vehicle: BeamVehicle, triggerId: Long): Future[Any] = { val personId = trackingVehicleAssignmentAtInitialization(vehicle.id) + val (_, activityType, location) = householdMembersToLocationTypeAndLocation(personId) val inquiry = ParkingInquiry.init( - SpaceTime(householdMembersToLocationTypeAndLocation(personId)._2, 0), - "init", + SpaceTime(location, 0), + activityType, VehicleManager.getReservedFor(vehicle.vehicleManagerId.get).get, beamVehicle = Option(vehicle), triggerId = triggerId diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 9237503fa9b..7418d7b33db 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -13,6 +13,7 @@ import beam.agentsim.agents.modalbehaviors.DrivesVehicle.ActualVehicle import beam.agentsim.agents.vehicles.{BeamVehicle, VehicleManager} import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.ChargingNetworkManager._ +import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.CompletionNotice import beam.agentsim.scheduler.HasTriggerId @@ -31,7 +32,7 @@ class HouseholdFleetManager( parkingManager: ActorRef, chargingNetworkManager: ActorRef, vehicles: Map[Id[BeamVehicle], BeamVehicle], - homeAndStartingWorkLocations: Map[Id[Person], (String, Coord)], + homeAndStartingWorkLocations: Map[Id[Person], (ParkingActivityType, String, Coord)], maybeEmergencyHouseholdVehicleGenerator: Option[EmergencyHouseholdVehicleGenerator] )(implicit val debug: Debug) extends LoggingMessageActor @@ -77,19 +78,20 @@ class HouseholdFleetManager( val listOfFutures: List[Future[(Id[BeamVehicle], ParkingInquiryResponse)]] = { // Request that all household vehicles be parked at the home coordinate. If the vehicle is an EV, // send the request to the charging manager. Otherwise send request to the parking manager. - val workingPersonsList = homeAndStartingWorkLocations.filter(_._2._1 == "Work").keys.toBuffer + val workingPersonsList = homeAndStartingWorkLocations.filter(_._2._1 == ParkingActivityType.Work).keys.toBuffer vehicles.toList.map { case (id, vehicle) => val personId: Id[Person] = if (workingPersonsList.nonEmpty) workingPersonsList.remove(0) else homeAndStartingWorkLocations - .find(_._2._1 == "Home") + .find(_._2._1 == ParkingActivityType.Home) .map(_._1) .getOrElse(homeAndStartingWorkLocations.keys.head) trackingVehicleAssignmentAtInitialization.put(vehicle.id, personId) + val (_, activityType, location) = homeAndStartingWorkLocations(personId) val inquiry = ParkingInquiry.init( - SpaceTime(homeAndStartingWorkLocations(personId)._2, 0), - "init", + SpaceTime(location, 0), + activityType, VehicleManager.getReservedFor(vehicle.vehicleManagerId.get).get, beamVehicle = Option(vehicle), triggerId = triggerId diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala index dd8f9429318..b9f543c6681 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala @@ -72,11 +72,13 @@ object ParkingInquiry extends LazyLogging { def activityTypeStringToEnum(activityType: String): ParkingActivityType = { activityType.toLowerCase match { - case "home" => ParkingActivityType.Home - case "init" => ParkingActivityType.Init - case "work" => ParkingActivityType.Work - case "charge" => ParkingActivityType.Charge - case "wherever" => ParkingActivityType.Wherever + case "home" => ParkingActivityType.Home + case "init" => ParkingActivityType.Init + case "work" => ParkingActivityType.Work + case "charge" => ParkingActivityType.Charge + case "wherever" => ParkingActivityType.Wherever + case otherType if otherType.contains("home") => ParkingActivityType.Home + case otherType if otherType.contains("work") => ParkingActivityType.Work case otherType => logger.debug(s"This Parking Activity Type ($otherType) has not been defined") ParkingActivityType.Wherever From 0dc9412cbf05d10008a19079b566600a57b6b955 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 8 Mar 2022 15:09:10 -0800 Subject: [PATCH 029/307] rolling back fix to large runs --- .../InfrastructureFunctions.scala | 53 ++----------------- .../infrastructure/ParkingFunctions.scala | 24 ++++----- .../parking/ParkingZoneSearch.scala | 44 ++++----------- test/input/beamville/beam.conf | 26 --------- 4 files changed, 26 insertions(+), 121 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 8344edaf025..455e4cddda8 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -1,8 +1,7 @@ package beam.agentsim.infrastructure import beam.agentsim.agents.choice.logit.UtilityFunctionOperation -import beam.agentsim.agents.vehicles.VehicleManager -import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.ParkingZone.UbiqiutousParkingAvailability import beam.agentsim.infrastructure.parking.ParkingZoneSearch.{ @@ -34,49 +33,11 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( seed: Int ) extends StrictLogging { - protected val ( - parkingZonesAggregated: Map[Id[ParkingZoneId], ParkingZone[GEO]], - aggregatedZonesToAllZones: Map[Id[ParkingZoneId], Array[Id[ParkingZoneId]]] - ) = { - val groupedZones = parkingZones - .map { - case (_, parkingZone) if parkingZone.reservedFor.managerType == VehicleManager.TypeEnum.Household => - (parkingZone, VehicleManager.createOrGetReservedFor("generic-hh", VehicleManager.TypeEnum.Household)) - case (_, parkingZone) => (parkingZone, parkingZone.reservedFor) - } - .groupBy { case (parkingZone, reservedFor) => - ( - parkingZone.geoId, - parkingZone.parkingType, - parkingZone.chargingPointType, - parkingZone.pricingModel, - reservedFor - ) - } - .map { case ((geoId, parkingType, chargingPointType, pricingModel, reservedFor), zones) => - val zone = ParkingZone.init( - None, - geoId, - parkingType, - reservedFor, - zones.map(_._1.maxStalls).sum, - chargingPointType, - pricingModel - ) - (zone, zones) - } - val aggregatedZones = groupedZones.map { case (zone, _) => zone.parkingZoneId -> zone } - val mappedZones = groupedZones.map { case (zone, zones) => - zone.parkingZoneId -> zones.map(_._1.parkingZoneId).toArray - } - (aggregatedZones, mappedZones) - } + protected val zoneSearchTree: ParkingZoneSearch.ZoneSearchTree[GEO] = + ParkingZoneFileUtils.createZoneSearchTree(parkingZones.values.toSeq) protected val mnlMultiplierParameters: Map[ParkingMNL.Parameters, UtilityFunctionOperation] - protected lazy val zoneSearchTree: ParkingZoneSearch.ZoneSearchTree[GEO] = - ParkingZoneFileUtils.createZoneSearchTree(parkingZonesAggregated.values.toSeq) - /** * Generic method for updating MNL Parameters * @param parkingAlternative ParkingAlternative @@ -162,14 +123,10 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( inquiry.searchMode, mnlMultiplierParameters, zoneSearchTree, - parkingZonesAggregated, - parkingZonesAggregated.map { case (zoneId, _) => - zoneId -> aggregatedZonesToAllZones(zoneId).map(parkingZones(_)) - }, + parkingZones, geoQuadTree, new Random(seed), - inquiry.departureLocation, - inquiry.reservedFor + inquiry.departureLocation ) val closestZone = diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index e60a2bc284b..96603ea2957 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -218,25 +218,21 @@ class ParkingFunctions[GEO: GeoLevel]( inquiry: ParkingInquiry, preferredParkingTypes: Set[ParkingType] ): Boolean = { - val originalZones = aggregatedZonesToAllZones(zone.parkingZoneId).map(parkingZones) + val hasAvailability: Boolean = parkingZones(zone.parkingZoneId).stallsAvailable > 0 - val isValidVehicleManager = zone.reservedFor.managerType match { - case VehicleManager.TypeEnum.Default => !inquiry.beamVehicle.exists(_.isCAV) - case VehicleManager.TypeEnum.NoManager => false - case _ => originalZones.exists(_.reservedFor == inquiry.reservedFor) - } + val validParkingType: Boolean = preferredParkingTypes.contains(zone.parkingType) - val isValidParkingType: Boolean = preferredParkingTypes.contains(zone.parkingType) + val isValidTime = inquiry.beamVehicle.forall(vehicle => + zone.timeRestrictions + .get(vehicle.beamVehicleType.vehicleCategory) + .forall(_.contains(inquiry.destinationUtm.time % (24 * 3600))) + ) - val hasAvailability = originalZones.exists { z => - z.stallsAvailable > 0 && inquiry.beamVehicle.forall(vehicle => - z.timeRestrictions - .get(vehicle.beamVehicleType.vehicleCategory) - .forall(_.contains(inquiry.destinationUtm.time % (24 * 3600))) - ) + val isValidVehicleManager = inquiry.beamVehicle.forall { vehicle => + zone.reservedFor.managerType == VehicleManager.TypeEnum.Default || zone.reservedFor.managerId == inquiry.reservedFor.managerId } - hasAvailability & isValidParkingType & isValidVehicleManager + hasAvailability & validParkingType & isValidTime & isValidVehicleManager } /** diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 0cc83830ab2..7749313afe3 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -1,8 +1,6 @@ package beam.agentsim.infrastructure.parking import beam.agentsim.agents.choice.logit.MultinomialLogit -import beam.agentsim.agents.vehicles.VehicleManager -import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode import beam.agentsim.infrastructure.ParkingStall import beam.agentsim.infrastructure.charging._ @@ -60,7 +58,7 @@ object ParkingZoneSearch { * @param parkingDuration duration of the activity agent wants to park for * @param parkingMNLConfig utility function which evaluates [[ParkingAlternative]]s * @param zoneSearchTree a nested map lookup of [[ParkingZone]]s - * @param aggregatedParkingZones the stored state of all [[ParkingZone]]s + * @param parkingZones the stored state of all [[ParkingZone]]s * @param zoneQuadTree [[ParkingZone]]s are associated with a TAZ, which are themselves stored in this Quad Tree * @param random random number generator * @param parkingTypes the list of acceptable parking types allowed for this search @@ -71,12 +69,10 @@ object ParkingZoneSearch { searchMode: ParkingSearchMode, parkingMNLConfig: ParkingMNL.ParkingMNLConfig, zoneSearchTree: ZoneSearchTree[GEO], - aggregatedParkingZones: Map[Id[ParkingZoneId], ParkingZone[GEO]], - aggregatedToAllZones: Map[Id[ParkingZoneId], Array[ParkingZone[GEO]]], + parkingZones: Map[Id[ParkingZoneId], ParkingZone[GEO]], zoneQuadTree: QuadTree[GEO], random: Random, originUTM: Option[Location], - reservedFor: ReservedFor, parkingTypes: Seq[ParkingType] = ParkingType.AllTypes ) @@ -163,10 +159,11 @@ object ParkingZoneSearch { parkingType <- params.parkingTypes parkingZoneIds <- parkingTypesSubtree.get(parkingType).toList parkingZoneId <- parkingZoneIds - parkingZone <- ParkingZone.getParkingZone(params.aggregatedParkingZones, parkingZoneId) + parkingZone <- ParkingZone.getParkingZone(params.parkingZones, parkingZoneId) if parkingZoneFilterFunction(parkingZone) } yield { - + // wrap ParkingZone in a ParkingAlternative + val stallLocation: Coord = parkingZoneLocSamplingFunction(parkingZone) val stallPriceInDollars: Double = parkingZone.pricingModel match { case None => 0 @@ -175,33 +172,14 @@ object ParkingZoneSearch { case Some(pricingModel) => PricingModel.evaluateParkingTicket(pricingModel, params.parkingDuration.toInt) } - - // wrap "original" ParkingZones in a ParkingAlternative - // as the aggregated ParkingZones serve as higher level of abstraction to speed up the search - val Some((originalZone, stallLocation, distance)) = params - .aggregatedToAllZones(parkingZone.parkingZoneId) - .foldLeft[Option[(ParkingZone[GEO], Location, Double)]](None) { case (acc, z) => - val stallLocation: Coord = parkingZoneLocSamplingFunction(parkingZone) - val distance: Double = config.distanceFunction(params.destinationUTM, stallLocation) - val validManagerType = - z.reservedFor.managerType == VehicleManager.TypeEnum.Default || z.reservedFor == params.reservedFor - if (z.stallsAvailable > 0 && validManagerType && (acc.isEmpty || acc.exists(_._3 > distance))) - Some((z, stallLocation, distance)) - else acc - } - val parkingAlternative: ParkingAlternative[GEO] = - ParkingAlternative( - zone, - originalZone.parkingType, - originalZone, - stallLocation, - stallPriceInDollars - ) - val parkingAlternativeUtility: Map[ParkingMNL.Parameters, Double] = parkingZoneMNLParamsFunction( - parkingAlternative + ParkingAlternative(zone, parkingZone.parkingType, parkingZone, stallLocation, stallPriceInDollars) + val parkingAlternativeUtility: Map[ParkingMNL.Parameters, Double] = + parkingZoneMNLParamsFunction(parkingAlternative) + ParkingSearchAlternative( + parkingAlternative, + parkingAlternativeUtility ) - ParkingSearchAlternative(parkingAlternative, parkingAlternativeUtility) } } diff --git a/test/input/beamville/beam.conf b/test/input/beamville/beam.conf index 9735307d689..47bde83a52f 100755 --- a/test/input/beamville/beam.conf +++ b/test/input/beamville/beam.conf @@ -218,32 +218,6 @@ beam.physsim.linkStatsWriteInterval = 0 # The remaining params customize how events are written to output files beam.outputs.events.fileOutputFormats = "csv,xml" # valid options: xml(.gz) , csv(.gz), none - DEFAULT: csv.gz -beam.agentsim.chargingNetworkManager { - timeStepInSeconds = 300 - chargingPointCountScalingFactor = 1.0 - chargingPointCostScalingFactor = 1.0 - scaleUp { - enabled = true - expansionFactor_home_activity = 10.0 - expansionFactor_work_activity = 10.0 - expansionFactor_charge_activity = 10.0 - expansionFactor_wherever_activity = 10.0 - expansionFactor_init_activity = 10.0 - } - helics { - connectionEnabled = false - feedbackEnabled = false - coreInitString = "--federates=1 --broker_address=tcp://127.0.0.1" - coreType = "zmq" - timeDeltaProperty = 1.0 - intLogLevel = 1 - federateName = "beamFederate" - dataOutStreamPoint = "chargingLoad" - dataInStreamPoint = "beam_to_pydss_federate/pubs_power_limit_and_lpm_control" - bufferSize = 10000000 - } -} - # Events Writing Logging Levels: beam.outputs.events.eventsToWrite = "PersonDepartureEvent,PersonArrivalEvent,ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,TeleportationEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent" beam.outputs.stats.binSize = 3600 From da78f17db664648e1c38736fbb8ef86ac992f267 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 9 Mar 2022 01:56:27 -0800 Subject: [PATCH 030/307] bring all changes --- src/main/resources/beam-template.conf | 1 + .../agents/household/HouseholdActor.scala | 5 +- .../household/HouseholdFleetManager.scala | 5 +- .../DefaultRideHailDepotParkingManager.scala | 3 +- .../infrastructure/ChargingFunctions.scala | 70 +- .../infrastructure/ChargingNetwork.scala | 3 +- .../ChargingNetworkManager.scala | 6 +- .../DefaultRidehailFunctions.scala | 6 +- .../HierarchicalParkingManager.scala | 10 +- .../InfrastructureFunctions.scala | 8 +- .../infrastructure/InfrastructureUtils.scala | 3 +- .../ParallelParkingManager.scala | 9 +- .../infrastructure/ParkingFunctions.scala | 45 +- .../infrastructure/ParkingInquiry.scala | 1 + .../ParkingManagerBenchmark.scala | 1 + .../infrastructure/ZonalParkingManager.scala | 12 +- .../parking/ParkingZoneSearch.scala | 13 +- .../infrastructure/parking/PricingModel.scala | 11 +- .../scala/beam/sim/config/BeamConfig.scala | 5537 ++++++----------- .../HierarchicalParkingManagerSpec.scala | 6 + .../ZonalParkingManagerSpec.scala | 3 +- .../parking/PricingModelSpec.scala | 7 +- 22 files changed, 2112 insertions(+), 3653 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 64c1b3039b7..3af7c6a7805 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -167,6 +167,7 @@ beam.agentsim.agents.parking.rangeAnxietyBuffer = "double | 20000.0" # if our re beam.agentsim.agents.parking.minSearchRadius = "double | 250.00" # something small enough that, on average, we see 2 orders of magnitude of samples at most beam.agentsim.agents.parking.maxSearchRadius = "double | 8046.72" # something large enough that we do not strand our drivers in an oasis beam.agentsim.agents.parking.searchMaxDistanceRelativeToEllipseFoci = "double | 4.0" # something large enough that we do not travel longer than the actual distance to destination +beam.agentsim.agents.parking.estimatedMinParkingDuration = "double | 60.0" # in seconds, something small enough but has meaningful impact on pricing #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index a5d2f8cd971..8a2f6fde597 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -22,7 +22,7 @@ import beam.agentsim.agents.vehicles.VehicleCategory.{Bike, Car, VehicleCategory import beam.agentsim.agents.vehicles._ import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.ChargingNetworkManager.ChargingPlugRequest -import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.HasTriggerId @@ -561,7 +561,8 @@ object HouseholdActor { activityType, VehicleManager.getReservedFor(vehicle.vehicleManagerId.get).get, beamVehicle = Option(vehicle), - triggerId = triggerId + triggerId = triggerId, + searchMode = ParkingSearchMode.Init ) if (vehicle.isEV) chargingNetworkManager ? inquiry else parkingManager ? inquiry } diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 7418d7b33db..05923c1978f 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -13,7 +13,7 @@ import beam.agentsim.agents.modalbehaviors.DrivesVehicle.ActualVehicle import beam.agentsim.agents.vehicles.{BeamVehicle, VehicleManager} import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.ChargingNetworkManager._ -import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.CompletionNotice import beam.agentsim.scheduler.HasTriggerId @@ -94,7 +94,8 @@ class HouseholdFleetManager( activityType, VehicleManager.getReservedFor(vehicle.vehicleManagerId.get).get, beamVehicle = Option(vehicle), - triggerId = triggerId + triggerId = triggerId, + searchMode = ParkingSearchMode.Init ) if (vehicle.isEV) (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) else (parkingManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) diff --git a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala index c2bde51ce2f..11bd1611a9d 100644 --- a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala @@ -373,7 +373,8 @@ object DefaultRideHailDepotParkingManager { beamServices.beamConfig.matsim.modules.global.randomSeed, beamServices.beamScenario.fuelTypePrices, beamServices.beamConfig.beam.agentsim.agents.rideHail, - beamServices.skims + beamServices.skims, + beamServices.beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 6d07e2473a0..a66f885e35d 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -2,7 +2,7 @@ package beam.agentsim.infrastructure import beam.agentsim.agents.vehicles.FuelType.FuelType import beam.agentsim.agents.vehicles.{BeamVehicle, BeamVehicleType, VehicleManager} -import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.ParkingZoneSearch.{ParkingAlternative, ParkingZoneSearchResult} import beam.agentsim.infrastructure.parking._ @@ -30,7 +30,8 @@ class ChargingFunctions[GEO: GeoLevel]( seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, skims: Option[Skims], - fuelPrice: Map[FuelType, Double] + fuelPrice: Map[FuelType, Double], + estimatedMinParkingDuration: Double ) extends ParkingFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -43,7 +44,8 @@ class ChargingFunctions[GEO: GeoLevel]( enrouteDuration, boundingBox, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) { /** @@ -76,6 +78,16 @@ class ChargingFunctions[GEO: GeoLevel]( } } + def ifOvernightStayThenSlowChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { + if ( + inquiry.searchMode == ParkingSearchMode.Init || List(ParkingActivityType.Home, ParkingActivityType.Work).contains( + inquiry.parkingActivityType + ) + ) { + !ChargingPointType.isFastCharger(zone.chargingPointType.get) + } else true + } + /** * Method that verifies if the vehicle has valid charging capability * @param zone ParkingZone @@ -107,10 +119,11 @@ class ChargingFunctions[GEO: GeoLevel]( val isEV: Boolean = inquiry.beamVehicle.forall(_.isEV) val rideHailFastChargingOnly: Boolean = ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone, inquiry) val enrouteFastChargingOnly: Boolean = ifEnrouteThenFastChargingOnly(zone, inquiry) + val overnightStaySlowChargingOnly: Boolean = ifOvernightStayThenSlowChargingOnly(zone, inquiry) val validChargingCapability: Boolean = hasValidChargingCapability(zone, inquiry.beamVehicle) val preferredParkingTypes = getPreferredParkingTypes(inquiry) val canCarParkHere: Boolean = canThisCarParkHere(zone, inquiry, preferredParkingTypes) - isEV && rideHailFastChargingOnly && validChargingCapability && canCarParkHere && enrouteFastChargingOnly + isEV && rideHailFastChargingOnly && validChargingCapability && canCarParkHere && enrouteFastChargingOnly && overnightStaySlowChargingOnly } /** @@ -123,7 +136,7 @@ class ChargingFunctions[GEO: GeoLevel]( parkingAlternative: ParkingAlternative[GEO], inquiry: ParkingInquiry ): Map[ParkingMNL.Parameters, Double] = { - val parkingParameters = inquiry.searchMode match { + val enrouteFactor: Double = inquiry.searchMode match { case ParkingSearchMode.EnRoute => val beamVehicle = inquiry.beamVehicle.get val origin = inquiry.originUtm.getOrElse( @@ -136,11 +149,50 @@ class ChargingFunctions[GEO: GeoLevel]( origin.time + travelTime1, beamVehicle.beamVehicleType ) - val enrouteFactor: Double = (travelTime1 + travelTime2) * inquiry.valueOfTime - Map(ParkingMNL.Parameters.EnrouteDetourCost -> enrouteFactor) - case _ => Map() + (travelTime1 + travelTime2) * inquiry.valueOfTime + case _ => 0.0 + } + + // end-of-day parking durations are set to zero, which will be mis-interpreted here + val tempParkingDuration = inquiry.searchMode match { + case ParkingSearchMode.EnRoute => enrouteDuration.toInt + case _ => inquiry.parkingDuration.toInt } - super[ParkingFunctions].setupMNLParameters(parkingAlternative, inquiry) ++ parkingParameters + val parkingDuration: Option[Int] = + if (tempParkingDuration < estimatedMinParkingDuration) + Some(estimatedMinParkingDuration.toInt) // at least a small duration of charging + else Some(tempParkingDuration) + + val addedEnergy: Double = + inquiry.beamVehicle match { + case Some(beamVehicle) => + parkingAlternative.parkingZone.chargingPointType match { + case Some(chargingPoint) => + val (_, addedEnergy) = ChargingPointType.calculateChargingSessionLengthAndEnergyInJoule( + chargingPoint, + beamVehicle.primaryFuelLevelInJoules, + beamVehicle.beamVehicleType.primaryFuelCapacityInJoule, + 1e6, + 1e6, + parkingDuration + ) + addedEnergy + case None => 0.0 // no charger here + } + case None => 0.0 // no beamVehicle, assume agent has range + } + + val rangeAnxietyFactor: Double = + inquiry.remainingTripData + .map { + _.rangeAnxiety(withAddedFuelInJoules = addedEnergy) + } + .getOrElse(0.0) // default no anxiety if no remaining trip data provided + + super[ParkingFunctions].setupMNLParameters(parkingAlternative, inquiry) ++ Map( + ParkingMNL.Parameters.EnrouteDetourCost -> enrouteFactor, + ParkingMNL.Parameters.RangeAnxietyCost -> rangeAnxietyFactor + ) } /** diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index bca09474253..acece6d2905 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -173,7 +173,8 @@ object ChargingNetwork extends LazyLogging { beamConfig.matsim.modules.global.randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, skims, - fuelPrice + fuelPrice, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 51b198671a4..6d63f0f41b1 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -10,7 +10,7 @@ import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.{NotApplicable, ShiftStatus} import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingStatus, ChargingVehicle} -import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.EnRoute +import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.{Destination, EnRoute, Init} import beam.agentsim.infrastructure.power.{PowerController, SitePowerManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger.TriggerWithId @@ -162,7 +162,9 @@ class ChargingNetworkManager( val activityType = vehicle2InquiryMap .get(vehicle.id) .map { - case ParkingInquiry(_, _, _, _, _, _, _, _, _, _, `EnRoute`, _, _) => EnRoute.toString + case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, searchMode, _, _) + if searchMode != Destination => + searchMode.toString + "-" + activityType case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, _, _, _) => activityType } .getOrElse("") diff --git a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala index 91817fa70dc..358f1d35817 100644 --- a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala @@ -33,7 +33,8 @@ class DefaultRidehailFunctions[GEO: GeoLevel]( seed: Int, fuelTypePrices: Map[FuelType, Double], rideHailConfig: BeamConfig.Beam.Agentsim.Agents.RideHail, - skims: Skims + skims: Skims, + estimatedMinParkingDuration: Double ) extends InfrastructureFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -45,7 +46,8 @@ class DefaultRidehailFunctions[GEO: GeoLevel]( 0.0, 0.0, boundingBox, - seed + seed, + estimatedMinParkingDuration ) { private val vehicleIdToEndRefuelTick: mutable.Map[VehicleId, Int] = mutable.Map.empty[VehicleId, Int] diff --git a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala index 4926515fe73..bf25bdce849 100644 --- a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala @@ -37,6 +37,7 @@ class HierarchicalParkingManager( boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double, checkThatNumberOfStallsMatch: Boolean = false ) extends ParkingNetwork[Link](parkingZones) { @@ -72,7 +73,8 @@ class HierarchicalParkingManager( 0.0, boundingBox, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) val DefaultParkingZone: ParkingZone[Link] = @@ -279,6 +281,7 @@ object HierarchicalParkingManager { boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork[Link] = { new HierarchicalParkingManager( @@ -291,6 +294,7 @@ object HierarchicalParkingManager { boundingBox, seed, mnlParkingConfig, + estimatedMinParkingDuration, checkThatNumberOfStallsMatch ) } @@ -305,6 +309,7 @@ object HierarchicalParkingManager { boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork[Link] = HierarchicalParkingManager( @@ -317,6 +322,7 @@ object HierarchicalParkingManager { boundingBox, seed, mnlParkingConfig, + estimatedMinParkingDuration, checkThatNumberOfStallsMatch ) @@ -399,7 +405,7 @@ object HierarchicalParkingManager { } .filter { case (_, _, maxStalls) => maxStalls > 0 } .zipWithIndex - .map { case ((linkId, description, maxStalls), id) => + .map { case ((linkId, description, maxStalls), _) => val numStalls = Math.min(maxStalls, Int.MaxValue).toInt val parkingZone = ParkingZone.init[Link]( None, diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 455e4cddda8..fdc82fd10af 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -1,7 +1,7 @@ package beam.agentsim.infrastructure import beam.agentsim.agents.choice.logit.UtilityFunctionOperation -import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} +import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.ParkingZone.UbiqiutousParkingAvailability import beam.agentsim.infrastructure.parking.ParkingZoneSearch.{ @@ -30,7 +30,8 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( searchMaxDistanceRelativeToEllipseFoci: Double, enrouteDuration: Double, boundingBox: Envelope, - seed: Int + seed: Int, + estimatedMinParkingDuration: Double ) extends StrictLogging { protected val zoneSearchTree: ParkingZoneSearch.ZoneSearchTree[GEO] = @@ -98,7 +99,8 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( searchMaxDistanceRelativeToEllipseFoci, boundingBox, distanceFunction, - enrouteDuration + enrouteDuration, + estimatedMinParkingDuration ) def searchForParkingStall(inquiry: ParkingInquiry): Option[ParkingZoneSearch.ParkingZoneSearchResult[GEO]] = { diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala index e261ff6c806..39f9ca2f808 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala @@ -181,7 +181,8 @@ object InfrastructureUtils extends LazyLogging { beamConfig.beam.agentsim.agents.parking.maxSearchRadius, envelopeInUTM, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) case "PARALLEL" => ParallelParkingManager.init( diff --git a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala index 8424d2d3266..a9620e19d2a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala @@ -39,7 +39,8 @@ class ParallelParkingManager( minSearchRadius: Double, maxSearchRadius: Double, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ) extends ParkingNetwork[TAZ](parkingZones) { override protected val searchFunctions: Option[InfrastructureFunctions[TAZ]] = None @@ -73,7 +74,8 @@ class ParallelParkingManager( minSearchRadius, maxSearchRadius, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) Worker(parkingNetwork, cluster) } @@ -182,7 +184,8 @@ object ParallelParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 96603ea2957..8406f02e629 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -3,7 +3,6 @@ package beam.agentsim.infrastructure import beam.agentsim.agents.choice.logit.UtilityFunctionOperation import beam.agentsim.agents.vehicles.VehicleManager import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} -import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.ParkingZoneSearch.{ParkingAlternative, ParkingZoneSearchResult} import beam.agentsim.infrastructure.parking._ import beam.agentsim.infrastructure.taz.TAZ @@ -26,7 +25,8 @@ class ParkingFunctions[GEO: GeoLevel]( enrouteDuration: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ) extends InfrastructureFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -38,7 +38,8 @@ class ParkingFunctions[GEO: GeoLevel]( searchMaxDistanceRelativeToEllipseFoci, enrouteDuration, boundingBox, - seed + seed, + estimatedMinParkingDuration ) { override protected val mnlMultiplierParameters: Map[ParkingMNL.Parameters, UtilityFunctionOperation] = Map( @@ -82,41 +83,8 @@ class ParkingFunctions[GEO: GeoLevel]( val homeActivityPrefersResidentialFactor: Double = if (goingHome) 1.0 else 0.0 - // end-of-day parking durations are set to zero, which will be mis-interpreted here - val tempParkingDuration = inquiry.searchMode match { - case ParkingSearchMode.EnRoute => enrouteDuration.toInt - case _ => inquiry.parkingDuration.toInt - } - val parkingDuration: Option[Int] = if (tempParkingDuration <= 0) None else Some(tempParkingDuration) - - val addedEnergy: Double = - inquiry.beamVehicle match { - case Some(beamVehicle) => - parkingAlternative.parkingZone.chargingPointType match { - case Some(chargingPoint) => - val (_, addedEnergy) = ChargingPointType.calculateChargingSessionLengthAndEnergyInJoule( - chargingPoint, - beamVehicle.primaryFuelLevelInJoules, - beamVehicle.beamVehicleType.primaryFuelCapacityInJoule, - 1e6, - 1e6, - parkingDuration - ) - addedEnergy - case None => 0.0 // no charger here - } - case None => 0.0 // no beamVehicle, assume agent has range - } - - val rangeAnxietyFactor: Double = - inquiry.remainingTripData - .map { - _.rangeAnxiety(withAddedFuelInJoules = addedEnergy) - } - .getOrElse(0.0) // default no anxiety if no remaining trip data provided - val params: Map[ParkingMNL.Parameters, Double] = Map( - ParkingMNL.Parameters.RangeAnxietyCost -> rangeAnxietyFactor, + ParkingMNL.Parameters.RangeAnxietyCost -> 0.0, ParkingMNL.Parameters.WalkingEgressCost -> distanceFactor, ParkingMNL.Parameters.ParkingTicketCost -> parkingCostsPriceFactor, ParkingMNL.Parameters.HomeActivityPrefersResidentialParking -> homeActivityPrefersResidentialFactor, @@ -228,9 +196,8 @@ class ParkingFunctions[GEO: GeoLevel]( .forall(_.contains(inquiry.destinationUtm.time % (24 * 3600))) ) - val isValidVehicleManager = inquiry.beamVehicle.forall { vehicle => + val isValidVehicleManager = zone.reservedFor.managerType == VehicleManager.TypeEnum.Default || zone.reservedFor.managerId == inquiry.reservedFor.managerId - } hasAvailability & validParkingType & isValidTime & isValidVehicleManager } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala index b9f543c6681..90851da3f03 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala @@ -58,6 +58,7 @@ object ParkingInquiry extends LazyLogging { val values: immutable.IndexedSeq[ParkingSearchMode] = findValues case object EnRoute extends ParkingSearchMode case object Destination extends ParkingSearchMode + case object Init extends ParkingSearchMode } object ParkingActivityType extends Enum[ParkingActivityType] { diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala index f63247977d7..e27c2b83af5 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala @@ -227,6 +227,7 @@ object ParkingManagerBenchmark extends StrictLogging { boundingBox, seed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) parkingNetwork diff --git a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala index 64d5a32b7ed..71f5e5756a6 100755 --- a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala @@ -46,7 +46,8 @@ object ZonalParkingManager extends LazyLogging { minSearchRadius: Double, maxSearchRadius: Double, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ): ZonalParkingManager[GEO] = { new ZonalParkingManager(parkingZones) { if (maxSearchRadius < minSearchRadius) { @@ -67,7 +68,8 @@ object ZonalParkingManager extends LazyLogging { 0.0, boundingBox, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) ) } @@ -97,7 +99,8 @@ object ZonalParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) } @@ -139,7 +142,8 @@ object ZonalParkingManager extends LazyLogging { minSearchRadius, maxSearchRadius, seed, - mnlParkingConfig + mnlParkingConfig, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 7749313afe3..7ef299a0146 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -48,6 +48,7 @@ object ParkingZoneSearch { boundingBox: Envelope, distanceFunction: (Coord, Coord) => Double, enrouteDuration: Double, + estimatedMinParkingDuration: Double, searchExpansionFactor: Double = 2.0 ) @@ -168,9 +169,17 @@ object ParkingZoneSearch { parkingZone.pricingModel match { case None => 0 case Some(pricingModel) if params.searchMode == ParkingSearchMode.EnRoute => - PricingModel.evaluateParkingTicket(pricingModel, config.enrouteDuration.toInt) + PricingModel.evaluateParkingTicket( + pricingModel, + config.enrouteDuration.toInt, + config.estimatedMinParkingDuration + ) case Some(pricingModel) => - PricingModel.evaluateParkingTicket(pricingModel, params.parkingDuration.toInt) + PricingModel.evaluateParkingTicket( + pricingModel, + params.parkingDuration.toInt, + config.estimatedMinParkingDuration + ) } val parkingAlternative: ParkingAlternative[GEO] = ParkingAlternative(zone, parkingZone.parkingType, parkingZone, stallLocation, stallPriceInDollars) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala index f29bb7ac97d..62069062a61 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala @@ -67,11 +67,18 @@ object PricingModel { * @param parkingDurationInSeconds duration of parking in seconds * @return monetary cost of parking, in cents */ - def evaluateParkingTicket(pricingModel: PricingModel, parkingDurationInSeconds: Int): Double = { + def evaluateParkingTicket( + pricingModel: PricingModel, + parkingDurationInSeconds: Int, + estimatedMinParkingDuration: Double + ): Double = { pricingModel match { case FlatFee(costInDollars) => costInDollars case Block(costInDollars, intervalSeconds) => - (math.max(0.0, parkingDurationInSeconds.toDouble) / intervalSeconds.toDouble) * costInDollars + (math.max( + estimatedMinParkingDuration, + parkingDurationInSeconds.toDouble + ) / intervalSeconds.toDouble) * costInDollars } } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index b858a80cc8e..cd3fb1e56c8 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,5137 +3,3526 @@ package beam.sim.config case class BeamConfig( - beam: BeamConfig.Beam, - matsim: BeamConfig.Matsim + beam : BeamConfig.Beam, + matsim : BeamConfig.Matsim ) - object BeamConfig { - case class Beam( - actorSystemName: java.lang.String, - agentsim: BeamConfig.Beam.Agentsim, - calibration: BeamConfig.Beam.Calibration, - cluster: BeamConfig.Beam.Cluster, - debug: BeamConfig.Beam.Debug, - exchange: BeamConfig.Beam.Exchange, - experimental: BeamConfig.Beam.Experimental, - input: BeamConfig.Beam.Input, - inputDirectory: java.lang.String, - logger: BeamConfig.Beam.Logger, - metrics: BeamConfig.Beam.Metrics, - output: BeamConfig.Beam.Output, - outputs: BeamConfig.Beam.Outputs, - physsim: BeamConfig.Beam.Physsim, - replanning: BeamConfig.Beam.Replanning, - router: BeamConfig.Beam.Router, - routing: BeamConfig.Beam.Routing, - sim: BeamConfig.Beam.Sim, - spatial: BeamConfig.Beam.Spatial, - urbansim: BeamConfig.Beam.Urbansim, - useLocalWorker: scala.Boolean, - warmStart: BeamConfig.Beam.WarmStart + actorSystemName : java.lang.String, + agentsim : BeamConfig.Beam.Agentsim, + calibration : BeamConfig.Beam.Calibration, + cluster : BeamConfig.Beam.Cluster, + debug : BeamConfig.Beam.Debug, + exchange : BeamConfig.Beam.Exchange, + experimental : BeamConfig.Beam.Experimental, + input : BeamConfig.Beam.Input, + inputDirectory : java.lang.String, + logger : BeamConfig.Beam.Logger, + metrics : BeamConfig.Beam.Metrics, + output : BeamConfig.Beam.Output, + outputs : BeamConfig.Beam.Outputs, + physsim : BeamConfig.Beam.Physsim, + replanning : BeamConfig.Beam.Replanning, + router : BeamConfig.Beam.Router, + routing : BeamConfig.Beam.Routing, + sim : BeamConfig.Beam.Sim, + spatial : BeamConfig.Beam.Spatial, + urbansim : BeamConfig.Beam.Urbansim, + useLocalWorker : scala.Boolean, + warmStart : BeamConfig.Beam.WarmStart ) - object Beam { - case class Agentsim( - agentSampleSizeAsFractionOfPopulation: scala.Double, - agents: BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime: java.lang.String, - firstIteration: scala.Int, - fractionOfPlansWithSingleActivity: scala.Double, - h3taz: BeamConfig.Beam.Agentsim.H3taz, - lastIteration: scala.Int, - populationAdjustment: java.lang.String, - scenarios: BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow: scala.Int, - simulationName: java.lang.String, - taz: BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters: scala.Int, - thresholdForWalkingInMeters: scala.Int, - timeBinSize: scala.Int, - toll: BeamConfig.Beam.Agentsim.Toll, - tuning: BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation : scala.Double, + agents : BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime : java.lang.String, + firstIteration : scala.Int, + fractionOfPlansWithSingleActivity : scala.Double, + h3taz : BeamConfig.Beam.Agentsim.H3taz, + lastIteration : scala.Int, + populationAdjustment : java.lang.String, + scenarios : BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow : scala.Int, + simulationName : java.lang.String, + taz : BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters : scala.Int, + thresholdForWalkingInMeters : scala.Int, + timeBinSize : scala.Int, + toll : BeamConfig.Beam.Agentsim.Toll, + tuning : BeamConfig.Beam.Agentsim.Tuning ) - object Agentsim { - case class Agents( - activities: BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType: java.lang.String, - freight: BeamConfig.Beam.Agentsim.Agents.Freight, - households: BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking: BeamConfig.Beam.Agentsim.Agents.Parking, - plans: BeamConfig.Beam.Agentsim.Agents.Plans, - population: BeamConfig.Beam.Agentsim.Agents.Population, - ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles + activities : BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType : java.lang.String, + freight : BeamConfig.Beam.Agentsim.Agents.Freight, + households : BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking : BeamConfig.Beam.Agentsim.Agents.Parking, + plans : BeamConfig.Beam.Agentsim.Agents.Plans, + population : BeamConfig.Beam.Agentsim.Agents.Population, + ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles ) - object Agents { - case class Activities( - activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] ) - object Activities { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = - if (c.hasPathOrNull("activityTypeToFixedDurationMap")) - scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) - else None + activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None ) } } - + case class Freight( - carrierParkingFilePath: scala.Option[java.lang.String], - carriersFilePath: java.lang.String, - convertWgs2Utm: scala.Boolean, - enabled: scala.Boolean, - generateFixedActivitiesDurations: scala.Boolean, - name: java.lang.String, - plansFilePath: java.lang.String, - reader: java.lang.String, - replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath: java.lang.String + carrierParkingFilePath : scala.Option[java.lang.String], + carriersFilePath : java.lang.String, + convertWgs2Utm : scala.Boolean, + enabled : scala.Boolean, + generateFixedActivitiesDurations : scala.Boolean, + name : java.lang.String, + plansFilePath : java.lang.String, + reader : java.lang.String, + replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath : java.lang.String ) - object Freight { - case class Replanning( - departureTime: scala.Int, - disableAfterIteration: scala.Int, - strategy: java.lang.String + departureTime : scala.Int, + disableAfterIteration : scala.Int, + strategy : java.lang.String ) - object Replanning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = - if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = - if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") - else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = - c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = - if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") - else "/test/input/beamville/freight/payload-plans.csv", - reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - toursFilePath = - if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") - else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", + reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath: java.lang.String, - inputHouseholdAttributesFilePath: java.lang.String + inputFilePath : java.lang.String, + inputHouseholdAttributesFilePath : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = - if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") - else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = - if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") - else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime: scala.Double, - highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts: scala.Int, - minimumValueOfTime: scala.Double, - modeChoiceClass: java.lang.String, - modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT: scala.Boolean, - overrideAutomationLevel: scala.Int, - poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] + defaultValueOfTime : scala.Double, + highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts : scala.Int, + minimumValueOfTime : scala.Double, + modeChoiceClass : java.lang.String, + modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT : scala.Boolean, + overrideAutomationLevel : scala.Int, + poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] ) - object ModalBehaviors { - case class HighTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) - object HighTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class Lccm( - filePath: java.lang.String + filePath : java.lang.String ) - object Lccm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) - object LowTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class ModeVotMultiplier( - CAV: scala.Double, - bike: scala.Double, - drive: scala.Double, - rideHail: scala.Double, - rideHailPooled: scala.Double, - rideHailTransit: scala.Double, - transit: scala.Double, - waiting: scala.Double, - walk: scala.Double + CAV : scala.Double, + bike : scala.Double, + drive : scala.Double, + rideHail : scala.Double, + rideHailPooled : scala.Double, + rideHailTransit : scala.Double, + transit : scala.Double, + waiting : scala.Double, + walk : scala.Double ) - object ModeVotMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor: scala.Double + params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor : scala.Double ) - object MulitnomialLogit { - case class Params( - bike_intercept: scala.Double, - bike_transit_intercept: scala.Double, - car_intercept: scala.Double, - cav_intercept: scala.Double, - drive_transit_intercept: scala.Double, - ride_hail_intercept: scala.Double, - ride_hail_pooled_intercept: scala.Double, - ride_hail_transit_intercept: scala.Double, - transfer: scala.Double, - transit_crowding: scala.Double, - transit_crowding_VOT_multiplier: scala.Double, - transit_crowding_VOT_threshold: scala.Double, - transit_crowding_percentile: scala.Double, - walk_intercept: scala.Double, - walk_transit_intercept: scala.Double + bike_intercept : scala.Double, + bike_transit_intercept : scala.Double, + car_intercept : scala.Double, + cav_intercept : scala.Double, + drive_transit_intercept : scala.Double, + ride_hail_intercept : scala.Double, + ride_hail_pooled_intercept : scala.Double, + ride_hail_transit_intercept : scala.Double, + transfer : scala.Double, + transit_crowding : scala.Double, + transit_crowding_VOT_multiplier : scala.Double, + transit_crowding_VOT_threshold : scala.Double, + transit_crowding_percentile : scala.Double, + walk_intercept : scala.Double, + walk_transit_intercept : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = - if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = - if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = - if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = - if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") - else 0.0, - ride_hail_transit_intercept = - if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") - else 0.0, - transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = - if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) - c.getDouble("transit_crowding_VOT_multiplier") - else 0.0, - transit_crowding_VOT_threshold = - if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") - else 0.5, - transit_crowding_percentile = - if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") - else 90.0, - walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = - if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, + ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, + transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, + transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, + transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, + walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ), - utility_scale_factor = - if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), + utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object PoolingMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = - if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") - ), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - if (c.hasPathOrNull("lccm")) c.getConfig("lccm") - else com.typesafe.config.ConfigFactory.parseString("lccm{}") - ), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") - ), - maximumNumberOfReplanningAttempts = - if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") - else 3, - minimumValueOfTime = - if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = - if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") - else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") - else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - overrideAutomationForVOTT = - c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = - if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") - else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") - ), - transitVehicleTypeVOTMultipliers = - if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) - scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) - else None - ) - } - } - + defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), + maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, + minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), + transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None + ) + } + } + case class ModeIncentive( - filePath: java.lang.String + filePath : java.lang.String ) - object ModeIncentive { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - maxSearchRadius: scala.Double, - minSearchRadius: scala.Double, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - rangeAnxietyBuffer: scala.Double, - searchMaxDistanceRelativeToEllipseFoci: scala.Double + estimatedMinParkingDuration : scala.Double, + maxSearchRadius : scala.Double, + minSearchRadius : scala.Double, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + rangeAnxietyBuffer : scala.Double, + searchMaxDistanceRelativeToEllipseFoci : scala.Double ) - object Parking { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - distanceMultiplier: scala.Double, - enrouteDetourMultiplier: scala.Double, - homeActivityPrefersResidentialParkingMultiplier: scala.Double, - parkingPriceMultiplier: scala.Double, - rangeAnxietyMultiplier: scala.Double + distanceMultiplier : scala.Double, + enrouteDetourMultiplier : scala.Double, + homeActivityPrefersResidentialParkingMultiplier : scala.Double, + parkingPriceMultiplier : scala.Double, + rangeAnxietyMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = - if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = - if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = - if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) - c.getDouble("homeActivityPrefersResidentialParkingMultiplier") - else 1.0, - parkingPriceMultiplier = - if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = - if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, + parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - rangeAnxietyBuffer = - if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = - if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) - c.getDouble("searchMaxDistanceRelativeToEllipseFoci") - else 4.0 + estimatedMinParkingDuration = if(c.hasPathOrNull("estimatedMinParkingDuration")) c.getDouble("estimatedMinParkingDuration") else 60.0, + maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath: java.lang.String, - inputPlansFilePath: java.lang.String, - merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath : java.lang.String, + inputPlansFilePath : java.lang.String, + merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) - object Plans { - case class Merge( - fraction: scala.Double + fraction : scala.Double ) - object Merge { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = - if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") - else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = - if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") - else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - if (c.hasPathOrNull("merge")) c.getConfig("merge") - else com.typesafe.config.ConfigFactory.parseString("merge{}") - ) + inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) ) } } - + case class Population( - industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling: scala.Boolean + industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling : scala.Boolean ) - object Population { - case class IndustryRemovalProbabilty( - enabled: scala.Boolean, - inputFilePath: java.lang.String, - removalStrategy: java.lang.String + enabled : scala.Boolean, + inputFilePath : java.lang.String, + removalStrategy : java.lang.String ) - object IndustryRemovalProbabilty { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = - if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") - else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") - ), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath: java.lang.String + filePath : java.lang.String ) - object PtFare { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost: scala.Double, - defaultCostPerMile: scala.Double, - defaultCostPerMinute: scala.Double, - human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations: scala.Boolean, - name: java.lang.String, - pooledBaseCost: scala.Double, - pooledCostPerMile: scala.Double, - pooledCostPerMinute: scala.Double, - pooledToRegularRideCostRatio: scala.Double, - rangeBufferForDispatchInMeters: scala.Int, - refuelLocationType: java.lang.String, - refuelThresholdInMeters: scala.Double, - repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost : scala.Double, + defaultCostPerMile : scala.Double, + defaultCostPerMinute : scala.Double, + human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations : scala.Boolean, + name : java.lang.String, + pooledBaseCost : scala.Double, + pooledCostPerMile : scala.Double, + pooledCostPerMinute : scala.Double, + pooledToRegularRideCostRatio : scala.Double, + rangeBufferForDispatchInMeters : scala.Int, + refuelLocationType : java.lang.String, + refuelThresholdInMeters : scala.Double, + repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) - object RideHail { - case class AllocationManager( - alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm: java.lang.String, - maxExcessRideTime: scala.Double, - maxWaitingTimeInSec: scala.Int, - name: java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, - repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds: scala.Int + alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm : java.lang.String, + maxExcessRideTime : scala.Double, + maxWaitingTimeInSec : scala.Int, + name : java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, + repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds : scala.Int ) - object AllocationManager { - case class AlonsoMora( - maxRequestsPerVehicle: scala.Int + maxRequestsPerVehicle : scala.Int ) - object AlonsoMora { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = - if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, - demandWeight: scala.Double, - distanceWeight: scala.Double, - keepMaxTopNScores: scala.Int, - minDemandPercentageInRadius: scala.Double, - minScoreThresholdForRepositioning: scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, - percentageOfVehiclesToReposition: scala.Double, - produceDebugImages: scala.Boolean, - repositionCircleRadiusInMeters: scala.Double, - repositioningMethod: java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, - waitingTimeWeight: scala.Double + allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, + demandWeight : scala.Double, + distanceWeight : scala.Double, + keepMaxTopNScores : scala.Int, + minDemandPercentageInRadius : scala.Double, + minScoreThresholdForRepositioning : scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, + percentageOfVehiclesToReposition : scala.Double, + produceDebugImages : scala.Boolean, + repositionCircleRadiusInMeters : scala.Double, + repositioningMethod : java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, + waitingTimeWeight : scala.Double ) - object RepositionLowWaitingTimes { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( - "allowIncreasingRadiusIfDemandInRadiusLow" - ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = - if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") - else 0.1, - minScoreThresholdForRepositioning = - if (c.hasPathOrNull("minScoreThresholdForRepositioning")) - c.getDouble("minScoreThresholdForRepositioning") - else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = - if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) - c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") - else 1, - percentageOfVehiclesToReposition = - if (c.hasPathOrNull("percentageOfVehiclesToReposition")) - c.getDouble("percentageOfVehiclesToReposition") - else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = - if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") - else 3000, - repositioningMethod = - if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = - if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) - c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") - else 1200, - waitingTimeWeight = - if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, + minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, + percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, + repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, + waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") - else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") - ), - matchingAlgorithm = - if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") - else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = - if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = - if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) - c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") - else 1, - repositionLowWaitingTimes = - BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") - else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") - ), - requestBufferTimeoutInSeconds = - if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), + matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, + repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), + requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int, - valueOfTime: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int, + valueOfTime : scala.Int ) - object Cav { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 16090, - valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, + valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) - object Charging { - case class VehicleChargingManager( - defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, - name: java.lang.String + defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, + name : java.lang.String ) - object VehicleChargingManager { - case class DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging: scala.Double, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, - noChargingThresholdExpirationTimeInS: scala.Int + fractionAvailableThresholdToFavorFasterCharging : scala.Double, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, + noChargingThresholdExpirationTimeInS : scala.Int ) - object DefaultVehicleChargingManager { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - chargingTimeMultiplier: scala.Double, - drivingTimeMultiplier: scala.Double, - insufficientRangeMultiplier: scala.Double, - queueingTimeMultiplier: scala.Double + chargingTimeMultiplier : scala.Double, + drivingTimeMultiplier : scala.Double, + insufficientRangeMultiplier : scala.Double, + queueingTimeMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - chargingTimeMultiplier = - if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") - else -0.01666667, - drivingTimeMultiplier = - if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") - else -0.01666667, - insufficientRangeMultiplier = - if (c.hasPathOrNull("insufficientRangeMultiplier")) - c.getDouble("insufficientRangeMultiplier") - else -60.0, - queueingTimeMultiplier = - if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") - else -0.01666667 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( + chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, + drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, + insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, + queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - params = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging = - if (c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) - c.getDouble("fractionAvailableThresholdToFavorFasterCharging") - else 1.01, - mulitnomialLogit = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - noChargingThresholdExpirationTimeInS = - if (c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) - c.getInt("noChargingThresholdExpirationTimeInS") - else 0 - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( + fractionAvailableThresholdToFavorFasterCharging = if(c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) c.getDouble("fractionAvailableThresholdToFavorFasterCharging") else 1.01, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + noChargingThresholdExpirationTimeInS = if(c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) c.getInt("noChargingThresholdExpirationTimeInS") else 0 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - if (c.hasPathOrNull("defaultVehicleChargingManager")) - c.getConfig("defaultVehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" + defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") - ) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) ) } } - + case class Human( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int, - valueOfTime: scala.Double + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int, + valueOfTime : scala.Double ) - object Human { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180, - valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180, + valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 ) } } - + case class Initialization( - filePath: java.lang.String, - initType: java.lang.String, - parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath : java.lang.String, + initType : java.lang.String, + parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) - object Initialization { - case class Parking( - filePath: java.lang.String + filePath : java.lang.String ) - object Parking { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet: scala.Double, - initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId: java.lang.String, - vehicleTypePrefix: java.lang.String + fractionOfInitialVehicleFleet : scala.Double, + initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId : java.lang.String, + vehicleTypePrefix : java.lang.String ) - object Procedural { - case class InitialLocation( - home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name: java.lang.String + home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name : java.lang.String ) - object InitialLocation { - case class Home( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object Home { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - if (c.hasPathOrNull("home")) c.getConfig("home") - else com.typesafe.config.ConfigFactory.parseString("home{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") - else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") - ), - vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = - if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - if (c.hasPathOrNull("procedural")) c.getConfig("procedural") - else com.typesafe.config.ConfigFactory.parseString("procedural{}") - ) + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) ) } } - + case class IterationStats( - timeBinSizeInSec: scala.Double + timeBinSizeInSec : scala.Double ) - object IterationStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name: java.lang.String, - timeout: scala.Int + demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name : java.lang.String, + timeout : scala.Int ) - object RepositioningManager { - case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider: scala.Double, - horizon: scala.Int, - numberOfClustersForDemand: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDemandForCAVs: scala.Double + fractionOfClosestClustersToConsider : scala.Double, + horizon : scala.Int, + numberOfClustersForDemand : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDemandForCAVs : scala.Double ) - object DemandFollowingRepositioningManager { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = - if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) - c.getDouble("fractionOfClosestClustersToConsider") - else 0.2, - horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = - if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 1, - sensitivityOfRepositioningToDemandForCAVs = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) - c.getDouble("sensitivityOfRepositioningToDemandForCAVs") - else 1 + fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, + horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, + sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDistance: scala.Double + predictionHorizon : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDistance : scala.Double ) - object InverseSquareDistanceRepositioningFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 0.4, - sensitivityOfRepositioningToDistance = - if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) - c.getDouble("sensitivityOfRepositioningToDistance") - else 0.9 + predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, + sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - if (c.hasPathOrNull("demandFollowingRepositioningManager")) - c.getConfig("demandFollowingRepositioningManager") - else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") - ), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager - .InverseSquareDistanceRepositioningFactor( - if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) - c.getConfig("inverseSquareDistanceRepositioningFactor") - else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object RideHailManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel: scala.Double, - numberOfCategories: scala.Int, - priceAdjustmentStrategy: java.lang.String, - surgeLevelAdaptionStep: scala.Double + minimumSurgeLevel : scala.Double, + numberOfCategories : scala.Int, + priceAdjustmentStrategy : java.lang.String, + surgeLevelAdaptionStep : scala.Double ) - object SurgePricing { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = - if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") - else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = - if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") - else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") - ), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - if (c.hasPathOrNull("cav")) c.getConfig("cav") - else com.typesafe.config.ConfigFactory.parseString("cav{}") - ), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - if (c.hasPathOrNull("charging")) c.getConfig("charging") - else com.typesafe.config.ConfigFactory.parseString("charging{}") - ), - defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = - if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = - if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - if (c.hasPathOrNull("human")) c.getConfig("human") - else com.typesafe.config.ConfigFactory.parseString("human{}") - ), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - if (c.hasPathOrNull("initialization")) c.getConfig("initialization") - else com.typesafe.config.ConfigFactory.parseString("initialization{}") - ), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") - else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") - ), - linkFleetStateAcrossIterations = - c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = - if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - pooledToRegularRideCostRatio = - if (c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") - else 0.6, - rangeBufferForDispatchInMeters = - if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") - else 10000, - refuelLocationType = - if (c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", - refuelThresholdInMeters = - if (c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") - else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") - ), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") - else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") - ), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") - else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") - ) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), + defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), + linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + pooledToRegularRideCostRatio = if(c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") else 0.6, + rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, + refuelLocationType = if(c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", + refuelThresholdInMeters = if(c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) + ) + } + } + case class RideHailTransit( - modesToConsider: java.lang.String + modesToConsider : java.lang.String ) - object RideHailTransit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) - object TripBehaviors { - case class CarUsage( - minDistanceToTrainStop: scala.Double + minDistanceToTrainStop : scala.Double ) - object CarUsage { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = - if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path: java.lang.String, - additional_trip_utility: scala.Double, - destination_nest_scale_factor: scala.Double, - generate_secondary_activities: scala.Boolean, - intercept_file_path: java.lang.String, - max_destination_choice_set_size: scala.Int, - max_destination_distance_meters: scala.Double, - mode_nest_scale_factor: scala.Double, - trip_nest_scale_factor: scala.Double + activity_file_path : java.lang.String, + additional_trip_utility : scala.Double, + destination_nest_scale_factor : scala.Double, + generate_secondary_activities : scala.Boolean, + intercept_file_path : java.lang.String, + max_destination_choice_set_size : scala.Int, + max_destination_distance_meters : scala.Double, + mode_nest_scale_factor : scala.Double, + trip_nest_scale_factor : scala.Double ) - object MulitnomialLogit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = - if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = - if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = - if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") - else 1.0, - generate_secondary_activities = - c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = - if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = - if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") - else 20, - max_destination_distance_meters = - if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") - else 32000, - mode_nest_scale_factor = - if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = - if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, + generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, + max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, + mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") - else com.typesafe.config.ConfigFactory.parseString("carUsage{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) ) } } - + case class Vehicles( - downsamplingMethod: java.lang.String, - dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet: scala.Double, - fractionOfPeopleWithBicycle: scala.Double, - fuelTypesFilePath: java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, - linkSocAcrossIterations: scala.Boolean, - linkToGradePercentFilePath: java.lang.String, - meanPrivateVehicleStartingSOC: scala.Double, - meanRidehailVehicleStartingSOC: scala.Double, - sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile: java.lang.String, - vehicleAdjustmentMethod: java.lang.String, - vehicleTypesFilePath: java.lang.String, - vehiclesFilePath: java.lang.String + downsamplingMethod : java.lang.String, + dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet : scala.Double, + fractionOfPeopleWithBicycle : scala.Double, + fuelTypesFilePath : java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, + linkSocAcrossIterations : scala.Boolean, + linkToGradePercentFilePath : java.lang.String, + meanPrivateVehicleStartingSOC : scala.Double, + meanRidehailVehicleStartingSOC : scala.Double, + sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile : java.lang.String, + vehicleAdjustmentMethod : java.lang.String, + vehicleTypesFilePath : java.lang.String, + vehiclesFilePath : java.lang.String ) - object Vehicles { - case class DummySharedBike( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedBike { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedCar { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond: scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, - noRefuelThresholdOffsetInMeters: scala.Double, - remainingDistanceWrtBatteryCapacityThreshold: scala.Int + estimateOfMeanChargingDurationInSecond : scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, + noRefuelThresholdOffsetInMeters : scala.Double, + remainingDistanceWrtBatteryCapacityThreshold : scala.Int ) - object Enroute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = - if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) - c.getInt("estimateOfMeanChargingDurationInSecond") - else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = - if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) - c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") - else 500, - noRefuelThresholdOffsetInMeters = - if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") - else 32186.9, - remainingDistanceWrtBatteryCapacityThreshold = - if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) - c.getInt("remainingDistanceWrtBatteryCapacityThreshold") - else 2 + estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, + noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, + remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving - ], - fixed_non_reserving_fleet_by_taz: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz - ], - inexhaustible_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving - ], - managerType: java.lang.String, - name: java.lang.String, - parkingFilePath: java.lang.String, - reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], + fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], + inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], + managerType : java.lang.String, + name : java.lang.String, + parkingFilePath : java.lang.String, + reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) - object SharedFleets$Elm { - case class FixedNonReserving( - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String ) - object FixedNonReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize: scala.Int, - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String, - vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] + fleetSize : scala.Int, + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String, + vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] ) - object FixedNonReservingFleetByTaz { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = - if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) - else None + fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object InexhaustibleReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm - ], - name: java.lang.String, - repositionTimeBin: scala.Int, - statTimeBin: scala.Int + min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], + name : java.lang.String, + repositionTimeBin : scala.Int, + statTimeBin : scala.Int ) - object Reposition { - case class MinAvailabilityUndersupplyAlgorithm( - matchLimit: scala.Int + matchLimit : scala.Int ) - object MinAvailabilityUndersupplyAlgorithm { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm( - matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( + matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = - if (c.hasPathOrNull("min-availability-undersupply-algorithm")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) - ) - else None, - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = - if (c.hasPathOrNull("fixed-non-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReserving(c.getConfig("fixed-non-reserving")) - ) - else None, - fixed_non_reserving_fleet_by_taz = - if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) - ) - else None, - inexhaustible_reserving = - if (c.hasPathOrNull("inexhaustible-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) - ) - else None, - managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = - if (c.hasPathOrNull("reposition")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) - ) - else None + fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, + fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, + inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, + managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = - if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") - else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") - else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") - ), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") - else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") - ), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - if (c.hasPathOrNull("enroute")) c.getConfig("enroute") - else com.typesafe.config.ConfigFactory.parseString("enroute{}") - ), - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 1.0, - fractionOfPeopleWithBicycle = - if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = - if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") - else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( - "generateEmergencyHouseholdVehicleWhenPlansRequireIt" - ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = - c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = - if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = - if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") - else 1.0, - meanRidehailVehicleStartingSOC = - if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") - else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = - if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") - else "", - vehicleAdjustmentMethod = - if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = - if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") - else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = - if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") - else "/test/input/beamville/vehicles.csv" - ) - } - - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, + fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, + meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", + vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" + ) + } + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Agentsim.Agents.Vehicles - .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities( - if (c.hasPathOrNull("activities")) c.getConfig("activities") - else com.typesafe.config.ConfigFactory.parseString("activities{}") - ), - bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight( - if (c.hasPathOrNull("freight")) c.getConfig("freight") - else com.typesafe.config.ConfigFactory.parseString("freight{}") - ), - households = BeamConfig.Beam.Agentsim.Agents.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") - else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") - ), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") - else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") - ), - parking = BeamConfig.Beam.Agentsim.Agents.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - plans = BeamConfig.Beam.Agentsim.Agents.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - population = BeamConfig.Beam.Agentsim.Agents.Population( - if (c.hasPathOrNull("population")) c.getConfig("population") - else com.typesafe.config.ConfigFactory.parseString("population{}") - ), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( - if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") - else com.typesafe.config.ConfigFactory.parseString("ptFare{}") - ), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( - if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") - else com.typesafe.config.ConfigFactory.parseString("rideHail{}") - ), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") - else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") - ), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") - else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") - ), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), + bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), + households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), + parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor: scala.Double, - chargingPointCountScalingFactor: scala.Double, - chargingPointFilePath: java.lang.String, - helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds: scala.Int + chargingPointCostScalingFactor : scala.Double, + chargingPointCountScalingFactor : scala.Double, + chargingPointFilePath : java.lang.String, + helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds : scala.Int ) - object ChargingNetworkManager { - case class Helics( - bufferSize: scala.Int, - connectionEnabled: scala.Boolean, - coreInitString: java.lang.String, - coreType: java.lang.String, - dataInStreamPoint: java.lang.String, - dataOutStreamPoint: java.lang.String, - federateName: java.lang.String, - feedbackEnabled: scala.Boolean, - intLogLevel: scala.Int, - timeDeltaProperty: scala.Double + bufferSize : scala.Int, + connectionEnabled : scala.Boolean, + coreInitString : java.lang.String, + coreType : java.lang.String, + dataInStreamPoint : java.lang.String, + dataOutStreamPoint : java.lang.String, + federateName : java.lang.String, + feedbackEnabled : scala.Boolean, + intLogLevel : scala.Int, + timeDeltaProperty : scala.Double ) - object Helics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = - if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") - else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = - if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") - else "GridFed/PhysicalBounds", - dataOutStreamPoint = - if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", + dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled: scala.Boolean, - expansionFactor_charge_activity: scala.Double, - expansionFactor_home_activity: scala.Double, - expansionFactor_init_activity: scala.Double, - expansionFactor_wherever_activity: scala.Double, - expansionFactor_work_activity: scala.Double + enabled : scala.Boolean, + expansionFactor_charge_activity : scala.Double, + expansionFactor_home_activity : scala.Double, + expansionFactor_init_activity : scala.Double, + expansionFactor_wherever_activity : scala.Double, + expansionFactor_work_activity : scala.Double ) - object ScaleUp { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = - if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") - else 1.0, - expansionFactor_home_activity = - if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") - else 1.0, - expansionFactor_init_activity = - if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") - else 1.0, - expansionFactor_wherever_activity = - if (c.hasPathOrNull("expansionFactor_wherever_activity")) - c.getDouble("expansionFactor_wherever_activity") - else 1.0, - expansionFactor_work_activity = - if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") - else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, + expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, + expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, + expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, + expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = - if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") - else 1.0, - chargingPointCountScalingFactor = - if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") - else 1.0, - chargingPointFilePath = - if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - if (c.hasPathOrNull("helics")) c.getConfig("helics") - else com.typesafe.config.ConfigFactory.parseString("helics{}") - ), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") - else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") - ), - timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, + chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, + chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), + timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution: scala.Int, - upperBoundResolution: scala.Int + lowerBoundResolution : scala.Int, + upperBoundResolution : scala.Int ) - object H3taz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile: java.lang.String + frequencyAdjustmentFile : java.lang.String ) - object Scenarios { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = - if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") - else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay: scala.Int, - interval: scala.Int + initialDelay : scala.Int, + interval : scala.Int ) - object ScheduleMonitorTask { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath: java.lang.String, - parkingCostScalingFactor: scala.Double, - parkingFilePath: java.lang.String, - parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor: scala.Double + filePath : java.lang.String, + parkingCostScalingFactor : scala.Double, + parkingFilePath : java.lang.String, + parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor : scala.Double ) - object Taz { - case class ParkingManager( - displayPerformanceTimings: scala.Boolean, - level: java.lang.String, - method: java.lang.String, - parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings : scala.Boolean, + level : java.lang.String, + method : java.lang.String, + parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) - object ParkingManager { - case class Parallel( - numberOfClusters: scala.Int + numberOfClusters : scala.Int ) - object Parallel { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - level = if (c.hasPathOrNull("level")) c.getString("level") else "TAZ", - method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - if (c.hasPathOrNull("parallel")) c.getConfig("parallel") - else com.typesafe.config.ConfigFactory.parseString("parallel{}") - ) + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + level = if(c.hasPathOrNull("level")) c.getString("level") else "TAZ", + method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = - if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( - if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") - else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") - ), - parkingStallCountScalingFactor = - if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") - else 1.0 + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), + parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 ) } } - + case class Toll( - filePath: java.lang.String + filePath : java.lang.String ) - object Toll { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules: scala.Double, - rideHailPrice: scala.Double, - tollPrice: scala.Double, - transitCapacity: scala.Option[scala.Double], - transitPrice: scala.Double + fuelCapacityInJoules : scala.Double, + rideHailPrice : scala.Double, + tollPrice : scala.Double, + transitCapacity : scala.Option[scala.Double], + transitPrice : scala.Double ) - object Tuning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = - if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = - if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) - c.getDouble("agentSampleSizeAsFractionOfPopulation") - else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents( - if (c.hasPathOrNull("agents")) c.getConfig("agents") - else com.typesafe.config.ConfigFactory.parseString("agents{}") - ), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( - if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") - else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") - ), - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = - if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") - else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz( - if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") - else com.typesafe.config.ConfigFactory.parseString("h3taz{}") - ), - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = - if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - scenarios = BeamConfig.Beam.Agentsim.Scenarios( - if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") - else com.typesafe.config.ConfigFactory.parseString("scenarios{}") - ), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") - else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") - ), - schedulerParallelismWindow = - if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - taz = BeamConfig.Beam.Agentsim.Taz( - if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") - ), - thresholdForMakingParkingChoiceInMeters = - if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) - c.getInt("thresholdForMakingParkingChoiceInMeters") - else 100, - thresholdForWalkingInMeters = - if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll( - if (c.hasPathOrNull("toll")) c.getConfig("toll") - else com.typesafe.config.ConfigFactory.parseString("toll{}") - ), - tuning = BeamConfig.Beam.Agentsim.Tuning( - if (c.hasPathOrNull("tuning")) c.getConfig("tuning") - else com.typesafe.config.ConfigFactory.parseString("tuning{}") - ) + agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), + schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), + thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, + thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), + tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) ) } } - + case class Calibration( - counts: BeamConfig.Beam.Calibration.Counts, - google: BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio: scala.Double, - mode: BeamConfig.Beam.Calibration.Mode, - objectiveFunction: java.lang.String, - roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, - studyArea: BeamConfig.Beam.Calibration.StudyArea + counts : BeamConfig.Beam.Calibration.Counts, + google : BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio : scala.Double, + mode : BeamConfig.Beam.Calibration.Mode, + objectiveFunction : java.lang.String, + roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, + studyArea : BeamConfig.Beam.Calibration.StudyArea ) - object Calibration { - case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Int, - inputCountsFile: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Int, + inputCountsFile : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes ) - object Google { - case class TravelTimes( - enable: scala.Boolean, - iterationInterval: scala.Int, - minDistanceInMeters: scala.Double, - numDataPointsOver24Hours: scala.Int, - offPeakEnabled: scala.Boolean, - queryDate: java.lang.String, - tolls: scala.Boolean + enable : scala.Boolean, + iterationInterval : scala.Int, + minDistanceInMeters : scala.Double, + numDataPointsOver24Hours : scala.Int, + offPeakEnabled : scala.Boolean, + queryDate : java.lang.String, + tolls : scala.Boolean ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = - if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = - if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class Mode( - benchmarkFilePath: java.lang.String + benchmarkFilePath : java.lang.String ) - object Mode { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) - object RoadNetwork { - case class TravelTimes( - zoneBoundariesFilePath: java.lang.String, - zoneODTravelTimesFilePath: java.lang.String + zoneBoundariesFilePath : java.lang.String, + zoneODTravelTimesFilePath : java.lang.String ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = - if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = - if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class StudyArea( - enabled: scala.Boolean, - lat: scala.Double, - lon: scala.Double, - radius: scala.Double + enabled : scala.Boolean, + lat : scala.Double, + lon : scala.Double, + radius : scala.Double ) - object StudyArea { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - google = BeamConfig.Beam.Calibration.Google( - if (c.hasPathOrNull("google")) c.getConfig("google") - else com.typesafe.config.ConfigFactory.parseString("google{}") - ), - meanToCountsWeightRatio = - if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode( - if (c.hasPathOrNull("mode")) c.getConfig("mode") - else com.typesafe.config.ConfigFactory.parseString("mode{}") - ), - objectiveFunction = - if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") - else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( - if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") - else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") - ), - studyArea = BeamConfig.Beam.Calibration.StudyArea( - if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") - else com.typesafe.config.ConfigFactory.parseString("studyArea{}") - ) + counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), + meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), + objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), + studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) ) } } - + case class Cluster( - clusterType: scala.Option[java.lang.String], - enabled: scala.Boolean + clusterType : scala.Option[java.lang.String], + enabled : scala.Boolean ) - object Cluster { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor: BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval: scala.Int, - clearRoutedOutstandingWorkEnabled: scala.Boolean, - debugActorTimerIntervalInSec: scala.Int, - debugEnabled: scala.Boolean, - memoryConsumptionDisplayTimeoutInSec: scala.Int, - messageLogging: scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork: scala.Int, - stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation: BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives: scala.Boolean, - writeRealizedModeChoiceFile: scala.Boolean + actor : BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval : scala.Int, + clearRoutedOutstandingWorkEnabled : scala.Boolean, + debugActorTimerIntervalInSec : scala.Int, + debugEnabled : scala.Boolean, + memoryConsumptionDisplayTimeoutInSec : scala.Int, + messageLogging : scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork : scala.Int, + stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation : BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives : scala.Boolean, + writeRealizedModeChoiceFile : scala.Boolean ) - object Debug { - case class Actor( - logDepth: scala.Int + logDepth : scala.Int ) - object Actor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs: scala.Long, - checkMaxNumberOfMessagesEnabled: scala.Boolean, - defaultTimeoutMs: scala.Long, - enabled: scala.Boolean, - overallSimulationTimeoutMs: scala.Long, - thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs : scala.Long, + checkMaxNumberOfMessagesEnabled : scala.Boolean, + defaultTimeoutMs : scala.Long, + enabled : scala.Boolean, + overallSimulationTimeoutMs : scala.Long, + thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) - object StuckAgentDetection { - case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs: scala.Long, - triggerType: java.lang.String + actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs : scala.Long, + triggerType : java.lang.String ) - object Thresholds$Elm { - case class ActorTypeToMaxNumberOfMessages( - population: scala.Option[scala.Int], - rideHailAgent: scala.Option[scala.Int], - rideHailManager: scala.Option[scala.Int], - transitDriverAgent: scala.Option[scala.Int] + population : scala.Option[scala.Int], + rideHailAgent : scala.Option[scala.Int], + rideHailManager : scala.Option[scala.Int], + transitDriverAgent : scala.Option[scala.Int] ) - object ActorTypeToMaxNumberOfMessages { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = - if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = - BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") - else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") - ), - markAsStuckAfterMs = - if (c.hasPathOrNull("markAsStuckAfterMs")) - c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 20000, - triggerType = - if (c.hasPathOrNull("triggerType")) c.getString("triggerType") - else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), + markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, + triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = - if (c.hasPathOrNull("checkIntervalMs")) - c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 200, - checkMaxNumberOfMessagesEnabled = - !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = - if (c.hasPathOrNull("defaultTimeoutMs")) - c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = - if (c.hasPathOrNull("overallSimulationTimeoutMs")) - c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, + checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Debug.StuckAgentDetection - .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class TriggerMeasurer( - enabled: scala.Boolean, - writeStuckAgentDetectionConfig: scala.Boolean + enabled : scala.Boolean, + writeStuckAgentDetectionConfig : scala.Boolean ) - object TriggerMeasurer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = - !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram: scala.Boolean + createGCClassHistogram : scala.Boolean ) - object VmInformation { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor( - if (c.hasPathOrNull("actor")) c.getConfig("actor") - else com.typesafe.config.ConfigFactory.parseString("actor{}") - ), - agentTripScoresInterval = - if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = - c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = - if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = - if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) - c.getInt("memoryConsumptionDisplayTimeoutInSec") - else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = - if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) - c.getInt("secondsToWaitToClearRoutedOutstandingWork") - else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( - if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") - else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") - ), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( - if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") - else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") - ), - vmInformation = BeamConfig.Beam.Debug.VmInformation( - if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") - else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") - ), - writeModeChoiceAlternatives = - c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = - c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), + agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), + vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), + writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output: BeamConfig.Beam.Exchange.Output, - scenario: BeamConfig.Beam.Exchange.Scenario + output : BeamConfig.Beam.Exchange.Output, + scenario : BeamConfig.Beam.Exchange.Scenario ) - object Exchange { - case class Output( - activitySimSkimsEnabled: scala.Boolean, - geo: BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled : scala.Boolean, + geo : BeamConfig.Beam.Exchange.Output.Geo ) - object Output { - case class Geo( - filePath: scala.Option[java.lang.String] + filePath : scala.Option[java.lang.String] ) - object Geo { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = - c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo( - if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") - ) + activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) ) } } - + case class Scenario( - convertWgs2Utm: scala.Boolean, - fileFormat: java.lang.String, - folder: java.lang.String, - modeMap: scala.Option[scala.List[java.lang.String]], - source: java.lang.String, - urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm : scala.Boolean, + fileFormat : java.lang.String, + folder : java.lang.String, + modeMap : scala.Option[scala.List[java.lang.String]], + source : java.lang.String, + urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim ) - object Scenario { - case class Urbansim( - activitySimEnabled: scala.Boolean + activitySimEnabled : scala.Boolean ) - object Urbansim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ) + fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - scenario = BeamConfig.Beam.Exchange.Scenario( - if (c.hasPathOrNull("scenario")) c.getConfig("scenario") - else com.typesafe.config.ConfigFactory.parseString("scenario{}") - ) + output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) ) } } - + case class Experimental( - optimizer: BeamConfig.Beam.Experimental.Optimizer + optimizer : BeamConfig.Beam.Experimental.Optimizer ) - object Experimental { - case class Optimizer( - enabled: scala.Boolean + enabled : scala.Boolean ) - object Optimizer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer( - if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") - else com.typesafe.config.ConfigFactory.parseString("optimizer{}") - ) + optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) ) } } - + case class Input( - lastBaseOutputDir: java.lang.String, - simulationPrefix: java.lang.String + lastBaseOutputDir : java.lang.String, + simulationPrefix : java.lang.String ) - object Input { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn: scala.Boolean + keepConsoleAppenderOn : scala.Boolean ) - object Logger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level: java.lang.String + level : java.lang.String ) - object Metrics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation: scala.Boolean + writePlansAndStopSimulation : scala.Boolean ) - object Output { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = - c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory: scala.Boolean, - baseOutputDirectory: java.lang.String, - collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, - defaultWriteInterval: scala.Int, - displayPerformanceTimings: scala.Boolean, - events: BeamConfig.Beam.Outputs.Events, - generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval: scala.Int, - matsim: BeamConfig.Beam.Outputs.Matsim, - stats: BeamConfig.Beam.Outputs.Stats, - writeAnalysis: scala.Boolean, - writeEventsInterval: scala.Int, - writeGraphs: scala.Boolean, - writeLinkTraversalInterval: scala.Int, - writePlansInterval: scala.Int, - writeR5RoutesInterval: scala.Int + addTimestampToOutputDirectory : scala.Boolean, + baseOutputDirectory : java.lang.String, + collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, + defaultWriteInterval : scala.Int, + displayPerformanceTimings : scala.Boolean, + events : BeamConfig.Beam.Outputs.Events, + generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval : scala.Int, + matsim : BeamConfig.Beam.Outputs.Matsim, + stats : BeamConfig.Beam.Outputs.Stats, + writeAnalysis : scala.Boolean, + writeEventsInterval : scala.Int, + writeGraphs : scala.Boolean, + writeLinkTraversalInterval : scala.Int, + writePlansInterval : scala.Int, + writeR5RoutesInterval : scala.Int ) - object Outputs { - case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime: scala.Int, - startTime: scala.Int + endTime : scala.Int, + startTime : scala.Int ) - object GeneralizedLinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles: java.lang.String, - deleteRootFolderFiles: java.lang.String + deleteITERSFolderFiles : java.lang.String, + deleteRootFolderFiles : java.lang.String ) - object Matsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = - if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = - if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize: scala.Int + binSize : scala.Int ) - object Stats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = - !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = - if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = - !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( - "collectAndCreateBeamAnalysisAndGraphs" - ), - defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( - if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") - else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") - ), - generalizedLinkStatsInterval = - if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ), - stats = BeamConfig.Beam.Outputs.Stats( - if (c.hasPathOrNull("stats")) c.getConfig("stats") - else com.typesafe.config.ConfigFactory.parseString("stats{}") - ), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writeLinkTraversalInterval = - if (c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), + defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), + generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), + stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writeLinkTraversalInterval = if(c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim: BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager: BeamConfig.Beam.Physsim.EventManager, - events: BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia: scala.Boolean, - eventsSampling: scala.Double, - flowCapacityFactor: scala.Double, - initializeRouterWithFreeFlowTimes: scala.Boolean, - inputNetworkFilePath: java.lang.String, - jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize: scala.Int, - linkStatsWriteInterval: scala.Int, - maxLinkLengthToApplySpeedScalingFactor: scala.Double, - name: java.lang.String, - network: BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath: java.lang.String, - parbprsim: BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize: scala.Double, - quick_fix_minCarSpeedInMetersPerSecond: scala.Double, - relaxation: BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim: scala.Boolean, - speedScalingFactor: scala.Double, - storageCapacityFactor: scala.Double, - writeEventsInterval: scala.Int, - writeMATSimNetwork: scala.Boolean, - writePlansInterval: scala.Int, - writeRouteHistoryInterval: scala.Int + bprsim : BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager : BeamConfig.Beam.Physsim.EventManager, + events : BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia : scala.Boolean, + eventsSampling : scala.Double, + flowCapacityFactor : scala.Double, + initializeRouterWithFreeFlowTimes : scala.Boolean, + inputNetworkFilePath : java.lang.String, + jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize : scala.Int, + linkStatsWriteInterval : scala.Int, + maxLinkLengthToApplySpeedScalingFactor : scala.Double, + name : java.lang.String, + network : BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath : java.lang.String, + parbprsim : BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize : scala.Double, + quick_fix_minCarSpeedInMetersPerSecond : scala.Double, + relaxation : BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim : scala.Boolean, + speedScalingFactor : scala.Double, + storageCapacityFactor : scala.Double, + writeEventsInterval : scala.Int, + writeMATSimNetwork : scala.Boolean, + writePlansInterval : scala.Int, + writeRouteHistoryInterval : scala.Int ) - object Physsim { - case class Bprsim( - inFlowAggregationTimeWindowInSeconds: scala.Int, - minFlowToUseBPRFunction: scala.Int, - travelTimeFunction: java.lang.String + inFlowAggregationTimeWindowInSeconds : scala.Int, + minFlowToUseBPRFunction : scala.Int, + travelTimeFunction : java.lang.String ) - object Bprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = - if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) - c.getInt("inFlowAggregationTimeWindowInSeconds") - else 900, - minFlowToUseBPRFunction = - if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, + minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor: scala.Double + congestionFactor : scala.Double ) - object CchRoutingAssignment { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax: scala.Int, - departureTimeShiftMin: scala.Int, - fractionOfEventsToDuplicate: scala.Double + departureTimeShiftMax : scala.Int, + departureTimeShiftMin : scala.Int, + fractionOfEventsToDuplicate : scala.Double ) - object DuplicatePTE { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = - if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = - if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = - if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads: scala.Int, - `type`: java.lang.String + numberOfThreads : scala.Int, + `type` : java.lang.String ) - object EventManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) - object Jdeqsim { - case class AgentSimPhysSimInterfaceDebugger( - enabled: scala.Boolean + enabled : scala.Boolean ) - object AgentSimPhysSimInterfaceDebugger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, - capacityPlansWriteInterval: scala.Int, - enabled: scala.Boolean, - minRoadCapacity: scala.Int, - minSpeedMetersPerSec: scala.Int, - speedAdjustmentFactor: scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, + capacityPlansWriteInterval : scala.Int, + enabled : scala.Boolean, + minRoadCapacity : scala.Int, + minSpeedMetersPerSec : scala.Int, + speedAdjustmentFactor : scala.Double ) - object Cacc { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = - if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) - c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") - else 1.3, - capacityPlansWriteInterval = - if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = - if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = - if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, + capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( - if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") - else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") - ), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - if (c.hasPathOrNull("cacc")) c.getConfig("cacc") - else com.typesafe.config.ConfigFactory.parseString("cacc{}") - ) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) ) } } - + case class Network( - maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) - object Network { - case class MaxSpeedInference( - enabled: scala.Boolean, - `type`: java.lang.String + enabled : scala.Boolean, + `type` : java.lang.String ) - object MaxSpeedInference { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled: scala.Boolean, - livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled : scala.Boolean, + livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) - object OverwriteRoadTypeProperties { - case class LivingStreet( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object LivingStreet { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Minor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Motorway { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object MotorwayLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Primary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object PrimaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Residential { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Secondary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object SecondaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Tertiary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TertiaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Trunk { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TrunkLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Unclassified { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") - else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") - ), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - if (c.hasPathOrNull("minor")) c.getConfig("minor") - else com.typesafe.config.ConfigFactory.parseString("minor{}") - ), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - if (c.hasPathOrNull("motorway")) c.getConfig("motorway") - else com.typesafe.config.ConfigFactory.parseString("motorway{}") - ), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") - else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") - ), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - if (c.hasPathOrNull("primary")) c.getConfig("primary") - else com.typesafe.config.ConfigFactory.parseString("primary{}") - ), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") - else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") - ), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - if (c.hasPathOrNull("residential")) c.getConfig("residential") - else com.typesafe.config.ConfigFactory.parseString("residential{}") - ), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - if (c.hasPathOrNull("secondary")) c.getConfig("secondary") - else com.typesafe.config.ConfigFactory.parseString("secondary{}") - ), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") - else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") - ), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") - else com.typesafe.config.ConfigFactory.parseString("tertiary{}") - ), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") - else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") - ), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - if (c.hasPathOrNull("trunk")) c.getConfig("trunk") - else com.typesafe.config.ConfigFactory.parseString("trunk{}") - ), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") - else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") - ), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") - else com.typesafe.config.ConfigFactory.parseString("unclassified{}") - ) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( - if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") - else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") - ), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") - else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") - ) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) ) } } - + case class Parbprsim( - numberOfClusters: scala.Int, - syncInterval: scala.Int + numberOfClusters : scala.Int, + syncInterval : scala.Int ) - object Parbprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier: scala.Double, - enabled: scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime: scala.Int + additionalTravelTimeMultiplier : scala.Double, + enabled : scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime : scala.Int ) - object PickUpDropOffAnalysis { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = - if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") - else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = - if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) - c.getInt("secondsFromPickUpPropOffToAffectTravelTime") - else 600 + additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 ) } } - + case class Relaxation( - experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type`: java.lang.String + experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type` : java.lang.String ) - object Relaxation { - case class Experiment20( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment20 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment21 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment30 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment40 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment50 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment51 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment52 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( - if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") - else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") - ), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( - if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") - else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") - ), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( - if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") - else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") - ), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( - if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") - else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") - ), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( - if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") - else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") - ), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( - if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") - else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") - ), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( - if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") - else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") - ), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim( - if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") - else com.typesafe.config.ConfigFactory.parseString("bprsim{}") - ), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( - if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") - else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") - ), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( - if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") - else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") - ), - eventManager = BeamConfig.Beam.Physsim.EventManager( - if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") - else com.typesafe.config.ConfigFactory.parseString("eventManager{}") - ), - events = BeamConfig.Beam.Physsim.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - eventsForFullVersionOfVia = - !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = - !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = - if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") - else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( - if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") - else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") - ), - linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = - if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = - if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) - c.getDouble("maxLinkLengthToApplySpeedScalingFactor") - else 50.0, - name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - overwriteLinkParamPath = - if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim( - if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") - else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") - ), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") - else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") - ), - ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = - if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) - c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") - else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation( - if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") - else com.typesafe.config.ConfigFactory.parseString("relaxation{}") - ), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = - if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = - if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), + eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), + events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), + linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, + name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), + ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1: scala.Double, - ModuleProbability_2: scala.Double, - ModuleProbability_3: scala.Double, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - clearModes: BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation: scala.Double, - maxAgentPlanMemorySize: scala.Int + ModuleProbability_1 : scala.Double, + ModuleProbability_2 : scala.Double, + ModuleProbability_3 : scala.Double, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + clearModes : BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation : scala.Double, + maxAgentPlanMemorySize : scala.Int ) - object Replanning { - case class ClearModes( - iteration: scala.Int, - modes: scala.Option[scala.List[java.lang.String]], - strategy: java.lang.String + iteration : scala.Int, + modes : scala.Option[scala.List[java.lang.String]], + strategy : java.lang.String ) - object ClearModes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes( - if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") - else com.typesafe.config.ConfigFactory.parseString("clearModes{}") - ), - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getDouble("fractionOfIterationsToDisableInnovation") - else Double.PositiveInfinity, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim: BeamConfig.Beam.Router.Skim + skim : BeamConfig.Beam.Router.Skim ) - object Router { - case class Skim( - activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims: scala.Int, - origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval: scala.Int, - writeSkimsInterval: scala.Int + activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims : scala.Int, + origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval : scala.Int, + writeSkimsInterval : scala.Int ) - object Skim { - case class ActivitySimSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object ActivitySimSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object DriveTimeSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") - else "skimsTravelTimeObservedVsSimulated", - name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", + name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String, - poolingTravelTimeOveheadFactor: scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, - writeFullSkimsInterval: scala.Int + fileBaseName : java.lang.String, + name : java.lang.String, + poolingTravelTimeOveheadFactor : scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, + writeFullSkimsInterval : scala.Int ) - object OriginDestinationSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = - if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") - else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = - if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) - c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") - else 0, - writeFullSkimsInterval = - if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, + writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName: java.lang.String, - geoHierarchy: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + geoHierarchy : java.lang.String, + name : java.lang.String ) - object TazSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object TransitCrowdingSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") - else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") - ), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") - else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") - ), - keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") - else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") - ), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( - if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") - else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") - ), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") - else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") - ), - writeAggregatedSkimsInterval = - if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), + keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), + writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim( - if (c.hasPathOrNull("skim")) c.getConfig("skim") - else com.typesafe.config.ConfigFactory.parseString("skim{}") - ) + skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) ) } } - + case class Routing( - baseDate: java.lang.String, - carRouter: java.lang.String, - gh: BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS: scala.Int, - overrideNetworkTravelTimesUsingSkims: scala.Boolean, - r5: BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor: scala.Double, - startingIterationForTravelTimesMSA: scala.Int, - transitOnStreetNetwork: scala.Boolean, - writeRoutingStatistic: scala.Boolean + baseDate : java.lang.String, + carRouter : java.lang.String, + gh : BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS : scala.Int, + overrideNetworkTravelTimesUsingSkims : scala.Boolean, + r5 : BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor : scala.Double, + startingIterationForTravelTimesMSA : scala.Int, + transitOnStreetNetwork : scala.Boolean, + writeRoutingStatistic : scala.Boolean ) - object Routing { - case class Gh( - useAlternativeRoutes: scala.Boolean + useAlternativeRoutes : scala.Boolean ) - object Gh { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath: java.lang.String, - bikeLaneScaleFactor: scala.Double, - departureWindow: scala.Double, - directory: java.lang.String, - directory2: scala.Option[java.lang.String], - linkRadiusMeters: scala.Double, - mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples: scala.Int, - osmFile: java.lang.String, - osmMapdbFile: java.lang.String, - travelTimeNoiseFraction: scala.Double + bikeLaneLinkIdsFilePath : java.lang.String, + bikeLaneScaleFactor : scala.Double, + departureWindow : scala.Double, + directory : java.lang.String, + directory2 : scala.Option[java.lang.String], + linkRadiusMeters : scala.Double, + mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples : scala.Int, + osmFile : java.lang.String, + osmMapdbFile : java.lang.String, + travelTimeNoiseFraction : scala.Double ) - object R5 { - case class MNetBuilder( - fromCRS: java.lang.String, - toCRS: java.lang.String + fromCRS : java.lang.String, + toCRS : java.lang.String ) - object MNetBuilder { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike: scala.Int + bike : scala.Int ) - object MaxDistanceLimitByModeInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = - if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = - if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( - if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") - else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") - ), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") - ), - numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmFile = - if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", - osmMapdbFile = - if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") - else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = - if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 - ) - } - } - + bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), + numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", + osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh( - if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") - ), - minimumPossibleSkimBasedTravelTimeInS = - if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) - c.getInt("minimumPossibleSkimBasedTravelTimeInS") - else 60, - overrideNetworkTravelTimesUsingSkims = - c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( - "overrideNetworkTravelTimesUsingSkims" - ), - r5 = BeamConfig.Beam.Routing.R5( - if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") - ), - skimTravelTimesScalingFactor = - if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = - if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") - else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), + minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, + overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), + r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), + skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric: BeamConfig.Beam.Sim.Metric, - termination: BeamConfig.Beam.Sim.Termination + metric : BeamConfig.Beam.Sim.Metric, + termination : BeamConfig.Beam.Sim.Termination ) - object Sim { - case class Metric( - collector: BeamConfig.Beam.Sim.Metric.Collector + collector : BeamConfig.Beam.Sim.Metric.Collector ) - object Metric { - case class Collector( - influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics: java.lang.String + influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics : java.lang.String ) - object Collector { - case class InfluxDbSimulationMetricCollector( - connectionString: java.lang.String, - database: java.lang.String + connectionString : java.lang.String, + database : java.lang.String ) - object InfluxDbSimulationMetricCollector { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = - if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = - BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - if (c.hasPathOrNull("influxDbSimulationMetricCollector")) - c.getConfig("influxDbSimulationMetricCollector") - else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") - ), - metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), + metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector( - if (c.hasPathOrNull("collector")) c.getConfig("collector") - else com.typesafe.config.ConfigFactory.parseString("collector{}") - ) + collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) ) } } - + case class Termination( - criterionName: java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName : java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) - object Termination { - case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration: scala.Int, - minLastIteration: scala.Int, - relativeTolerance: scala.Double + maxLastIteration : scala.Int, + minLastIteration : scala.Int, + relativeTolerance : scala.Double ) - object TerminateAtRideHailFleetStoredElectricityConvergence { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = - if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = - BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) - c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") - else - com.typesafe.config.ConfigFactory - .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") - ) + criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric( - if (c.hasPathOrNull("metric")) c.getConfig("metric") - else com.typesafe.config.ConfigFactory.parseString("metric{}") - ), - termination = BeamConfig.Beam.Sim.Termination( - if (c.hasPathOrNull("termination")) c.getConfig("termination") - else com.typesafe.config.ConfigFactory.parseString("termination{}") - ) + metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), + termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) ) } } - + case class Spatial( - boundingBoxBuffer: scala.Int, - localCRS: java.lang.String + boundingBoxBuffer : scala.Int, + localCRS : java.lang.String ) - object Spatial { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear ) - object Urbansim { - case class BackgroundODSkimsCreator( - calculationTimeoutHours: scala.Int, - enabled: scala.Boolean, - maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes: scala.Int, - peakHours: scala.Option[scala.List[scala.Double]], - routerType: java.lang.String, - skimsGeoType: java.lang.String, - skimsKind: java.lang.String + calculationTimeoutHours : scala.Int, + enabled : scala.Boolean, + maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes : scala.Int, + peakHours : scala.Option[scala.List[scala.Double]], + routerType : java.lang.String, + skimsGeoType : java.lang.String, + skimsKind : java.lang.String ) - object BackgroundODSkimsCreator { - case class MaxTravelDistanceInMeters( - bike: scala.Int, - walk: scala.Int + bike : scala.Int, + walk : scala.Int ) - object MaxTravelDistanceInMeters { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive: scala.Boolean, - transit: scala.Boolean, - walk: scala.Boolean + drive : scala.Boolean, + transit : scala.Boolean, + walk : scala.Boolean ) - object ModesToBuild { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = - if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") - ), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") - else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") - ), - numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), + numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes: scala.Double, - bike: scala.Double, - car: scala.Double, - drive_transit: scala.Double, - walk: scala.Double, - walk_transit: scala.Double + allModes : scala.Double, + bike : scala.Double, + car : scala.Double, + drive_transit : scala.Double, + walk : scala.Double, + walk_transit : scala.Double ) - object FractionOfModesToClear { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") - else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") - ), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( - if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") - else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") - ) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) ) } } - + case class WarmStart( - path: java.lang.String, - prepareData: scala.Boolean, - samplePopulationIntegerFlag: scala.Int, - skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type`: java.lang.String + path : java.lang.String, + prepareData : scala.Boolean, + samplePopulationIntegerFlag : scala.Int, + skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type` : java.lang.String ) - object WarmStart { - case class SkimsFilePaths$Elm( - skimType: java.lang.String, - skimsFilePath: java.lang.String + skimType : java.lang.String, + skimsFilePath : java.lang.String ) - object SkimsFilePaths$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if (c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = - if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = - if (c.hasPathOrNull("skimsFilePaths")) - scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) - else None, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if(c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim( - if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") - else com.typesafe.config.ConfigFactory.parseString("agentsim{}") - ), - calibration = BeamConfig.Beam.Calibration( - if (c.hasPathOrNull("calibration")) c.getConfig("calibration") - else com.typesafe.config.ConfigFactory.parseString("calibration{}") - ), - cluster = BeamConfig.Beam.Cluster( - if (c.hasPathOrNull("cluster")) c.getConfig("cluster") - else com.typesafe.config.ConfigFactory.parseString("cluster{}") - ), - debug = BeamConfig.Beam.Debug( - if (c.hasPathOrNull("debug")) c.getConfig("debug") - else com.typesafe.config.ConfigFactory.parseString("debug{}") - ), - exchange = BeamConfig.Beam.Exchange( - if (c.hasPathOrNull("exchange")) c.getConfig("exchange") - else com.typesafe.config.ConfigFactory.parseString("exchange{}") - ), - experimental = BeamConfig.Beam.Experimental( - if (c.hasPathOrNull("experimental")) c.getConfig("experimental") - else com.typesafe.config.ConfigFactory.parseString("experimental{}") - ), - input = BeamConfig.Beam.Input( - if (c.hasPathOrNull("input")) c.getConfig("input") - else com.typesafe.config.ConfigFactory.parseString("input{}") - ), - inputDirectory = - if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger( - if (c.hasPathOrNull("logger")) c.getConfig("logger") - else com.typesafe.config.ConfigFactory.parseString("logger{}") - ), - metrics = BeamConfig.Beam.Metrics( - if (c.hasPathOrNull("metrics")) c.getConfig("metrics") - else com.typesafe.config.ConfigFactory.parseString("metrics{}") - ), - output = BeamConfig.Beam.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - outputs = BeamConfig.Beam.Outputs( - if (c.hasPathOrNull("outputs")) c.getConfig("outputs") - else com.typesafe.config.ConfigFactory.parseString("outputs{}") - ), - physsim = BeamConfig.Beam.Physsim( - if (c.hasPathOrNull("physsim")) c.getConfig("physsim") - else com.typesafe.config.ConfigFactory.parseString("physsim{}") - ), - replanning = BeamConfig.Beam.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - router = BeamConfig.Beam.Router( - if (c.hasPathOrNull("router")) c.getConfig("router") - else com.typesafe.config.ConfigFactory.parseString("router{}") - ), - routing = BeamConfig.Beam.Routing( - if (c.hasPathOrNull("routing")) c.getConfig("routing") - else com.typesafe.config.ConfigFactory.parseString("routing{}") - ), - sim = BeamConfig.Beam.Sim( - if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") - ), - spatial = BeamConfig.Beam.Spatial( - if (c.hasPathOrNull("spatial")) c.getConfig("spatial") - else com.typesafe.config.ConfigFactory.parseString("spatial{}") - ), - urbansim = BeamConfig.Beam.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart( - if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") - else com.typesafe.config.ConfigFactory.parseString("warmStart{}") - ) + actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), + calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), + cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), + debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), + exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), + experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), + input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), + inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), + metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), + output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), + physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), + replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), + routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), + sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), + spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), + urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) ) } } - + case class Matsim( - conversion: BeamConfig.Matsim.Conversion, - modules: BeamConfig.Matsim.Modules + conversion : BeamConfig.Matsim.Conversion, + modules : BeamConfig.Matsim.Modules ) - object Matsim { - case class Conversion( - defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles: scala.Boolean, - matsimNetworkFile: java.lang.String, - osmFile: java.lang.String, - populationFile: java.lang.String, - scenarioDirectory: java.lang.String, - shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile: java.lang.String + defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles : scala.Boolean, + matsimNetworkFile : java.lang.String, + osmFile : java.lang.String, + populationFile : java.lang.String, + scenarioDirectory : java.lang.String, + shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile : java.lang.String ) - object Conversion { - case class DefaultHouseholdIncome( - currency: java.lang.String, - period: java.lang.String, - value: scala.Int + currency : java.lang.String, + period : java.lang.String, + value : scala.Int ) - object DefaultHouseholdIncome { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if (c.hasPathOrNull("period")) c.getString("period") else "year", - value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if(c.hasPathOrNull("period")) c.getString("period") else "year", + value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile: java.lang.String, - tazIdFieldName: java.lang.String + shapeFile : java.lang.String, + tazIdFieldName : java.lang.String ) - object ShapeConfig { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") - else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") - ), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = - if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = - if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = - if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") - else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( - if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") - else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") - ), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode: BeamConfig.Matsim.Modules.ChangeMode, - controler: BeamConfig.Matsim.Modules.Controler, - counts: BeamConfig.Matsim.Modules.Counts, - global: BeamConfig.Matsim.Modules.Global, - households: BeamConfig.Matsim.Modules.Households, - linkStats: BeamConfig.Matsim.Modules.LinkStats, - network: BeamConfig.Matsim.Modules.Network, - parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, - plans: BeamConfig.Matsim.Modules.Plans, - qsim: BeamConfig.Matsim.Modules.Qsim, - strategy: BeamConfig.Matsim.Modules.Strategy, - transit: BeamConfig.Matsim.Modules.Transit, - vehicles: BeamConfig.Matsim.Modules.Vehicles + changeMode : BeamConfig.Matsim.Modules.ChangeMode, + controler : BeamConfig.Matsim.Modules.Controler, + counts : BeamConfig.Matsim.Modules.Counts, + global : BeamConfig.Matsim.Modules.Global, + households : BeamConfig.Matsim.Modules.Households, + linkStats : BeamConfig.Matsim.Modules.LinkStats, + network : BeamConfig.Matsim.Modules.Network, + parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, + plans : BeamConfig.Matsim.Modules.Plans, + qsim : BeamConfig.Matsim.Modules.Qsim, + strategy : BeamConfig.Matsim.Modules.Strategy, + transit : BeamConfig.Matsim.Modules.Transit, + vehicles : BeamConfig.Matsim.Modules.Vehicles ) - object Modules { - case class ChangeMode( - modes: java.lang.String + modes : java.lang.String ) - object ChangeMode { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat: java.lang.String, - firstIteration: scala.Int, - lastIteration: scala.Int, - mobsim: java.lang.String, - outputDirectory: java.lang.String, - overwriteFiles: java.lang.String + eventsFileFormat : java.lang.String, + firstIteration : scala.Int, + lastIteration : scala.Int, + mobsim : java.lang.String, + outputDirectory : java.lang.String, + overwriteFiles : java.lang.String ) - object Controler { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = - if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Double, - inputCountsFile: java.lang.String, - outputformat: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Double, + inputCountsFile : java.lang.String, + outputformat : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem: java.lang.String, - randomSeed: scala.Int + coordinateSystem : java.lang.String, + randomSeed : scala.Int ) - object Global { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile: java.lang.String, - inputHouseholdAttributesFile: java.lang.String + inputFile : java.lang.String, + inputHouseholdAttributesFile : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = - if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = - if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") - else "/test/input/beamville/householdAttributes.xml" + inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations: scala.Int, - writeLinkStatsInterval: scala.Int + averageLinkStatsOverIterations : scala.Int, + writeLinkStatsInterval : scala.Int ) - object LinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = - if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = - if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile: java.lang.String + inputNetworkFile : java.lang.String ) - object Network { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = - if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") - else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents: scala.Int, - numberOfThreads: scala.Int, - oneThreadPerHandler: scala.Boolean, - synchronizeOnSimSteps: scala.Boolean + estimatedNumberOfEvents : scala.Int, + numberOfThreads : scala.Int, + oneThreadPerHandler : scala.Boolean, + synchronizeOnSimSteps : scala.Boolean ) - object ParallelEventHandling { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = - if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta: scala.Long, - earlyDeparture: scala.Long, - lateArrival: scala.Long, - learningRate: scala.Long, - parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing: scala.Long, - traveling: scala.Long, - waiting: scala.Long, - writeExperiencedPlans: scala.Boolean + BrainExpBeta : scala.Long, + earlyDeparture : scala.Long, + lateArrival : scala.Long, + learningRate : scala.Long, + parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing : scala.Long, + traveling : scala.Long, + waiting : scala.Long, + writeExperiencedPlans : scala.Boolean ) - object PlanCalcScore { - case class Parameterset$Elm( - activityType: java.lang.String, - priority: scala.Int, - scoringThisActivityAtAll: scala.Boolean, - `type`: java.lang.String, - typicalDuration: java.lang.String, - typicalDurationScoreComputation: java.lang.String + activityType : java.lang.String, + priority : scala.Int, + scoringThisActivityAtAll : scala.Boolean, + `type` : java.lang.String, + typicalDuration : java.lang.String, + typicalDurationScoreComputation : java.lang.String ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = - !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = - if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") - else "uniform" + activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = - if (c.hasPathOrNull("BrainExpBeta")) - c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) - else 2, - earlyDeparture = - if (c.hasPathOrNull("earlyDeparture")) - c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, - lateArrival = - if (c.hasPathOrNull("lateArrival")) - c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) - else -18, - learningRate = - if (c.hasPathOrNull("learningRate")) - c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) - else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = - if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) - else 6, - traveling = - if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) - else -6, - waiting = - if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, + BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, + earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, + learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, + traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, + waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.PlanCalcScore - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Plans( - inputPersonAttributesFile: java.lang.String, - inputPlansFile: java.lang.String + inputPersonAttributesFile : java.lang.String, + inputPlansFile : java.lang.String ) - object Plans { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = - if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") - else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = - if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") - else "/test/input/beamville/population.xml" + inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime: java.lang.String, - snapshotperiod: java.lang.String, - startTime: java.lang.String + endTime : java.lang.String, + snapshotperiod : java.lang.String, + startTime : java.lang.String ) - object Qsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1: scala.Int, - ModuleProbability_2: scala.Int, - ModuleProbability_3: scala.Int, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - fractionOfIterationsToDisableInnovation: scala.Int, - maxAgentPlanMemorySize: scala.Int, - parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval: java.lang.String + ModuleProbability_1 : scala.Int, + ModuleProbability_2 : scala.Int, + ModuleProbability_3 : scala.Int, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + fractionOfIterationsToDisableInnovation : scala.Int, + maxAgentPlanMemorySize : scala.Int, + parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval : java.lang.String ) - object Strategy { - case class Parameterset$Elm( - disableAfterIteration: scala.Int, - strategyName: java.lang.String, - `type`: java.lang.String, - weight: scala.Int + disableAfterIteration : scala.Int, + strategyName : java.lang.String, + `type` : java.lang.String, + weight : scala.Int ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getInt("fractionOfIterationsToDisableInnovation") - else 999999, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = - if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") - else "WorstPlanForRemovalSelector" - ) - } - - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" + ) + } + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.Strategy - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Transit( - transitModes: java.lang.String, - useTransit: scala.Boolean, - vehiclesFile: java.lang.String + transitModes : java.lang.String, + useTransit : scala.Boolean, + vehiclesFile : java.lang.String ) - object Transit { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile: java.lang.String + vehiclesFile : java.lang.String ) - object Vehicles { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode( - if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") - else com.typesafe.config.ConfigFactory.parseString("changeMode{}") - ), - controler = BeamConfig.Matsim.Modules.Controler( - if (c.hasPathOrNull("controler")) c.getConfig("controler") - else com.typesafe.config.ConfigFactory.parseString("controler{}") - ), - counts = BeamConfig.Matsim.Modules.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - global = BeamConfig.Matsim.Modules.Global( - if (c.hasPathOrNull("global")) c.getConfig("global") - else com.typesafe.config.ConfigFactory.parseString("global{}") - ), - households = BeamConfig.Matsim.Modules.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - linkStats = BeamConfig.Matsim.Modules.LinkStats( - if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") - else com.typesafe.config.ConfigFactory.parseString("linkStats{}") - ), - network = BeamConfig.Matsim.Modules.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( - if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") - else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") - ), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( - if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") - else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") - ), - plans = BeamConfig.Matsim.Modules.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - qsim = BeamConfig.Matsim.Modules.Qsim( - if (c.hasPathOrNull("qsim")) c.getConfig("qsim") - else com.typesafe.config.ConfigFactory.parseString("qsim{}") - ), - strategy = BeamConfig.Matsim.Modules.Strategy( - if (c.hasPathOrNull("strategy")) c.getConfig("strategy") - else com.typesafe.config.ConfigFactory.parseString("strategy{}") - ), - transit = BeamConfig.Matsim.Modules.Transit( - if (c.hasPathOrNull("transit")) c.getConfig("transit") - else com.typesafe.config.ConfigFactory.parseString("transit{}") - ), - vehicles = BeamConfig.Matsim.Modules.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) + changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), + controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), + counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), + households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), + network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), + plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), + strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), + transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), + vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion( - if (c.hasPathOrNull("conversion")) c.getConfig("conversion") - else com.typesafe.config.ConfigFactory.parseString("conversion{}") - ), - modules = BeamConfig.Matsim.Modules( - if (c.hasPathOrNull("modules")) c.getConfig("modules") - else com.typesafe.config.ConfigFactory.parseString("modules{}") - ) + conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), + modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam( - if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") - ), - matsim = BeamConfig.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ) + beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), + matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) ) } - private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - - private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - - private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { + private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ( - (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number] - ) throw $_expE(cv, "double") + if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - - private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { + private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException( - cv.origin.lineNumber + + new java.lang.RuntimeException(cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) - ) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) } - - private def $_str(cv: com.typesafe.config.ConfigValue) = + private def $_str(cv:com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } + diff --git a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala index 6e9f42fb58c..e823fbe113a 100644 --- a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala @@ -79,6 +79,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -121,6 +122,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) @@ -180,6 +182,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -254,6 +257,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -341,6 +345,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -395,6 +400,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index ba0a59e18cd..beb0f0f1a37 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -441,7 +441,8 @@ class ZonalParkingManagerSpec beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) assertParkingResponse( diff --git a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala index 077802adb18..c820b489620 100644 --- a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala @@ -18,7 +18,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { PricingModel("flatfee", inputCost.toString) match { case Some(PricingModel.FlatFee(cost)) => cost should equal(inputCost) - PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration) should equal( + PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration, 0.0) should equal( inputCost ) case _ => fail() @@ -31,7 +31,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { case Some(PricingModel.Block(cost, intervalInSeconds)) => cost should equal(100) intervalInSeconds should equal(PricingModel.DefaultPricingInterval) - PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration) should equal( + PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration, 0.0) should equal( inputCost * 2 ) case _ => fail() @@ -54,7 +54,8 @@ class PricingModelSpec extends AnyWordSpec with Matchers { inputCost.toDouble * (parkingDuration.toDouble / blockIntervalInSeconds.toDouble) PricingModel.evaluateParkingTicket( PricingModel.Block(cost, intervalInSeconds), - parkingDuration + parkingDuration, + 0.0 ) should equal( expectedTicketPrice ) From a61a08726772eee5ae2fd5b295c25b2158fa391b Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 9 Mar 2022 14:38:34 -0800 Subject: [PATCH 031/307] introducing emergency fix --- .../household/HouseholdFleetManager.scala | 65 +- .../scala/beam/sim/config/BeamConfig.scala | 5541 +++++++++++------ 2 files changed, 3608 insertions(+), 1998 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 05923c1978f..28c0d1a7a1a 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -142,43 +142,38 @@ class HouseholdFleetManager( for { neededVehicleCategory <- requireVehicleCategoryAvailable emergencyHouseholdVehicleGenerator <- maybeEmergencyHouseholdVehicleGenerator + vehicle <- emergencyHouseholdVehicleGenerator.createVehicle( + personId, + nextVehicleIndex, + neededVehicleCategory, + whenWhere, + self + ) } yield { - val vehicleCreatedOutOfThinAir: Boolean = if (availableVehicles.isEmpty) { - emergencyHouseholdVehicleGenerator.createVehicle( - personId, - nextVehicleIndex, - neededVehicleCategory, + if (availableVehicles.isEmpty) { + // Create a vehicle out of thin air + nextVehicleIndex += 1 + val mobilityRequester = sender() + vehiclesInternal(vehicle.id) = vehicle + + // Pipe my car through the parking manager + // and complete initialization only when I got them all. + val responseFuture = parkingManager ? ParkingInquiry.init( whenWhere, - self - ) match { - case Some(vehicle) => - logger.warn( - s"No vehicles available for category ${neededVehicleCategory} available for person ${personId.toString}, creating a new vehicle with id ${vehicle.id.toString}" - ) - nextVehicleIndex += 1 - val mobilityRequester = sender() - vehiclesInternal(vehicle.id) = vehicle - - // Pipe my car through the parking manager - // and complete initialization only when I got them all. - val responseFuture = parkingManager ? ParkingInquiry.init( - whenWhere, - "wherever", - triggerId = triggerId - ) - responseFuture.collect { case ParkingInquiryResponse(stall, _, otherTriggerId) => - vehicle.useParkingStall(stall) - logger.debug("Vehicle {} is now taken, which was just created", vehicle.id) - vehicle.becomeDriver(mobilityRequester) - MobilityStatusResponse(Vector(ActualVehicle(vehicle)), otherTriggerId) - } pipeTo mobilityRequester - true - case _ => - false - } - } else false - - if (!vehicleCreatedOutOfThinAir) { + "wherever", + triggerId = triggerId + ) + logger.warn( + s"No vehicles available for category ${neededVehicleCategory} available for person ${personId.toString}, creating a new vehicle with id ${vehicle.id.toString}" + ) + + responseFuture.collect { case ParkingInquiryResponse(stall, _, otherTriggerId) => + vehicle.useParkingStall(stall) + logger.debug("Vehicle {} is now taken, which was just created", vehicle.id) + vehicle.becomeDriver(mobilityRequester) + MobilityStatusResponse(Vector(ActualVehicle(vehicle)), otherTriggerId) + } pipeTo mobilityRequester + } else { availableVehicles = availableVehicles match { case firstVehicle :: rest => logger.debug("Vehicle {} is now taken", firstVehicle.id) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index cd3fb1e56c8..63402520503 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,3526 +3,5141 @@ package beam.sim.config case class BeamConfig( - beam : BeamConfig.Beam, - matsim : BeamConfig.Matsim + beam: BeamConfig.Beam, + matsim: BeamConfig.Matsim ) + object BeamConfig { + case class Beam( - actorSystemName : java.lang.String, - agentsim : BeamConfig.Beam.Agentsim, - calibration : BeamConfig.Beam.Calibration, - cluster : BeamConfig.Beam.Cluster, - debug : BeamConfig.Beam.Debug, - exchange : BeamConfig.Beam.Exchange, - experimental : BeamConfig.Beam.Experimental, - input : BeamConfig.Beam.Input, - inputDirectory : java.lang.String, - logger : BeamConfig.Beam.Logger, - metrics : BeamConfig.Beam.Metrics, - output : BeamConfig.Beam.Output, - outputs : BeamConfig.Beam.Outputs, - physsim : BeamConfig.Beam.Physsim, - replanning : BeamConfig.Beam.Replanning, - router : BeamConfig.Beam.Router, - routing : BeamConfig.Beam.Routing, - sim : BeamConfig.Beam.Sim, - spatial : BeamConfig.Beam.Spatial, - urbansim : BeamConfig.Beam.Urbansim, - useLocalWorker : scala.Boolean, - warmStart : BeamConfig.Beam.WarmStart + actorSystemName: java.lang.String, + agentsim: BeamConfig.Beam.Agentsim, + calibration: BeamConfig.Beam.Calibration, + cluster: BeamConfig.Beam.Cluster, + debug: BeamConfig.Beam.Debug, + exchange: BeamConfig.Beam.Exchange, + experimental: BeamConfig.Beam.Experimental, + input: BeamConfig.Beam.Input, + inputDirectory: java.lang.String, + logger: BeamConfig.Beam.Logger, + metrics: BeamConfig.Beam.Metrics, + output: BeamConfig.Beam.Output, + outputs: BeamConfig.Beam.Outputs, + physsim: BeamConfig.Beam.Physsim, + replanning: BeamConfig.Beam.Replanning, + router: BeamConfig.Beam.Router, + routing: BeamConfig.Beam.Routing, + sim: BeamConfig.Beam.Sim, + spatial: BeamConfig.Beam.Spatial, + urbansim: BeamConfig.Beam.Urbansim, + useLocalWorker: scala.Boolean, + warmStart: BeamConfig.Beam.WarmStart ) + object Beam { + case class Agentsim( - agentSampleSizeAsFractionOfPopulation : scala.Double, - agents : BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime : java.lang.String, - firstIteration : scala.Int, - fractionOfPlansWithSingleActivity : scala.Double, - h3taz : BeamConfig.Beam.Agentsim.H3taz, - lastIteration : scala.Int, - populationAdjustment : java.lang.String, - scenarios : BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow : scala.Int, - simulationName : java.lang.String, - taz : BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters : scala.Int, - thresholdForWalkingInMeters : scala.Int, - timeBinSize : scala.Int, - toll : BeamConfig.Beam.Agentsim.Toll, - tuning : BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation: scala.Double, + agents: BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime: java.lang.String, + firstIteration: scala.Int, + fractionOfPlansWithSingleActivity: scala.Double, + h3taz: BeamConfig.Beam.Agentsim.H3taz, + lastIteration: scala.Int, + populationAdjustment: java.lang.String, + scenarios: BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow: scala.Int, + simulationName: java.lang.String, + taz: BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters: scala.Int, + thresholdForWalkingInMeters: scala.Int, + timeBinSize: scala.Int, + toll: BeamConfig.Beam.Agentsim.Toll, + tuning: BeamConfig.Beam.Agentsim.Tuning ) + object Agentsim { + case class Agents( - activities : BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType : java.lang.String, - freight : BeamConfig.Beam.Agentsim.Agents.Freight, - households : BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking : BeamConfig.Beam.Agentsim.Agents.Parking, - plans : BeamConfig.Beam.Agentsim.Agents.Plans, - population : BeamConfig.Beam.Agentsim.Agents.Population, - ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles + activities: BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType: java.lang.String, + freight: BeamConfig.Beam.Agentsim.Agents.Freight, + households: BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking: BeamConfig.Beam.Agentsim.Agents.Parking, + plans: BeamConfig.Beam.Agentsim.Agents.Plans, + population: BeamConfig.Beam.Agentsim.Agents.Population, + ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles ) + object Agents { + case class Activities( - activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] ) + object Activities { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None + activityTypeToFixedDurationMap = + if (c.hasPathOrNull("activityTypeToFixedDurationMap")) + scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) + else None ) } } - + case class Freight( - carrierParkingFilePath : scala.Option[java.lang.String], - carriersFilePath : java.lang.String, - convertWgs2Utm : scala.Boolean, - enabled : scala.Boolean, - generateFixedActivitiesDurations : scala.Boolean, - name : java.lang.String, - plansFilePath : java.lang.String, - reader : java.lang.String, - replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath : java.lang.String + carrierParkingFilePath: scala.Option[java.lang.String], + carriersFilePath: java.lang.String, + convertWgs2Utm: scala.Boolean, + enabled: scala.Boolean, + generateFixedActivitiesDurations: scala.Boolean, + name: java.lang.String, + plansFilePath: java.lang.String, + reader: java.lang.String, + replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath: java.lang.String ) + object Freight { + case class Replanning( - departureTime : scala.Int, - disableAfterIteration : scala.Int, - strategy : java.lang.String + departureTime: scala.Int, + disableAfterIteration: scala.Int, + strategy: java.lang.String ) + object Replanning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", - reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = + if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = + if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") + else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = + c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = + if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") + else "/test/input/beamville/freight/payload-plans.csv", + reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + toursFilePath = + if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") + else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath : java.lang.String, - inputHouseholdAttributesFilePath : java.lang.String + inputFilePath: java.lang.String, + inputHouseholdAttributesFilePath: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = + if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") + else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = + if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") + else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime : scala.Double, - highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts : scala.Int, - minimumValueOfTime : scala.Double, - modeChoiceClass : java.lang.String, - modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT : scala.Boolean, - overrideAutomationLevel : scala.Int, - poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] + defaultValueOfTime: scala.Double, + highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts: scala.Int, + minimumValueOfTime: scala.Double, + modeChoiceClass: java.lang.String, + modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT: scala.Boolean, + overrideAutomationLevel: scala.Int, + poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] ) + object ModalBehaviors { + case class HighTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) + object HighTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class Lccm( - filePath : java.lang.String + filePath: java.lang.String ) + object Lccm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) + object LowTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class ModeVotMultiplier( - CAV : scala.Double, - bike : scala.Double, - drive : scala.Double, - rideHail : scala.Double, - rideHailPooled : scala.Double, - rideHailTransit : scala.Double, - transit : scala.Double, - waiting : scala.Double, - walk : scala.Double + CAV: scala.Double, + bike: scala.Double, + drive: scala.Double, + rideHail: scala.Double, + rideHailPooled: scala.Double, + rideHailTransit: scala.Double, + transit: scala.Double, + waiting: scala.Double, + walk: scala.Double ) + object ModeVotMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor : scala.Double + params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor: scala.Double ) + object MulitnomialLogit { + case class Params( - bike_intercept : scala.Double, - bike_transit_intercept : scala.Double, - car_intercept : scala.Double, - cav_intercept : scala.Double, - drive_transit_intercept : scala.Double, - ride_hail_intercept : scala.Double, - ride_hail_pooled_intercept : scala.Double, - ride_hail_transit_intercept : scala.Double, - transfer : scala.Double, - transit_crowding : scala.Double, - transit_crowding_VOT_multiplier : scala.Double, - transit_crowding_VOT_threshold : scala.Double, - transit_crowding_percentile : scala.Double, - walk_intercept : scala.Double, - walk_transit_intercept : scala.Double + bike_intercept: scala.Double, + bike_transit_intercept: scala.Double, + car_intercept: scala.Double, + cav_intercept: scala.Double, + drive_transit_intercept: scala.Double, + ride_hail_intercept: scala.Double, + ride_hail_pooled_intercept: scala.Double, + ride_hail_transit_intercept: scala.Double, + transfer: scala.Double, + transit_crowding: scala.Double, + transit_crowding_VOT_multiplier: scala.Double, + transit_crowding_VOT_threshold: scala.Double, + transit_crowding_percentile: scala.Double, + walk_intercept: scala.Double, + walk_transit_intercept: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, - ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, - transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, - transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, - transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, - walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = + if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = + if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = + if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = + if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") + else 0.0, + ride_hail_transit_intercept = + if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") + else 0.0, + transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = + if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) + c.getDouble("transit_crowding_VOT_multiplier") + else 0.0, + transit_crowding_VOT_threshold = + if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") + else 0.5, + transit_crowding_percentile = + if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") + else 90.0, + walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = + if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), - utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ), + utility_scale_factor = + if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object PoolingMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), - maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, - minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), - transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None - ) - } - } - + defaultValueOfTime = + if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( + if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") + ), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( + if (c.hasPathOrNull("lccm")) c.getConfig("lccm") + else com.typesafe.config.ConfigFactory.parseString("lccm{}") + ), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( + if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") + ), + maximumNumberOfReplanningAttempts = + if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") + else 3, + minimumValueOfTime = + if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = + if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") + else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( + if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") + else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + overrideAutomationForVOTT = + c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = + if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( + if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") + else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") + ), + transitVehicleTypeVOTMultipliers = + if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) + scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) + else None + ) + } + } + case class ModeIncentive( - filePath : java.lang.String + filePath: java.lang.String ) + object ModeIncentive { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - estimatedMinParkingDuration : scala.Double, - maxSearchRadius : scala.Double, - minSearchRadius : scala.Double, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - rangeAnxietyBuffer : scala.Double, - searchMaxDistanceRelativeToEllipseFoci : scala.Double + estimatedMinParkingDuration: scala.Double, + maxSearchRadius: scala.Double, + minSearchRadius: scala.Double, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + rangeAnxietyBuffer: scala.Double, + searchMaxDistanceRelativeToEllipseFoci: scala.Double ) + object Parking { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - distanceMultiplier : scala.Double, - enrouteDetourMultiplier : scala.Double, - homeActivityPrefersResidentialParkingMultiplier : scala.Double, - parkingPriceMultiplier : scala.Double, - rangeAnxietyMultiplier : scala.Double + distanceMultiplier: scala.Double, + enrouteDetourMultiplier: scala.Double, + homeActivityPrefersResidentialParkingMultiplier: scala.Double, + parkingPriceMultiplier: scala.Double, + rangeAnxietyMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, - parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = + if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = + if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = + if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) + c.getDouble("homeActivityPrefersResidentialParkingMultiplier") + else 1.0, + parkingPriceMultiplier = + if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = + if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - estimatedMinParkingDuration = if(c.hasPathOrNull("estimatedMinParkingDuration")) c.getDouble("estimatedMinParkingDuration") else 60.0, - maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 + estimatedMinParkingDuration = + if (c.hasPathOrNull("estimatedMinParkingDuration")) c.getDouble("estimatedMinParkingDuration") + else 60.0, + maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + rangeAnxietyBuffer = + if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = + if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) + c.getDouble("searchMaxDistanceRelativeToEllipseFoci") + else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath : java.lang.String, - inputPlansFilePath : java.lang.String, - merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath: java.lang.String, + inputPlansFilePath: java.lang.String, + merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) + object Plans { + case class Merge( - fraction : scala.Double + fraction: scala.Double ) + object Merge { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) + inputPersonAttributesFilePath = + if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") + else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = + if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") + else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( + if (c.hasPathOrNull("merge")) c.getConfig("merge") + else com.typesafe.config.ConfigFactory.parseString("merge{}") + ) ) } } - + case class Population( - industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling : scala.Boolean + industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling: scala.Boolean ) + object Population { + case class IndustryRemovalProbabilty( - enabled : scala.Boolean, - inputFilePath : java.lang.String, - removalStrategy : java.lang.String + enabled: scala.Boolean, + inputFilePath: java.lang.String, + removalStrategy: java.lang.String ) + object IndustryRemovalProbabilty { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = + if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( + if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") + else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") + ), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath : java.lang.String + filePath: java.lang.String ) + object PtFare { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost : scala.Double, - defaultCostPerMile : scala.Double, - defaultCostPerMinute : scala.Double, - human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations : scala.Boolean, - name : java.lang.String, - pooledBaseCost : scala.Double, - pooledCostPerMile : scala.Double, - pooledCostPerMinute : scala.Double, - pooledToRegularRideCostRatio : scala.Double, - rangeBufferForDispatchInMeters : scala.Int, - refuelLocationType : java.lang.String, - refuelThresholdInMeters : scala.Double, - repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost: scala.Double, + defaultCostPerMile: scala.Double, + defaultCostPerMinute: scala.Double, + human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations: scala.Boolean, + name: java.lang.String, + pooledBaseCost: scala.Double, + pooledCostPerMile: scala.Double, + pooledCostPerMinute: scala.Double, + pooledToRegularRideCostRatio: scala.Double, + rangeBufferForDispatchInMeters: scala.Int, + refuelLocationType: java.lang.String, + refuelThresholdInMeters: scala.Double, + repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) + object RideHail { + case class AllocationManager( - alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm : java.lang.String, - maxExcessRideTime : scala.Double, - maxWaitingTimeInSec : scala.Int, - name : java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, - repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds : scala.Int + alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm: java.lang.String, + maxExcessRideTime: scala.Double, + maxWaitingTimeInSec: scala.Int, + name: java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, + repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds: scala.Int ) + object AllocationManager { + case class AlonsoMora( - maxRequestsPerVehicle : scala.Int + maxRequestsPerVehicle: scala.Int ) + object AlonsoMora { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = + if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, - demandWeight : scala.Double, - distanceWeight : scala.Double, - keepMaxTopNScores : scala.Int, - minDemandPercentageInRadius : scala.Double, - minScoreThresholdForRepositioning : scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, - percentageOfVehiclesToReposition : scala.Double, - produceDebugImages : scala.Boolean, - repositionCircleRadiusInMeters : scala.Double, - repositioningMethod : java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, - waitingTimeWeight : scala.Double + allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, + demandWeight: scala.Double, + distanceWeight: scala.Double, + keepMaxTopNScores: scala.Int, + minDemandPercentageInRadius: scala.Double, + minScoreThresholdForRepositioning: scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, + percentageOfVehiclesToReposition: scala.Double, + produceDebugImages: scala.Boolean, + repositionCircleRadiusInMeters: scala.Double, + repositioningMethod: java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, + waitingTimeWeight: scala.Double ) + object RepositionLowWaitingTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, - minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, - percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, - repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, - waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( + "allowIncreasingRadiusIfDemandInRadiusLow" + ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = + if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") + else 0.1, + minScoreThresholdForRepositioning = + if (c.hasPathOrNull("minScoreThresholdForRepositioning")) + c.getDouble("minScoreThresholdForRepositioning") + else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = + if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) + c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") + else 1, + percentageOfVehiclesToReposition = + if (c.hasPathOrNull("percentageOfVehiclesToReposition")) + c.getDouble("percentageOfVehiclesToReposition") + else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = + if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") + else 3000, + repositioningMethod = + if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = + if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) + c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") + else 1200, + waitingTimeWeight = + if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), - matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, - repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), - requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( + if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") + else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") + ), + matchingAlgorithm = + if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") + else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = + if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = + if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) + c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") + else 1, + repositionLowWaitingTimes = + BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( + if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") + else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") + ), + requestBufferTimeoutInSeconds = + if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Int ) + object Cav { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 16090, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) + object Charging { + case class VehicleChargingManager( - defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, - name : java.lang.String + defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager, + name: java.lang.String ) + object VehicleChargingManager { + case class DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging : scala.Double, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, - noChargingThresholdExpirationTimeInS : scala.Int + fractionAvailableThresholdToFavorFasterCharging: scala.Double, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit, + noChargingThresholdExpirationTimeInS: scala.Int ) + object DefaultVehicleChargingManager { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - chargingTimeMultiplier : scala.Double, - drivingTimeMultiplier : scala.Double, - insufficientRangeMultiplier : scala.Double, - queueingTimeMultiplier : scala.Double + chargingTimeMultiplier: scala.Double, + drivingTimeMultiplier: scala.Double, + insufficientRangeMultiplier: scala.Double, + queueingTimeMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( - chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, - drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, - insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, - queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + chargingTimeMultiplier = + if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") + else -0.01666667, + drivingTimeMultiplier = + if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") + else -0.01666667, + insufficientRangeMultiplier = + if (c.hasPathOrNull("insufficientRangeMultiplier")) + c.getDouble("insufficientRangeMultiplier") + else -60.0, + queueingTimeMultiplier = + if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") + else -0.01666667 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + params = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( - fractionAvailableThresholdToFavorFasterCharging = if(c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) c.getDouble("fractionAvailableThresholdToFavorFasterCharging") else 1.01, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - noChargingThresholdExpirationTimeInS = if(c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) c.getInt("noChargingThresholdExpirationTimeInS") else 0 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + fractionAvailableThresholdToFavorFasterCharging = + if (c.hasPathOrNull("fractionAvailableThresholdToFavorFasterCharging")) + c.getDouble("fractionAvailableThresholdToFavorFasterCharging") + else 1.01, + mulitnomialLogit = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + noChargingThresholdExpirationTimeInS = + if (c.hasPathOrNull("noChargingThresholdExpirationTimeInS")) + c.getInt("noChargingThresholdExpirationTimeInS") + else 0 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" + defaultVehicleChargingManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + if (c.hasPathOrNull("defaultVehicleChargingManager")) + c.getConfig("defaultVehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DefaultVehicleChargingManager" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( + if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") + ) ) } } - + case class Human( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Double + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Double ) + object Human { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getDouble("valueOfTime") else 22.9 ) } } - + case class Initialization( - filePath : java.lang.String, - initType : java.lang.String, - parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath: java.lang.String, + initType: java.lang.String, + parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) + object Initialization { + case class Parking( - filePath : java.lang.String + filePath: java.lang.String ) + object Parking { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet : scala.Double, - initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId : java.lang.String, - vehicleTypePrefix : java.lang.String + fractionOfInitialVehicleFleet: scala.Double, + initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId: java.lang.String, + vehicleTypePrefix: java.lang.String ) + object Procedural { + case class InitialLocation( - home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name : java.lang.String + home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name: java.lang.String ) + object InitialLocation { + case class Home( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object Home { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( + if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") + else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") + ), + vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = + if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( + if (c.hasPathOrNull("procedural")) c.getConfig("procedural") + else com.typesafe.config.ConfigFactory.parseString("procedural{}") + ) ) } } - + case class IterationStats( - timeBinSizeInSec : scala.Double + timeBinSizeInSec: scala.Double ) + object IterationStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name : java.lang.String, - timeout : scala.Int + demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name: java.lang.String, + timeout: scala.Int ) + object RepositioningManager { + case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider : scala.Double, - horizon : scala.Int, - numberOfClustersForDemand : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDemandForCAVs : scala.Double + fractionOfClosestClustersToConsider: scala.Double, + horizon: scala.Int, + numberOfClustersForDemand: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDemandForCAVs: scala.Double ) + object DemandFollowingRepositioningManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, - horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, - sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 + fractionOfClosestClustersToConsider = + if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) + c.getDouble("fractionOfClosestClustersToConsider") + else 0.2, + horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = + if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 1, + sensitivityOfRepositioningToDemandForCAVs = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) + c.getDouble("sensitivityOfRepositioningToDemandForCAVs") + else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDistance : scala.Double + predictionHorizon: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDistance: scala.Double ) + object InverseSquareDistanceRepositioningFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, - sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 + predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 0.4, + sensitivityOfRepositioningToDistance = + if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) + c.getDouble("sensitivityOfRepositioningToDistance") + else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( + if (c.hasPathOrNull("demandFollowingRepositioningManager")) + c.getConfig("demandFollowingRepositioningManager") + else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") + ), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager + .InverseSquareDistanceRepositioningFactor( + if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) + c.getConfig("inverseSquareDistanceRepositioningFactor") + else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object RideHailManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel : scala.Double, - numberOfCategories : scala.Int, - priceAdjustmentStrategy : java.lang.String, - surgeLevelAdaptionStep : scala.Double + minimumSurgeLevel: scala.Double, + numberOfCategories: scala.Int, + priceAdjustmentStrategy: java.lang.String, + surgeLevelAdaptionStep: scala.Double ) + object SurgePricing { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = + if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") + else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = + if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), - defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), - linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - pooledToRegularRideCostRatio = if(c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") else 0.6, - rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, - refuelLocationType = if(c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", - refuelThresholdInMeters = if(c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( + if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") + else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") + ), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( + if (c.hasPathOrNull("cav")) c.getConfig("cav") + else com.typesafe.config.ConfigFactory.parseString("cav{}") + ), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( + if (c.hasPathOrNull("charging")) c.getConfig("charging") + else com.typesafe.config.ConfigFactory.parseString("charging{}") + ), + defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = + if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = + if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( + if (c.hasPathOrNull("human")) c.getConfig("human") + else com.typesafe.config.ConfigFactory.parseString("human{}") + ), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( + if (c.hasPathOrNull("initialization")) c.getConfig("initialization") + else com.typesafe.config.ConfigFactory.parseString("initialization{}") + ), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( + if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") + else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") + ), + linkFleetStateAcrossIterations = + c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = + if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + pooledToRegularRideCostRatio = + if (c.hasPathOrNull("pooledToRegularRideCostRatio")) c.getDouble("pooledToRegularRideCostRatio") + else 0.6, + rangeBufferForDispatchInMeters = + if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") + else 10000, + refuelLocationType = + if (c.hasPathOrNull("refuelLocationType")) c.getString("refuelLocationType") else "AtTAZCenter", + refuelThresholdInMeters = + if (c.hasPathOrNull("refuelThresholdInMeters")) c.getDouble("refuelThresholdInMeters") else 5000.0, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( + if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") + else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") + ), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( + if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") + else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") + ), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( + if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") + else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") + ) + ) + } + } + case class RideHailTransit( - modesToConsider : java.lang.String + modesToConsider: java.lang.String ) + object RideHailTransit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) + object TripBehaviors { + case class CarUsage( - minDistanceToTrainStop : scala.Double + minDistanceToTrainStop: scala.Double ) + object CarUsage { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = + if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path : java.lang.String, - additional_trip_utility : scala.Double, - destination_nest_scale_factor : scala.Double, - generate_secondary_activities : scala.Boolean, - intercept_file_path : java.lang.String, - max_destination_choice_set_size : scala.Int, - max_destination_distance_meters : scala.Double, - mode_nest_scale_factor : scala.Double, - trip_nest_scale_factor : scala.Double + activity_file_path: java.lang.String, + additional_trip_utility: scala.Double, + destination_nest_scale_factor: scala.Double, + generate_secondary_activities: scala.Boolean, + intercept_file_path: java.lang.String, + max_destination_choice_set_size: scala.Int, + max_destination_distance_meters: scala.Double, + mode_nest_scale_factor: scala.Double, + trip_nest_scale_factor: scala.Double ) + object MulitnomialLogit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, - generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, - max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, - mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = + if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = + if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = + if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") + else 1.0, + generate_secondary_activities = + c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = + if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = + if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") + else 20, + max_destination_distance_meters = + if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") + else 32000, + mode_nest_scale_factor = + if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = + if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( + if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") + else com.typesafe.config.ConfigFactory.parseString("carUsage{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ) ) } } - + case class Vehicles( - downsamplingMethod : java.lang.String, - dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet : scala.Double, - fractionOfPeopleWithBicycle : scala.Double, - fuelTypesFilePath : java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, - linkSocAcrossIterations : scala.Boolean, - linkToGradePercentFilePath : java.lang.String, - meanPrivateVehicleStartingSOC : scala.Double, - meanRidehailVehicleStartingSOC : scala.Double, - sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile : java.lang.String, - vehicleAdjustmentMethod : java.lang.String, - vehicleTypesFilePath : java.lang.String, - vehiclesFilePath : java.lang.String + downsamplingMethod: java.lang.String, + dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet: scala.Double, + fractionOfPeopleWithBicycle: scala.Double, + fuelTypesFilePath: java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, + linkSocAcrossIterations: scala.Boolean, + linkToGradePercentFilePath: java.lang.String, + meanPrivateVehicleStartingSOC: scala.Double, + meanRidehailVehicleStartingSOC: scala.Double, + sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile: java.lang.String, + vehicleAdjustmentMethod: java.lang.String, + vehicleTypesFilePath: java.lang.String, + vehiclesFilePath: java.lang.String ) + object Vehicles { + case class DummySharedBike( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedBike { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedCar { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond : scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, - noRefuelThresholdOffsetInMeters : scala.Double, - remainingDistanceWrtBatteryCapacityThreshold : scala.Int + estimateOfMeanChargingDurationInSecond: scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, + noRefuelThresholdOffsetInMeters: scala.Double, + remainingDistanceWrtBatteryCapacityThreshold: scala.Int ) + object Enroute { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, - noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, - remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 + estimateOfMeanChargingDurationInSecond = + if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) + c.getInt("estimateOfMeanChargingDurationInSecond") + else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = + if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) + c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") + else 500, + noRefuelThresholdOffsetInMeters = + if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") + else 32186.9, + remainingDistanceWrtBatteryCapacityThreshold = + if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) + c.getInt("remainingDistanceWrtBatteryCapacityThreshold") + else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], - fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], - inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], - managerType : java.lang.String, - name : java.lang.String, - parkingFilePath : java.lang.String, - reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving + ], + fixed_non_reserving_fleet_by_taz: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz + ], + inexhaustible_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving + ], + managerType: java.lang.String, + name: java.lang.String, + parkingFilePath: java.lang.String, + reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) + object SharedFleets$Elm { + case class FixedNonReserving( - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String ) + object FixedNonReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize : scala.Int, - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String, - vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] + fleetSize: scala.Int, + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String, + vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] ) + object FixedNonReservingFleetByTaz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None + fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = + if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) + else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object InexhaustibleReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], - name : java.lang.String, - repositionTimeBin : scala.Int, - statTimeBin : scala.Int + min_availability_undersupply_algorithm: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm + ], + name: java.lang.String, + repositionTimeBin: scala.Int, + statTimeBin: scala.Int ) + object Reposition { + case class MinAvailabilityUndersupplyAlgorithm( - matchLimit : scala.Int + matchLimit: scala.Int ) + object MinAvailabilityUndersupplyAlgorithm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( - matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm( + matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = + if (c.hasPathOrNull("min-availability-undersupply-algorithm")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) + ) + else None, + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, - fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, - inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, - managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None + fixed_non_reserving = + if (c.hasPathOrNull("fixed-non-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReserving(c.getConfig("fixed-non-reserving")) + ) + else None, + fixed_non_reserving_fleet_by_taz = + if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) + ) + else None, + inexhaustible_reserving = + if (c.hasPathOrNull("inexhaustible-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) + ) + else None, + managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = + if (c.hasPathOrNull("reposition")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) + ) + else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, - fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, - meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", - vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" - ) - } - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = + if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") + else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( + if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") + else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") + ), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( + if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") + else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") + ), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( + if (c.hasPathOrNull("enroute")) c.getConfig("enroute") + else com.typesafe.config.ConfigFactory.parseString("enroute{}") + ), + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 1.0, + fractionOfPeopleWithBicycle = + if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = + if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") + else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( + "generateEmergencyHouseholdVehicleWhenPlansRequireIt" + ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = + c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = + if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = + if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") + else 1.0, + meanRidehailVehicleStartingSOC = + if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") + else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = + if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") + else "", + vehicleAdjustmentMethod = + if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = + if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") + else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = + if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") + else "/test/input/beamville/vehicles.csv" + ) + } + + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Agentsim.Agents.Vehicles + .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), - bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), - households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), - parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities( + if (c.hasPathOrNull("activities")) c.getConfig("activities") + else com.typesafe.config.ConfigFactory.parseString("activities{}") + ), + bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight( + if (c.hasPathOrNull("freight")) c.getConfig("freight") + else com.typesafe.config.ConfigFactory.parseString("freight{}") + ), + households = BeamConfig.Beam.Agentsim.Agents.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( + if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") + else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") + ), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( + if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") + else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") + ), + parking = BeamConfig.Beam.Agentsim.Agents.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + plans = BeamConfig.Beam.Agentsim.Agents.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + population = BeamConfig.Beam.Agentsim.Agents.Population( + if (c.hasPathOrNull("population")) c.getConfig("population") + else com.typesafe.config.ConfigFactory.parseString("population{}") + ), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( + if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") + else com.typesafe.config.ConfigFactory.parseString("ptFare{}") + ), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( + if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") + else com.typesafe.config.ConfigFactory.parseString("rideHail{}") + ), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( + if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") + else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") + ), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( + if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") + else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") + ), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor : scala.Double, - chargingPointCountScalingFactor : scala.Double, - chargingPointFilePath : java.lang.String, - helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds : scala.Int + chargingPointCostScalingFactor: scala.Double, + chargingPointCountScalingFactor: scala.Double, + chargingPointFilePath: java.lang.String, + helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds: scala.Int ) + object ChargingNetworkManager { + case class Helics( - bufferSize : scala.Int, - connectionEnabled : scala.Boolean, - coreInitString : java.lang.String, - coreType : java.lang.String, - dataInStreamPoint : java.lang.String, - dataOutStreamPoint : java.lang.String, - federateName : java.lang.String, - feedbackEnabled : scala.Boolean, - intLogLevel : scala.Int, - timeDeltaProperty : scala.Double + bufferSize: scala.Int, + connectionEnabled: scala.Boolean, + coreInitString: java.lang.String, + coreType: java.lang.String, + dataInStreamPoint: java.lang.String, + dataOutStreamPoint: java.lang.String, + federateName: java.lang.String, + feedbackEnabled: scala.Boolean, + intLogLevel: scala.Int, + timeDeltaProperty: scala.Double ) + object Helics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", - dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = + if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") + else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = + if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") + else "GridFed/PhysicalBounds", + dataOutStreamPoint = + if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled : scala.Boolean, - expansionFactor_charge_activity : scala.Double, - expansionFactor_home_activity : scala.Double, - expansionFactor_init_activity : scala.Double, - expansionFactor_wherever_activity : scala.Double, - expansionFactor_work_activity : scala.Double + enabled: scala.Boolean, + expansionFactor_charge_activity: scala.Double, + expansionFactor_home_activity: scala.Double, + expansionFactor_init_activity: scala.Double, + expansionFactor_wherever_activity: scala.Double, + expansionFactor_work_activity: scala.Double ) + object ScaleUp { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, - expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, - expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, - expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, - expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = + if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") + else 1.0, + expansionFactor_home_activity = + if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") + else 1.0, + expansionFactor_init_activity = + if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") + else 1.0, + expansionFactor_wherever_activity = + if (c.hasPathOrNull("expansionFactor_wherever_activity")) + c.getDouble("expansionFactor_wherever_activity") + else 1.0, + expansionFactor_work_activity = + if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") + else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, - chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, - chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), - timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = + if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") + else 1.0, + chargingPointCountScalingFactor = + if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") + else 1.0, + chargingPointFilePath = + if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( + if (c.hasPathOrNull("helics")) c.getConfig("helics") + else com.typesafe.config.ConfigFactory.parseString("helics{}") + ), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( + if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") + else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") + ), + timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution : scala.Int, - upperBoundResolution : scala.Int + lowerBoundResolution: scala.Int, + upperBoundResolution: scala.Int ) + object H3taz { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile : java.lang.String + frequencyAdjustmentFile: java.lang.String ) + object Scenarios { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = + if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") + else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay : scala.Int, - interval : scala.Int + initialDelay: scala.Int, + interval: scala.Int ) + object ScheduleMonitorTask { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath : java.lang.String, - parkingCostScalingFactor : scala.Double, - parkingFilePath : java.lang.String, - parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor : scala.Double + filePath: java.lang.String, + parkingCostScalingFactor: scala.Double, + parkingFilePath: java.lang.String, + parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor: scala.Double ) + object Taz { + case class ParkingManager( - displayPerformanceTimings : scala.Boolean, - level : java.lang.String, - method : java.lang.String, - parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings: scala.Boolean, + level: java.lang.String, + method: java.lang.String, + parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) + object ParkingManager { + case class Parallel( - numberOfClusters : scala.Int + numberOfClusters: scala.Int ) + object Parallel { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - level = if(c.hasPathOrNull("level")) c.getString("level") else "TAZ", - method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + level = if (c.hasPathOrNull("level")) c.getString("level") else "TAZ", + method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( + if (c.hasPathOrNull("parallel")) c.getConfig("parallel") + else com.typesafe.config.ConfigFactory.parseString("parallel{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), - parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = + if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( + if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") + else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") + ), + parkingStallCountScalingFactor = + if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") + else 1.0 ) } } - + case class Toll( - filePath : java.lang.String + filePath: java.lang.String ) + object Toll { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules : scala.Double, - rideHailPrice : scala.Double, - tollPrice : scala.Double, - transitCapacity : scala.Option[scala.Double], - transitPrice : scala.Double + fuelCapacityInJoules: scala.Double, + rideHailPrice: scala.Double, + tollPrice: scala.Double, + transitCapacity: scala.Option[scala.Double], + transitPrice: scala.Double ) + object Tuning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = + if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), - schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), - thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, - thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), - tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) + agentSampleSizeAsFractionOfPopulation = + if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) + c.getDouble("agentSampleSizeAsFractionOfPopulation") + else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents( + if (c.hasPathOrNull("agents")) c.getConfig("agents") + else com.typesafe.config.ConfigFactory.parseString("agents{}") + ), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( + if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") + else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") + ), + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = + if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") + else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz( + if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") + else com.typesafe.config.ConfigFactory.parseString("h3taz{}") + ), + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = + if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + scenarios = BeamConfig.Beam.Agentsim.Scenarios( + if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") + else com.typesafe.config.ConfigFactory.parseString("scenarios{}") + ), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( + if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") + else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") + ), + schedulerParallelismWindow = + if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + taz = BeamConfig.Beam.Agentsim.Taz( + if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") + ), + thresholdForMakingParkingChoiceInMeters = + if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) + c.getInt("thresholdForMakingParkingChoiceInMeters") + else 100, + thresholdForWalkingInMeters = + if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll( + if (c.hasPathOrNull("toll")) c.getConfig("toll") + else com.typesafe.config.ConfigFactory.parseString("toll{}") + ), + tuning = BeamConfig.Beam.Agentsim.Tuning( + if (c.hasPathOrNull("tuning")) c.getConfig("tuning") + else com.typesafe.config.ConfigFactory.parseString("tuning{}") + ) ) } } - + case class Calibration( - counts : BeamConfig.Beam.Calibration.Counts, - google : BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio : scala.Double, - mode : BeamConfig.Beam.Calibration.Mode, - objectiveFunction : java.lang.String, - roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, - studyArea : BeamConfig.Beam.Calibration.StudyArea + counts: BeamConfig.Beam.Calibration.Counts, + google: BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio: scala.Double, + mode: BeamConfig.Beam.Calibration.Mode, + objectiveFunction: java.lang.String, + roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, + studyArea: BeamConfig.Beam.Calibration.StudyArea ) + object Calibration { + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Int, - inputCountsFile : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Int, + inputCountsFile: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes ) + object Google { + case class TravelTimes( - enable : scala.Boolean, - iterationInterval : scala.Int, - minDistanceInMeters : scala.Double, - numDataPointsOver24Hours : scala.Int, - offPeakEnabled : scala.Boolean, - queryDate : java.lang.String, - tolls : scala.Boolean + enable: scala.Boolean, + iterationInterval: scala.Int, + minDistanceInMeters: scala.Double, + numDataPointsOver24Hours: scala.Int, + offPeakEnabled: scala.Boolean, + queryDate: java.lang.String, + tolls: scala.Boolean ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = + if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = + if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class Mode( - benchmarkFilePath : java.lang.String + benchmarkFilePath: java.lang.String ) + object Mode { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) + object RoadNetwork { + case class TravelTimes( - zoneBoundariesFilePath : java.lang.String, - zoneODTravelTimesFilePath : java.lang.String + zoneBoundariesFilePath: java.lang.String, + zoneODTravelTimesFilePath: java.lang.String ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = + if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = + if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class StudyArea( - enabled : scala.Boolean, - lat : scala.Double, - lon : scala.Double, - radius : scala.Double + enabled: scala.Boolean, + lat: scala.Double, + lon: scala.Double, + radius: scala.Double ) + object StudyArea { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), - meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), - objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), - studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) + counts = BeamConfig.Beam.Calibration.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + google = BeamConfig.Beam.Calibration.Google( + if (c.hasPathOrNull("google")) c.getConfig("google") + else com.typesafe.config.ConfigFactory.parseString("google{}") + ), + meanToCountsWeightRatio = + if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode( + if (c.hasPathOrNull("mode")) c.getConfig("mode") + else com.typesafe.config.ConfigFactory.parseString("mode{}") + ), + objectiveFunction = + if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") + else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( + if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") + else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") + ), + studyArea = BeamConfig.Beam.Calibration.StudyArea( + if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") + else com.typesafe.config.ConfigFactory.parseString("studyArea{}") + ) ) } } - + case class Cluster( - clusterType : scala.Option[java.lang.String], - enabled : scala.Boolean + clusterType: scala.Option[java.lang.String], + enabled: scala.Boolean ) + object Cluster { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor : BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval : scala.Int, - clearRoutedOutstandingWorkEnabled : scala.Boolean, - debugActorTimerIntervalInSec : scala.Int, - debugEnabled : scala.Boolean, - memoryConsumptionDisplayTimeoutInSec : scala.Int, - messageLogging : scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork : scala.Int, - stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation : BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives : scala.Boolean, - writeRealizedModeChoiceFile : scala.Boolean + actor: BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval: scala.Int, + clearRoutedOutstandingWorkEnabled: scala.Boolean, + debugActorTimerIntervalInSec: scala.Int, + debugEnabled: scala.Boolean, + memoryConsumptionDisplayTimeoutInSec: scala.Int, + messageLogging: scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork: scala.Int, + stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation: BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives: scala.Boolean, + writeRealizedModeChoiceFile: scala.Boolean ) + object Debug { + case class Actor( - logDepth : scala.Int + logDepth: scala.Int ) + object Actor { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs : scala.Long, - checkMaxNumberOfMessagesEnabled : scala.Boolean, - defaultTimeoutMs : scala.Long, - enabled : scala.Boolean, - overallSimulationTimeoutMs : scala.Long, - thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs: scala.Long, + checkMaxNumberOfMessagesEnabled: scala.Boolean, + defaultTimeoutMs: scala.Long, + enabled: scala.Boolean, + overallSimulationTimeoutMs: scala.Long, + thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) + object StuckAgentDetection { + case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs : scala.Long, - triggerType : java.lang.String + actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs: scala.Long, + triggerType: java.lang.String ) + object Thresholds$Elm { + case class ActorTypeToMaxNumberOfMessages( - population : scala.Option[scala.Int], - rideHailAgent : scala.Option[scala.Int], - rideHailManager : scala.Option[scala.Int], - transitDriverAgent : scala.Option[scala.Int] + population: scala.Option[scala.Int], + rideHailAgent: scala.Option[scala.Int], + rideHailManager: scala.Option[scala.Int], + transitDriverAgent: scala.Option[scala.Int] ) + object ActorTypeToMaxNumberOfMessages { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = + if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), - markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, - triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = + BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( + if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") + else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") + ), + markAsStuckAfterMs = + if (c.hasPathOrNull("markAsStuckAfterMs")) + c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 20000, + triggerType = + if (c.hasPathOrNull("triggerType")) c.getString("triggerType") + else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, - checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = + if (c.hasPathOrNull("checkIntervalMs")) + c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 200, + checkMaxNumberOfMessagesEnabled = + !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = + if (c.hasPathOrNull("defaultTimeoutMs")) + c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = + if (c.hasPathOrNull("overallSimulationTimeoutMs")) + c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Debug.StuckAgentDetection + .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class TriggerMeasurer( - enabled : scala.Boolean, - writeStuckAgentDetectionConfig : scala.Boolean + enabled: scala.Boolean, + writeStuckAgentDetectionConfig: scala.Boolean ) + object TriggerMeasurer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = + !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram : scala.Boolean + createGCClassHistogram: scala.Boolean ) + object VmInformation { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), - agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), - vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), - writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor( + if (c.hasPathOrNull("actor")) c.getConfig("actor") + else com.typesafe.config.ConfigFactory.parseString("actor{}") + ), + agentTripScoresInterval = + if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = + c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = + if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = + if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) + c.getInt("memoryConsumptionDisplayTimeoutInSec") + else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = + if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) + c.getInt("secondsToWaitToClearRoutedOutstandingWork") + else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( + if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") + else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") + ), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( + if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") + else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") + ), + vmInformation = BeamConfig.Beam.Debug.VmInformation( + if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") + else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") + ), + writeModeChoiceAlternatives = + c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = + c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output : BeamConfig.Beam.Exchange.Output, - scenario : BeamConfig.Beam.Exchange.Scenario + output: BeamConfig.Beam.Exchange.Output, + scenario: BeamConfig.Beam.Exchange.Scenario ) + object Exchange { + case class Output( - activitySimSkimsEnabled : scala.Boolean, - geo : BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled: scala.Boolean, + geo: BeamConfig.Beam.Exchange.Output.Geo ) + object Output { + case class Geo( - filePath : scala.Option[java.lang.String] + filePath: scala.Option[java.lang.String] ) + object Geo { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) + activitySimSkimsEnabled = + c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo( + if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") + ) ) } } - + case class Scenario( - convertWgs2Utm : scala.Boolean, - fileFormat : java.lang.String, - folder : java.lang.String, - modeMap : scala.Option[scala.List[java.lang.String]], - source : java.lang.String, - urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm: scala.Boolean, + fileFormat: java.lang.String, + folder: java.lang.String, + modeMap: scala.Option[scala.List[java.lang.String]], + source: java.lang.String, + urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim ) + object Scenario { + case class Urbansim( - activitySimEnabled : scala.Boolean + activitySimEnabled: scala.Boolean ) + object Urbansim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) + fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) + output = BeamConfig.Beam.Exchange.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + scenario = BeamConfig.Beam.Exchange.Scenario( + if (c.hasPathOrNull("scenario")) c.getConfig("scenario") + else com.typesafe.config.ConfigFactory.parseString("scenario{}") + ) ) } } - + case class Experimental( - optimizer : BeamConfig.Beam.Experimental.Optimizer + optimizer: BeamConfig.Beam.Experimental.Optimizer ) + object Experimental { + case class Optimizer( - enabled : scala.Boolean + enabled: scala.Boolean ) + object Optimizer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) + optimizer = BeamConfig.Beam.Experimental.Optimizer( + if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") + else com.typesafe.config.ConfigFactory.parseString("optimizer{}") + ) ) } } - + case class Input( - lastBaseOutputDir : java.lang.String, - simulationPrefix : java.lang.String + lastBaseOutputDir: java.lang.String, + simulationPrefix: java.lang.String ) + object Input { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn : scala.Boolean + keepConsoleAppenderOn: scala.Boolean ) + object Logger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level : java.lang.String + level: java.lang.String ) + object Metrics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation : scala.Boolean + writePlansAndStopSimulation: scala.Boolean ) + object Output { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = + c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory : scala.Boolean, - baseOutputDirectory : java.lang.String, - collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, - defaultWriteInterval : scala.Int, - displayPerformanceTimings : scala.Boolean, - events : BeamConfig.Beam.Outputs.Events, - generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval : scala.Int, - matsim : BeamConfig.Beam.Outputs.Matsim, - stats : BeamConfig.Beam.Outputs.Stats, - writeAnalysis : scala.Boolean, - writeEventsInterval : scala.Int, - writeGraphs : scala.Boolean, - writeLinkTraversalInterval : scala.Int, - writePlansInterval : scala.Int, - writeR5RoutesInterval : scala.Int + addTimestampToOutputDirectory: scala.Boolean, + baseOutputDirectory: java.lang.String, + collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, + defaultWriteInterval: scala.Int, + displayPerformanceTimings: scala.Boolean, + events: BeamConfig.Beam.Outputs.Events, + generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval: scala.Int, + matsim: BeamConfig.Beam.Outputs.Matsim, + stats: BeamConfig.Beam.Outputs.Stats, + writeAnalysis: scala.Boolean, + writeEventsInterval: scala.Int, + writeGraphs: scala.Boolean, + writeLinkTraversalInterval: scala.Int, + writePlansInterval: scala.Int, + writeR5RoutesInterval: scala.Int ) + object Outputs { + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime : scala.Int, - startTime : scala.Int + endTime: scala.Int, + startTime: scala.Int ) + object GeneralizedLinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles : java.lang.String, - deleteRootFolderFiles : java.lang.String + deleteITERSFolderFiles: java.lang.String, + deleteRootFolderFiles: java.lang.String ) + object Matsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = + if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = + if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize : scala.Int + binSize: scala.Int ) + object Stats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), - defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), - generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), - stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writeLinkTraversalInterval = if(c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = + !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = + if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = + !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( + "collectAndCreateBeamAnalysisAndGraphs" + ), + defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( + if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") + else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") + ), + generalizedLinkStatsInterval = + if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ), + stats = BeamConfig.Beam.Outputs.Stats( + if (c.hasPathOrNull("stats")) c.getConfig("stats") + else com.typesafe.config.ConfigFactory.parseString("stats{}") + ), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writeLinkTraversalInterval = + if (c.hasPathOrNull("writeLinkTraversalInterval")) c.getInt("writeLinkTraversalInterval") else 0, + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim : BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager : BeamConfig.Beam.Physsim.EventManager, - events : BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia : scala.Boolean, - eventsSampling : scala.Double, - flowCapacityFactor : scala.Double, - initializeRouterWithFreeFlowTimes : scala.Boolean, - inputNetworkFilePath : java.lang.String, - jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize : scala.Int, - linkStatsWriteInterval : scala.Int, - maxLinkLengthToApplySpeedScalingFactor : scala.Double, - name : java.lang.String, - network : BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath : java.lang.String, - parbprsim : BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize : scala.Double, - quick_fix_minCarSpeedInMetersPerSecond : scala.Double, - relaxation : BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim : scala.Boolean, - speedScalingFactor : scala.Double, - storageCapacityFactor : scala.Double, - writeEventsInterval : scala.Int, - writeMATSimNetwork : scala.Boolean, - writePlansInterval : scala.Int, - writeRouteHistoryInterval : scala.Int + bprsim: BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager: BeamConfig.Beam.Physsim.EventManager, + events: BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia: scala.Boolean, + eventsSampling: scala.Double, + flowCapacityFactor: scala.Double, + initializeRouterWithFreeFlowTimes: scala.Boolean, + inputNetworkFilePath: java.lang.String, + jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize: scala.Int, + linkStatsWriteInterval: scala.Int, + maxLinkLengthToApplySpeedScalingFactor: scala.Double, + name: java.lang.String, + network: BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath: java.lang.String, + parbprsim: BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize: scala.Double, + quick_fix_minCarSpeedInMetersPerSecond: scala.Double, + relaxation: BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim: scala.Boolean, + speedScalingFactor: scala.Double, + storageCapacityFactor: scala.Double, + writeEventsInterval: scala.Int, + writeMATSimNetwork: scala.Boolean, + writePlansInterval: scala.Int, + writeRouteHistoryInterval: scala.Int ) + object Physsim { + case class Bprsim( - inFlowAggregationTimeWindowInSeconds : scala.Int, - minFlowToUseBPRFunction : scala.Int, - travelTimeFunction : java.lang.String + inFlowAggregationTimeWindowInSeconds: scala.Int, + minFlowToUseBPRFunction: scala.Int, + travelTimeFunction: java.lang.String ) + object Bprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, - minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = + if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) + c.getInt("inFlowAggregationTimeWindowInSeconds") + else 900, + minFlowToUseBPRFunction = + if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor : scala.Double + congestionFactor: scala.Double ) + object CchRoutingAssignment { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax : scala.Int, - departureTimeShiftMin : scala.Int, - fractionOfEventsToDuplicate : scala.Double + departureTimeShiftMax: scala.Int, + departureTimeShiftMin: scala.Int, + fractionOfEventsToDuplicate: scala.Double ) + object DuplicatePTE { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = + if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = + if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = + if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads : scala.Int, - `type` : java.lang.String + numberOfThreads: scala.Int, + `type`: java.lang.String ) + object EventManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) + object Jdeqsim { + case class AgentSimPhysSimInterfaceDebugger( - enabled : scala.Boolean + enabled: scala.Boolean ) + object AgentSimPhysSimInterfaceDebugger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, - capacityPlansWriteInterval : scala.Int, - enabled : scala.Boolean, - minRoadCapacity : scala.Int, - minSpeedMetersPerSec : scala.Int, - speedAdjustmentFactor : scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, + capacityPlansWriteInterval: scala.Int, + enabled: scala.Boolean, + minRoadCapacity: scala.Int, + minSpeedMetersPerSec: scala.Int, + speedAdjustmentFactor: scala.Double ) + object Cacc { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, - capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = + if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) + c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") + else 1.3, + capacityPlansWriteInterval = + if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = + if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = + if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( + if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") + else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") + ), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( + if (c.hasPathOrNull("cacc")) c.getConfig("cacc") + else com.typesafe.config.ConfigFactory.parseString("cacc{}") + ) ) } } - + case class Network( - maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) + object Network { + case class MaxSpeedInference( - enabled : scala.Boolean, - `type` : java.lang.String + enabled: scala.Boolean, + `type`: java.lang.String ) + object MaxSpeedInference { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled : scala.Boolean, - livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled: scala.Boolean, + livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) + object OverwriteRoadTypeProperties { + case class LivingStreet( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object LivingStreet { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Minor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Motorway { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object MotorwayLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Primary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object PrimaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Residential { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Secondary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object SecondaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Tertiary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TertiaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Trunk { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TrunkLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Unclassified { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( + if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") + else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") + ), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( + if (c.hasPathOrNull("minor")) c.getConfig("minor") + else com.typesafe.config.ConfigFactory.parseString("minor{}") + ), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( + if (c.hasPathOrNull("motorway")) c.getConfig("motorway") + else com.typesafe.config.ConfigFactory.parseString("motorway{}") + ), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( + if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") + else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") + ), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( + if (c.hasPathOrNull("primary")) c.getConfig("primary") + else com.typesafe.config.ConfigFactory.parseString("primary{}") + ), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( + if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") + else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") + ), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( + if (c.hasPathOrNull("residential")) c.getConfig("residential") + else com.typesafe.config.ConfigFactory.parseString("residential{}") + ), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( + if (c.hasPathOrNull("secondary")) c.getConfig("secondary") + else com.typesafe.config.ConfigFactory.parseString("secondary{}") + ), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( + if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") + else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") + ), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( + if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") + else com.typesafe.config.ConfigFactory.parseString("tertiary{}") + ), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( + if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") + else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") + ), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( + if (c.hasPathOrNull("trunk")) c.getConfig("trunk") + else com.typesafe.config.ConfigFactory.parseString("trunk{}") + ), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( + if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") + else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") + ), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( + if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") + else com.typesafe.config.ConfigFactory.parseString("unclassified{}") + ) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( + if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") + else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") + ), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( + if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") + else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") + ) ) } } - + case class Parbprsim( - numberOfClusters : scala.Int, - syncInterval : scala.Int + numberOfClusters: scala.Int, + syncInterval: scala.Int ) + object Parbprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier : scala.Double, - enabled : scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime : scala.Int + additionalTravelTimeMultiplier: scala.Double, + enabled: scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime: scala.Int ) + object PickUpDropOffAnalysis { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 + additionalTravelTimeMultiplier = + if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") + else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = + if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) + c.getInt("secondsFromPickUpPropOffToAffectTravelTime") + else 600 ) } } - + case class Relaxation( - experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type` : java.lang.String + experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type`: java.lang.String ) + object Relaxation { + case class Experiment20( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment20 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment21 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment30 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment40 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment50 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment51 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment52 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( + if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") + else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") + ), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( + if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") + else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") + ), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( + if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") + else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") + ), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( + if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") + else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") + ), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( + if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") + else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") + ), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( + if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") + else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") + ), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( + if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") + else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") + ), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), - eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), - events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), - linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, - name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), - ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim( + if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") + else com.typesafe.config.ConfigFactory.parseString("bprsim{}") + ), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( + if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") + else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") + ), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( + if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") + else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") + ), + eventManager = BeamConfig.Beam.Physsim.EventManager( + if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") + else com.typesafe.config.ConfigFactory.parseString("eventManager{}") + ), + events = BeamConfig.Beam.Physsim.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + eventsForFullVersionOfVia = + !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = + !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = + if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") + else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( + if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") + else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") + ), + linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = + if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = + if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) + c.getDouble("maxLinkLengthToApplySpeedScalingFactor") + else 50.0, + name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + overwriteLinkParamPath = + if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim( + if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") + else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") + ), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( + if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") + else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") + ), + ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = + if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) + c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") + else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation( + if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") + else com.typesafe.config.ConfigFactory.parseString("relaxation{}") + ), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = + if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writeMATSimNetwork = !c.hasPathOrNull("writeMATSimNetwork") || c.getBoolean("writeMATSimNetwork"), + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = + if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1 : scala.Double, - ModuleProbability_2 : scala.Double, - ModuleProbability_3 : scala.Double, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - clearModes : BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation : scala.Double, - maxAgentPlanMemorySize : scala.Int + ModuleProbability_1: scala.Double, + ModuleProbability_2: scala.Double, + ModuleProbability_3: scala.Double, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + clearModes: BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation: scala.Double, + maxAgentPlanMemorySize: scala.Int ) + object Replanning { + case class ClearModes( - iteration : scala.Int, - modes : scala.Option[scala.List[java.lang.String]], - strategy : java.lang.String + iteration: scala.Int, + modes: scala.Option[scala.List[java.lang.String]], + strategy: java.lang.String ) + object ClearModes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes( + if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") + else com.typesafe.config.ConfigFactory.parseString("clearModes{}") + ), + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getDouble("fractionOfIterationsToDisableInnovation") + else Double.PositiveInfinity, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim : BeamConfig.Beam.Router.Skim + skim: BeamConfig.Beam.Router.Skim ) + object Router { + case class Skim( - activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims : scala.Int, - origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval : scala.Int, - writeSkimsInterval : scala.Int + activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims: scala.Int, + origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval: scala.Int, + writeSkimsInterval: scala.Int ) + object Skim { + case class ActivitySimSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object ActivitySimSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object DriveTimeSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", - name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") + else "skimsTravelTimeObservedVsSimulated", + name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String, - poolingTravelTimeOveheadFactor : scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, - writeFullSkimsInterval : scala.Int + fileBaseName: java.lang.String, + name: java.lang.String, + poolingTravelTimeOveheadFactor: scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, + writeFullSkimsInterval: scala.Int ) + object OriginDestinationSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, - writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = + if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") + else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = + if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) + c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") + else 0, + writeFullSkimsInterval = + if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName : java.lang.String, - geoHierarchy : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + geoHierarchy: java.lang.String, + name: java.lang.String ) + object TazSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object TransitCrowdingSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), - keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), - writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( + if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") + else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") + ), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( + if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") + else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") + ), + keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( + if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") + else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") + ), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( + if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") + else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") + ), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( + if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") + else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") + ), + writeAggregatedSkimsInterval = + if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) + skim = BeamConfig.Beam.Router.Skim( + if (c.hasPathOrNull("skim")) c.getConfig("skim") + else com.typesafe.config.ConfigFactory.parseString("skim{}") + ) ) } } - + case class Routing( - baseDate : java.lang.String, - carRouter : java.lang.String, - gh : BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS : scala.Int, - overrideNetworkTravelTimesUsingSkims : scala.Boolean, - r5 : BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor : scala.Double, - startingIterationForTravelTimesMSA : scala.Int, - transitOnStreetNetwork : scala.Boolean, - writeRoutingStatistic : scala.Boolean + baseDate: java.lang.String, + carRouter: java.lang.String, + gh: BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS: scala.Int, + overrideNetworkTravelTimesUsingSkims: scala.Boolean, + r5: BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor: scala.Double, + startingIterationForTravelTimesMSA: scala.Int, + transitOnStreetNetwork: scala.Boolean, + writeRoutingStatistic: scala.Boolean ) + object Routing { + case class Gh( - useAlternativeRoutes : scala.Boolean + useAlternativeRoutes: scala.Boolean ) + object Gh { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath : java.lang.String, - bikeLaneScaleFactor : scala.Double, - departureWindow : scala.Double, - directory : java.lang.String, - directory2 : scala.Option[java.lang.String], - linkRadiusMeters : scala.Double, - mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples : scala.Int, - osmFile : java.lang.String, - osmMapdbFile : java.lang.String, - travelTimeNoiseFraction : scala.Double + bikeLaneLinkIdsFilePath: java.lang.String, + bikeLaneScaleFactor: scala.Double, + departureWindow: scala.Double, + directory: java.lang.String, + directory2: scala.Option[java.lang.String], + linkRadiusMeters: scala.Double, + mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples: scala.Int, + osmFile: java.lang.String, + osmMapdbFile: java.lang.String, + travelTimeNoiseFraction: scala.Double ) + object R5 { + case class MNetBuilder( - fromCRS : java.lang.String, - toCRS : java.lang.String + fromCRS: java.lang.String, + toCRS: java.lang.String ) + object MNetBuilder { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike : scala.Int + bike: scala.Int ) + object MaxDistanceLimitByModeInMeters { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), - numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", - osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 - ) - } - } - + bikeLaneLinkIdsFilePath = + if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = + if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( + if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") + else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") + ), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( + if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") + ), + numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmFile = + if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "/test/input/beamville/r5/beamville.osm.pbf", + osmMapdbFile = + if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") + else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = + if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), - minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, - overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), - r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), - skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh( + if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") + ), + minimumPossibleSkimBasedTravelTimeInS = + if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) + c.getInt("minimumPossibleSkimBasedTravelTimeInS") + else 60, + overrideNetworkTravelTimesUsingSkims = + c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( + "overrideNetworkTravelTimesUsingSkims" + ), + r5 = BeamConfig.Beam.Routing.R5( + if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") + ), + skimTravelTimesScalingFactor = + if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = + if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") + else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric : BeamConfig.Beam.Sim.Metric, - termination : BeamConfig.Beam.Sim.Termination + metric: BeamConfig.Beam.Sim.Metric, + termination: BeamConfig.Beam.Sim.Termination ) + object Sim { + case class Metric( - collector : BeamConfig.Beam.Sim.Metric.Collector + collector: BeamConfig.Beam.Sim.Metric.Collector ) + object Metric { + case class Collector( - influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics : java.lang.String + influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics: java.lang.String ) + object Collector { + case class InfluxDbSimulationMetricCollector( - connectionString : java.lang.String, - database : java.lang.String + connectionString: java.lang.String, + database: java.lang.String ) + object InfluxDbSimulationMetricCollector { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = + if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), - metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = + BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( + if (c.hasPathOrNull("influxDbSimulationMetricCollector")) + c.getConfig("influxDbSimulationMetricCollector") + else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") + ), + metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) + collector = BeamConfig.Beam.Sim.Metric.Collector( + if (c.hasPathOrNull("collector")) c.getConfig("collector") + else com.typesafe.config.ConfigFactory.parseString("collector{}") + ) ) } } - + case class Termination( - criterionName : java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName: java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) + object Termination { + case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration : scala.Int, - minLastIteration : scala.Int, - relativeTolerance : scala.Double + maxLastIteration: scala.Int, + minLastIteration: scala.Int, + relativeTolerance: scala.Double ) + object TerminateAtRideHailFleetStoredElectricityConvergence { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) + criterionName = + if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = + BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( + if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) + c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") + else + com.typesafe.config.ConfigFactory + .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), - termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) + metric = BeamConfig.Beam.Sim.Metric( + if (c.hasPathOrNull("metric")) c.getConfig("metric") + else com.typesafe.config.ConfigFactory.parseString("metric{}") + ), + termination = BeamConfig.Beam.Sim.Termination( + if (c.hasPathOrNull("termination")) c.getConfig("termination") + else com.typesafe.config.ConfigFactory.parseString("termination{}") + ) ) } } - + case class Spatial( - boundingBoxBuffer : scala.Int, - localCRS : java.lang.String + boundingBoxBuffer: scala.Int, + localCRS: java.lang.String ) + object Spatial { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear ) + object Urbansim { + case class BackgroundODSkimsCreator( - calculationTimeoutHours : scala.Int, - enabled : scala.Boolean, - maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes : scala.Int, - peakHours : scala.Option[scala.List[scala.Double]], - routerType : java.lang.String, - skimsGeoType : java.lang.String, - skimsKind : java.lang.String + calculationTimeoutHours: scala.Int, + enabled: scala.Boolean, + maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes: scala.Int, + peakHours: scala.Option[scala.List[scala.Double]], + routerType: java.lang.String, + skimsGeoType: java.lang.String, + skimsKind: java.lang.String ) + object BackgroundODSkimsCreator { + case class MaxTravelDistanceInMeters( - bike : scala.Int, - walk : scala.Int + bike: scala.Int, + walk: scala.Int ) + object MaxTravelDistanceInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive : scala.Boolean, - transit : scala.Boolean, - walk : scala.Boolean + drive: scala.Boolean, + transit: scala.Boolean, + walk: scala.Boolean ) + object ModesToBuild { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), - numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = + if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( + if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") + ), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( + if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") + else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") + ), + numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes : scala.Double, - bike : scala.Double, - car : scala.Double, - drive_transit : scala.Double, - walk : scala.Double, - walk_transit : scala.Double + allModes: scala.Double, + bike: scala.Double, + car: scala.Double, + drive_transit: scala.Double, + walk: scala.Double, + walk_transit: scala.Double ) + object FractionOfModesToClear { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( + if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") + else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") + ), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( + if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") + else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") + ) ) } } - + case class WarmStart( - path : java.lang.String, - prepareData : scala.Boolean, - samplePopulationIntegerFlag : scala.Int, - skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type` : java.lang.String + path: java.lang.String, + prepareData: scala.Boolean, + samplePopulationIntegerFlag: scala.Int, + skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type`: java.lang.String ) + object WarmStart { + case class SkimsFilePaths$Elm( - skimType : java.lang.String, - skimsFilePath : java.lang.String + skimType: java.lang.String, + skimsFilePath: java.lang.String ) + object SkimsFilePaths$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if(c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if (c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = + if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = + if (c.hasPathOrNull("skimsFilePaths")) + scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) + else None, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), - calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), - cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), - debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), - exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), - experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), - input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), - inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), - metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), - output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), - physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), - replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), - routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), - sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), - spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), - urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) + actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim( + if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") + else com.typesafe.config.ConfigFactory.parseString("agentsim{}") + ), + calibration = BeamConfig.Beam.Calibration( + if (c.hasPathOrNull("calibration")) c.getConfig("calibration") + else com.typesafe.config.ConfigFactory.parseString("calibration{}") + ), + cluster = BeamConfig.Beam.Cluster( + if (c.hasPathOrNull("cluster")) c.getConfig("cluster") + else com.typesafe.config.ConfigFactory.parseString("cluster{}") + ), + debug = BeamConfig.Beam.Debug( + if (c.hasPathOrNull("debug")) c.getConfig("debug") + else com.typesafe.config.ConfigFactory.parseString("debug{}") + ), + exchange = BeamConfig.Beam.Exchange( + if (c.hasPathOrNull("exchange")) c.getConfig("exchange") + else com.typesafe.config.ConfigFactory.parseString("exchange{}") + ), + experimental = BeamConfig.Beam.Experimental( + if (c.hasPathOrNull("experimental")) c.getConfig("experimental") + else com.typesafe.config.ConfigFactory.parseString("experimental{}") + ), + input = BeamConfig.Beam.Input( + if (c.hasPathOrNull("input")) c.getConfig("input") + else com.typesafe.config.ConfigFactory.parseString("input{}") + ), + inputDirectory = + if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger( + if (c.hasPathOrNull("logger")) c.getConfig("logger") + else com.typesafe.config.ConfigFactory.parseString("logger{}") + ), + metrics = BeamConfig.Beam.Metrics( + if (c.hasPathOrNull("metrics")) c.getConfig("metrics") + else com.typesafe.config.ConfigFactory.parseString("metrics{}") + ), + output = BeamConfig.Beam.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + outputs = BeamConfig.Beam.Outputs( + if (c.hasPathOrNull("outputs")) c.getConfig("outputs") + else com.typesafe.config.ConfigFactory.parseString("outputs{}") + ), + physsim = BeamConfig.Beam.Physsim( + if (c.hasPathOrNull("physsim")) c.getConfig("physsim") + else com.typesafe.config.ConfigFactory.parseString("physsim{}") + ), + replanning = BeamConfig.Beam.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + router = BeamConfig.Beam.Router( + if (c.hasPathOrNull("router")) c.getConfig("router") + else com.typesafe.config.ConfigFactory.parseString("router{}") + ), + routing = BeamConfig.Beam.Routing( + if (c.hasPathOrNull("routing")) c.getConfig("routing") + else com.typesafe.config.ConfigFactory.parseString("routing{}") + ), + sim = BeamConfig.Beam.Sim( + if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") + ), + spatial = BeamConfig.Beam.Spatial( + if (c.hasPathOrNull("spatial")) c.getConfig("spatial") + else com.typesafe.config.ConfigFactory.parseString("spatial{}") + ), + urbansim = BeamConfig.Beam.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart( + if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") + else com.typesafe.config.ConfigFactory.parseString("warmStart{}") + ) ) } } - + case class Matsim( - conversion : BeamConfig.Matsim.Conversion, - modules : BeamConfig.Matsim.Modules + conversion: BeamConfig.Matsim.Conversion, + modules: BeamConfig.Matsim.Modules ) + object Matsim { + case class Conversion( - defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles : scala.Boolean, - matsimNetworkFile : java.lang.String, - osmFile : java.lang.String, - populationFile : java.lang.String, - scenarioDirectory : java.lang.String, - shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile : java.lang.String + defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles: scala.Boolean, + matsimNetworkFile: java.lang.String, + osmFile: java.lang.String, + populationFile: java.lang.String, + scenarioDirectory: java.lang.String, + shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile: java.lang.String ) + object Conversion { + case class DefaultHouseholdIncome( - currency : java.lang.String, - period : java.lang.String, - value : scala.Int + currency: java.lang.String, + period: java.lang.String, + value: scala.Int ) + object DefaultHouseholdIncome { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if(c.hasPathOrNull("period")) c.getString("period") else "year", - value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if (c.hasPathOrNull("period")) c.getString("period") else "year", + value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile : java.lang.String, - tazIdFieldName : java.lang.String + shapeFile: java.lang.String, + tazIdFieldName: java.lang.String ) + object ShapeConfig { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( + if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") + else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") + ), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = + if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = + if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = + if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") + else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( + if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") + else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") + ), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode : BeamConfig.Matsim.Modules.ChangeMode, - controler : BeamConfig.Matsim.Modules.Controler, - counts : BeamConfig.Matsim.Modules.Counts, - global : BeamConfig.Matsim.Modules.Global, - households : BeamConfig.Matsim.Modules.Households, - linkStats : BeamConfig.Matsim.Modules.LinkStats, - network : BeamConfig.Matsim.Modules.Network, - parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, - plans : BeamConfig.Matsim.Modules.Plans, - qsim : BeamConfig.Matsim.Modules.Qsim, - strategy : BeamConfig.Matsim.Modules.Strategy, - transit : BeamConfig.Matsim.Modules.Transit, - vehicles : BeamConfig.Matsim.Modules.Vehicles + changeMode: BeamConfig.Matsim.Modules.ChangeMode, + controler: BeamConfig.Matsim.Modules.Controler, + counts: BeamConfig.Matsim.Modules.Counts, + global: BeamConfig.Matsim.Modules.Global, + households: BeamConfig.Matsim.Modules.Households, + linkStats: BeamConfig.Matsim.Modules.LinkStats, + network: BeamConfig.Matsim.Modules.Network, + parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, + plans: BeamConfig.Matsim.Modules.Plans, + qsim: BeamConfig.Matsim.Modules.Qsim, + strategy: BeamConfig.Matsim.Modules.Strategy, + transit: BeamConfig.Matsim.Modules.Transit, + vehicles: BeamConfig.Matsim.Modules.Vehicles ) + object Modules { + case class ChangeMode( - modes : java.lang.String + modes: java.lang.String ) + object ChangeMode { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat : java.lang.String, - firstIteration : scala.Int, - lastIteration : scala.Int, - mobsim : java.lang.String, - outputDirectory : java.lang.String, - overwriteFiles : java.lang.String + eventsFileFormat: java.lang.String, + firstIteration: scala.Int, + lastIteration: scala.Int, + mobsim: java.lang.String, + outputDirectory: java.lang.String, + overwriteFiles: java.lang.String ) + object Controler { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = + if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Double, - inputCountsFile : java.lang.String, - outputformat : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Double, + inputCountsFile: java.lang.String, + outputformat: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem : java.lang.String, - randomSeed : scala.Int + coordinateSystem: java.lang.String, + randomSeed: scala.Int ) + object Global { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile : java.lang.String, - inputHouseholdAttributesFile : java.lang.String + inputFile: java.lang.String, + inputHouseholdAttributesFile: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" + inputFile = + if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = + if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") + else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations : scala.Int, - writeLinkStatsInterval : scala.Int + averageLinkStatsOverIterations: scala.Int, + writeLinkStatsInterval: scala.Int ) + object LinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = + if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = + if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile : java.lang.String + inputNetworkFile: java.lang.String ) + object Network { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = + if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") + else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents : scala.Int, - numberOfThreads : scala.Int, - oneThreadPerHandler : scala.Boolean, - synchronizeOnSimSteps : scala.Boolean + estimatedNumberOfEvents: scala.Int, + numberOfThreads: scala.Int, + oneThreadPerHandler: scala.Boolean, + synchronizeOnSimSteps: scala.Boolean ) + object ParallelEventHandling { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = + if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta : scala.Long, - earlyDeparture : scala.Long, - lateArrival : scala.Long, - learningRate : scala.Long, - parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing : scala.Long, - traveling : scala.Long, - waiting : scala.Long, - writeExperiencedPlans : scala.Boolean + BrainExpBeta: scala.Long, + earlyDeparture: scala.Long, + lateArrival: scala.Long, + learningRate: scala.Long, + parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing: scala.Long, + traveling: scala.Long, + waiting: scala.Long, + writeExperiencedPlans: scala.Boolean ) + object PlanCalcScore { + case class Parameterset$Elm( - activityType : java.lang.String, - priority : scala.Int, - scoringThisActivityAtAll : scala.Boolean, - `type` : java.lang.String, - typicalDuration : java.lang.String, - typicalDurationScoreComputation : java.lang.String + activityType: java.lang.String, + priority: scala.Int, + scoringThisActivityAtAll: scala.Boolean, + `type`: java.lang.String, + typicalDuration: java.lang.String, + typicalDurationScoreComputation: java.lang.String ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" + activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = + !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = + if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") + else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, - earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, - lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, - learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, - traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, - waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + BrainExpBeta = + if (c.hasPathOrNull("BrainExpBeta")) + c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) + else 2, + earlyDeparture = + if (c.hasPathOrNull("earlyDeparture")) + c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, + lateArrival = + if (c.hasPathOrNull("lateArrival")) + c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) + else -18, + learningRate = + if (c.hasPathOrNull("learningRate")) + c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) + else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = + if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) + else 6, + traveling = + if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) + else -6, + waiting = + if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.PlanCalcScore + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Plans( - inputPersonAttributesFile : java.lang.String, - inputPlansFile : java.lang.String + inputPersonAttributesFile: java.lang.String, + inputPlansFile: java.lang.String ) + object Plans { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" + inputPersonAttributesFile = + if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") + else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = + if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") + else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime : java.lang.String, - snapshotperiod : java.lang.String, - startTime : java.lang.String + endTime: java.lang.String, + snapshotperiod: java.lang.String, + startTime: java.lang.String ) + object Qsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1 : scala.Int, - ModuleProbability_2 : scala.Int, - ModuleProbability_3 : scala.Int, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - fractionOfIterationsToDisableInnovation : scala.Int, - maxAgentPlanMemorySize : scala.Int, - parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval : java.lang.String + ModuleProbability_1: scala.Int, + ModuleProbability_2: scala.Int, + ModuleProbability_3: scala.Int, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + fractionOfIterationsToDisableInnovation: scala.Int, + maxAgentPlanMemorySize: scala.Int, + parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval: java.lang.String ) + object Strategy { + case class Parameterset$Elm( - disableAfterIteration : scala.Int, - strategyName : java.lang.String, - `type` : java.lang.String, - weight : scala.Int + disableAfterIteration: scala.Int, + strategyName: java.lang.String, + `type`: java.lang.String, + weight: scala.Int ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" - ) - } - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getInt("fractionOfIterationsToDisableInnovation") + else 999999, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = + if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") + else "WorstPlanForRemovalSelector" + ) + } + + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.Strategy + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Transit( - transitModes : java.lang.String, - useTransit : scala.Boolean, - vehiclesFile : java.lang.String + transitModes: java.lang.String, + useTransit: scala.Boolean, + vehiclesFile: java.lang.String ) + object Transit { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile : java.lang.String + vehiclesFile: java.lang.String ) + object Vehicles { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), - controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), - counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), - households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), - network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), - plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), - strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), - transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), - vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + changeMode = BeamConfig.Matsim.Modules.ChangeMode( + if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") + else com.typesafe.config.ConfigFactory.parseString("changeMode{}") + ), + controler = BeamConfig.Matsim.Modules.Controler( + if (c.hasPathOrNull("controler")) c.getConfig("controler") + else com.typesafe.config.ConfigFactory.parseString("controler{}") + ), + counts = BeamConfig.Matsim.Modules.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + global = BeamConfig.Matsim.Modules.Global( + if (c.hasPathOrNull("global")) c.getConfig("global") + else com.typesafe.config.ConfigFactory.parseString("global{}") + ), + households = BeamConfig.Matsim.Modules.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + linkStats = BeamConfig.Matsim.Modules.LinkStats( + if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") + else com.typesafe.config.ConfigFactory.parseString("linkStats{}") + ), + network = BeamConfig.Matsim.Modules.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( + if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") + else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") + ), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( + if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") + else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") + ), + plans = BeamConfig.Matsim.Modules.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + qsim = BeamConfig.Matsim.Modules.Qsim( + if (c.hasPathOrNull("qsim")) c.getConfig("qsim") + else com.typesafe.config.ConfigFactory.parseString("qsim{}") + ), + strategy = BeamConfig.Matsim.Modules.Strategy( + if (c.hasPathOrNull("strategy")) c.getConfig("strategy") + else com.typesafe.config.ConfigFactory.parseString("strategy{}") + ), + transit = BeamConfig.Matsim.Modules.Transit( + if (c.hasPathOrNull("transit")) c.getConfig("transit") + else com.typesafe.config.ConfigFactory.parseString("transit{}") + ), + vehicles = BeamConfig.Matsim.Modules.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), - modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) + conversion = BeamConfig.Matsim.Conversion( + if (c.hasPathOrNull("conversion")) c.getConfig("conversion") + else com.typesafe.config.ConfigFactory.parseString("conversion{}") + ), + modules = BeamConfig.Matsim.Modules( + if (c.hasPathOrNull("modules")) c.getConfig("modules") + else com.typesafe.config.ConfigFactory.parseString("modules{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), - matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) + beam = BeamConfig.Beam( + if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") + ), + matsim = BeamConfig.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ) ) } - private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + + private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { + + private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") + if ( + (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number] + ) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { + + private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException(cv.origin.lineNumber + + new java.lang.RuntimeException( + cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) + ) } - private def $_str(cv:com.typesafe.config.ConfigValue) = + + private def $_str(cv: com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } - From 1f9de8a21bbee9df06ce21dfc55ce5d8bc3709f6 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 9 Mar 2022 14:55:26 -0800 Subject: [PATCH 032/307] adding fixes to overnight charging step1 --- .../agents/household/HouseholdActor.scala | 5 +- .../household/HouseholdFleetManager.scala | 70 +++++++++---------- .../agents/modalbehaviors/ChoosesMode.scala | 37 +++++++--- 3 files changed, 65 insertions(+), 47 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index a5d2f8cd971..8a2f6fde597 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -22,7 +22,7 @@ import beam.agentsim.agents.vehicles.VehicleCategory.{Bike, Car, VehicleCategory import beam.agentsim.agents.vehicles._ import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.ChargingNetworkManager.ChargingPlugRequest -import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.HasTriggerId @@ -561,7 +561,8 @@ object HouseholdActor { activityType, VehicleManager.getReservedFor(vehicle.vehicleManagerId.get).get, beamVehicle = Option(vehicle), - triggerId = triggerId + triggerId = triggerId, + searchMode = ParkingSearchMode.Init ) if (vehicle.isEV) chargingNetworkManager ? inquiry else parkingManager ? inquiry } diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 7418d7b33db..28c0d1a7a1a 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -13,7 +13,7 @@ import beam.agentsim.agents.modalbehaviors.DrivesVehicle.ActualVehicle import beam.agentsim.agents.vehicles.{BeamVehicle, VehicleManager} import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.ChargingNetworkManager._ -import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.CompletionNotice import beam.agentsim.scheduler.HasTriggerId @@ -94,7 +94,8 @@ class HouseholdFleetManager( activityType, VehicleManager.getReservedFor(vehicle.vehicleManagerId.get).get, beamVehicle = Option(vehicle), - triggerId = triggerId + triggerId = triggerId, + searchMode = ParkingSearchMode.Init ) if (vehicle.isEV) (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) else (parkingManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) @@ -141,43 +142,38 @@ class HouseholdFleetManager( for { neededVehicleCategory <- requireVehicleCategoryAvailable emergencyHouseholdVehicleGenerator <- maybeEmergencyHouseholdVehicleGenerator + vehicle <- emergencyHouseholdVehicleGenerator.createVehicle( + personId, + nextVehicleIndex, + neededVehicleCategory, + whenWhere, + self + ) } yield { - val vehicleCreatedOutOfThinAir: Boolean = if (availableVehicles.isEmpty) { - emergencyHouseholdVehicleGenerator.createVehicle( - personId, - nextVehicleIndex, - neededVehicleCategory, + if (availableVehicles.isEmpty) { + // Create a vehicle out of thin air + nextVehicleIndex += 1 + val mobilityRequester = sender() + vehiclesInternal(vehicle.id) = vehicle + + // Pipe my car through the parking manager + // and complete initialization only when I got them all. + val responseFuture = parkingManager ? ParkingInquiry.init( whenWhere, - self - ) match { - case Some(vehicle) => - logger.warn( - s"No vehicles available for category ${neededVehicleCategory} available for person ${personId.toString}, creating a new vehicle with id ${vehicle.id.toString}" - ) - nextVehicleIndex += 1 - val mobilityRequester = sender() - vehiclesInternal(vehicle.id) = vehicle - - // Pipe my car through the parking manager - // and complete initialization only when I got them all. - val responseFuture = parkingManager ? ParkingInquiry.init( - whenWhere, - "wherever", - triggerId = triggerId - ) - responseFuture.collect { case ParkingInquiryResponse(stall, _, otherTriggerId) => - vehicle.useParkingStall(stall) - logger.debug("Vehicle {} is now taken, which was just created", vehicle.id) - vehicle.becomeDriver(mobilityRequester) - MobilityStatusResponse(Vector(ActualVehicle(vehicle)), otherTriggerId) - } pipeTo mobilityRequester - true - case _ => - false - } - } else false - - if (!vehicleCreatedOutOfThinAir) { + "wherever", + triggerId = triggerId + ) + logger.warn( + s"No vehicles available for category ${neededVehicleCategory} available for person ${personId.toString}, creating a new vehicle with id ${vehicle.id.toString}" + ) + + responseFuture.collect { case ParkingInquiryResponse(stall, _, otherTriggerId) => + vehicle.useParkingStall(stall) + logger.debug("Vehicle {} is now taken, which was just created", vehicle.id) + vehicle.becomeDriver(mobilityRequester) + MobilityStatusResponse(Vector(ActualVehicle(vehicle)), otherTriggerId) + } pipeTo mobilityRequester + } else { availableVehicles = availableVehicles match { case firstVehicle :: rest => logger.debug("Vehicle {} is now taken", firstVehicle.id) diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index b0d6f44be46..616d24b74b2 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -227,7 +227,7 @@ trait ChoosesMode { _, _, _, - None | Some(CAR | BIKE | DRIVE_TRANSIT | BIKE_TRANSIT), + plansModeOption @ (None | Some(CAR | BIKE | DRIVE_TRANSIT | BIKE_TRANSIT)), _, _, _, @@ -259,11 +259,29 @@ trait ChoosesMode { _ ) => implicit val executionContext: ExecutionContext = context.system.dispatcher - requestAvailableVehicles( - vehicleFleets, - currentLocation, - _experiencedBeamPlan.activities(currentActivityIndex) - ) pipeTo self + plansModeOption match { + case Some(CAR | DRIVE_TRANSIT) => + requestAvailableVehicles( + vehicleFleets, + currentLocation, + _experiencedBeamPlan.activities(currentActivityIndex), + Some(VehicleCategory.Car) + ) pipeTo self + case Some(BIKE | BIKE_TRANSIT) => + requestAvailableVehicles( + vehicleFleets, + currentLocation, + _experiencedBeamPlan.activities(currentActivityIndex), + Some(VehicleCategory.Bike) + ) pipeTo self + case _ => + requestAvailableVehicles( + vehicleFleets, + currentLocation, + _experiencedBeamPlan.activities(currentActivityIndex) + ) pipeTo self + } + // Otherwise, send empty list to self case _ => self ! MobilityStatusResponse(Vector(), getCurrentTriggerIdOrGenerate) @@ -328,8 +346,11 @@ trait ChoosesMode { var availablePersonalStreetVehicles = correctedCurrentTourMode match { - case None | Some(CAR | BIKE | HOV2_TELEPORTATION | HOV3_TELEPORTATION) => - // In these cases, a personal vehicle will be involved + case None | Some(CAR | BIKE) => + // In these cases, a personal vehicle will be involved, but filter out teleportation vehicles + newlyAvailableBeamVehicles.filterNot(v => BeamVehicle.isSharedTeleportationVehicle(v.id)) + case Some(HOV2_TELEPORTATION | HOV3_TELEPORTATION) => + // In these cases, also include teleportation vehicles newlyAvailableBeamVehicles case Some(DRIVE_TRANSIT | BIKE_TRANSIT) => val tour = _experiencedBeamPlan.getTourContaining(nextAct) From c3ed334136d5f62cb3adcced08f4a7815320ec06 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 9 Mar 2022 15:02:43 -0800 Subject: [PATCH 033/307] adding fixed to overnight charging --- src/main/resources/beam-template.conf | 1 + .../beam/agentsim/agents/PersonAgent.scala | 6 +- .../DefaultRideHailDepotParkingManager.scala | 3 +- .../infrastructure/ChargingFunctions.scala | 74 ++++++++++++++++--- .../infrastructure/ChargingNetwork.scala | 3 +- .../ChargingNetworkManager.scala | 6 +- .../DefaultRidehailFunctions.scala | 6 +- .../HierarchicalParkingManager.scala | 10 ++- .../InfrastructureFunctions.scala | 11 ++- .../infrastructure/InfrastructureUtils.scala | 3 +- .../ParallelParkingManager.scala | 9 ++- .../infrastructure/ParkingFunctions.scala | 44 ++--------- .../infrastructure/ParkingInquiry.scala | 1 + .../ParkingManagerBenchmark.scala | 1 + .../infrastructure/ZonalParkingManager.scala | 12 ++- .../parking/ParkingZoneSearch.scala | 13 +++- .../infrastructure/parking/PricingModel.scala | 11 ++- .../scala/beam/sim/config/BeamConfig.scala | 4 + .../HierarchicalParkingManagerSpec.scala | 6 ++ .../ZonalParkingManagerSpec.scala | 3 +- .../parking/PricingModelSpec.scala | 7 +- 21 files changed, 154 insertions(+), 80 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 64c1b3039b7..3af7c6a7805 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -167,6 +167,7 @@ beam.agentsim.agents.parking.rangeAnxietyBuffer = "double | 20000.0" # if our re beam.agentsim.agents.parking.minSearchRadius = "double | 250.00" # something small enough that, on average, we see 2 orders of magnitude of samples at most beam.agentsim.agents.parking.maxSearchRadius = "double | 8046.72" # something large enough that we do not strand our drivers in an oasis beam.agentsim.agents.parking.searchMaxDistanceRelativeToEllipseFoci = "double | 4.0" # something large enough that we do not travel longer than the actual distance to destination +beam.agentsim.agents.parking.estimatedMinParkingDuration = "double | 60.0" # in seconds, something small enough but has meaningful impact on pricing #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 2170f710f79..6097c3d9f57 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -643,7 +643,11 @@ class PersonAgent( ) eventsManager.processEvent(teleportationEvent) - goto(ProcessingNextLegOrStartActivity) using data.copy(hasDeparted = true) + goto(ProcessingNextLegOrStartActivity) using data.copy( + hasDeparted = true, + currentVehicle = Vector.empty[Id[BeamVehicle]], + currentTourPersonalVehicle = None + ) } diff --git a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala index c2bde51ce2f..11bd1611a9d 100644 --- a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala @@ -373,7 +373,8 @@ object DefaultRideHailDepotParkingManager { beamServices.beamConfig.matsim.modules.global.randomSeed, beamServices.beamScenario.fuelTypePrices, beamServices.beamConfig.beam.agentsim.agents.rideHail, - beamServices.skims + beamServices.skims, + beamServices.beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index d219e1a36a9..a66f885e35d 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -2,7 +2,7 @@ package beam.agentsim.infrastructure import beam.agentsim.agents.vehicles.FuelType.FuelType import beam.agentsim.agents.vehicles.{BeamVehicle, BeamVehicleType, VehicleManager} -import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.ParkingZoneSearch.{ParkingAlternative, ParkingZoneSearchResult} import beam.agentsim.infrastructure.parking._ @@ -30,7 +30,8 @@ class ChargingFunctions[GEO: GeoLevel]( seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, skims: Option[Skims], - fuelPrice: Map[FuelType, Double] + fuelPrice: Map[FuelType, Double], + estimatedMinParkingDuration: Double ) extends ParkingFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -43,7 +44,8 @@ class ChargingFunctions[GEO: GeoLevel]( enrouteDuration, boundingBox, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) { /** @@ -53,7 +55,7 @@ class ChargingFunctions[GEO: GeoLevel]( * @return */ def ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { - inquiry.reservedFor match { + inquiry.reservedFor.managerType match { case VehicleManager.TypeEnum.RideHail if inquiry.parkingDuration <= 3600 => ChargingPointType.isFastCharger(zone.chargingPointType.get) case _ => @@ -76,6 +78,16 @@ class ChargingFunctions[GEO: GeoLevel]( } } + def ifOvernightStayThenSlowChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { + if ( + inquiry.searchMode == ParkingSearchMode.Init || List(ParkingActivityType.Home, ParkingActivityType.Work).contains( + inquiry.parkingActivityType + ) + ) { + !ChargingPointType.isFastCharger(zone.chargingPointType.get) + } else true + } + /** * Method that verifies if the vehicle has valid charging capability * @param zone ParkingZone @@ -104,13 +116,14 @@ class ChargingFunctions[GEO: GeoLevel]( ): Boolean = { if (zone.chargingPointType.isEmpty) throw new RuntimeException("ChargingFunctions expect only stalls with charging points") - val isEV: Boolean = inquiry.beamVehicle.forall(v => v.isBEV || v.isPHEV) + val isEV: Boolean = inquiry.beamVehicle.forall(_.isEV) val rideHailFastChargingOnly: Boolean = ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone, inquiry) val enrouteFastChargingOnly: Boolean = ifEnrouteThenFastChargingOnly(zone, inquiry) + val overnightStaySlowChargingOnly: Boolean = ifOvernightStayThenSlowChargingOnly(zone, inquiry) val validChargingCapability: Boolean = hasValidChargingCapability(zone, inquiry.beamVehicle) val preferredParkingTypes = getPreferredParkingTypes(inquiry) val canCarParkHere: Boolean = canThisCarParkHere(zone, inquiry, preferredParkingTypes) - isEV && rideHailFastChargingOnly && validChargingCapability && canCarParkHere && enrouteFastChargingOnly + isEV && rideHailFastChargingOnly && validChargingCapability && canCarParkHere && enrouteFastChargingOnly && overnightStaySlowChargingOnly } /** @@ -123,7 +136,7 @@ class ChargingFunctions[GEO: GeoLevel]( parkingAlternative: ParkingAlternative[GEO], inquiry: ParkingInquiry ): Map[ParkingMNL.Parameters, Double] = { - val parkingParameters = inquiry.searchMode match { + val enrouteFactor: Double = inquiry.searchMode match { case ParkingSearchMode.EnRoute => val beamVehicle = inquiry.beamVehicle.get val origin = inquiry.originUtm.getOrElse( @@ -136,11 +149,50 @@ class ChargingFunctions[GEO: GeoLevel]( origin.time + travelTime1, beamVehicle.beamVehicleType ) - val enrouteFactor: Double = (travelTime1 + travelTime2) * inquiry.valueOfTime - Map(ParkingMNL.Parameters.EnrouteDetourCost -> enrouteFactor) - case _ => Map() + (travelTime1 + travelTime2) * inquiry.valueOfTime + case _ => 0.0 + } + + // end-of-day parking durations are set to zero, which will be mis-interpreted here + val tempParkingDuration = inquiry.searchMode match { + case ParkingSearchMode.EnRoute => enrouteDuration.toInt + case _ => inquiry.parkingDuration.toInt } - super[ParkingFunctions].setupMNLParameters(parkingAlternative, inquiry) ++ parkingParameters + val parkingDuration: Option[Int] = + if (tempParkingDuration < estimatedMinParkingDuration) + Some(estimatedMinParkingDuration.toInt) // at least a small duration of charging + else Some(tempParkingDuration) + + val addedEnergy: Double = + inquiry.beamVehicle match { + case Some(beamVehicle) => + parkingAlternative.parkingZone.chargingPointType match { + case Some(chargingPoint) => + val (_, addedEnergy) = ChargingPointType.calculateChargingSessionLengthAndEnergyInJoule( + chargingPoint, + beamVehicle.primaryFuelLevelInJoules, + beamVehicle.beamVehicleType.primaryFuelCapacityInJoule, + 1e6, + 1e6, + parkingDuration + ) + addedEnergy + case None => 0.0 // no charger here + } + case None => 0.0 // no beamVehicle, assume agent has range + } + + val rangeAnxietyFactor: Double = + inquiry.remainingTripData + .map { + _.rangeAnxiety(withAddedFuelInJoules = addedEnergy) + } + .getOrElse(0.0) // default no anxiety if no remaining trip data provided + + super[ParkingFunctions].setupMNLParameters(parkingAlternative, inquiry) ++ Map( + ParkingMNL.Parameters.EnrouteDetourCost -> enrouteFactor, + ParkingMNL.Parameters.RangeAnxietyCost -> rangeAnxietyFactor + ) } /** diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index bca09474253..acece6d2905 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -173,7 +173,8 @@ object ChargingNetwork extends LazyLogging { beamConfig.matsim.modules.global.randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, skims, - fuelPrice + fuelPrice, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 51b198671a4..6d63f0f41b1 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -10,7 +10,7 @@ import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.{NotApplicable, ShiftStatus} import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingStatus, ChargingVehicle} -import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.EnRoute +import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.{Destination, EnRoute, Init} import beam.agentsim.infrastructure.power.{PowerController, SitePowerManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger.TriggerWithId @@ -162,7 +162,9 @@ class ChargingNetworkManager( val activityType = vehicle2InquiryMap .get(vehicle.id) .map { - case ParkingInquiry(_, _, _, _, _, _, _, _, _, _, `EnRoute`, _, _) => EnRoute.toString + case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, searchMode, _, _) + if searchMode != Destination => + searchMode.toString + "-" + activityType case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, _, _, _) => activityType } .getOrElse("") diff --git a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala index 91817fa70dc..358f1d35817 100644 --- a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala @@ -33,7 +33,8 @@ class DefaultRidehailFunctions[GEO: GeoLevel]( seed: Int, fuelTypePrices: Map[FuelType, Double], rideHailConfig: BeamConfig.Beam.Agentsim.Agents.RideHail, - skims: Skims + skims: Skims, + estimatedMinParkingDuration: Double ) extends InfrastructureFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -45,7 +46,8 @@ class DefaultRidehailFunctions[GEO: GeoLevel]( 0.0, 0.0, boundingBox, - seed + seed, + estimatedMinParkingDuration ) { private val vehicleIdToEndRefuelTick: mutable.Map[VehicleId, Int] = mutable.Map.empty[VehicleId, Int] diff --git a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala index 4926515fe73..bf25bdce849 100644 --- a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala @@ -37,6 +37,7 @@ class HierarchicalParkingManager( boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double, checkThatNumberOfStallsMatch: Boolean = false ) extends ParkingNetwork[Link](parkingZones) { @@ -72,7 +73,8 @@ class HierarchicalParkingManager( 0.0, boundingBox, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) val DefaultParkingZone: ParkingZone[Link] = @@ -279,6 +281,7 @@ object HierarchicalParkingManager { boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork[Link] = { new HierarchicalParkingManager( @@ -291,6 +294,7 @@ object HierarchicalParkingManager { boundingBox, seed, mnlParkingConfig, + estimatedMinParkingDuration, checkThatNumberOfStallsMatch ) } @@ -305,6 +309,7 @@ object HierarchicalParkingManager { boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork[Link] = HierarchicalParkingManager( @@ -317,6 +322,7 @@ object HierarchicalParkingManager { boundingBox, seed, mnlParkingConfig, + estimatedMinParkingDuration, checkThatNumberOfStallsMatch ) @@ -399,7 +405,7 @@ object HierarchicalParkingManager { } .filter { case (_, _, maxStalls) => maxStalls > 0 } .zipWithIndex - .map { case ((linkId, description, maxStalls), id) => + .map { case ((linkId, description, maxStalls), _) => val numStalls = Math.min(maxStalls, Int.MaxValue).toInt val parkingZone = ParkingZone.init[Link]( None, diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 89893cd29de..1fa1e1ac400 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -30,7 +30,8 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( searchMaxDistanceRelativeToEllipseFoci: Double, enrouteDuration: Double, boundingBox: Envelope, - seed: Int + seed: Int, + estimatedMinParkingDuration: Double ) extends StrictLogging { protected val zoneSearchTree: ParkingZoneSearch.ZoneSearchTree[GEO] = @@ -98,7 +99,8 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( searchMaxDistanceRelativeToEllipseFoci, boundingBox, distanceFunction, - enrouteDuration + enrouteDuration, + estimatedMinParkingDuration ) def searchForParkingStall(inquiry: ParkingInquiry): Option[ParkingZoneSearch.ParkingZoneSearchResult[GEO]] = { @@ -143,10 +145,7 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( // filters out ParkingZones which do not apply to this agent // TODO: check for conflicts between variables here - is it always false? val parkingZoneFilterFunction: ParkingZone[GEO] => Boolean = - (zone: ParkingZone[GEO]) => { - val searchFilterPredicates = setupSearchFilterPredicates(zone, inquiry) - searchFilterPredicates - } + (zone: ParkingZone[GEO]) => setupSearchFilterPredicates(zone, inquiry) // generates a coordinate for an embodied ParkingStall from a ParkingZone val parkingZoneLocSamplingFunction: ParkingZone[GEO] => Coord = diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala index e261ff6c806..39f9ca2f808 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala @@ -181,7 +181,8 @@ object InfrastructureUtils extends LazyLogging { beamConfig.beam.agentsim.agents.parking.maxSearchRadius, envelopeInUTM, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) case "PARALLEL" => ParallelParkingManager.init( diff --git a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala index 8424d2d3266..a9620e19d2a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala @@ -39,7 +39,8 @@ class ParallelParkingManager( minSearchRadius: Double, maxSearchRadius: Double, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ) extends ParkingNetwork[TAZ](parkingZones) { override protected val searchFunctions: Option[InfrastructureFunctions[TAZ]] = None @@ -73,7 +74,8 @@ class ParallelParkingManager( minSearchRadius, maxSearchRadius, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) Worker(parkingNetwork, cluster) } @@ -182,7 +184,8 @@ object ParallelParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 96603ea2957..d368446ce34 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -26,7 +26,8 @@ class ParkingFunctions[GEO: GeoLevel]( enrouteDuration: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ) extends InfrastructureFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -38,7 +39,8 @@ class ParkingFunctions[GEO: GeoLevel]( searchMaxDistanceRelativeToEllipseFoci, enrouteDuration, boundingBox, - seed + seed, + estimatedMinParkingDuration ) { override protected val mnlMultiplierParameters: Map[ParkingMNL.Parameters, UtilityFunctionOperation] = Map( @@ -82,41 +84,8 @@ class ParkingFunctions[GEO: GeoLevel]( val homeActivityPrefersResidentialFactor: Double = if (goingHome) 1.0 else 0.0 - // end-of-day parking durations are set to zero, which will be mis-interpreted here - val tempParkingDuration = inquiry.searchMode match { - case ParkingSearchMode.EnRoute => enrouteDuration.toInt - case _ => inquiry.parkingDuration.toInt - } - val parkingDuration: Option[Int] = if (tempParkingDuration <= 0) None else Some(tempParkingDuration) - - val addedEnergy: Double = - inquiry.beamVehicle match { - case Some(beamVehicle) => - parkingAlternative.parkingZone.chargingPointType match { - case Some(chargingPoint) => - val (_, addedEnergy) = ChargingPointType.calculateChargingSessionLengthAndEnergyInJoule( - chargingPoint, - beamVehicle.primaryFuelLevelInJoules, - beamVehicle.beamVehicleType.primaryFuelCapacityInJoule, - 1e6, - 1e6, - parkingDuration - ) - addedEnergy - case None => 0.0 // no charger here - } - case None => 0.0 // no beamVehicle, assume agent has range - } - - val rangeAnxietyFactor: Double = - inquiry.remainingTripData - .map { - _.rangeAnxiety(withAddedFuelInJoules = addedEnergy) - } - .getOrElse(0.0) // default no anxiety if no remaining trip data provided - val params: Map[ParkingMNL.Parameters, Double] = Map( - ParkingMNL.Parameters.RangeAnxietyCost -> rangeAnxietyFactor, + ParkingMNL.Parameters.RangeAnxietyCost -> 0.0, ParkingMNL.Parameters.WalkingEgressCost -> distanceFactor, ParkingMNL.Parameters.ParkingTicketCost -> parkingCostsPriceFactor, ParkingMNL.Parameters.HomeActivityPrefersResidentialParking -> homeActivityPrefersResidentialFactor, @@ -228,9 +197,8 @@ class ParkingFunctions[GEO: GeoLevel]( .forall(_.contains(inquiry.destinationUtm.time % (24 * 3600))) ) - val isValidVehicleManager = inquiry.beamVehicle.forall { vehicle => + val isValidVehicleManager = zone.reservedFor.managerType == VehicleManager.TypeEnum.Default || zone.reservedFor.managerId == inquiry.reservedFor.managerId - } hasAvailability & validParkingType & isValidTime & isValidVehicleManager } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala index b9f543c6681..90851da3f03 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala @@ -58,6 +58,7 @@ object ParkingInquiry extends LazyLogging { val values: immutable.IndexedSeq[ParkingSearchMode] = findValues case object EnRoute extends ParkingSearchMode case object Destination extends ParkingSearchMode + case object Init extends ParkingSearchMode } object ParkingActivityType extends Enum[ParkingActivityType] { diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala index f63247977d7..e27c2b83af5 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala @@ -227,6 +227,7 @@ object ParkingManagerBenchmark extends StrictLogging { boundingBox, seed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) parkingNetwork diff --git a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala index 64d5a32b7ed..71f5e5756a6 100755 --- a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala @@ -46,7 +46,8 @@ object ZonalParkingManager extends LazyLogging { minSearchRadius: Double, maxSearchRadius: Double, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + estimatedMinParkingDuration: Double ): ZonalParkingManager[GEO] = { new ZonalParkingManager(parkingZones) { if (maxSearchRadius < minSearchRadius) { @@ -67,7 +68,8 @@ object ZonalParkingManager extends LazyLogging { 0.0, boundingBox, seed, - mnlParkingConfig + mnlParkingConfig, + estimatedMinParkingDuration ) ) } @@ -97,7 +99,8 @@ object ZonalParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) } @@ -139,7 +142,8 @@ object ZonalParkingManager extends LazyLogging { minSearchRadius, maxSearchRadius, seed, - mnlParkingConfig + mnlParkingConfig, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 7749313afe3..7ef299a0146 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -48,6 +48,7 @@ object ParkingZoneSearch { boundingBox: Envelope, distanceFunction: (Coord, Coord) => Double, enrouteDuration: Double, + estimatedMinParkingDuration: Double, searchExpansionFactor: Double = 2.0 ) @@ -168,9 +169,17 @@ object ParkingZoneSearch { parkingZone.pricingModel match { case None => 0 case Some(pricingModel) if params.searchMode == ParkingSearchMode.EnRoute => - PricingModel.evaluateParkingTicket(pricingModel, config.enrouteDuration.toInt) + PricingModel.evaluateParkingTicket( + pricingModel, + config.enrouteDuration.toInt, + config.estimatedMinParkingDuration + ) case Some(pricingModel) => - PricingModel.evaluateParkingTicket(pricingModel, params.parkingDuration.toInt) + PricingModel.evaluateParkingTicket( + pricingModel, + params.parkingDuration.toInt, + config.estimatedMinParkingDuration + ) } val parkingAlternative: ParkingAlternative[GEO] = ParkingAlternative(zone, parkingZone.parkingType, parkingZone, stallLocation, stallPriceInDollars) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala index f29bb7ac97d..62069062a61 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala @@ -67,11 +67,18 @@ object PricingModel { * @param parkingDurationInSeconds duration of parking in seconds * @return monetary cost of parking, in cents */ - def evaluateParkingTicket(pricingModel: PricingModel, parkingDurationInSeconds: Int): Double = { + def evaluateParkingTicket( + pricingModel: PricingModel, + parkingDurationInSeconds: Int, + estimatedMinParkingDuration: Double + ): Double = { pricingModel match { case FlatFee(costInDollars) => costInDollars case Block(costInDollars, intervalSeconds) => - (math.max(0.0, parkingDurationInSeconds.toDouble) / intervalSeconds.toDouble) * costInDollars + (math.max( + estimatedMinParkingDuration, + parkingDurationInSeconds.toDouble + ) / intervalSeconds.toDouble) * costInDollars } } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index b858a80cc8e..63402520503 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -713,6 +713,7 @@ object BeamConfig { } case class Parking( + estimatedMinParkingDuration: scala.Double, maxSearchRadius: scala.Double, minSearchRadius: scala.Double, mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, @@ -770,6 +771,9 @@ object BeamConfig { def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( + estimatedMinParkingDuration = + if (c.hasPathOrNull("estimatedMinParkingDuration")) c.getDouble("estimatedMinParkingDuration") + else 60.0, maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( diff --git a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala index 6e9f42fb58c..e823fbe113a 100644 --- a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala @@ -79,6 +79,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -121,6 +122,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) @@ -180,6 +182,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -254,6 +257,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -341,6 +345,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) } { @@ -395,6 +400,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, checkThatNumberOfStallsMatch = true ) diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index ba0a59e18cd..beb0f0f1a37 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -441,7 +441,8 @@ class ZonalParkingManagerSpec beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration ) assertParkingResponse( diff --git a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala index 077802adb18..c820b489620 100644 --- a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala @@ -18,7 +18,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { PricingModel("flatfee", inputCost.toString) match { case Some(PricingModel.FlatFee(cost)) => cost should equal(inputCost) - PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration) should equal( + PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration, 0.0) should equal( inputCost ) case _ => fail() @@ -31,7 +31,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { case Some(PricingModel.Block(cost, intervalInSeconds)) => cost should equal(100) intervalInSeconds should equal(PricingModel.DefaultPricingInterval) - PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration) should equal( + PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration, 0.0) should equal( inputCost * 2 ) case _ => fail() @@ -54,7 +54,8 @@ class PricingModelSpec extends AnyWordSpec with Matchers { inputCost.toDouble * (parkingDuration.toDouble / blockIntervalInSeconds.toDouble) PricingModel.evaluateParkingTicket( PricingModel.Block(cost, intervalInSeconds), - parkingDuration + parkingDuration, + 0.0 ) should equal( expectedTicketPrice ) From 3ff0cfa6f0a43e302071abd1abac1c2637fc3549 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 9 Mar 2022 15:38:47 -0800 Subject: [PATCH 034/307] renaming slow charging only function --- .../unlimited_charging_infrastructure.py | 22 +++++++++---------- .../infrastructure/ChargingFunctions.scala | 10 +++++++-- .../InfrastructureFunctions.scala | 2 +- .../infrastructure/ParkingFunctions.scala | 1 - 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/main/python/gemini/unlimited_charging_infrastructure.py b/src/main/python/gemini/unlimited_charging_infrastructure.py index d0936fe6dd6..b31c9661042 100644 --- a/src/main/python/gemini/unlimited_charging_infrastructure.py +++ b/src/main/python/gemini/unlimited_charging_infrastructure.py @@ -14,24 +14,24 @@ csv_writer.write(headerfile+"\n") for x in range(1, 1455): - csv_writer.write(f"{x},Residential,Block,HomeLevel1(1.8|AC),9999999,50,Any" + "\n") - csv_writer.write(f"{x},Residential,Block,HomeLevel2(7.2|AC),9999999,200,Any" + "\n") + csv_writer.write(f"{x},Residential,Block,HomeLevel1(1.8|AC),9999999,0.45,Any" + "\n") + csv_writer.write(f"{x},Residential,Block,HomeLevel2(7.2|AC),9999999,1.8,Any" + "\n") - csv_writer.write(f"{x},Workplace,Block,WorkLevel2(7.2|AC),9999999,200,Any" + "\n") + csv_writer.write(f"{x},Workplace,Block,WorkLevel2(7.2|AC),9999999,14.4,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicLevel2(7.2|AC),9999999,200,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicFC(50|DC),9999999,1600,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicFC(150|DC),9999999,4800,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicXFC(250|DC),9999999,9500,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicXFC(400|DC),9999999,15200,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicLevel2(7.2|AC),9999999,19.3,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicFC(50|DC),9999999,306.73,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicFC(150|DC),9999999,490.98,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicXFC(250|DC),9999999,675.05,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicXFC(400|DC),9999999,950.52,Any" + "\n") with open('gemini_taz_unlimited_depots.csv', mode='w') as csv_writer: csv_writer.write(headerfile+"\n") for x in range(1, 1455): - csv_writer.write(f"{x},Public,FlatFee,DepotFC(150.0|DC),9999999,4800,ridehail(GlobalRHM)" + "\n") - csv_writer.write(f"{x},Public,FlatFee,DepotXFC(250.0|DC),9999999,9500,ridehail(GlobalRHM)" + "\n") - csv_writer.write(f"{x},Public,FlatFee,DepotXFC(400.0|DC),9999999,15200,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotFC(150.0|DC),9999999,490.98,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotXFC(250.0|DC),9999999,675.05,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotXFC(400.0|DC),9999999,950.52,ridehail(GlobalRHM)" + "\n") diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index a66f885e35d..7bfd5a9ed61 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -78,7 +78,13 @@ class ChargingFunctions[GEO: GeoLevel]( } } - def ifOvernightStayThenSlowChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { + /** + * function that verifies if Home, Work or Overnight Then Slow Charging Only + * @param zone ParkingZone + * @param inquiry ParkingInquiry + * @return + */ + def ifHomeOrWorkOrOvernightThenSlowChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { if ( inquiry.searchMode == ParkingSearchMode.Init || List(ParkingActivityType.Home, ParkingActivityType.Work).contains( inquiry.parkingActivityType @@ -119,7 +125,7 @@ class ChargingFunctions[GEO: GeoLevel]( val isEV: Boolean = inquiry.beamVehicle.forall(_.isEV) val rideHailFastChargingOnly: Boolean = ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone, inquiry) val enrouteFastChargingOnly: Boolean = ifEnrouteThenFastChargingOnly(zone, inquiry) - val overnightStaySlowChargingOnly: Boolean = ifOvernightStayThenSlowChargingOnly(zone, inquiry) + val overnightStaySlowChargingOnly: Boolean = ifHomeOrWorkOrOvernightThenSlowChargingOnly(zone, inquiry) val validChargingCapability: Boolean = hasValidChargingCapability(zone, inquiry.beamVehicle) val preferredParkingTypes = getPreferredParkingTypes(inquiry) val canCarParkHere: Boolean = canThisCarParkHere(zone, inquiry, preferredParkingTypes) diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 1fa1e1ac400..fdc82fd10af 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -1,7 +1,7 @@ package beam.agentsim.infrastructure import beam.agentsim.agents.choice.logit.UtilityFunctionOperation -import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} +import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.ParkingZone.UbiqiutousParkingAvailability import beam.agentsim.infrastructure.parking.ParkingZoneSearch.{ diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index d368446ce34..8406f02e629 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -3,7 +3,6 @@ package beam.agentsim.infrastructure import beam.agentsim.agents.choice.logit.UtilityFunctionOperation import beam.agentsim.agents.vehicles.VehicleManager import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} -import beam.agentsim.infrastructure.charging.ChargingPointType import beam.agentsim.infrastructure.parking.ParkingZoneSearch.{ParkingAlternative, ParkingZoneSearchResult} import beam.agentsim.infrastructure.parking._ import beam.agentsim.infrastructure.taz.TAZ From 59b582de65dcdc380089b18ed9ae3b83370e9940 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 9 Mar 2022 16:39:03 -0800 Subject: [PATCH 035/307] adding if refuel needed to parking --- src/main/resources/beam-template.conf | 2 ++ .../agents/parking/ChoosesParking.scala | 13 ++++++++++- .../infrastructure/ChargingFunctions.scala | 10 ++++---- .../ChargingNetworkManager.scala | 5 ++-- .../infrastructure/ParkingFunctions.scala | 2 +- .../infrastructure/ParkingInquiry.scala | 13 ++++++----- .../parking/ParkingZoneSearch.scala | 4 ++-- .../scala/beam/sim/config/BeamConfig.scala | 23 +++++++++++++++++++ 8 files changed, 54 insertions(+), 18 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 3af7c6a7805..87f434fa1b5 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -315,6 +315,8 @@ beam.agentsim.agents.vehicles.enroute.noRefuelThresholdOffsetInMeters = 32186.9 beam.agentsim.agents.vehicles.enroute.noRefuelAtRemainingDistanceThresholdInMeters = 500 # 500 meters beam.agentsim.agents.vehicles.enroute.estimateOfMeanChargingDurationInSecond = 1800 # 80% of the battery charges in 30min beam.agentsim.agents.vehicles.enroute.remainingDistanceWrtBatteryCapacityThreshold = 2 # this represents +/- the number of times an agent will enroute when ranger is x times lower than the remaining distance +beam.agentsim.agents.vehicles.destination.refuelRequiredThresholdInMeters = 32180.0 # 20 miles +beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters = 128720.0 # 80 miles # these must be one of the shared vehicle types beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId = "sharedVehicle-sharedCar" beam.agentsim.agents.vehicles.dummySharedBike.vehicleTypeId = "sharedVehicle-sharedBike" diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 77a1b5e072e..be1346d22ec 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -215,11 +215,21 @@ trait ChoosesParking extends { Some(id), attributes.valueOfTime, parkingDuration, - searchMode = ParkingSearchMode.EnRoute, + searchMode = ParkingSearchMode.EnRouteCharging, originUtm = Some(vehicle.spaceTime), triggerId = getCurrentTriggerIdOrGenerate ) } else { + val searchModeChargeOrPark = + if ( + currentBeamVehicle.isRefuelNeeded( + beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.refuelRequiredThresholdInMeters, + beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters + ) + ) { + ParkingSearchMode.DestinationCharging + } else ParkingSearchMode.Parking + // for regular parking inquiry, we have vehicle information in `currentBeamVehicle` val reservedFor = VehicleManager.getReservedFor(currentBeamVehicle.vehicleManagerId.get).get ParkingInquiry.init( @@ -231,6 +241,7 @@ trait ChoosesParking extends { Some(id), attributes.valueOfTime, parkingDuration, + searchMode = searchModeChargeOrPark, triggerId = getCurrentTriggerIdOrGenerate ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 7bfd5a9ed61..c557bf80997 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -71,7 +71,7 @@ class ChargingFunctions[GEO: GeoLevel]( */ def ifEnrouteThenFastChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { inquiry.searchMode match { - case ParkingSearchMode.EnRoute => + case ParkingSearchMode.EnRouteCharging => ChargingPointType.isFastCharger(zone.chargingPointType.get) case _ => true // if it is not Enroute charging then it does not matter @@ -143,7 +143,7 @@ class ChargingFunctions[GEO: GeoLevel]( inquiry: ParkingInquiry ): Map[ParkingMNL.Parameters, Double] = { val enrouteFactor: Double = inquiry.searchMode match { - case ParkingSearchMode.EnRoute => + case ParkingSearchMode.EnRouteCharging => val beamVehicle = inquiry.beamVehicle.get val origin = inquiry.originUtm.getOrElse( throw new RuntimeException(s"Enroute requires an origin location in parking inquiry $inquiry") @@ -161,8 +161,8 @@ class ChargingFunctions[GEO: GeoLevel]( // end-of-day parking durations are set to zero, which will be mis-interpreted here val tempParkingDuration = inquiry.searchMode match { - case ParkingSearchMode.EnRoute => enrouteDuration.toInt - case _ => inquiry.parkingDuration.toInt + case ParkingSearchMode.EnRouteCharging => enrouteDuration.toInt + case _ => inquiry.parkingDuration.toInt } val parkingDuration: Option[Int] = if (tempParkingDuration < estimatedMinParkingDuration) @@ -209,7 +209,7 @@ class ChargingFunctions[GEO: GeoLevel]( inquiry: ParkingInquiry, parkingZoneSearchResult: Option[ParkingZoneSearchResult[GEO]] ): Option[ParkingZoneSearchResult[GEO]] = parkingZoneSearchResult match { - case None if inquiry.searchMode == ParkingSearchMode.EnRoute => + case None if inquiry.searchMode == ParkingSearchMode.EnRouteCharging => // did not find a stall with a fast charging point, return a dummy stall Some( ParkingZoneSearch.ParkingZoneSearchResult( diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 6d63f0f41b1..c48285b4bd0 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -10,7 +10,7 @@ import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.{NotApplicable, ShiftStatus} import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingStatus, ChargingVehicle} -import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.{Destination, EnRoute, Init} +import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.Parking import beam.agentsim.infrastructure.power.{PowerController, SitePowerManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger.TriggerWithId @@ -162,8 +162,7 @@ class ChargingNetworkManager( val activityType = vehicle2InquiryMap .get(vehicle.id) .map { - case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, searchMode, _, _) - if searchMode != Destination => + case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, searchMode, _, _) if searchMode != Parking => searchMode.toString + "-" + activityType case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, _, _, _) => activityType } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 8406f02e629..2e9ee6f2436 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -209,7 +209,7 @@ class ParkingFunctions[GEO: GeoLevel]( */ protected def getPreferredParkingTypes(inquiry: ParkingInquiry): Set[ParkingType] = { // a lookup for valid parking types based on this inquiry - if (inquiry.searchMode == ParkingSearchMode.EnRoute) Set(ParkingType.Public) + if (inquiry.searchMode == ParkingSearchMode.EnRouteCharging) Set(ParkingType.Public) else { inquiry.parkingActivityType match { case ParkingActivityType.Home => Set(ParkingType.Residential, ParkingType.Public) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala index 90851da3f03..46ec3029157 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala @@ -38,15 +38,15 @@ case class ParkingInquiry( reserveStall: Boolean = true, requestId: Int = ParkingManagerIdGenerator.nextId, // note, this expects all Agents exist in the same JVM to rely on calling this singleton - searchMode: ParkingSearchMode = ParkingSearchMode.Destination, + searchMode: ParkingSearchMode = ParkingSearchMode.Parking, originUtm: Option[SpaceTime] = None, triggerId: Long ) extends HasTriggerId { val parkingActivityType: ParkingActivityType = activityTypeStringToEnum(activityType) val departureLocation: Option[Coord] = searchMode match { - case ParkingSearchMode.EnRoute => beamVehicle.map(_.spaceTime).orElse(originUtm).map(_.loc) - case _ => None + case ParkingSearchMode.EnRouteCharging => beamVehicle.map(_.spaceTime).orElse(originUtm).map(_.loc) + case _ => None } } @@ -56,8 +56,9 @@ object ParkingInquiry extends LazyLogging { object ParkingSearchMode extends Enum[ParkingSearchMode] { val values: immutable.IndexedSeq[ParkingSearchMode] = findValues - case object EnRoute extends ParkingSearchMode - case object Destination extends ParkingSearchMode + case object EnRouteCharging extends ParkingSearchMode + case object DestinationCharging extends ParkingSearchMode + case object Parking extends ParkingSearchMode case object Init extends ParkingSearchMode } @@ -97,7 +98,7 @@ object ParkingInquiry extends LazyLogging { parkingDuration: Double = 0, reserveStall: Boolean = true, requestId: Int = ParkingManagerIdGenerator.nextId, - searchMode: ParkingSearchMode = ParkingSearchMode.Destination, + searchMode: ParkingSearchMode = ParkingSearchMode.Parking, originUtm: Option[SpaceTime] = None, triggerId: Long ): ParkingInquiry = diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 7ef299a0146..991ec343883 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -168,7 +168,7 @@ object ParkingZoneSearch { val stallPriceInDollars: Double = parkingZone.pricingModel match { case None => 0 - case Some(pricingModel) if params.searchMode == ParkingSearchMode.EnRoute => + case Some(pricingModel) if params.searchMode == ParkingSearchMode.EnRouteCharging => PricingModel.evaluateParkingTicket( pricingModel, config.enrouteDuration.toInt, @@ -315,7 +315,7 @@ object ParkingZoneSearch { params: ParkingZoneSearchParams[GEO] ): SearchMode[GEO] = { params.searchMode match { - case ParkingSearchMode.EnRoute => + case ParkingSearchMode.EnRouteCharging => EnrouteSearch( params.originUTM.getOrElse(throw new RuntimeException("Enroute process is expecting an origin location")), params.destinationUTM, diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 63402520503..71afef6bca6 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -1573,6 +1573,7 @@ object BeamConfig { } case class Vehicles( + destination: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination, downsamplingMethod: java.lang.String, dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, @@ -1594,6 +1595,24 @@ object BeamConfig { object Vehicles { + case class Destination( + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int + ) + + object Destination { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180 + ) + } + } + case class DummySharedBike( vehicleTypeId: java.lang.String ) @@ -1813,6 +1832,10 @@ object BeamConfig { def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( + destination = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( + if (c.hasPathOrNull("destination")) c.getConfig("destination") + else com.typesafe.config.ConfigFactory.parseString("destination{}") + ), downsamplingMethod = if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", From c1445c9a6d353af0c8aeda2ad2f3e52e1fc0ee7d Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 9 Mar 2022 16:59:22 -0800 Subject: [PATCH 036/307] filtering out Destination and Enroute Charging --- .../agents/modalbehaviors/DrivesVehicle.scala | 17 +++++++++-------- .../agents/parking/ChoosesParking.scala | 3 ++- .../beam/analysis/VehicleChargingAnalysis.scala | 3 --- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala index 6ed9d63cb33..0ea78bb3ab7 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala @@ -15,7 +15,7 @@ import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.NotApplicable import beam.agentsim.events._ import beam.agentsim.infrastructure.ChargingNetworkManager._ -import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.{ParkingInquiry, ParkingStall} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger.TriggerWithId @@ -918,14 +918,15 @@ trait DrivesVehicle[T <: DrivingData] extends BeamAgent[T] with Stash with Expon 0.0 } - protected def park(parkingInquiry: ParkingInquiry): Unit = { - val isChargingRequestOrEV: Boolean = parkingInquiry.beamVehicle match { - case Some(vehicle) => vehicle.isPHEV || vehicle.isBEV - case _ => parkingInquiry.parkingActivityType == ParkingActivityType.Charge + protected def park(inquiry: ParkingInquiry): Unit = { + import ParkingSearchMode._ + val isChargingRequest: Boolean = inquiry.beamVehicle match { + case Some(vehicle) => vehicle.isEV && List(DestinationCharging, EnRouteCharging).contains(inquiry.searchMode) + case _ => inquiry.parkingActivityType == ParkingActivityType.Charge } - if (isChargingRequestOrEV) - chargingNetworkManager ! parkingInquiry + if (isChargingRequest) + chargingNetworkManager ! inquiry else - parkingManager ! parkingInquiry + parkingManager ! inquiry } } diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index be1346d22ec..bc9f9a54d2e 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -16,7 +16,7 @@ import beam.agentsim.events.{LeavingParkingEvent, ParkingEvent, SpaceTime} import beam.agentsim.infrastructure.ChargingNetworkManager._ import beam.agentsim.infrastructure.charging.{ChargingPointType, ElectricCurrentType} import beam.agentsim.infrastructure.parking.PricingModel -import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.taz.TAZTreeMap import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse, ParkingStall} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} @@ -222,6 +222,7 @@ trait ChoosesParking extends { } else { val searchModeChargeOrPark = if ( + ParkingInquiry.activityTypeStringToEnum(activityType) == ParkingActivityType.Home || currentBeamVehicle.isRefuelNeeded( beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.refuelRequiredThresholdInMeters, beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters diff --git a/src/main/scala/beam/analysis/VehicleChargingAnalysis.scala b/src/main/scala/beam/analysis/VehicleChargingAnalysis.scala index 702167a2152..5ac5761d2e7 100644 --- a/src/main/scala/beam/analysis/VehicleChargingAnalysis.scala +++ b/src/main/scala/beam/analysis/VehicleChargingAnalysis.scala @@ -1,12 +1,9 @@ package beam.analysis -//import beam.agentsim.events.{ChargingPlugInEvent, ChargingPlugOutEvent} import beam.agentsim.events.{ChargingPlugInEvent, ChargingPlugOutEvent} import beam.analysis.plots.{GraphAnalysis, GraphUtils, GraphsStatsAgentSimEventsListener} import beam.sim.metrics.MetricsSupport import beam.utils.logging.ExponentialLazyLogging -import org.jfree.chart.ChartFactory -import org.jfree.chart.plot.PlotOrientation import org.jfree.data.category.{CategoryDataset, DefaultCategoryDataset} import org.matsim.api.core.v01.events.Event import org.matsim.core.controler.events.IterationEndsEvent From ed533db2cc1ef8f7d25ba977dbd65d62a4024a7c Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 9 Mar 2022 17:11:44 -0800 Subject: [PATCH 037/307] adding more condition in park --- .../agentsim/agents/modalbehaviors/DrivesVehicle.scala | 9 +++++++-- .../beam/agentsim/agents/ridehail/RideHailAgent.scala | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala index 0ea78bb3ab7..e9fecd2cc2e 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/DrivesVehicle.scala @@ -921,8 +921,13 @@ trait DrivesVehicle[T <: DrivingData] extends BeamAgent[T] with Stash with Expon protected def park(inquiry: ParkingInquiry): Unit = { import ParkingSearchMode._ val isChargingRequest: Boolean = inquiry.beamVehicle match { - case Some(vehicle) => vehicle.isEV && List(DestinationCharging, EnRouteCharging).contains(inquiry.searchMode) - case _ => inquiry.parkingActivityType == ParkingActivityType.Charge + // If ChoosesMode, then verify if vehicle is EV + case Some(vehicle) if !inquiry.reserveStall => vehicle.isEV + // If ChoosesParking, then verify if vehicle needs to either enroute or destination charge + case Some(vehicle) if inquiry.reserveStall => + vehicle.isEV && List(DestinationCharging, EnRouteCharging).contains(inquiry.searchMode) + // If non vehicle has been specified, then verify if the request is a charge request + case _ => inquiry.parkingActivityType == ParkingActivityType.Charge } if (isChargingRequest) chargingNetworkManager ! inquiry diff --git a/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala b/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala index 03e276689cc..a48b5b18584 100755 --- a/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala @@ -18,6 +18,7 @@ import beam.agentsim.events.RefuelSessionEvent.{OffShift, OnShift} import beam.agentsim.events.ShiftEvent.{EndShift, StartShift} import beam.agentsim.events._ import beam.agentsim.infrastructure.ChargingNetworkManager._ +import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode import beam.agentsim.infrastructure.parking.ParkingZoneId import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse, ParkingStall} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, IllegalTriggerGoToError, ScheduleTrigger} @@ -1144,7 +1145,8 @@ class RideHailAgent( VehicleManager.getReservedFor(vehicle.vehicleManagerId.get).get, beamVehicle = Some(vehicle), parkingDuration = parkingDuration, - triggerId = getCurrentTriggerIdOrGenerate + triggerId = getCurrentTriggerIdOrGenerate, + searchMode = ParkingSearchMode.DestinationCharging ) park(inquiry) } From c688e25808a86cc108db9495ed50b4838516f60c Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 10 Mar 2022 02:10:56 -0800 Subject: [PATCH 038/307] updating becnhmark --- src/main/python/gemini/debugging.py | 29 +++++ src/main/python/gemini/helper.py | 7 ++ .../nrel_to_beam_charging_infrastruture.py | 111 ++++++++++++++++++ 3 files changed, 147 insertions(+) create mode 100644 src/main/python/gemini/debugging.py create mode 100644 src/main/python/gemini/helper.py create mode 100644 src/main/python/gemini/nrel_to_beam_charging_infrastruture.py diff --git a/src/main/python/gemini/debugging.py b/src/main/python/gemini/debugging.py new file mode 100644 index 00000000000..02608f320f1 --- /dev/null +++ b/src/main/python/gemini/debugging.py @@ -0,0 +1,29 @@ +import helper +import os + +mnl_lines = ["mnlStatus,requestId,parkingZoneId,chargingPointType,parkingType,costInDollars\n"] +mnl_search_lines = ["parkingZoneId,geoId,parkingType,chargingPointType,pricingModel,reservedFor,stallsAvailable," + "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,requestId,isEV,rideHailFastChargingOnly," + "validChargingCapability,hasAvailability,validParkingType,isValidTime,isValidVehicleManager\n"] +mnl_param_lines = ["parkingZoneId,geoId,parkingType,chargingPointType,pricingModel,reservedFor,stallsAvailable," + "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,requestId,costInDollars,RangeAnxietyCost," + "WalkingEgressCost,ParkingTicketCost,HomeActivityPrefersResidentialParking\n"] +output_log_file = os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/beamLog.out.txt') +with open(output_log_file) as infile: + for line in infile: + if "SAMPLED: " in line: + mnl_lines.append("sampled,"+line.split("SAMPLED: ")[1]) + elif "CHOSEN: " in line: + mnl_lines.append("chosen,"+line.split("CHOSEN: ")[1]) + elif "SEARCH: " in line: + mnl_search_lines.append(line.split("SEARCH: ")[1]) + elif "PARAM: " in line: + mnl_param_lines.append(line.split("PARAM: ")[1]) + +with open(os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-beamLog.csv'), 'w') as f: + f.writelines(mnl_lines) +with open(os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-search-beamLog.csv'), 'w') as f: + f.writelines(mnl_search_lines) +with open(os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-param-beamLog.csv'), 'w') as f: + f.writelines(mnl_param_lines) +print("END") diff --git a/src/main/python/gemini/helper.py b/src/main/python/gemini/helper.py new file mode 100644 index 00000000000..78ee1545f72 --- /dev/null +++ b/src/main/python/gemini/helper.py @@ -0,0 +1,7 @@ +import pandas as pd + +def read_file(filename): + compression = None + if filename.endswith(".gz"): + compression = 'gzip' + return pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) \ No newline at end of file diff --git a/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py b/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py new file mode 100644 index 00000000000..3c9b3c71cc5 --- /dev/null +++ b/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py @@ -0,0 +1,111 @@ +import pandas as pd +import os +import random +from tqdm import tqdm + +nrel_file_input = os.path.expanduser('~/Data/GEMINI/2022Feb/siting/init1-7_2022_Feb_03_wgs84.csv') +smart_file_input = os.path.expanduser("~/Data/GEMINI/stations/taz-parking-sparse-fast-limited-l2-150-lowtech-b.csv") +nrel_file_converted_input = os.path.expanduser(nrel_file_input.split(".")[0] + "_converted.csv") +smart_file_updated_input = os.path.expanduser(smart_file_input.split(".")[0] + "_updated.csv") +smart_file_with_fees_input = os.path.expanduser(nrel_file_input.split(".")[0] + "_withFees.csv.gz") + + +def read_file(filename): + compression = None + if filename.endswith(".gz"): + compression = 'gzip' + return pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) + + +def convert_nrel_data(nrel_file, nrel_file_converted): + if not os.path.exists(nrel_file_converted): + data = read_file(nrel_file) + data2 = data[["subSpace", "pType", "chrgType", "field_1", "household_id", "X", "Y", "housingTypes", "propertytype", "propertysubtype", "county"]] + data2 = data2.rename(columns={ + "chrgType": "chargingPointType", + "pType": "parkingType", + "subSpace": "taz", + "X": "locationX", + "Y": "locationY", + "housingTypes": "housingType", + "propertytype": "propertyType", + "propertysubtype": "propertySubType", + "county": "county" + }) + data2["parkingZoneId"] = "" + data2["reservedFor"] = "Any" + data2["pricingModel"] = "Block" + data2["feeInCents"] = 0 + data2["numStalls"] = 1 + data2.loc[data2["household_id"].notna(), ['reservedFor']] = data2.loc[data2["household_id"].notna()].apply( + lambda row1: "household(" + str(int(row1["household_id"])) + ")", axis=1) + data2.loc[data2["field_1"].notna(), ['parkingZoneId']] = data2.loc[data2["field_1"].notna()].apply( + lambda row2: "PEV-" + str(int(row2["taz"])) + "-" + str(int(row2["field_1"])), axis=1) + nrel_data = data2.drop(columns=['household_id', 'field_1']) + nrel_data.to_csv(nrel_file_converted, index=False) + print("Reading nrel infrastructure done!") + return nrel_data + else: + return read_file(nrel_file_converted) + + +# Reading fees +def reading_sf_bay_fees(smart_file, smart_file_updated): + if not os.path.exists(smart_file_updated): + smart_data = read_file(smart_file) + smart_data["chargingPointType"] = "NoCharger" + smart_data.loc[(smart_data["chargingType"] == "WorkLevel2(7.2|AC)") & (smart_data["parkingType"] == "Public"), ['chargingPointType']] = "publiclevel2(7.2|AC)" + smart_data.loc[(smart_data["chargingType"] == "WorkLevel2(7.2|AC)") & (smart_data["parkingType"] == "Workplace"), ['chargingPointType']] = "worklevel2(7.2|AC)" + smart_data.loc[smart_data["chargingType"] == "Custom(150.0|DC)", ['chargingPointType']] = "publicfc(150.0|DC)" + smart_data.loc[smart_data["chargingType"] == "HomeLevel2(7.2|AC)", ['chargingPointType']] = "homelevel2(7.2|AC)" + smart_data.loc[smart_data["chargingType"] == "HomeLevel1(1.8|AC)", ['chargingPointType']] = "homelevel1(1.8|AC)" + smart_data = smart_data.drop(columns=["chargingType"]) + smart_data = smart_data.rename(columns={"ReservedFor": "reservedFor"}) + smart_data.to_csv(smart_file_updated, index=False) + print("Reading Fees done!") + return smart_data + else: + return read_file(smart_file_updated) + + +def assign_fees_to_infrastructure(nrel_data, fees_data, smart_file_with_fees): + df_dict = nrel_data.to_dict('records') + for row in tqdm(df_dict): + charging_type_arg = row["chargingPointType"] + if "fc" in charging_type_arg: + charging_type_arg = "publicfc(150.0|DC)" + filtered = fees_data.loc[(fees_data["taz"] == row["taz"]) & + (fees_data["parkingType"] == row["parkingType"]) & + (fees_data["chargingPointType"] == charging_type_arg)] + if len(filtered.index) == 0: + filtered = fees_data.loc[(fees_data["parkingType"] == row["parkingType"]) & + (fees_data["chargingPointType"] == charging_type_arg)] + pd.options.mode.chained_assignment = None + filtered.loc[:, "numStalls"] = filtered.loc[:, "numStalls"].astype('int') + tot_stalls = filtered["numStalls"].sum() + cumulated = 0.0 + memorized_fee = 0.0 + rd_prob = random.uniform(0, 1) + for row2 in filtered.itertuples(): + memorized_fee = row2.feeInCents + cumulated = cumulated + float(row2.numStalls) / float(tot_stalls) + if cumulated >= rd_prob: + break + if "(150.0|DC)" in row["chargingPointType"]: + memorized_fee = memorized_fee * 1.6 + elif "(250.0|DC)" in row["chargingPointType"]: + memorized_fee = memorized_fee * 2.2 + elif "(400.0|DC)" in row["chargingPointType"]: + memorized_fee = memorized_fee * 3.1 + row["feeInCents"] = memorized_fee + output = pd.DataFrame.from_dict(df_dict) + output.reset_index(drop=True, inplace=True) + output.to_csv(smart_file_with_fees, index=False) + + +nrel_data_output = convert_nrel_data(nrel_file_input, nrel_file_converted_input) +print("convert_nrel_data done!") +fees_data_output = reading_sf_bay_fees(smart_file_input, smart_file_updated_input) +print("reading_sf_bay_fees done!") +assign_fees_to_infrastructure(nrel_data_output, fees_data_output, smart_file_with_fees_input) +print("END") From 82b2889b4e1c2a024a93dc86777df9a904cd06f8 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 11 Mar 2022 20:02:03 -0800 Subject: [PATCH 039/307] considering charging at work as well --- .../scala/beam/agentsim/agents/parking/ChoosesParking.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index bc9f9a54d2e..b54dc4001e6 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -222,7 +222,9 @@ trait ChoosesParking extends { } else { val searchModeChargeOrPark = if ( - ParkingInquiry.activityTypeStringToEnum(activityType) == ParkingActivityType.Home || + ParkingInquiry.activityTypeStringToEnum( + activityType + ) == ParkingActivityType.Home || ParkingActivityType.Work || currentBeamVehicle.isRefuelNeeded( beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.refuelRequiredThresholdInMeters, beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters From 166e22806f466417b9d590f016a0f6323fcaa330 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sat, 12 Mar 2022 17:13:12 -0800 Subject: [PATCH 040/307] fixing compilation exception --- .../scala/beam/agentsim/agents/parking/ChoosesParking.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index b54dc4001e6..e962b86cf3d 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -222,9 +222,9 @@ trait ChoosesParking extends { } else { val searchModeChargeOrPark = if ( - ParkingInquiry.activityTypeStringToEnum( - activityType - ) == ParkingActivityType.Home || ParkingActivityType.Work || + List(ParkingActivityType.Home, ParkingActivityType.Work).contains( + ParkingInquiry.activityTypeStringToEnum(activityType) + ) || currentBeamVehicle.isRefuelNeeded( beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.refuelRequiredThresholdInMeters, beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters From 156169047d815b103f46f40a71c635f3af4a3b28 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sat, 12 Mar 2022 17:27:00 -0800 Subject: [PATCH 041/307] add EV --- .../scala/beam/agentsim/agents/parking/ChoosesParking.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index e962b86cf3d..3924af092a3 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -222,13 +222,13 @@ trait ChoosesParking extends { } else { val searchModeChargeOrPark = if ( - List(ParkingActivityType.Home, ParkingActivityType.Work).contains( + currentBeamVehicle.isEV && (List(ParkingActivityType.Home, ParkingActivityType.Work).contains( ParkingInquiry.activityTypeStringToEnum(activityType) ) || currentBeamVehicle.isRefuelNeeded( beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.refuelRequiredThresholdInMeters, beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters - ) + )) ) { ParkingSearchMode.DestinationCharging } else ParkingSearchMode.Parking From 33e0b196ab47318f3c04a2e041e4b2a704c652b7 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 13 Mar 2022 00:19:41 -0800 Subject: [PATCH 042/307] let agent park at workplace directly --- .../agentsim/infrastructure/ChargingFunctions.scala | 10 ---------- .../agentsim/infrastructure/ParkingFunctions.scala | 8 ++++++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 12c4b7bf39f..c557bf80997 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -78,16 +78,6 @@ class ChargingFunctions[GEO: GeoLevel]( } } - def ifOvernightStayThenSlowChargingOnly(zone: ParkingZone[GEO], inquiry: ParkingInquiry): Boolean = { - if ( - inquiry.searchMode == ParkingSearchMode.Init || List(ParkingActivityType.Home, ParkingActivityType.Work).contains( - inquiry.parkingActivityType - ) - ) { - !ChargingPointType.isFastCharger(zone.chargingPointType.get) - } else true - } - /** * function that verifies if Home, Work or Overnight Then Slow Charging Only * @param zone ParkingZone diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 2e9ee6f2436..6aee5412d8a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -162,7 +162,11 @@ class ParkingFunctions[GEO: GeoLevel]( ): Coord = { if (parkingZone.link.isDefined) parkingZone.link.get.getCoord - else if (parkingZone.reservedFor.managerType == VehicleManager.TypeEnum.Household) + else if ( + (parkingZone.reservedFor.managerType == VehicleManager.TypeEnum.Household) || + (inquiry.parkingActivityType == ParkingActivityType.Home && parkingZone.parkingType == ParkingType.Residential) || + (inquiry.parkingActivityType == ParkingActivityType.Work && parkingZone.parkingType == ParkingType.Workplace) + ) inquiry.destinationUtm.loc else GeoLevel[GEO].geoSampling( @@ -197,7 +201,7 @@ class ParkingFunctions[GEO: GeoLevel]( ) val isValidVehicleManager = - zone.reservedFor.managerType == VehicleManager.TypeEnum.Default || zone.reservedFor.managerId == inquiry.reservedFor.managerId + zone.reservedFor.managerType == VehicleManager.TypeEnum.Default || zone.reservedFor == inquiry.reservedFor hasAvailability & validParkingType & isValidTime & isValidVehicleManager } From 6c32f8c1c95ed38c9376fb14ff98974afc8a9916 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 19 Jan 2022 21:35:36 +0600 Subject: [PATCH 043/307] Add relaxation-network-scenario map --- .../r5/relaxation-network-scenario.osm | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm new file mode 100644 index 00000000000..d16871bd2dd --- /dev/null +++ b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66a44d230a52e5a78c48d198d05b5cff262dae9f58488485d947a67720a1b86b +size 7830 From 000bd79335b2e9affb2f2fe42b7ffca791f02476 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 9 Feb 2022 17:58:02 +0600 Subject: [PATCH 044/307] Initial state for relaxation-network-scenario --- .../jdeqsim/EventToHourFrequency.scala | 25 +- .../integration/NetworkRelaxationSpec.scala | 250 ++++++++++++++++++ .../relaxation-network-scenario/beam.conf | 85 ++++++ .../beamFuelTypes.csv | 3 + .../relaxation-network-scenario/r5/dummy.zip | 3 + .../relaxation-network-scenario/r5/fares.dat | 3 + .../r5/relaxation-network-scenario.osm | 4 +- .../r5/relaxation-network-scenario.osm.pbf | 3 + .../relaxation-network-scenario/r5/tolls.dat | 3 + .../taz-centers.csv | 3 + .../urbansim_v2/blocks.csv.gz | 3 + .../urbansim_v2/households.csv.gz | 3 + .../urbansim_v2/persons.csv.gz | 3 + .../urbansim_v2/plans.csv.gz | 3 + .../vehicleTypes.csv | 3 + .../relaxation-network-scenario/vehicles.csv | 3 + 16 files changed, 387 insertions(+), 13 deletions(-) create mode 100644 src/test/scala/beam/integration/NetworkRelaxationSpec.scala create mode 100644 test/input/relaxation-network-scenario/beam.conf create mode 100644 test/input/relaxation-network-scenario/beamFuelTypes.csv create mode 100644 test/input/relaxation-network-scenario/r5/dummy.zip create mode 100644 test/input/relaxation-network-scenario/r5/fares.dat create mode 100644 test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf create mode 100644 test/input/relaxation-network-scenario/r5/tolls.dat create mode 100644 test/input/relaxation-network-scenario/taz-centers.csv create mode 100644 test/input/relaxation-network-scenario/urbansim_v2/blocks.csv.gz create mode 100644 test/input/relaxation-network-scenario/urbansim_v2/households.csv.gz create mode 100644 test/input/relaxation-network-scenario/urbansim_v2/persons.csv.gz create mode 100644 test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz create mode 100644 test/input/relaxation-network-scenario/vehicleTypes.csv create mode 100644 test/input/relaxation-network-scenario/vehicles.csv diff --git a/src/main/scala/beam/physsim/jdeqsim/EventToHourFrequency.scala b/src/main/scala/beam/physsim/jdeqsim/EventToHourFrequency.scala index c83d4e3b007..711769c4f56 100644 --- a/src/main/scala/beam/physsim/jdeqsim/EventToHourFrequency.scala +++ b/src/main/scala/beam/physsim/jdeqsim/EventToHourFrequency.scala @@ -42,20 +42,23 @@ class EventToHourFrequency(val controlerIO: OutputDirectoryHierarchy) } override def notifyIterationEnds(event: IterationEndsEvent): Unit = { - val filePath = controlerIO.getIterationFilename(event.getIteration, "PhysSimEventToHourFrequency.csv") - val csvWriter = new CsvWriter(filePath, Vector("event_type", "hour", "count")) - val maxHour = eventToHourFreq.values.flatten.map(_._1).max - logger.info(s"Handled $cnt events. MaxHour: $maxHour") + val hours = eventToHourFreq.values.flatten.map(_._1) + val maxHourOpt = if (hours.isEmpty) None else Some(hours.max) + logger.info(s"Handled $cnt events. MaxHour: ${maxHourOpt.mkString}") - try { - (0 to maxHour).map { hour => - eventToHourFreq.map { case (event, hourFreq) => - val cnt = hourFreq.getOrElse(hour, 0) - csvWriter.write(event, hour, cnt) + maxHourOpt.foreach { maxHour => + val filePath = controlerIO.getIterationFilename(event.getIteration, "PhysSimEventToHourFrequency.csv") + val csvWriter = new CsvWriter(filePath, Vector("event_type", "hour", "count")) + try { + (0 to maxHour).map { hour => + eventToHourFreq.map { case (event, hourFreq) => + val cnt = hourFreq.getOrElse(hour, 0) + csvWriter.write(event, hour, cnt) + } } + } finally { + Try(csvWriter.close()) } - } finally { - Try(csvWriter.close()) } } } diff --git a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala new file mode 100644 index 00000000000..12646dc051d --- /dev/null +++ b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala @@ -0,0 +1,250 @@ +package beam.integration + +import akka.actor.ActorSystem +import beam.agentsim.infrastructure.taz.CsvTaz +import beam.sim.{BeamHelper, BeamServices} +import beam.sim.common.GeoUtilsImpl +import beam.sim.config.{BeamConfig, MatSimBeamConfigBuilder} +import beam.utils.{ConfigConsistencyComparator, FileUtils, InputConsistencyCheck, LoggingUtil} +import org.scalatest.wordspec.AnyWordSpecLike +import beam.utils.TestConfigUtils.testConfig +import beam.utils.csv.CsvWriter +import beam.utils.matsim_conversion.{ConversionConfig, MatsimConversionTool} +import beam.utils.scenario.{HouseholdId, HouseholdInfo, VehicleInfo} +import beam.utils.scenario.generic.writers.CsvPersonInfoWriter.{headers, logger} +import beam.utils.scenario.urbansim.censusblock.entities.{ + Activity, + Female, + InputPersonInfo, + InputPlanElement, + Leg, + Male +} +import ch.qos.logback.classic.util.ContextInitializer +import com.google.inject.Injector +import com.typesafe.config.ConfigFactory +import org.matsim.api.core.v01.Coord +import org.matsim.core.network.NetworkUtils +import org.matsim.core.scenario.MutableScenario + +import java.io.File +import java.nio.file.Paths +import scala.util.Random + +class NetworkRelaxationScenarioGenerator { + val scenarioDir = new File("test/input/relaxation-network-scenario/urbansim_v2") + + def generateHouseholds(count: Int = 2000) = { + println(s"Generating $count households") + val csvWriter = new CsvWriter( + scenarioDir + "/households.csv", + Seq("household_id", "income", "cars", "block_id") + ) + try { + for (i <- 1 to count) { + csvWriter.write(i.toString, "0", "1", "1") + } + } finally { + csvWriter.close() + } + + } + + def generateVehicles(count: Int = 2000) = { + println(s"Generating $count vehicles") + val vehicles = for (i <- 1 to count) yield { + VehicleInfo(i.toString, "car", None, i.toString) + } + val csvWriter = new CsvWriter( + "test/input/relaxation-network-scenario/vehicles.csv", + Seq("vehicleId", "vehicleTypeId", "stateOfCharge", "householdId") + ) + try { + vehicles.foreach { vehicle => + csvWriter.write( + vehicle.vehicleId, + vehicle.vehicleTypeId, + vehicle.initialSoc, + vehicle.householdId + ) + } + } finally { + csvWriter.close() + } + } + + def generatePersons(count: Int = 2000) = { + println(s"Generating $count persons") + val persons = for (i <- 1 to count) yield { + InputPersonInfo( + personId = i.toString, + householdId = i.toString, + age = 20 + Random.nextInt(50), + sex = if (Random.nextBoolean()) Male else Female + ) + } + val csvWriter = new CsvWriter(scenarioDir.getPath + "/persons.csv", Seq("person_id", "household_id", "age", "sex")) + try { + persons.foreach { person => + csvWriter.write( + person.personId, + person.householdId, + person.age, + person.sex match { + case Male => 1 + case Female => 2 + } + ) + } + } finally { + csvWriter.close() + } + } + + def generatePlans(count: Int = 2000) = { + println("Generating plans") + val headers = Seq( + "trip_id", + "person_id", + "PlanElementIndex", + "ActivityElement", + "trip_mode", + "ActivityType", + "x", + "y", + "departure_time" + ) + val plans = for (i <- 1 to count) yield { + // Home = -0.03763798759, 0.00975476975 + // Work = 0.04874384139, 0.01013286711 + + // TODO wgs2utm = + Seq( + InputPlanElement( + tripId = Some(i.toString), + personId = i.toString, + planElementIndex = 1, + activityElement = Activity, + tripMode = None, + ActivityType = Some("Home"), + x = Some(161827.4228835071), + y = Some(1079.7224574150498), + departureTime = Some(8) + ), + InputPlanElement( + tripId = Some(i.toString), + personId = i.toString, + planElementIndex = 2, + activityElement = Leg, + tripMode = Some("CAR"), + ActivityType = None, + x = None, + y = None, + departureTime = None + ), + InputPlanElement( + tripId = Some(i.toString), + personId = i.toString, + planElementIndex = 3, + activityElement = Activity, + tripMode = None, + ActivityType = Some("Work"), + x = Some(171452.789949885), + y = Some(1121.4837267244413), + departureTime = None + ) + ) + } + println(plans) + + val csvWriter = new CsvWriter(scenarioDir.getPath + "/plans.csv", headers) + try { + plans.flatten.foreach { plan => + csvWriter.write( + plan.tripId.mkString, + plan.personId.mkString, + plan.planElementIndex, + plan.activityElement, + plan.tripMode, + plan.ActivityType, + plan.x, + plan.y, + plan.departureTime + ) + } + } finally { + csvWriter.close() + } + } + + def generate() = { +// generateHouseholds() +// generateVehicles() +// generatePersons() + generatePlans() + } +} + +object NetworkRelaxationScenarioGenerator extends App { + new NetworkRelaxationScenarioGenerator().generate() +} + +class NetworkRelaxationSpec extends AnyWordSpecLike with BeamHelper { + System.setProperty(ContextInitializer.CONFIG_FILE_PROPERTY, "logback-test.xml") + + "Network relaxation" should { + "pass" in { + val config = ConfigFactory + .parseFile(new File("test/input/relaxation-network-scenario/beam.conf")) + .resolve() + val configBuilder = new MatSimBeamConfigBuilder(config) + val matsimConfig = configBuilder.buildMatSimConf() + val beamConfig = BeamConfig(config) + + val geoUtils = new GeoUtilsImpl(beamConfig) + + // Home = -0.03763798759, 0.00975476975 + // Work = 0.04874384139, 0.01013286711 + + println(geoUtils.wgs2Utm(new Coord(-0.03763798759, 0.00975476975))) + println(geoUtils.wgs2Utm(new Coord(0.04874384139, 0.01013286711))) + + val networkCoordinator = buildNetworkCoordinator(beamConfig) + val boundingBox = NetworkUtils.getBoundingBox(networkCoordinator.network.getNodes.values()) + val minX = boundingBox(0) + val maxX = boundingBox(2) + val minY = boundingBox(1) + val maxY = boundingBox(3) + + val midX = (maxX + minX) / 2 + val midY = (maxY + minY) / 2 + +// println(new Coord(midX, midY)) + + val (scenarioBuilt, beamScenario, _) = buildBeamServicesAndScenario(beamConfig, matsimConfig) + val scenario: MutableScenario = scenarioBuilt + val outputDir = FileUtils.setConfigOutputFile(beamConfig, matsimConfig) + val injector: Injector = buildInjector(config, beamConfig, scenario, beamScenario) + implicit val actorSystem: ActorSystem = injector.getInstance(classOf[ActorSystem]) + val beamServices: BeamServices = buildBeamServices(injector) + + LoggingUtil.initLogger(outputDir, beamConfig.beam.logger.keepConsoleAppenderOn) + println(s"Beam output directory is: $outputDir") + logger.info(ConfigConsistencyComparator.getMessage.getOrElse("")) + + val errors = InputConsistencyCheck.checkConsistency(beamConfig) + if (errors.nonEmpty) { + logger.error("Input consistency check failed:\n" + errors.mkString("\n")) + } + + runBeam( + beamServices, + scenario, + beamScenario, + outputDir, + true + ) + fail + } + } +} diff --git a/test/input/relaxation-network-scenario/beam.conf b/test/input/relaxation-network-scenario/beam.conf new file mode 100644 index 00000000000..6fe6d086a4a --- /dev/null +++ b/test/input/relaxation-network-scenario/beam.conf @@ -0,0 +1,85 @@ +include "../common/akka.conf" +include "../common/metrics.conf" +include "../common/matsim.conf" + +beam.inputDirectory = "test/input/relaxation-network-scenario" + +################################################################## +# SPATIAL +################################################################## +beam.spatial = { + localCRS = "epsg:32631" # what crs to use for distance calculations, must be in units of meters + boundingBoxBuffer = 10000 # meters of buffer around network for defining extend of spatial indices +} + +beam.physsim.inputNetworkFilePath = ${beam.routing.r5.directory}"/physsim-network.xml" + +beam.agentsim.taz.filePath=${beam.inputDirectory}"/taz-centers.csv" +beam.agentsim.firstIteration = 0 +beam.agentsim.lastIteration = 2 +beam.agentsim.startTime = "00:00:00" +beam.agentsim.endTime = "30:00:00" + + +beam.agentsim.simulationName = "relaxation-network-scenario" +beam.agentsim.agents.plans = { + inputPersonAttributesFilePath = "" + inputPlansFilePath = "" +} + +beam.agentsim.agents.households = { + inputFilePath = "" + inputHouseholdAttributesFilePath = "" +} + +beam.agentsim.agents.vehicles { + vehicleTypesFilePath = ${beam.inputDirectory}"/vehicleTypes.csv" + vehiclesFilePath = ${beam.inputDirectory}"/vehicles.csv" + fuelTypesFilePath = ${beam.inputDirectory}"/beamFuelTypes.csv" + sharedFleets = [] + fractionOfPeopleWithBicycle = 0 +} + +beam.replanning = { + maxAgentPlanMemorySize = 4 + Module_1 = "SelectExpBeta" + ModuleProbability_1 = 0.7 + Module_2 = "ClearRoutes" + ModuleProbability_2 = 0.1 + Module_3 = "ClearModes" + ModuleProbability_3 = 0.1 + Module_4 = "TimeMutator" + ModuleProbability_4 = 0.1 +} + +beam.outputs.defaultWriteInterval = 1 +beam.outputs.collectAndCreateBeamAnalysisAndGraphs = false +beam.outputs.writeR5RoutesInterval = 1 + +beam.calibration.counts = { + countsScaleFactor = 10.355 + writeCountsInterval = 0 + averageCountsOverIterations = ${beam.outputs.defaultWriteInterval} +} + +beam.debug.stuckAgentDetection.thresholds = [] + + +beam.routing.carRouter="R5" +beam.routing { + baseDate = "2016-10-17T00:00:00-07:00" + r5 { + directory = ${beam.inputDirectory}"/r5" + osmMapdbFile = ${beam.inputDirectory}"/r5/osm.mapdb" + mNetBuilder.fromCRS = "epsg:4326" # WGS84 + mNetBuilder.toCRS = ${beam.spatial.localCRS} + } +} + +beam.exchange.scenario { + source = "urbansim_v2" + fileFormat = "csv" + folder = ${beam.inputDirectory}"/urbansim_v2" + modeMap = ["CAR -> car"] + convertWgs2Utm = true +} diff --git a/test/input/relaxation-network-scenario/beamFuelTypes.csv b/test/input/relaxation-network-scenario/beamFuelTypes.csv new file mode 100644 index 00000000000..d8ddb0d1495 --- /dev/null +++ b/test/input/relaxation-network-scenario/beamFuelTypes.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84b0bf195c7793cff5872b49f437c7688633d7b157b101e8ac1396690f0e9cc1 +size 48 diff --git a/test/input/relaxation-network-scenario/r5/dummy.zip b/test/input/relaxation-network-scenario/r5/dummy.zip new file mode 100644 index 00000000000..07028c701c9 --- /dev/null +++ b/test/input/relaxation-network-scenario/r5/dummy.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ede9ee1c5d02536ea84e4ddbdbf2de3d7100c4ead696710c8f632f3a4c1fc55 +size 3069 diff --git a/test/input/relaxation-network-scenario/r5/fares.dat b/test/input/relaxation-network-scenario/r5/fares.dat new file mode 100644 index 00000000000..d6627c674a6 --- /dev/null +++ b/test/input/relaxation-network-scenario/r5/fares.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de8c74ca5d6f0f056fb2823599dbd7dbc18211abee477cc60a3ab614651683e5 +size 61 diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm index d16871bd2dd..425e9bbe175 100644 --- a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm +++ b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:66a44d230a52e5a78c48d198d05b5cff262dae9f58488485d947a67720a1b86b -size 7830 +oid sha256:65c935ef275ff35c966ee3aac53f2cda9963f0491847c6c42b57c386daf1f629 +size 8112 diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf new file mode 100644 index 00000000000..d1e939ef61e --- /dev/null +++ b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e33e3a972b6b4a27775518a7431a39080b563423896ab3b2dcbca01e32e17b3a +size 745 diff --git a/test/input/relaxation-network-scenario/r5/tolls.dat b/test/input/relaxation-network-scenario/r5/tolls.dat new file mode 100644 index 00000000000..ab0d41765f9 --- /dev/null +++ b/test/input/relaxation-network-scenario/r5/tolls.dat @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ab7b773c68626d7403a01dbe1695b2c58e9c3a784054f7e77ecf114747cb009 +size 82 diff --git a/test/input/relaxation-network-scenario/taz-centers.csv b/test/input/relaxation-network-scenario/taz-centers.csv new file mode 100644 index 00000000000..37c855ae57f --- /dev/null +++ b/test/input/relaxation-network-scenario/taz-centers.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:936e934ae540172cfa40b0c42a27a51a904e89c5bda7cf9edcaf7cb4101c709a +size 64 diff --git a/test/input/relaxation-network-scenario/urbansim_v2/blocks.csv.gz b/test/input/relaxation-network-scenario/urbansim_v2/blocks.csv.gz new file mode 100644 index 00000000000..b3702a316d2 --- /dev/null +++ b/test/input/relaxation-network-scenario/urbansim_v2/blocks.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68b319ba400bfb91182c20e3a7a3cbd200f3c2780e088277712550d2f262deef +size 82 diff --git a/test/input/relaxation-network-scenario/urbansim_v2/households.csv.gz b/test/input/relaxation-network-scenario/urbansim_v2/households.csv.gz new file mode 100644 index 00000000000..6e055679c79 --- /dev/null +++ b/test/input/relaxation-network-scenario/urbansim_v2/households.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:308c50fb53ca09dbf4eb7dad49a15e8551bad1fce455328f4e7d784a584e13ea +size 4588 diff --git a/test/input/relaxation-network-scenario/urbansim_v2/persons.csv.gz b/test/input/relaxation-network-scenario/urbansim_v2/persons.csv.gz new file mode 100644 index 00000000000..8a8e372069c --- /dev/null +++ b/test/input/relaxation-network-scenario/urbansim_v2/persons.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:25df1ae741e1b4f991645a0686d9ac1293fb2fee1c97bbaad68359993bcfaac7 +size 10769 diff --git a/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz b/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz new file mode 100644 index 00000000000..fc067879dfa --- /dev/null +++ b/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64cdcdd9936968649b2f4591d3472aa789f164abe781c652857ce0f3ad41bfc6 +size 21637 diff --git a/test/input/relaxation-network-scenario/vehicleTypes.csv b/test/input/relaxation-network-scenario/vehicleTypes.csv new file mode 100644 index 00000000000..f7b6c81c51b --- /dev/null +++ b/test/input/relaxation-network-scenario/vehicleTypes.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0baefdcdac4b4972e0484ea80bdfb16c71ead408459a831296d6a7e4aa154d8c +size 701 diff --git a/test/input/relaxation-network-scenario/vehicles.csv b/test/input/relaxation-network-scenario/vehicles.csv new file mode 100644 index 00000000000..304d1315209 --- /dev/null +++ b/test/input/relaxation-network-scenario/vehicles.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5dcbecb36fd8f10a329ad5a65ec2553b6e1c1a90c6f17d0890d5c02b381ca81 +size 27836 From 4adf7db6b13c4bf45bbb5767cb8a2d28762e08d2 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 9 Feb 2022 19:00:16 +0600 Subject: [PATCH 045/307] Allow configurable log level in test --- src/test/resources/logback-test.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 94f303cddee..711b58b833a 100755 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -4,7 +4,7 @@ - ERROR + ${LOG_LEVEL:-ERROR} @@ -27,7 +27,7 @@ - + From b194a6a722d4380632c35485423d894bd3403ab7 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 9 Feb 2022 19:02:44 +0600 Subject: [PATCH 046/307] car -> Car --- src/test/scala/beam/integration/NetworkRelaxationSpec.scala | 6 +++--- test/input/relaxation-network-scenario/vehicleTypes.csv | 2 +- test/input/relaxation-network-scenario/vehicles.csv | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala index 12646dc051d..4edcb1c3d3c 100644 --- a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala +++ b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala @@ -53,7 +53,7 @@ class NetworkRelaxationScenarioGenerator { def generateVehicles(count: Int = 2000) = { println(s"Generating $count vehicles") val vehicles = for (i <- 1 to count) yield { - VehicleInfo(i.toString, "car", None, i.toString) + VehicleInfo(i.toString, "Car", None, i.toString) } val csvWriter = new CsvWriter( "test/input/relaxation-network-scenario/vehicles.csv", @@ -179,9 +179,9 @@ class NetworkRelaxationScenarioGenerator { def generate() = { // generateHouseholds() -// generateVehicles() + generateVehicles() // generatePersons() - generatePlans() +// generatePlans() } } diff --git a/test/input/relaxation-network-scenario/vehicleTypes.csv b/test/input/relaxation-network-scenario/vehicleTypes.csv index f7b6c81c51b..4da49de5cf3 100644 --- a/test/input/relaxation-network-scenario/vehicleTypes.csv +++ b/test/input/relaxation-network-scenario/vehicleTypes.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0baefdcdac4b4972e0484ea80bdfb16c71ead408459a831296d6a7e4aa154d8c +oid sha256:91a32864fc273fbb721d5aa5e989b5c0357b747490a5df9dc4a845a2aaf39bd2 size 701 diff --git a/test/input/relaxation-network-scenario/vehicles.csv b/test/input/relaxation-network-scenario/vehicles.csv index 304d1315209..515eb98101c 100644 --- a/test/input/relaxation-network-scenario/vehicles.csv +++ b/test/input/relaxation-network-scenario/vehicles.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d5dcbecb36fd8f10a329ad5a65ec2553b6e1c1a90c6f17d0890d5c02b381ca81 +oid sha256:a680bf01113cb5d6c42d5a737f5536ff2e30e1d68ed7c2f32a0068b464f0d15b size 27836 From 94a690a9f6ced3b9755e99ce1ca4a5ea5598f271 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 9 Feb 2022 19:04:23 +0600 Subject: [PATCH 047/307] Add shared car to satisfy input consistency check --- test/input/relaxation-network-scenario/vehicleTypes.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/input/relaxation-network-scenario/vehicleTypes.csv b/test/input/relaxation-network-scenario/vehicleTypes.csv index 4da49de5cf3..ea7ff3ef6ce 100644 --- a/test/input/relaxation-network-scenario/vehicleTypes.csv +++ b/test/input/relaxation-network-scenario/vehicleTypes.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:91a32864fc273fbb721d5aa5e989b5c0357b747490a5df9dc4a845a2aaf39bd2 -size 701 +oid sha256:2db67b7bfc738194a92bc57d02dd483e1762df67b672360a378302c499505345 +size 786 From 6b67c7a63e79ad7fe87fb991163d22a3c63046e5 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 10 Feb 2022 16:41:16 +0600 Subject: [PATCH 048/307] Update map fixing tags and ids --- .../r5/relaxation-network-scenario.osm | 4 ++-- .../r5/relaxation-network-scenario.osm.pbf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm index 425e9bbe175..e0b851efb87 100644 --- a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm +++ b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:65c935ef275ff35c966ee3aac53f2cda9963f0491847c6c42b57c386daf1f629 -size 8112 +oid sha256:b548e6cf8228a30ae35b164b989b9768b5943e43e5652d59a1afc11a5bed4118 +size 13573 diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf index d1e939ef61e..2d8e2b61569 100644 --- a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf +++ b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e33e3a972b6b4a27775518a7431a39080b563423896ab3b2dcbca01e32e17b3a -size 745 +oid sha256:4c9fd1748a681f66597d0fd2083ec5e8bb2962bda74178a4d828eb62c2dfd3ab +size 634 From 6a53f4b9b8fbd6385702736be2f7bc207049b4a8 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 14 Feb 2022 16:59:14 +0600 Subject: [PATCH 049/307] Add a config to disable removing islands when generating a network --- src/main/resources/beam-template.conf | 2 ++ src/main/scala/beam/router/r5/NetworkCoordinator.scala | 2 +- src/main/scala/beam/sim/config/BeamConfig.scala | 6 ++++-- test/input/relaxation-network-scenario/beam.conf | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 64c1b3039b7..d69426c988d 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -640,6 +640,8 @@ beam.physsim.network.maxSpeedInference { type = "String | MEAN" } +beam.physsim.network.removeIslands = "boolean | true" + # Replanning beam.replanning.maxAgentPlanMemorySize = "int | 5" beam.replanning.Module_1 = "SelectExpBeta" diff --git a/src/main/scala/beam/router/r5/NetworkCoordinator.scala b/src/main/scala/beam/router/r5/NetworkCoordinator.scala index e4c8ecb27a1..d68d5b0c636 100644 --- a/src/main/scala/beam/router/r5/NetworkCoordinator.scala +++ b/src/main/scala/beam/router/r5/NetworkCoordinator.scala @@ -103,7 +103,7 @@ trait NetworkCoordinator extends LazyLogging { ) transportNetwork = TransportNetwork.fromDirectory( Paths.get(beamConfig.beam.routing.r5.directory).toFile, - true, + beamConfig.beam.physsim.network.removeIslands, false, beamConfig.beam.routing.r5.linkRadiusMeters ) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index b858a80cc8e..7cc476036c2 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3108,7 +3108,8 @@ object BeamConfig { case class Network( maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties, + removeIslands: scala.Boolean ) object Network { @@ -3542,7 +3543,8 @@ object BeamConfig { overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") - ) + ), + removeIslands = !c.hasPathOrNull("removeIslands") || c.getBoolean("removeIslands") ) } } diff --git a/test/input/relaxation-network-scenario/beam.conf b/test/input/relaxation-network-scenario/beam.conf index 6fe6d086a4a..c31ba26f043 100644 --- a/test/input/relaxation-network-scenario/beam.conf +++ b/test/input/relaxation-network-scenario/beam.conf @@ -13,6 +13,7 @@ beam.spatial = { } beam.physsim.inputNetworkFilePath = ${beam.routing.r5.directory}"/physsim-network.xml" +beam.physsim.network.removeIslands = false beam.agentsim.taz.filePath=${beam.inputDirectory}"/taz-centers.csv" beam.agentsim.firstIteration = 0 From 58479650f7405b89e265751d43108347a9143b90 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Tue, 15 Feb 2022 15:22:35 +0600 Subject: [PATCH 050/307] Do not show not relevant warnings --- src/test/resources/logback-test.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 711b58b833a..5cc9e34c4e2 100755 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -28,6 +28,8 @@ + + From 6e9e2c4074e9bee6d508eb2fe34a2febf4679bb1 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 21 Feb 2022 15:40:57 +0600 Subject: [PATCH 051/307] Crash early in case all plans/persons/households are filtered out --- .../beam/utils/scenario/UrbanSimScenarioLoader.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala index 725bf5e1fda..5e3ae225d0c 100644 --- a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala +++ b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala @@ -103,10 +103,21 @@ class UrbanSimScenarioLoader( } val inputPlans = Await.result(plansF, 1800.seconds) logger.info(s"Reading plans done.") + if (inputPlans.isEmpty) { + throw new RuntimeException("Filtered plans are empty") + } + val persons = Await.result(personsF, 1800.seconds) logger.info(s"Reading persons done.") + if (persons.isEmpty) { + throw new RuntimeException("Filtered persons are empty") + } + val households = Await.result(householdsF, 1800.seconds) logger.info(s"Reading households done.") + if (households.isEmpty) { + throw new RuntimeException("Filtered households are empty") + } val (mergedPlans, plansMerged) = previousRunPlanMerger.map(_.merge(inputPlans)).getOrElse(inputPlans -> false) From 417648db2dae693507eec415c76102f1ef2ed9cd Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 21 Feb 2022 16:08:31 +0600 Subject: [PATCH 052/307] Fix coordinate conversion logic, remove some unnecessary conversions --- .../scenario/UrbanSimScenarioLoader.scala | 50 +++++++++---------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala index 5e3ae225d0c..7aac727cca4 100644 --- a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala +++ b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala @@ -42,11 +42,21 @@ class UrbanSimScenarioLoader( private val rand: Random = new Random(beamScenario.beamConfig.matsim.modules.global.randomSeed) + private val wereCoordinatesInWGS = beamScenario.beamConfig.beam.exchange.scenario.convertWgs2Utm + + def utmCoord(x: Double, y: Double): Coord = { + val coord = new Coord(x, y) + if (wereCoordinatesInWGS) geo.wgs2Utm(coord) else coord + } + + def wgsCoord(x: Double, y: Double): Coord = { + val coord = new Coord(x, y) + if (wereCoordinatesInWGS) coord else geo.utm2Wgs(coord) + } + def loadScenario(): (Scenario, Boolean) = { clear() - val wereCoordinatesInWGS = beamScenario.beamConfig.beam.exchange.scenario.convertWgs2Utm - val plansF = Future { val plans = scenarioSource.getPlans logger.info(s"Read ${plans.size} plans") @@ -57,9 +67,8 @@ class UrbanSimScenarioLoader( val personIdsWithinRange = activities .filter { act => - val actCoord = new Coord(act.activityLocationX.get, act.activityLocationY.get) - val wgsCoord = if (wereCoordinatesInWGS) geo.utm2Wgs(actCoord) else actCoord - beamScenario.transportNetwork.streetLayer.envelope.contains(wgsCoord.getX, wgsCoord.getY) + val coord = wgsCoord(act.activityLocationX.get, act.activityLocationY.get) + beamScenario.transportNetwork.streetLayer.envelope.contains(coord.getX, coord.getY) } .map { act => act.personId @@ -82,9 +91,8 @@ class UrbanSimScenarioLoader( logger.info(s"Read ${households.size} households") val householdIdsWithinBoundingBox = households.view .filter { hh => - val coord = new Coord(hh.locationX, hh.locationY) - val wgsCoord = if (wereCoordinatesInWGS) geo.utm2Wgs(coord) else coord - beamScenario.transportNetwork.streetLayer.envelope.contains(wgsCoord.getX, wgsCoord.getY) + val coord = wgsCoord(hh.locationX, hh.locationY) + beamScenario.transportNetwork.streetLayer.envelope.contains(coord.getX, coord.getY) } .map { hh => hh.householdId @@ -205,11 +213,7 @@ class UrbanSimScenarioLoader( assignVehicles(households, householdIdToPersons, personId2Score).foreach { case (householdInfo, nVehicles) => val id = Id.create(householdInfo.householdId.id, classOf[Household]) val household = new HouseholdsFactoryImpl().createHousehold(id) - val coord = if (beamScenario.beamConfig.beam.exchange.scenario.convertWgs2Utm) { - geo.wgs2Utm(new Coord(householdInfo.locationX, householdInfo.locationY)) - } else { - new Coord(householdInfo.locationX, householdInfo.locationY) - } + val coord = utmCoord(householdInfo.locationX, householdInfo.locationY) household.setIncome(new IncomeImpl(householdInfo.income, Income.IncomePeriod.year)) @@ -287,7 +291,7 @@ class UrbanSimScenarioLoader( private def plansToTravelStats(planElements: Iterable[PlanElement]): PersonTravelStats = { val homeCoord = planElements.find(_.activityType.getOrElse("") == "Home") match { case Some(homeElement) => - Some(geo.wgs2Utm(new Coord(homeElement.activityLocationX.get, homeElement.activityLocationY.get))) + Some(utmCoord(homeElement.activityLocationX.get, homeElement.activityLocationY.get)) case None => None } @@ -299,14 +303,10 @@ class UrbanSimScenarioLoader( Some( PlanTripStats( firstElement.activityEndTime.getOrElse(0.0), - geo.wgs2Utm( - new Coord(firstElement.activityLocationX.getOrElse(0.0), firstElement.activityLocationY.getOrElse(0.0)) - ), - geo.wgs2Utm( - new Coord( - secondElement.activityLocationX.getOrElse(0.0), - secondElement.activityLocationY.getOrElse(0.0) - ) + utmCoord(firstElement.activityLocationX.getOrElse(0.0), firstElement.activityLocationY.getOrElse(0.0)), + utmCoord( + secondElement.activityLocationX.getOrElse(0.0), + secondElement.activityLocationY.getOrElse(0.0) ) ) ) @@ -607,11 +607,7 @@ class UrbanSimScenarioLoader( planInfo.activityLocationY.isDefined, s"planElement is `activity`, but `y` is None! planInfo: $planInfo" ) - val coord = if (beamScenario.beamConfig.beam.exchange.scenario.convertWgs2Utm) { - geo.wgs2Utm(new Coord(planInfo.activityLocationX.get, planInfo.activityLocationY.get)) - } else { - new Coord(planInfo.activityLocationX.get, planInfo.activityLocationY.get) - } + val coord = utmCoord(planInfo.activityLocationX.get, planInfo.activityLocationY.get) val activityType = planInfo.activityType.getOrElse( throw new IllegalStateException( s"planElement is `activity`, but `activityType` is None. planInfo: $planInfo" From 96fa5d71cd8cad7d74c15d10f647ac1fe8610062 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 21 Feb 2022 19:11:39 +0600 Subject: [PATCH 053/307] Set conversion to false --- test/input/relaxation-network-scenario/beam.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/input/relaxation-network-scenario/beam.conf b/test/input/relaxation-network-scenario/beam.conf index c31ba26f043..824d71ab9a9 100644 --- a/test/input/relaxation-network-scenario/beam.conf +++ b/test/input/relaxation-network-scenario/beam.conf @@ -82,5 +82,5 @@ beam.exchange.scenario { fileFormat = "csv" folder = ${beam.inputDirectory}"/urbansim_v2" modeMap = ["CAR -> car"] - convertWgs2Utm = true + convertWgs2Utm = false } From ca05d9a51e092cf3b0a3dfdc25aa7534586e11fb Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 28 Feb 2022 18:19:06 +0600 Subject: [PATCH 054/307] Set back r5 logger to error --- src/test/resources/logback-test.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 5cc9e34c4e2..e8c8d8dc483 100755 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -27,7 +27,7 @@ - + From d2444de239f1fc7f4786b294b749595767722788 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 14 Mar 2022 19:17:21 +0600 Subject: [PATCH 055/307] Fix compilation error after rebase --- src/test/scala/beam/integration/NetworkRelaxationSpec.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala index 4edcb1c3d3c..fe84b0de87e 100644 --- a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala +++ b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala @@ -80,7 +80,8 @@ class NetworkRelaxationScenarioGenerator { personId = i.toString, householdId = i.toString, age = 20 + Random.nextInt(50), - sex = if (Random.nextBoolean()) Male else Female + sex = if (Random.nextBoolean()) Male else Female, + None ) } val csvWriter = new CsvWriter(scenarioDir.getPath + "/persons.csv", Seq("person_id", "household_id", "age", "sex")) From 96c31af483147b5c515c4bf492bd2be3f0be0bbc Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 14 Mar 2022 17:10:18 -0700 Subject: [PATCH 056/307] try refuel needed for work --- src/main/resources/beam-template.conf | 3 +- .../agents/parking/ChoosesParking.scala | 29 ++++++++---- .../scala/beam/sim/config/BeamConfig.scala | 47 +++++++++++++++++-- 3 files changed, 64 insertions(+), 15 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 87f434fa1b5..f1c98554893 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -315,7 +315,8 @@ beam.agentsim.agents.vehicles.enroute.noRefuelThresholdOffsetInMeters = 32186.9 beam.agentsim.agents.vehicles.enroute.noRefuelAtRemainingDistanceThresholdInMeters = 500 # 500 meters beam.agentsim.agents.vehicles.enroute.estimateOfMeanChargingDurationInSecond = 1800 # 80% of the battery charges in 30min beam.agentsim.agents.vehicles.enroute.remainingDistanceWrtBatteryCapacityThreshold = 2 # this represents +/- the number of times an agent will enroute when ranger is x times lower than the remaining distance -beam.agentsim.agents.vehicles.destination.refuelRequiredThresholdInMeters = 32180.0 # 20 miles +beam.agentsim.agents.vehicles.destination.work.refuelRequiredThresholdInMeters = 64373.8 # 40 miles +beam.agentsim.agents.vehicles.destination.secondary.refuelRequiredThresholdInMeters = 32180.0 # 20 miles beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters = 128720.0 # 80 miles # these must be one of the shared vehicle types beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId = "sharedVehicle-sharedCar" diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 3924af092a3..80430a474f6 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -221,17 +221,9 @@ trait ChoosesParking extends { ) } else { val searchModeChargeOrPark = - if ( - currentBeamVehicle.isEV && (List(ParkingActivityType.Home, ParkingActivityType.Work).contains( - ParkingInquiry.activityTypeStringToEnum(activityType) - ) || - currentBeamVehicle.isRefuelNeeded( - beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.refuelRequiredThresholdInMeters, - beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters - )) - ) { + if (currentBeamVehicle.isEV && isRefuelAtDestinationNeeded(currentBeamVehicle, activityType)) ParkingSearchMode.DestinationCharging - } else ParkingSearchMode.Parking + else ParkingSearchMode.Parking // for regular parking inquiry, we have vehicle information in `currentBeamVehicle` val reservedFor = VehicleManager.getReservedFor(currentBeamVehicle.vehicleManagerId.get).get @@ -250,6 +242,23 @@ trait ChoosesParking extends { } } + private def isRefuelAtDestinationNeeded(vehicle: BeamVehicle, activityType: String): Boolean = { + ParkingInquiry.activityTypeStringToEnum(activityType) match { + case ParkingActivityType.Home => true + case ParkingActivityType.Work => + // multiplying + vehicle.isRefuelNeeded( + beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.work.refuelRequiredThresholdInMeters, + beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters + ) + case _ => + vehicle.isRefuelNeeded( + beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.secondary.refuelRequiredThresholdInMeters, + beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters + ) + } + } + onTransition { case ReadyToChooseParking -> ChoosingParkingSpot => val personData = stateData.asInstanceOf[BasePersonData] latestParkingInquiry = Some(buildParkingInquiry(personData)) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 71afef6bca6..dc8126eb74d 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -1597,18 +1597,57 @@ object BeamConfig { case class Destination( noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int + secondary: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary, + work: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work ) object Destination { + case class Secondary( + refuelRequiredThresholdInMeters: scala.Int + ) + + object Secondary { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary( + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180 + ) + } + } + + case class Work( + refuelRequiredThresholdInMeters: scala.Double + ) + + object Work { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work( + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) + c.getDouble("refuelRequiredThresholdInMeters") + else 64373.8 + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( noRefuelThresholdInMeters = if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180 + secondary = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary( + if (c.hasPathOrNull("secondary")) c.getConfig("secondary") + else com.typesafe.config.ConfigFactory.parseString("secondary{}") + ), + work = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work( + if (c.hasPathOrNull("work")) c.getConfig("work") + else com.typesafe.config.ConfigFactory.parseString("work{}") + ) ) } } From c49c7f20b2c4886790c9dbc53d4678e8cc759ae6 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 16 Mar 2022 00:06:57 -0700 Subject: [PATCH 057/307] additional changes --- src/main/R/gemini/gemini-main.R | 42 +-- src/main/R/gemini/gemini-processing.R | 288 +++++++++++++++++- src/main/R/gemini/gemini-utils.R | 4 +- src/main/python/gemini/events_processing.py | 4 +- .../agents/parking/ChoosesParking.scala | 4 +- .../ChargingNetworkManager.scala | 7 +- 6 files changed, 301 insertions(+), 48 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 4ef2e389aa8..763caf0dade 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -27,7 +27,7 @@ expFactor <- (6.015/0.6015) severity_order <- c("Public <1MW", "Public 1-5MW", "Public >5MW", "Ridehail Depot <1MW", "Ridehail Depot 1-5MW", "Ridehail Depot >5MW") extreme_lab_order <- c("<1MW", "1-5MW", ">5MW") -dataDir <- normalizePath("~/Data/GEMINI/2021Oct29/BATCH1") +dataDir <- normalizePath("~/Data/GEMINI/2022Feb/BATCH1") #events <- readCsv(pp(dataDir, "/events/0.events.BASE.csv.gz")) #eventsDir <- paste(dataDir, "/events",sep="") resultsDir <- paste(dataDir, "/results",sep="") @@ -39,7 +39,9 @@ dir.create(plotsDir, showWarnings = FALSE) # MAIN processEventsFileAndScaleUp(dataDir, scaleup, expFactor) -countyNames <- c('Alameda County','Contra Costa County','Marin County','Napa County','Santa Clara County','San Francisco County','San Mateo County','Sonoma County','Solano County') +countyNames <- c('Alameda County','Contra Costa County','Marin County', + 'Napa County','Santa Clara County','San Francisco County', + 'San Mateo County','Sonoma County','Solano County') # PLOTS if (!file.exists(pp(resultsDir,'/ready-to-plot.Rdata'))) { generateReadyToPlot(resultsDir, loadTypes, countyNames) @@ -58,11 +60,16 @@ for(j in 1:nrow(publicLoads)){ scens <- as.data.table(readCsv(pp(resultsDir,'/../scenarios.csv'))) all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) +# sc2 <- all.sessions[code=="SC2"&!startsWith(parkingZoneId,"X")] +# sc3 <- all.sessions[code=="SC3"&!startsWith(parkingZoneId,"X")] +# nrow(sc2)*900/3600 +# nrow(sc3)*900/3600 ##### -#scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') -scenarioNames <- c('Scenario2', 'Scenario3') -scenarioBaselineLabel <- 'Scenario2' +# scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') +# scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') +scenarioNames <- c('Scenario4') +scenarioBaselineLabel <- 'Scenario4' #all.loads <- all.loads[!is.na(loadType)] ########################################## # LOADS & ENERGY @@ -153,13 +160,6 @@ register_google(key = google_api_key_1) oakland_map <- ggmap::get_googlemap("oakland california", zoom = 14, maptype = "roadmap") # Plot it -ggmap(oakland_map) + - theme_void() + - ggtitle("terrain") + - theme( - plot.title = element_text(colour = "orange"), - panel.border = element_rect(colour = "grey", fill=NA, size=2) - ) hours_to_show <- c(0, 8, 12, 18) toplot <- all.loads[name==scenarioBaselineLabel&hour.bin2 %in% hours_to_show] toplot$hour.bin2.label <- "12am" @@ -206,18 +206,6 @@ p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadTy facet_wrap(~factor(name,scenarioNames),ncol = 2) ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units='in') -## ************************************** -## public charging by scenario -p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% - ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ - theme_marain() + - geom_area(colour="black", size=0.3) + - scale_fill_manual(values = chargingTypes.colors, name = "") + - labs(x = "hour", y = "GW", fill="load severity", title="Public Charging") + - theme(strip.text = element_text(size=rel(1.2))) + - facet_wrap(~factor(name,scenarioNames),ncol = 2) -ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units='in') - all.loads[name%in%scenarioNames,.(fuel=sum(fuel)),by=.(name)] ## public daily charging by scenario toplot <- join.on(all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','name')],all.loads[site=='public'&name%in%scenarioNames][,.(tot.kw=sum(kw)),by=c('name')],'name','name') @@ -227,7 +215,7 @@ p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=kw/tot.kw*100,fill=factor( scale_fill_manual(values = chargingTypes.colors, name = "") + labs(x = "", y = "Share of Charging (%)", fill="load severity", title="Public Charging") + theme(axis.text.x = element_text(angle = 0, hjust=0.5), strip.text = element_text(size=rel(1.2))) - #theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) +#theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) ggsave(pp(plotsDir,'/public-daily-charging-by-scenario.png'),p,width=5,height=3,units='in') @@ -259,7 +247,7 @@ p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=value,fill=factor(severity theme_marain()+ scale_fill_manual(values = c(brewer.pal(3, "Blues"), brewer.pal(3, "Reds"))) + theme(axis.text.x = element_text(angle=0, hjust=0.5), strip.text = element_text(size=rel(1.2))) - #theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) +#theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) ggsave(pp(plotsDir,'/energy-charged-by-scenario.png'),p,width=8,height=3,units='in') @@ -274,7 +262,7 @@ p <- ggplot(xfc.metric,aes(x=factor(name,scenarioNames),y=xfc.hours,fill=factor( theme_marain()+ scale_fill_manual(values = c(brewer.pal(3, "Blues")[c(1,3)], brewer.pal(3, "Reds")[c(1,3)])) + theme(axis.text.x = element_text(angle=0, hjust=0.5),strip.text = element_text(size=rel(1.2))) - #theme(axis.text.x = element_text(angle = 30, hjust=1),strip.text = element_text(size=rel(1.2))) +#theme(axis.text.x = element_text(angle = 30, hjust=1),strip.text = element_text(size=rel(1.2))) ggsave(pp(plotsDir,'/xfc-hours-per-site-per-day.png'),p,width=5,height=3,units='in') diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 4b41c91aa79..d73f98c1b9a 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -22,7 +22,81 @@ oaklandCbg <- st_read(shpFile) ### #eventsraw <- readCsv(pp(workDir, "/2021Aug22-Oakland/BASE0/events-raw/2.events.BASE0.csv.gz")) -events <- readCsv(pp(workDir, "/2021Oct29/BATCH1/events/filtered.3.events.SC4.csv.gz")) +events <- readCsv(pp(workDir, "/2022Feb/BATCH1/events/filtered.0.events.SC4.csv.gz")) + +## temp +workdir <- "/Users/haitamlaarabi/Data/GEMINI/enroute-scenario3" +# default <- readCsv(pp(workdir,"/default.0.events.csv.gz")) +# default.ref <- default[type=="RefuelSessionEvent"] +# write.csv( +# default.ref, +# file = pp(workDir, "/default.0.events.pt.csv.gz"), +# row.names=FALSE, +# quote=FALSE, +# na="0") +# +# enroute <- readCsv(pp(workdir,"/enroute.0.events.csv.gz")) +# enroute.ref <- enroute[type=="RefuelSessionEvent"] +# write.csv( +# enroute.ref, +# file = pp(workDir, "/enroute.0.events.pt.csv.gz"), +# row.names=FALSE, +# quote=FALSE, +# na="0") + +default.ref <- readCsv(pp(workdir,"/default.0.events.pt.csv.gz")) +enroute.ref <- readCsv(pp(workdir,"/enroute.0.events.pt.csv.gz")) + +default.ref.sum <- default.ref[,.(sumFuel=sum(fuel)),by=chargingPointType] +enroute.ref.sum <- enroute.ref[,.(sumFuel=sum(fuel)),by=chargingPointType] + +default.ref.sum$shareFuel <- default.ref.sum$sumFuel/sum(default.ref.sum$sumFuel) +enroute.ref.sum$shareFuel <- enroute.ref.sum$sumFuel/sum(enroute.ref.sum$sumFuel) + +default.ref.sum$scenario <- "DestinationOnly" +enroute.ref.sum$scenario <- "Enroute" + +ref <- data.table::data.table(rbind(default.ref.sum,enroute.ref.sum)) + +ref %>% + ggplot(aes(chargingPointType, shareFuel, fill=scenario)) + + geom_bar(stat='identity',position='dodge') + + theme_marain() + + labs(x = "Charging Point", y = "Share (%)", fill="Capability") + + theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) + +fc.labels <- c("publicfc(150.0|DC)","publicxfc(250.0|DC)") +default.ref.fc <- sum(ref[scenario=="DestinationOnly"&chargingPointType%in%fc.labels]$sumFuel) +enroute.ref.fc <- sum(ref[scenario=="Enroute"&chargingPointType%in%fc.labels]$sumFuel) +default.ref.nonfc <- sum(ref[scenario=="DestinationOnly"&!chargingPointType%in%fc.labels]$sumFuel) +enroute.ref.nonfc <- sum(ref[scenario=="Enroute"&!chargingPointType%in%fc.labels]$sumFuel) + +ref.change <- data.table::data.table( + scenario=c("AC Level1/2","DC Fast"), + relativeEnergy=c((enroute.ref.nonfc/default.ref.nonfc)-1,(enroute.ref.fc/default.ref.fc)-1) +) + +p <- ref.change %>% + ggplot(aes(scenario, relativeEnergy, fill=scenario)) + + geom_bar(stat='identity',position='dodge') + + theme_marain() + + labs(x = "Charging Point Type", y = "Enroute Energy wrt DestinationOnly") + + guides(fill="none") +ggsave(pp(workdir,'/Relative-energy-charged.png'),p,width=4,height=5,units='in') + + + +ref$chargingPoint <- "Level1/2" +ref[chargingPointType=="dcfast(50.0|DC)"]$chargingPoint <- "Fast" +ref[chargingPointType=="ultrafast(250.0|DC)"]$chargingPoint <- "XFC" + +chargingPoint_order <- c("Level1/2","Fast","XFC") +ref %>% + ggplot(aes(factor(chargingPoint, levels=chargingPoint_order), shareFuel, fill=scenario)) + + geom_bar(stat='identity',position='dodge') + + theme_marain() + + labs(x = "Charging Point", y = "Share (%)", fill="Capability") + #################### REV @@ -70,6 +144,9 @@ trips <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010/trips.csv.gz") # persons <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010-cut-718k-by-shapefile/persons.csv.gz")) # households <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010-cut-718k-by-shapefile/households.csv.gz")) # blocks <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010-cut-718k-by-shapefile/blocks.csv.gz")) + + + refueling_person_ids <- unique(refuel_actstart$person) plans <- readCsv(pp(activitySimDir, "/activitysim-plans-base-2010-cut-718k-by-shapefile/plans.csv.gz")) plans$person_id <- as.character(plans$person_id) @@ -77,14 +154,14 @@ plans_filtered <- plans[person_id %in% refueling_person_ids] plans_leg_act_merge_temp <- plans_filtered[ order(person_id,-PlanElementIndex), .(person = person_id, - tripId = .SD[.I+1]$trip_id, - numberOfParticipants = .SD[.I+1]$number_of_participants, - tripMode = .SD[.I+1]$trip_mode, - actType = ActivityType, - actLocationX = x, - actLocationY = y, - departureTime = departure_time) -, ] + tripId = .SD[.I+1]$trip_id, + numberOfParticipants = .SD[.I+1]$number_of_participants, + tripMode = .SD[.I+1]$trip_mode, + actType = ActivityType, + actLocationX = x, + actLocationY = y, + departureTime = departure_time) + , ] plans_leg_act_merge_temp[is.na(departureTime)]$departureTime <- 32 plans_leg_act_merge <- plans_leg_act_merge_temp[ !(is.na(tripId)|tripId=="")][ @@ -228,7 +305,7 @@ oakland_charging_events_merged_with_urbansim_tripIds_scaledUpby10 <- scaleUpAllS # quote=FALSE, # na="") # -# +# # initInfra_1_5_updated_constrained_non_AlamedaOakland[startsWith(reservedFor, "household")] # # initInfra_1_5[household_id == 1800619] @@ -237,7 +314,7 @@ oakland_charging_events_merged_with_urbansim_tripIds_scaledUpby10 <- scaleUpAllS ########### sfbay_contrained_parking <- readCsv( pp(workDir, "/taz-parking-sparse-fast-limited-l2-150-lowtech-b.csv") - ) +) #sfbay_contrained_parking[chargingType!="NoCharger",.(fee=max(feeInCents)),by=.(parkingType,chargingType)] #sfbay_contrained_parking[chargingType!="NoCharger",.N,by=.(parkingType,chargingType)] sfbay_contrained_parking$chargingPointType <- "NoCharger" @@ -357,6 +434,9 @@ write.csv( na="") +test <- readCsv(pp(workDir, "/2021Aug22-Oakland/stations/gemini-base-scenario-2-charging-with-household-infra16.csv")) + + ##### chargingBehaviorFunc <- function(DT) { rseSum <- DT[,.(fuel=sum(fuel)),by=.(parkingType,chargingPointType)] @@ -570,7 +650,7 @@ looTest2[departure_time<=16&departure_time>=8,.N,by=.(timeBin=as.POSIXct(cut(toD ### fooFile <- "/2021Aug22-Oakland/beamLog.out-choiceset.txt" - + ## sc2 <- readCsv(pp(workDir, "/gemini-base-scenario-2-parking-charging-infra16.csv")) @@ -630,6 +710,190 @@ write.csv( +## calibration +summarizingCharging <- function(DATA) { + refSession <- DATA[type=="RefuelSessionEvent"] + refSession$loadType <- "" + refSession[chargingPointType == "homelevel1(1.8|AC)"]$loadType <- "Home L1" + refSession[chargingPointType == "homelevel2(7.2|AC)"]$loadType <- "Home L2" + refSession[chargingPointType == "worklevel2(7.2|AC)"]$loadType <- "Work L2" + refSession[chargingPointType == "publiclevel2(7.2|AC)"]$loadType <- "Public L2" + refSession[grepl("fc", chargingPointType)]$loadType <- "Public L3" + chgSummary <- refSession[,.(sumFuel=sum(fuel)),by=.(loadType)] + chgSummaryTotFuel <- sum(chgSummary$sumFuel) + chgSummary[,shareFuel:=sumFuel/chgSummaryTotFuel][,-c("sumFuel")][order(loadType)] + print(chgSummary[,-c("sumFuel")][order(loadType)]) + home1 <- chgSummary[loadType == "Home L1"]$shareFuel + home2 <- chgSummary[loadType == "Home L2"]$shareFuel + print("Home L1+L2") + home1 + home2 +} + +summarizingCharging2 <- function(DATA) { + chgSummary <- DATA[type=="RefuelSessionEvent"][,.(sumFuel=sum(fuel)),by=.(actType)] + chgSummaryTotFuel <- sum(chgSummary$sumFuel) + chgSummary[,shareFuel:=sumFuel/chgSummaryTotFuel][,-c("sumFuel")][order(actType)] +} + +events1 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-1.csv.gz")) +events2 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-2.csv.gz")) +events3 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-3.csv.gz")) +events4 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-4.csv.gz")) +events5 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-5.csv.gz")) +events6 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-6.csv.gz")) +events7 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-7.csv.gz")) +events8 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-8.csv.gz")) + +# ev <- events1[startsWith(vehicleType, "ev-")] +# phev <- events1[startsWith(vehicleType, "phev-")] +# virtual <- events1[startsWith(vehicleType, "VirtualCarType")] +# +# allEv <- rbind(ev,phev) +# allEVSummary <- allEv[,.(.N),by=.(vehicle,vehicleType)] +# allEVSummary$vehType <- "Car" +# allEVSummary[grepl("Midsize",vehicleType)]$vehType <- "Midsize" +# allEVSummary[grepl("SUV",vehicleType)]$vehType <- "SUV" +# allEVSummary[grepl("Pickup",vehicleType)]$vehType <- "Pickup" +# allEVSummary[,.N,by=.(vehType)] +# +# +# n_ev <- length(unique(ev$vehicle)) +# n_phev <- length(unique(phev$vehicle)) +# n_virtual <- length(unique(virtual$vehicle)) +# n_ev_virtual <- n_virtual*(n_ev/(n_ev+n_phev)) +# n_phev_virtual <- n_virtual*(n_phev/(n_ev+n_phev)) +# +# tot <- n_ev + n_phev + n_ev_virtual + n_phev_virtual + +# home_l1 <- c(214111.2,211923.08,208621.38,202296.8,194829.95,187391.03,179245.57,171491.27,164053.89,156328.68,149317.28,142827.17,136334.76,129988.95,123245.08,117163.17,110797.83,104364.94,98190.02,92319.37,86389.21,80431.88,74753.37,69292.44,62771.91,57877.63,52755.43,48026.31,42823.35,38926.68,35399.17,33372.94,32068.76,31352.66,30194.87,28925.32,27057.94,26295.52,25438.38,25708.78,26050.95,27227.11,27994.12,29514.74,32059.96,34931.46,37853.67,41214.31,44844.4,49689.12,54051.58,56591.05,58572.11,61640.34,64870.28,67340.67,70304.79,75464.69,82198.98,87824.1,96141.41,106715.73,117904.53,126863.88,136510.25,146884.4,157953.02,167726.08,179445.74,194061.4,210797.06,224026.44,236691.85,247128.19,255858.86,260320.45,263116.93,265472.88,268295.78,270321.62,271914.39,272345.16,271250.72,272341.52,271938.5,273983.09,274960.99,273487.06,271519.02,268411.56,265309.26,260089.08,254698.2,248714.27,241775.97,234571.86) +# home_l2 <- c(163140.29,144023.61,125243.75,104454.89,98585.96,83711.95,76033.63,66311.86,56915.23,49768.92,44792.73,37462.7,33046.28,28099.37,22954.78,19483.53,15918.31,13051.22,11216.17,8809.13,6872.47,6118.66,5179.04,6088.62,5961.16,6490.87,7593.55,8055.51,9037.62,9724.45,12430.41,15092.36,20329.96,22542.76,23192.08,21461.53,21462.48,22072.19,24639.03,27293.13,29829.93,32118.33,39065.04,43416.6,48766.72,60068.05,65967.97,72970.38,82464.03,97277.38,105904.7,105871.21,105859.73,112139.33,118064.71,119554.33,126458.18,134333.42,157911.3,174437.79,201619.36,228802.07,253878.37,266873.71,296407.97,325078.39,339972.5,353857.51,385748.1,422134.16,463759.92,488407.37,516707.11,520134.54,526323.62,522026.8,520062.77,503784.68,483819.28,466238.16,456407.69,439618.65,430171.49,419233.96,409436.02,400816.55,383956.12,363607.02,347688.71,327030.36,306217.58,280592.42,256449.04,234875.95,214052.64,191748.7) +# work_l1 <- c(1562.72,1507.23,1485.79,1452.3,1270.89,1158.17,1125.25,1082.39,957.04,910.92,830.16,768.73,638.03,595.54,575.83,584.06,619.46,629.61,767.97,935.22,1281.22,1705.68,2335.86,2961.44,4114.64,4720.51,5862.99,7249.08,9493.85,10814.87,13062.7,15345.55,18619.88,19822.45,20812.02,21449.09,22778.72,23018.32,23094.1,23204.52,23374.46,23130.46,22902.35,22569.56,22279.06,21909.91,21265.37,20302.78,19036.87,18252.83,17586.1,17087.01,16860.04,16603.8,16153.51,15625.9,14838.22,14334.92,13848.08,13272.63,12127.09,11452.13,10663.69,10268.7,9478.92,8735.07,7993.7,7205.07,6184.3,5529.62,4812.18,4533.16,4036.37,3692.48,3513.35,3422.07,3267.83,3036.08,2833.8,2746.54,2622.34,2443.98,2240.36,2094.16,2047.65,2036.17,2054.93,2105.26,1891.69,1810.74,1769.79,1712.57,1686.92,1681.37,1628.94,1677.35) +# work_l2 <- c(2652.38,2488.76,2540.62,2572.39,2072.72,1872.36,1807.87,1945.27,1776.29,1547.8,1435.27,1562.15,1498.42,1460.53,2251.85,3499,5391.65,6120.19,6930.83,9421.13,15780.72,18806.46,24901.78,32720.76,48371.92,57512.69,74029.8,90552.08,125095.25,143729.09,173419.71,198975.58,246980.46,251954.92,256120.84,250745.85,254545.87,240578.38,223418.84,207430.87,190271.9,167443.04,150213.27,133096.22,119458.84,107286.2,95935.88,85443.66,77644.96,71057.83,66784.16,66993.52,66857.46,62364.67,61714.21,59384.28,56212.14,52570.95,49901.92,48116.44,45140.64,41447.78,42206.57,39041.89,37433.23,34350.84,31920.26,30529.58,28071.62,26228.93,24383.74,22007.31,20483.44,17821.87,17092.18,17393.01,16069.11,14293.97,12657.19,11710.86,10525.33,8932.18,8141.25,7892.47,7812.86,6883.76,6105.46,5509.72,5533.07,4846.82,4352.89,4475.37,4098.18,3458.24,3196.06,2820.21) +# public_l2 <- c(19788.76,18253.6,15948.36,14610.69,13154.36,12062.03,10948.83,10387.54,9408.3,8252.05,6699.28,5991.59,5558.33,5303.43,5069,4458.53,4354.81,4287.25,3674.87,3940.49,5068.23,6015.32,7886.53,9011.21,13842.34,16395.02,18872.87,21881.2,25059.47,27813.08,32476.95,37535.23,47378.52,51027.56,55825.96,57967.57,65746.17,70316.27,73245.57,72648.68,76039.95,75117.16,76287.96,76544.59,76267.29,74199.54,75421.25,76531.96,79423.55,79431.21,78182.71,75911.15,76946.27,75698.35,75548.89,75372.07,75104.91,71943.68,70442.19,68094.09,72936.12,72580.56,70357.99,73058.22,73292.64,71539.89,69061.84,70978.03,72952.01,72969.42,76923.5,81983.69,87958.83,90399.75,90921.8,94572.56,97035.49,93019.79,88844.68,85019.96,78802.37,73560.37,64138.86,58119.14,50942.78,46139.02,42267.61,36899.5,33431.12,30559.24,29203,29484.51,26575.88,24058.79,23409.67,21778.24) +# public_l3 <- c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,392.5,725.1,185.05,0,0.19,947.28,1440.06,4366.86,5009.1,4164.97,2661.76,4667.31,3887.1,8270.8,7615.17,14079.25,14335.69,11754.3,10793.05,13989.31,11593.17,13399.51,15847.89,17059.26,15505.72,14141.45,14448.21,16772.97,13977.83,16665.23,17113.04,16727.62,18224.13,21393.59,17138.68,16346.03,13321.24,13832.77,17703.98,17284.69,14626,18584.28,20115.24,16532.61,13048.34,11299.61,10443.42,9273.77,9134.84,12408.02,16232.54,17234.55,14942.52,9471.07,11043.17,13640.25,16696.61,14306.41,11058.68,8682.63,5775.34,3623.39,3078.95,2567.03,1351.45,392.31,392.31,392.31,418.33,784.62,624.82,392.31,392.31,279.59,0) +# +# tot <- sum(home_l1) + sum(home_l2) + sum(work_l1) + sum(work_l2) + sum(public_l2) + sum(public_l3) +# sum(home_l1)/tot +# sum(home_l2)/tot +# (sum(home_l1)+sum(home_l2))/tot +# (sum(work_l1)+sum(work_l2))/tot +# sum(public_l2)/tot +# sum(public_l3)/tot + +# LoadType,Share,period +# Home L1,33.8%,weekday +# Home L2,43.7%,weekday +# Work L1+L2,9.2%,weekday +# Public L2,11.4%,weekday +# Public L3,1.8%,weekday +# Home L1+L2,77.5,weekday + + +summarizingCharging(events1) +summarizingCharging(events2) +summarizingCharging(events3) +summarizingCharging(events4) +summarizingCharging(events5) +summarizingCharging(events6) +summarizingCharging(events7) +summarizingCharging(events8) + +ref2 <- events2[(type=="RefuelSessionEvent") & (time < 5*3600)] +summarizingCharging2(ref2) +events2[type=="RefuelSessionEvent",.N,by=.(time2=time/60.0)] %>% ggplot(aes(time2,N)) + geom_line() +stationsUnlimited <- readCsv(pp(workDir, "/2022Mars-Calibration/gemini_taz_unlimited_charging_point.csv")) +stationsUnlimitedBis <- stationsUnlimited[,.(stalls=sum(numStalls),fees=mean(feeInCents)),by=.(chargingPointType)] +stationsUnlimitedBis$shareStalls<- stationsUnlimitedBis$stalls / sum(stationsUnlimitedBis$stalls) + +stationsTemp <- readCsv(pp(workDir, "/2022Mars-Calibration/gemini-base-scenario-3-charging-no-household-infra16.csv")) +stationsTempBis <- stationsTemp[,.(stalls=sum(numStalls),fees=mean(feeInCents)),by=.(chargingPointType)] +stationsTempBis$shareStalls <- stationsTempBis$stalls / sum(stationsTempBis$stalls) + +stationsAgg <- readCsv(pp(workDir, "/2022Mars-Calibration/init1-7_2022_Feb_03_wgs84_withFees_aggregated.csv")) +stationsAggBis <- stationsAgg[,.(stalls=sum(numStalls),fees=mean(feeInCents)),by=.(chargingPointType)] +stationsAggBis$shareStalls<- stationsAggBis$stalls / sum(stationsAggBis$stalls) + +stations <- readCsv(pp(workDir, "/2022Mars-Calibration/init1-7_2022_Feb_03.csv")) +stationsBis <- stations[,.(stalls=.N),by=.(chrgType)] +stationsBis$shareStalls<- stationsBis$stalls / sum(stationsBis$stalls) + +mnl <- readCsv(pp(workDir, "/2022Mars-Calibration/mnl-beamLog.csv")) +mnl_search <- readCsv(pp(workDir, "/2022Mars-Calibration/mnl-search-beamLog.csv")) +mnl_param <- readCsv(pp(workDir, "/2022Mars-Calibration/mnl-param-beamLog.csv")) +sampled <- mnl[mnlStatus=="sampled"] +chosen <- mnl[mnlStatus=="chosen"] + +mnl_param$result <- mnl_param$RangeAnxietyCost * -0.5 + + mnl_param$WalkingEgressCost * -0.086 + + mnl_param$ParkingTicketCost * -0.5 + + mnl_param$HomeActivityPrefersResidentialParking * 5.0 + +requestIds <- unique(mnl_param[grepl("Home", activityType)]$requestId) +chosen_home <- chosen[requestId %in% requestIds] +chosen_home_nonHome <- chosen_home[!startsWith(chargingPointType,"homelevel")] +requestIds_nonHome <- unique(chosen_home_nonHome$requestId) +home_nonHome_param <- mnl_param[requestId %in% requestIds_nonHome] +home_nonHome_search <- mnl_search[requestId %in% requestIds_nonHome] +home_nonHome_param[,.N,by=.(chargingPointType)] +home_nonHome_search[,.N,by=.(chargingPointType)] + +requestIds <- unique(mnl_param[grepl("work",tolower(activityType))]$requestId) +chosen_work <- chosen[requestId %in% requestIds] +chosen_work_nonWork <- chosen_work[!startsWith(chargingPointType,"worklevel")] +requestIds_nonWork <- unique(chosen_work_nonWork$requestId) +home_nonWork_param <- mnl_param[requestId %in% requestIds_nonWork] +chosen_nonWork <- chosen[requestId %in% requestIds_nonWork] + +chosen_nonWork[,.N,by=.(chargingPointType)] + +test <- mnl_param[,.(n=.N),by=.(activityType,requestId)] + +chosen_fc_ids <- unique(chosen[grepl("fc", chargingPointType)]$requestId) +param_fc <- mnl_param[requestId %in% chosen_fc_ids] +param_fc_home <- param_fc[activityType == "Home"] +chosen[requestId==112605] +chosen$idBis <- paste(chosen$requestId,chosen$parkingZoneId,sep="-") +mnl_param$idBis <- paste(mnl_param$requestId,mnl_param$parkingZoneId,sep="-") +res <- mnl_param[idBis %in% chosen$idBis] +mean(mnl_param[idBis %in% chosen$idBis]$result) +mean(mnl_param[,.SD[which.max(result)],by=.(requestId)]$result) + +chosen[requestId == 93342] +mnl_param[requestId == 93342] +mnl_search[requestId == 93342] +sampled[requestId == 93342] +sampled[,.N,by=.(chargingPointType)] +mnl_param[,.N,by=.(chargingPointType)] + + +res <- home_nonHome_param[,.SD[which.max(result)],by=.(vehicleId)] +res[,.N,by=.(chargingPointType)] +res[chargingPointType=="publiclevel2(7.2|AC)"] + +unique(stations[subSpace == 1186]$chrgType) +stationsAgg[taz == 1186] + +test <- output1[,.(cost=mean(costInDollars)),by=.(mnlStatus,parkingZoneId,chargingPointType,parkingType)] +test2 <- test[cost > 0] + +chosenSummary <- chosen[,.(n=.N,cost=mean(costInDollars)),b=.(chargingPointType)] +sampled[,.(n=.N,cost=mean(costInDollars)),b=.(chargingPointType)] + + +#res <- home_param[activityType=="Home",.SD[which.max(result)],by=.(vehicleId)] +res <- mnl_param[,.SD[which.max(result)],by=.(vehicleId)] +res[,.N,by=.(chargingPointType)] +sum(res[,.N,by=.(chargingPointType)]$N) + + +events <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-1.csv.gz")) +events[type=="RefuelSessionEvent"][,.(.N,sumFuel=sum(fuel)),by=.(actType)] +events[type=="RefuelSessionEvent"][,.(.N,sumFuel=sum(fuel)),by=.(chargingPointType)] + + +mnl_param[,.(.N,mean(costInDollars)),by=.(chargingPointType)] + +events7[type=="RefuelSessionEvent"][,.(sumFuel=sum(fuel)),by=.(actType)] diff --git a/src/main/R/gemini/gemini-utils.R b/src/main/R/gemini/gemini-utils.R index 2cc8126817d..9503574a310 100644 --- a/src/main/R/gemini/gemini-utils.R +++ b/src/main/R/gemini/gemini-utils.R @@ -177,12 +177,12 @@ generateReadyToPlot <- function(resultsDirName, loadTypes, countyNames) { chargingTypes <- data.table() if (!file.exists(pp(sim.xfc.temp.file,"-loads.csv"))) { code <- unlist(strsplit(sim.xfc.file, "\\."))[3] - + sessions <- readCsv(sim.xfc.file) sessions[(depot),taz:=-kmeans(sessions[(depot)][,.(x,y)],20)$cluster] sessions[,code:=code] write.csv(sessions,file = pp(sim.xfc.temp.file,"-sessions.csv"),row.names=FALSE,quote=FALSE,na="0") - + loads <- extractLoads(sessions, loadTypes, countyNames) loads[,hour.bin2:=hour.bin%%24] loads[,code:=code] diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 6ebb9393ca7..898fd1da3df 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,7 +1,7 @@ import pandas as pd import os -filename = '~/Data/GEMINI/2021Oct29/BATCH1/events-raw/0.events.SC4Bis5.csv.gz' +filename = '~/Data/GEMINI/2022Feb/BATCH1/events-raw/0.events.SC4.csv.gz' full_filename = os.path.expanduser(filename) compression = None if filename.endswith(".gz"): @@ -16,5 +16,5 @@ "parkingZoneId", "pricingModel", "actType"] ] -data_filtered2.to_csv('~/Data/GEMINI/2021Oct29/BATCH1/events/filtered.0.events.SC4Bis5.csv.gz') +data_filtered2.to_csv('~/Data/GEMINI/2022Feb/BATCH1/events-raw/filtered.0.events.SC4.csv.gz') print("END") diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 80430a474f6..96ccbdf908d 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -11,12 +11,12 @@ import beam.agentsim.agents.freight.input.FreightReader.FREIGHT_REQUEST_TYPE import beam.agentsim.agents.modalbehaviors.DrivesVehicle.StartLegTrigger import beam.agentsim.agents.parking.ChoosesParking._ import beam.agentsim.agents.vehicles.VehicleProtocol.StreetVehicle -import beam.agentsim.agents.vehicles.{BeamVehicle, PassengerSchedule, VehicleCategory, VehicleManager} +import beam.agentsim.agents.vehicles.{BeamVehicle, PassengerSchedule, VehicleManager} import beam.agentsim.events.{LeavingParkingEvent, ParkingEvent, SpaceTime} import beam.agentsim.infrastructure.ChargingNetworkManager._ +import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.charging.{ChargingPointType, ElectricCurrentType} import beam.agentsim.infrastructure.parking.PricingModel -import beam.agentsim.infrastructure.ParkingInquiry.{ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.taz.TAZTreeMap import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse, ParkingStall} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index c48285b4bd0..5026e89209b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -10,7 +10,7 @@ import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.{NotApplicable, ShiftStatus} import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingStatus, ChargingVehicle} -import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.Parking +import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.EnRouteCharging import beam.agentsim.infrastructure.power.{PowerController, SitePowerManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger.TriggerWithId @@ -162,8 +162,9 @@ class ChargingNetworkManager( val activityType = vehicle2InquiryMap .get(vehicle.id) .map { - case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, searchMode, _, _) if searchMode != Parking => - searchMode.toString + "-" + activityType + case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, searchMode, _, _) + if searchMode == EnRouteCharging => + "EnRoute-" + activityType case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, _, _, _) => activityType } .getOrElse("") From c1d19c18cf8f09d21a37eabf3ee2e5269f1341d5 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 16 Mar 2022 02:34:23 -0700 Subject: [PATCH 058/307] testing a fix --- .../agentsim/infrastructure/parking/ParkingZoneSearch.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 991ec343883..01dc6f2467e 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -298,7 +298,7 @@ object ParkingZoneSearch { override def lookupParkingZonesInNextSearchAreaUnlessThresholdReached( zoneQuadTree: QuadTree[GEO] ): Option[List[GEO]] = { - if (thisInnerDistance > maxDistance) None + if (thisInnerDistance >= maxDistance) None else { val result = zoneQuadTree .getElliptical(originUTM.getX, originUTM.getY, destinationUTM.getX, destinationUTM.getY, thisInnerDistance) From f30fcfaf8bdde7b4000ff590e90e88bc2c8eb4b0 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 16 Mar 2022 06:02:04 -0700 Subject: [PATCH 059/307] sampling vehicleTypes --- .../infrastructure/ScaleUpCharging.scala | 60 +++++++++++-------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 8b9a88136fe..ff84f662b0b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -7,14 +7,14 @@ import beam.agentsim.events.RefuelSessionEvent.NotApplicable import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.ChargingNetwork.ChargingVehicle import beam.agentsim.infrastructure.ChargingNetworkManager._ -import beam.agentsim.infrastructure.ParkingInquiry.{activityTypeStringToEnum, ParkingActivityType} +import beam.agentsim.infrastructure.ParkingInquiry.{activityTypeStringToEnum, ParkingActivityType, ParkingSearchMode} import beam.agentsim.infrastructure.taz.{TAZ, TAZTreeMap} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger import beam.agentsim.scheduler.Trigger.TriggerWithId import beam.sim.config.BeamConfig.Beam.Agentsim import beam.utils.MathUtils.roundUniformly -import beam.utils.BeamVehicleUtils.toPowerInKW +import beam.utils.BeamVehicleUtils.{readBeamVehicleTypeFile, readVehiclesFile, toPowerInKW} import beam.utils.{MathUtils, VehicleIdGenerator} import org.apache.commons.math3.distribution.EnumeratedDistribution import org.apache.commons.math3.random.MersenneTwister @@ -53,6 +53,23 @@ trait ScaleUpCharging extends { } } +// lazy val nonSampledVehicle: Map[Id[BeamVehicle], BeamVehicle] = { +// val vehicleTypes: Map[Id[BeamVehicleType], BeamVehicleType] = readBeamVehicleTypeFile(beamConfig) +// var (allVehicles, _) = readVehiclesFile( +// beamConfig.beam.agentsim.agents.vehicles.vehiclesFilePath, +// vehicleTypes, +// beamConfig.matsim.modules.global.randomSeed, +// VehicleManager.AnyManager.managerId +// ) +// getBeamServices.matsimServices.getScenario.getHouseholds.getHouseholds +// .values() +// .asScala +// .flatMap(_.getVehicleIds.asScala.map { vehicleId => +// allVehicles = allVehicles - BeamVehicle.createId(vehicleId) +// }) +// allVehicles +// } + private lazy val defaultScaleUpFactor: Double = if (!cnmConfig.scaleUp.enabled) 1.0 else cnmConfig.scaleUp.expansionFactor_wherever_activity @@ -145,6 +162,13 @@ trait ScaleUpCharging extends { new CPair[String, java.lang.Double](activityType, elems.size.toDouble) } .toVector + val pmfVehicleType = + data + .groupBy(_.vehicleType) + .map { case (vehicleType, elems) => + new CPair[BeamVehicleType, java.lang.Double](vehicleType, elems.size.toDouble) + } + .toVector val vehicleInfoSummary = VehicleInfoSummary( numObservation = numObservation, totPowerInKW = totPowerInKW, @@ -156,7 +180,8 @@ trait ScaleUpCharging extends { stdDevSOC = Math.sqrt(socList.map(_ - meanSOC).map(t => t * t).sum / numObservation), stdDevEnergy = Math.sqrt(energyList.map(_ - meanEnergy).map(t => t * t).sum / numObservation), stdFuelCapacity = Math.sqrt(fuelCapacityList.map(_ - meanFuelCapacity).map(t => t * t).sum / numObservation), - new EnumeratedDistribution[String](mersenne, pmfActivityType.asJava) + new EnumeratedDistribution[String](mersenne, pmfActivityType.asJava), + new EnumeratedDistribution[BeamVehicleType](mersenne, pmfVehicleType.asJava) ) parkingActivityType -> (data, vehicleInfoSummary) }) @@ -184,7 +209,7 @@ trait ScaleUpCharging extends { val energyToCharge = summary.getEnergy(rand) val taz = getBeamServices.beamScenario.tazTreeMap.getTAZ(tazId).get val destinationUtm = TAZTreeMap.randomLocationInTAZ(taz, rand) - val vehicleType = getBeamVehicleType(summary.getFuelCapacity(rand, energyToCharge, soc)) + val vehicleType = summary.vehicleTypeDistribution.sample() val reservedFor = VehicleManager.AnyManager val beamVehicle = getBeamVehicle(vehicleType, reservedFor, soc) val personId = getPerson(beamVehicle.id) @@ -198,6 +223,7 @@ trait ScaleUpCharging extends { Some(personId), 1.0, // valueOfTime duration, + searchMode = ParkingSearchMode.DestinationCharging, triggerId = triggerId ) val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) @@ -239,30 +265,14 @@ trait ScaleUpCharging extends { durationToCharge, Math.max(chargingVehicle.vehicle.primaryFuelLevelInJoules, 0.0), chargingVehicle.vehicle.beamVehicleType.primaryFuelCapacityInJoule, - chargingVehicle.activityType + chargingVehicle.activityType, + chargingVehicle.vehicle.beamVehicleType ) ) } } } - /** - * get Beam Vehicle Type - * @return BeamVehicleType - */ - protected def getBeamVehicleType(fuelCapacityInJoule: Double): BeamVehicleType = { - BeamVehicleType( - id = Id.create(VIRTUAL_CAR_ALIAS + "Type", classOf[BeamVehicleType]), - seatingCapacity = 4, - standingRoomCapacity = 0, - lengthInMeter = 4.1, - primaryFuelType = FuelType.Electricity, - primaryFuelConsumptionInJoulePerMeter = 626, - primaryFuelCapacityInJoule = fuelCapacityInJoule, - vehicleCategory = VehicleCategory.Car - ) - } - /** * get Beam Vehicle * @param vehicleType BeamVehicleType @@ -310,7 +320,8 @@ object ScaleUpCharging { durationToChargeInSec: Int, remainingFuelInJoule: Double, fuelCapacityInJoule: Double, - activityType: String + activityType: String, + vehicleType: BeamVehicleType ) case class VehicleInfoSummary( @@ -324,7 +335,8 @@ object ScaleUpCharging { stdDevSOC: Double, stdDevEnergy: Double, stdFuelCapacity: Double, - activityTypeDistribution: EnumeratedDistribution[String] + activityTypeDistribution: EnumeratedDistribution[String], + vehicleTypeDistribution: EnumeratedDistribution[BeamVehicleType] ) { def getDuration(rand: Random): Int = { From abb38bdb29a74792c26b167872fcb12aa24b235c Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 16 Mar 2022 11:32:05 -0700 Subject: [PATCH 060/307] small change to enm distribution --- .../scala/beam/agentsim/infrastructure/ScaleUpCharging.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index ff84f662b0b..9441b803fcc 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -210,13 +210,14 @@ trait ScaleUpCharging extends { val taz = getBeamServices.beamScenario.tazTreeMap.getTAZ(tazId).get val destinationUtm = TAZTreeMap.randomLocationInTAZ(taz, rand) val vehicleType = summary.vehicleTypeDistribution.sample() + val activityType = summary.activityTypeDistribution.sample() val reservedFor = VehicleManager.AnyManager val beamVehicle = getBeamVehicle(vehicleType, reservedFor, soc) val personId = getPerson(beamVehicle.id) val startTime = timeBin + timeStep val parkingInquiry = ParkingInquiry( SpaceTime(destinationUtm, startTime), - summary.activityTypeDistribution.sample(), + activityType, reservedFor, Some(beamVehicle), None, // remainingTripData From 75e71ae113364d8ec162a944d27e7cf98f1f5616 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:37:12 -0700 Subject: [PATCH 061/307] updating scripts --- src/main/R/gemini/gemini-processing.R | 3 +++ src/main/python/gemini/events_processing.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index d73f98c1b9a..55ae90b61cf 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -735,6 +735,8 @@ summarizingCharging2 <- function(DATA) { chgSummary[,shareFuel:=sumFuel/chgSummaryTotFuel][,-c("sumFuel")][order(actType)] } +events0 <- readCsv(pp(workDir, "/2022Mars-Calibration/filtered.0.events.SC4a.csv.gz")) + events1 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-1.csv.gz")) events2 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-2.csv.gz")) events3 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-3.csv.gz")) @@ -788,6 +790,7 @@ events8 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-8.csv.gz")) # Public L3,1.8%,weekday # Home L1+L2,77.5,weekday +summarizingCharging(events0) summarizingCharging(events1) summarizingCharging(events2) diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 898fd1da3df..512636aba87 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,7 +1,7 @@ import pandas as pd import os -filename = '~/Data/GEMINI/2022Feb/BATCH1/events-raw/0.events.SC4.csv.gz' +filename = '~/Data/GEMINI/2022Feb/BATCH1/events-raw/0.events.SC4a.csv.gz' full_filename = os.path.expanduser(filename) compression = None if filename.endswith(".gz"): @@ -16,5 +16,5 @@ "parkingZoneId", "pricingModel", "actType"] ] -data_filtered2.to_csv('~/Data/GEMINI/2022Feb/BATCH1/events-raw/filtered.0.events.SC4.csv.gz') +data_filtered2.to_csv('~/Data/GEMINI/2022Feb/BATCH1/events/filtered.0.events.SC4a.csv.gz') print("END") From b921aea68306540f082d9652121fe51c89a05d36 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 17 Mar 2022 10:10:14 -0700 Subject: [PATCH 062/307] testing fix --- .../agentsim/infrastructure/parking/ParkingZoneSearch.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 01dc6f2467e..bed89fdc0f5 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -294,17 +294,19 @@ object ParkingZoneSearch { private val startDistance: Double = distanceFunction(originUTM, destinationUTM) * 1.01 private val maxDistance: Double = startDistance * searchMaxDistanceToFociInPercent private var thisInnerDistance: Double = startDistance + private var counter = 0 override def lookupParkingZonesInNextSearchAreaUnlessThresholdReached( zoneQuadTree: QuadTree[GEO] ): Option[List[GEO]] = { - if (thisInnerDistance >= maxDistance) None + if (thisInnerDistance >= maxDistance || counter > 3) None else { val result = zoneQuadTree .getElliptical(originUTM.getX, originUTM.getY, destinationUTM.getX, destinationUTM.getY, thisInnerDistance) .asScala .toList thisInnerDistance = thisInnerDistance * expansionFactor + counter = counter + 1 Some(result) } } From 9cb4a27cc50c91cf48f170d81da124633e1d7740 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 18 Mar 2022 15:36:37 -0700 Subject: [PATCH 063/307] scripts --- src/main/R/gemini/gemini-main.R | 4 ++-- src/main/R/gemini/gemini-utils.R | 12 +++++++++--- src/main/python/gemini/events_processing.py | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 763caf0dade..818dd2eebdc 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -68,8 +68,8 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) ##### # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') -scenarioNames <- c('Scenario4') -scenarioBaselineLabel <- 'Scenario4' +scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base') +scenarioBaselineLabel <- 'Scenario4a-Base' #all.loads <- all.loads[!is.na(loadType)] ########################################## # LOADS & ENERGY diff --git a/src/main/R/gemini/gemini-utils.R b/src/main/R/gemini/gemini-utils.R index 9503574a310..2dca2fd9501 100644 --- a/src/main/R/gemini/gemini-utils.R +++ b/src/main/R/gemini/gemini-utils.R @@ -14,12 +14,18 @@ loadTypes <- data.table::data.table( "homelevel1(1.8|AC)", "homelevel2(7.2|AC)", "worklevel2(7.2|AC)", "publiclevel2(7.2|AC)", - "publicfc(50.0|DC)", "publicfc(150.0|DC)", "depotfc(150.0|DC)", - "publicxfc(250.0|DC)", "publicxfc(400.0|DC)", "depotfc(250.0|DC)", "depotfc(400.0|DC)"), + "publicfc(50.0|DC)", + "depotfc(150.0|DC)", + "publicfc(150.0|DC)", + "depotxfc(200.0|DC)", "depotxfc(300.0|DC)", "depotxfc(400.0|DC)", + "publicfc(200.0|DC)", "publicxfc(200.0|DC)", "publicxfc(300.0|DC)", "publicxfc(400.0|DC)"), loadType = c("Home-L1", "Home-L2", "Work-L2", "Public-L2", - "DCFC", "DCFC", "DCFC", + "DCFC", + "DCFC", + "DCFC", + "XFC", "XFC", "XFC", "XFC", "XFC", "XFC", "XFC")) nextTimePoisson <- function(rate) { diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 512636aba87..1fb475c5d5b 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,7 +1,7 @@ import pandas as pd import os -filename = '~/Data/GEMINI/2022Feb/BATCH1/events-raw/0.events.SC4a.csv.gz' +filename = '~/Data/GEMINI/2022Feb/BATCH1/events-raw/0.events.SC4b.csv.gz' full_filename = os.path.expanduser(filename) compression = None if filename.endswith(".gz"): @@ -16,5 +16,5 @@ "parkingZoneId", "pricingModel", "actType"] ] -data_filtered2.to_csv('~/Data/GEMINI/2022Feb/BATCH1/events/filtered.0.events.SC4a.csv.gz') +data_filtered2.to_csv('~/Data/GEMINI/2022Feb/BATCH1/events/filtered.0.events.SC4b.csv.gz') print("END") From 9a95de8482a9d16217b851a63709994542661924 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 18 Mar 2022 15:38:32 -0700 Subject: [PATCH 064/307] more timeout --- .../agentsim/infrastructure/parking/ParkingZoneSearch.scala | 4 +--- src/main/scala/beam/sim/BeamMobsim.scala | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index bed89fdc0f5..01dc6f2467e 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -294,19 +294,17 @@ object ParkingZoneSearch { private val startDistance: Double = distanceFunction(originUTM, destinationUTM) * 1.01 private val maxDistance: Double = startDistance * searchMaxDistanceToFociInPercent private var thisInnerDistance: Double = startDistance - private var counter = 0 override def lookupParkingZonesInNextSearchAreaUnlessThresholdReached( zoneQuadTree: QuadTree[GEO] ): Option[List[GEO]] = { - if (thisInnerDistance >= maxDistance || counter > 3) None + if (thisInnerDistance >= maxDistance) None else { val result = zoneQuadTree .getElliptical(originUTM.getX, originUTM.getY, destinationUTM.getX, destinationUTM.getY, thisInnerDistance) .asScala .toList thisInnerDistance = thisInnerDistance * expansionFactor - counter = counter + 1 Some(result) } } diff --git a/src/main/scala/beam/sim/BeamMobsim.scala b/src/main/scala/beam/sim/BeamMobsim.scala index f023de5c1a5..78ba25a6aeb 100755 --- a/src/main/scala/beam/sim/BeamMobsim.scala +++ b/src/main/scala/beam/sim/BeamMobsim.scala @@ -65,7 +65,7 @@ class BeamMobsim @Inject() ( ) extends Mobsim with LazyLogging with MetricsSupport { - private implicit val timeout: Timeout = Timeout(50000, TimeUnit.SECONDS) + private implicit val timeout: Timeout = Timeout(500000, TimeUnit.SECONDS) import beamServices._ val physsimConfig = beamConfig.beam.physsim From 8241328a3b20d82e55670d5d0e05b6848e66063c Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 20 Mar 2022 18:26:57 -0700 Subject: [PATCH 065/307] adding refuelRequiredThresholdOffsetInMeters --- src/main/resources/beam-template.conf | 1 + src/main/scala/beam/agentsim/agents/PersonAgent.scala | 2 +- src/main/scala/beam/sim/config/BeamConfig.scala | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index f1c98554893..ed97fcee53d 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -311,6 +311,7 @@ beam.agentsim.agents.vehicles.linkSocAcrossIterations = "boolean | false" beam.agentsim.agents.vehicles.meanRidehailVehicleStartingSOC = "double | 1.0" beam.agentsim.agents.vehicles.transitVehicleTypesByRouteFile = "" beam.agentsim.agents.vehicles.generateEmergencyHouseholdVehicleWhenPlansRequireIt = "boolean | false" +beam.agentsim.agents.vehicles.enroute.refuelRequiredThresholdOffsetInMeters = 0.0 # 0 miles beam.agentsim.agents.vehicles.enroute.noRefuelThresholdOffsetInMeters = 32186.9 # 20 miles beam.agentsim.agents.vehicles.enroute.noRefuelAtRemainingDistanceThresholdInMeters = 500 # 500 meters beam.agentsim.agents.vehicles.enroute.estimateOfMeanChargingDurationInSecond = 1800 # 80% of the battery charges in 30min diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 6097c3d9f57..ad2f18f1738 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1118,7 +1118,7 @@ class PersonAgent( val vehicleTrip = data.restOfCurrentTrip.takeWhile(_.beamVehicleId == firstLeg.beamVehicleId) val totalDistance: Double = vehicleTrip.map(_.beamLeg.travelPath.distanceInM).sum // Calculating distance to cross before enroute charging - val refuelRequiredThresholdInMeters = totalDistance + val refuelRequiredThresholdInMeters = totalDistance - enrouteConfig.refuelRequiredThresholdOffsetInMeters val noRefuelThresholdInMeters = totalDistance + enrouteConfig.noRefuelThresholdOffsetInMeters val originUtm = vehicle.spaceTime.loc val lastLeg = vehicleTrip.last.beamLeg diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index dc8126eb74d..e960b6882f6 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -1684,6 +1684,7 @@ object BeamConfig { estimateOfMeanChargingDurationInSecond: scala.Int, noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, noRefuelThresholdOffsetInMeters: scala.Double, + refuelRequiredThresholdOffsetInMeters: scala.Int, remainingDistanceWrtBatteryCapacityThreshold: scala.Int ) @@ -1702,6 +1703,10 @@ object BeamConfig { noRefuelThresholdOffsetInMeters = if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, + refuelRequiredThresholdOffsetInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdOffsetInMeters")) + c.getInt("refuelRequiredThresholdOffsetInMeters") + else 0, remainingDistanceWrtBatteryCapacityThreshold = if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") From 97962a4d573e9c06ac0af10feeb5fbcccd5de136 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 21 Mar 2022 09:23:38 -0700 Subject: [PATCH 066/307] adding offset to enroute total distance --- src/main/scala/beam/agentsim/agents/PersonAgent.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index ad2f18f1738..cb61bd11416 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1118,7 +1118,7 @@ class PersonAgent( val vehicleTrip = data.restOfCurrentTrip.takeWhile(_.beamVehicleId == firstLeg.beamVehicleId) val totalDistance: Double = vehicleTrip.map(_.beamLeg.travelPath.distanceInM).sum // Calculating distance to cross before enroute charging - val refuelRequiredThresholdInMeters = totalDistance - enrouteConfig.refuelRequiredThresholdOffsetInMeters + val refuelRequiredThresholdInMeters = totalDistance + enrouteConfig.refuelRequiredThresholdOffsetInMeters val noRefuelThresholdInMeters = totalDistance + enrouteConfig.noRefuelThresholdOffsetInMeters val originUtm = vehicle.spaceTime.loc val lastLeg = vehicleTrip.last.beamLeg From 9bb0b46a48441ccd44f61a96d906e951372fb5dc Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 29 Mar 2022 13:50:09 -0700 Subject: [PATCH 067/307] allow non-dominating transit paths --- src/main/resources/beam-template.conf | 2 + src/main/scala/beam/router/r5/R5Wrapper.scala | 33 +- .../scala/beam/sim/config/BeamConfig.scala | 5487 ++++++----------- 3 files changed, 1972 insertions(+), 3550 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index c7acb17f322..e39f611c653 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -893,6 +893,8 @@ beam.routing { bikeLaneScaleFactor = "double | 1.0" bikeLaneLinkIdsFilePath = "" linkRadiusMeters = "double | 10000.0" + transitAlternativeList = "OPTIMAL" + suboptimalMinutes = "int | 0" } gh { useAlternativeRoutes = "boolean | false" diff --git a/src/main/scala/beam/router/r5/R5Wrapper.scala b/src/main/scala/beam/router/r5/R5Wrapper.scala index c43457b5f25..8cfc9fa1e4c 100644 --- a/src/main/scala/beam/router/r5/R5Wrapper.scala +++ b/src/main/scala/beam/router/r5/R5Wrapper.scala @@ -17,7 +17,14 @@ import beam.sim.metrics.{Metrics, MetricsSupport} import com.conveyal.r5.analyst.fare.SimpleInRoutingFareCalculator import com.conveyal.r5.api.ProfileResponse import com.conveyal.r5.api.util._ -import com.conveyal.r5.profile.{McRaptorSuboptimalPathProfileRouter, ProfileRequest, StreetMode, StreetPath} +import com.conveyal.r5.profile.{ + DominatingList, + McRaptorSuboptimalPathProfileRouter, + ProfileRequest, + StreetMode, + StreetPath, + SuboptimalDominatingList +} import com.conveyal.r5.streets._ import com.conveyal.r5.transit.TransitLayer import com.typesafe.scalalogging.StrictLogging @@ -28,6 +35,7 @@ import org.matsim.vehicles.Vehicle import java.time.ZonedDateTime import java.time.temporal.ChronoUnit import java.util +import java.util.function.IntFunction import java.util.{Collections, Optional} import scala.collection.JavaConverters._ import scala.collection.mutable @@ -222,7 +230,7 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo profileRequest.date = dates.localBaseDate // Doesn't calculate any fares, is just a no-op placeholder profileRequest.inRoutingFareCalculator = new SimpleInRoutingFareCalculator - profileRequest.suboptimalMinutes = 0 + profileRequest.suboptimalMinutes = beamConfig.beam.routing.r5.suboptimalMinutes profileRequest } @@ -618,6 +626,20 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo } } + val departureTimeToDominatingList: IntFunction[DominatingList] = (departureTime: Int) => + beamConfig.beam.routing.r5.transitAlternativeList.toLowerCase match { + case "suboptimal" => + new SuboptimalDominatingList( + profileRequest.suboptimalMinutes + ) + case _ => + new BeamDominatingList( + profileRequest.inRoutingFareCalculator, + Integer.MAX_VALUE, + departureTime + profileRequest.maxTripDurationMinutes * 60 + ) + } + val transitPaths = latency("getpath-transit-time", Metrics.VerboseLevel) { profileRequest.fromTime = request.departureTime profileRequest.toTime = @@ -627,12 +649,7 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo profileRequest, accessStopsByMode.mapValues(_.stops).asJava, egressStopsByMode.mapValues(_.stops).asJava, - (departureTime: Int) => - new BeamDominatingList( - profileRequest.inRoutingFareCalculator, - Integer.MAX_VALUE, - departureTime + profileRequest.maxTripDurationMinutes * 60 - ), + departureTimeToDominatingList, null ) Try(router.getPaths.asScala).getOrElse(Nil) // Catch IllegalStateException in R5.StatsCalculator diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 57f17ef5f07..0396aa24e61 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,5105 +3,3508 @@ package beam.sim.config case class BeamConfig( - beam: BeamConfig.Beam, - matsim: BeamConfig.Matsim + beam : BeamConfig.Beam, + matsim : BeamConfig.Matsim ) - object BeamConfig { - case class Beam( - actorSystemName: java.lang.String, - agentsim: BeamConfig.Beam.Agentsim, - calibration: BeamConfig.Beam.Calibration, - cluster: BeamConfig.Beam.Cluster, - debug: BeamConfig.Beam.Debug, - exchange: BeamConfig.Beam.Exchange, - experimental: BeamConfig.Beam.Experimental, - input: BeamConfig.Beam.Input, - inputDirectory: java.lang.String, - logger: BeamConfig.Beam.Logger, - metrics: BeamConfig.Beam.Metrics, - output: BeamConfig.Beam.Output, - outputs: BeamConfig.Beam.Outputs, - physsim: BeamConfig.Beam.Physsim, - replanning: BeamConfig.Beam.Replanning, - router: BeamConfig.Beam.Router, - routing: BeamConfig.Beam.Routing, - sim: BeamConfig.Beam.Sim, - spatial: BeamConfig.Beam.Spatial, - urbansim: BeamConfig.Beam.Urbansim, - useLocalWorker: scala.Boolean, - warmStart: BeamConfig.Beam.WarmStart + actorSystemName : java.lang.String, + agentsim : BeamConfig.Beam.Agentsim, + calibration : BeamConfig.Beam.Calibration, + cluster : BeamConfig.Beam.Cluster, + debug : BeamConfig.Beam.Debug, + exchange : BeamConfig.Beam.Exchange, + experimental : BeamConfig.Beam.Experimental, + input : BeamConfig.Beam.Input, + inputDirectory : java.lang.String, + logger : BeamConfig.Beam.Logger, + metrics : BeamConfig.Beam.Metrics, + output : BeamConfig.Beam.Output, + outputs : BeamConfig.Beam.Outputs, + physsim : BeamConfig.Beam.Physsim, + replanning : BeamConfig.Beam.Replanning, + router : BeamConfig.Beam.Router, + routing : BeamConfig.Beam.Routing, + sim : BeamConfig.Beam.Sim, + spatial : BeamConfig.Beam.Spatial, + urbansim : BeamConfig.Beam.Urbansim, + useLocalWorker : scala.Boolean, + warmStart : BeamConfig.Beam.WarmStart ) - object Beam { - case class Agentsim( - agentSampleSizeAsFractionOfPopulation: scala.Double, - agents: BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime: java.lang.String, - firstIteration: scala.Int, - fractionOfPlansWithSingleActivity: scala.Double, - h3taz: BeamConfig.Beam.Agentsim.H3taz, - lastIteration: scala.Int, - populationAdjustment: java.lang.String, - scenarios: BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow: scala.Int, - simulationName: java.lang.String, - taz: BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters: scala.Int, - thresholdForWalkingInMeters: scala.Int, - timeBinSize: scala.Int, - toll: BeamConfig.Beam.Agentsim.Toll, - tuning: BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation : scala.Double, + agents : BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime : java.lang.String, + firstIteration : scala.Int, + fractionOfPlansWithSingleActivity : scala.Double, + h3taz : BeamConfig.Beam.Agentsim.H3taz, + lastIteration : scala.Int, + populationAdjustment : java.lang.String, + scenarios : BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow : scala.Int, + simulationName : java.lang.String, + taz : BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters : scala.Int, + thresholdForWalkingInMeters : scala.Int, + timeBinSize : scala.Int, + toll : BeamConfig.Beam.Agentsim.Toll, + tuning : BeamConfig.Beam.Agentsim.Tuning ) - object Agentsim { - case class Agents( - activities: BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType: java.lang.String, - freight: BeamConfig.Beam.Agentsim.Agents.Freight, - households: BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking: BeamConfig.Beam.Agentsim.Agents.Parking, - plans: BeamConfig.Beam.Agentsim.Agents.Plans, - population: BeamConfig.Beam.Agentsim.Agents.Population, - ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles + activities : BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType : java.lang.String, + freight : BeamConfig.Beam.Agentsim.Agents.Freight, + households : BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking : BeamConfig.Beam.Agentsim.Agents.Parking, + plans : BeamConfig.Beam.Agentsim.Agents.Plans, + population : BeamConfig.Beam.Agentsim.Agents.Population, + ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles ) - object Agents { - case class Activities( - activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] ) - object Activities { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = - if (c.hasPathOrNull("activityTypeToFixedDurationMap")) - scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) - else None + activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None ) } } - + case class Freight( - carrierParkingFilePath: scala.Option[java.lang.String], - carriersFilePath: java.lang.String, - convertWgs2Utm: scala.Boolean, - enabled: scala.Boolean, - generateFixedActivitiesDurations: scala.Boolean, - name: java.lang.String, - plansFilePath: java.lang.String, - reader: java.lang.String, - replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath: java.lang.String + carrierParkingFilePath : scala.Option[java.lang.String], + carriersFilePath : java.lang.String, + convertWgs2Utm : scala.Boolean, + enabled : scala.Boolean, + generateFixedActivitiesDurations : scala.Boolean, + name : java.lang.String, + plansFilePath : java.lang.String, + reader : java.lang.String, + replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath : java.lang.String ) - object Freight { - case class Replanning( - departureTime: scala.Int, - disableAfterIteration: scala.Int, - strategy: java.lang.String + departureTime : scala.Int, + disableAfterIteration : scala.Int, + strategy : java.lang.String ) - object Replanning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = - if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = - if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") - else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = - c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = - if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") - else "/test/input/beamville/freight/payload-plans.csv", - reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - toursFilePath = - if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") - else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", + reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath: java.lang.String, - inputHouseholdAttributesFilePath: java.lang.String + inputFilePath : java.lang.String, + inputHouseholdAttributesFilePath : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = - if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") - else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = - if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") - else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime: scala.Double, - highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts: scala.Int, - minimumValueOfTime: scala.Double, - modeChoiceClass: java.lang.String, - modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT: scala.Boolean, - overrideAutomationLevel: scala.Int, - poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] + defaultValueOfTime : scala.Double, + highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts : scala.Int, + minimumValueOfTime : scala.Double, + modeChoiceClass : java.lang.String, + modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT : scala.Boolean, + overrideAutomationLevel : scala.Int, + poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] ) - object ModalBehaviors { - case class HighTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) - object HighTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class Lccm( - filePath: java.lang.String + filePath : java.lang.String ) - object Lccm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) - object LowTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class ModeVotMultiplier( - CAV: scala.Double, - bike: scala.Double, - drive: scala.Double, - rideHail: scala.Double, - rideHailPooled: scala.Double, - rideHailTransit: scala.Double, - transit: scala.Double, - waiting: scala.Double, - walk: scala.Double + CAV : scala.Double, + bike : scala.Double, + drive : scala.Double, + rideHail : scala.Double, + rideHailPooled : scala.Double, + rideHailTransit : scala.Double, + transit : scala.Double, + waiting : scala.Double, + walk : scala.Double ) - object ModeVotMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor: scala.Double + params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor : scala.Double ) - object MulitnomialLogit { - case class Params( - bike_intercept: scala.Double, - bike_transit_intercept: scala.Double, - car_intercept: scala.Double, - cav_intercept: scala.Double, - drive_transit_intercept: scala.Double, - ride_hail_intercept: scala.Double, - ride_hail_pooled_intercept: scala.Double, - ride_hail_transit_intercept: scala.Double, - transfer: scala.Double, - transit_crowding: scala.Double, - transit_crowding_VOT_multiplier: scala.Double, - transit_crowding_VOT_threshold: scala.Double, - transit_crowding_percentile: scala.Double, - walk_intercept: scala.Double, - walk_transit_intercept: scala.Double + bike_intercept : scala.Double, + bike_transit_intercept : scala.Double, + car_intercept : scala.Double, + cav_intercept : scala.Double, + drive_transit_intercept : scala.Double, + ride_hail_intercept : scala.Double, + ride_hail_pooled_intercept : scala.Double, + ride_hail_transit_intercept : scala.Double, + transfer : scala.Double, + transit_crowding : scala.Double, + transit_crowding_VOT_multiplier : scala.Double, + transit_crowding_VOT_threshold : scala.Double, + transit_crowding_percentile : scala.Double, + walk_intercept : scala.Double, + walk_transit_intercept : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = - if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = - if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = - if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = - if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") - else 0.0, - ride_hail_transit_intercept = - if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") - else 0.0, - transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = - if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) - c.getDouble("transit_crowding_VOT_multiplier") - else 0.0, - transit_crowding_VOT_threshold = - if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") - else 0.5, - transit_crowding_percentile = - if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") - else 90.0, - walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = - if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, + ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, + transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, + transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, + transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, + walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ), - utility_scale_factor = - if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), + utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object PoolingMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = - if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") - ), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - if (c.hasPathOrNull("lccm")) c.getConfig("lccm") - else com.typesafe.config.ConfigFactory.parseString("lccm{}") - ), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") - ), - maximumNumberOfReplanningAttempts = - if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") - else 3, - minimumValueOfTime = - if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = - if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") - else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") - else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - overrideAutomationForVOTT = - c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = - if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") - else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") - ), - transitVehicleTypeVOTMultipliers = - if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) - scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) - else None - ) - } - } - + defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), + maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, + minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), + transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None + ) + } + } + case class ModeIncentive( - filePath: java.lang.String + filePath : java.lang.String ) - object ModeIncentive { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - maxSearchRadius: scala.Double, - minSearchRadius: scala.Double, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - rangeAnxietyBuffer: scala.Double, - searchMaxDistanceRelativeToEllipseFoci: scala.Double + maxSearchRadius : scala.Double, + minSearchRadius : scala.Double, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + rangeAnxietyBuffer : scala.Double, + searchMaxDistanceRelativeToEllipseFoci : scala.Double ) - object Parking { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - distanceMultiplier: scala.Double, - enrouteDetourMultiplier: scala.Double, - homeActivityPrefersResidentialParkingMultiplier: scala.Double, - parkingPriceMultiplier: scala.Double, - rangeAnxietyMultiplier: scala.Double + distanceMultiplier : scala.Double, + enrouteDetourMultiplier : scala.Double, + homeActivityPrefersResidentialParkingMultiplier : scala.Double, + parkingPriceMultiplier : scala.Double, + rangeAnxietyMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = - if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = - if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = - if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) - c.getDouble("homeActivityPrefersResidentialParkingMultiplier") - else 1.0, - parkingPriceMultiplier = - if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = - if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, + parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - rangeAnxietyBuffer = - if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = - if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) - c.getDouble("searchMaxDistanceRelativeToEllipseFoci") - else 4.0 + maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath: java.lang.String, - inputPlansFilePath: java.lang.String, - merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath : java.lang.String, + inputPlansFilePath : java.lang.String, + merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) - object Plans { - case class Merge( - fraction: scala.Double + fraction : scala.Double ) - object Merge { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = - if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") - else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = - if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") - else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - if (c.hasPathOrNull("merge")) c.getConfig("merge") - else com.typesafe.config.ConfigFactory.parseString("merge{}") - ) + inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) ) } } - + case class Population( - industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling: scala.Boolean + industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling : scala.Boolean ) - object Population { - case class IndustryRemovalProbabilty( - enabled: scala.Boolean, - inputFilePath: java.lang.String, - removalStrategy: java.lang.String + enabled : scala.Boolean, + inputFilePath : java.lang.String, + removalStrategy : java.lang.String ) - object IndustryRemovalProbabilty { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = - if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") - else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") - ), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath: java.lang.String + filePath : java.lang.String ) - object PtFare { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost: scala.Double, - defaultCostPerMile: scala.Double, - defaultCostPerMinute: scala.Double, - human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations: scala.Boolean, - name: java.lang.String, - pooledBaseCost: scala.Double, - pooledCostPerMile: scala.Double, - pooledCostPerMinute: scala.Double, - rangeBufferForDispatchInMeters: scala.Int, - repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost : scala.Double, + defaultCostPerMile : scala.Double, + defaultCostPerMinute : scala.Double, + human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations : scala.Boolean, + name : java.lang.String, + pooledBaseCost : scala.Double, + pooledCostPerMile : scala.Double, + pooledCostPerMinute : scala.Double, + rangeBufferForDispatchInMeters : scala.Int, + repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) - object RideHail { - case class AllocationManager( - alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm: java.lang.String, - maxExcessRideTime: scala.Double, - maxWaitingTimeInSec: scala.Int, - name: java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, - repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds: scala.Int + alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm : java.lang.String, + maxExcessRideTime : scala.Double, + maxWaitingTimeInSec : scala.Int, + name : java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, + repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds : scala.Int ) - object AllocationManager { - case class AlonsoMora( - maxRequestsPerVehicle: scala.Int + maxRequestsPerVehicle : scala.Int ) - object AlonsoMora { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = - if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, - demandWeight: scala.Double, - distanceWeight: scala.Double, - keepMaxTopNScores: scala.Int, - minDemandPercentageInRadius: scala.Double, - minScoreThresholdForRepositioning: scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, - percentageOfVehiclesToReposition: scala.Double, - produceDebugImages: scala.Boolean, - repositionCircleRadiusInMeters: scala.Double, - repositioningMethod: java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, - waitingTimeWeight: scala.Double + allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, + demandWeight : scala.Double, + distanceWeight : scala.Double, + keepMaxTopNScores : scala.Int, + minDemandPercentageInRadius : scala.Double, + minScoreThresholdForRepositioning : scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, + percentageOfVehiclesToReposition : scala.Double, + produceDebugImages : scala.Boolean, + repositionCircleRadiusInMeters : scala.Double, + repositioningMethod : java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, + waitingTimeWeight : scala.Double ) - object RepositionLowWaitingTimes { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( - "allowIncreasingRadiusIfDemandInRadiusLow" - ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = - if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") - else 0.1, - minScoreThresholdForRepositioning = - if (c.hasPathOrNull("minScoreThresholdForRepositioning")) - c.getDouble("minScoreThresholdForRepositioning") - else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = - if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) - c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") - else 1, - percentageOfVehiclesToReposition = - if (c.hasPathOrNull("percentageOfVehiclesToReposition")) - c.getDouble("percentageOfVehiclesToReposition") - else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = - if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") - else 3000, - repositioningMethod = - if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = - if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) - c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") - else 1200, - waitingTimeWeight = - if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, + minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, + percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, + repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, + waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") - else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") - ), - matchingAlgorithm = - if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") - else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = - if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = - if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) - c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") - else 1, - repositionLowWaitingTimes = - BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") - else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") - ), - requestBufferTimeoutInSeconds = - if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), + matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, + repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), + requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int, - valueOfTime: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int, + valueOfTime : scala.Int ) - object Cav { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 16090, - valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, + valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) - object Charging { - case class VehicleChargingManager( - defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager ) - object VehicleChargingManager { - case class DefaultVehicleChargingManager( - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit ) - object DefaultVehicleChargingManager { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - chargingTimeMultiplier: scala.Double, - drivingTimeMultiplier: scala.Double, - insufficientRangeMultiplier: scala.Double, - queueingTimeMultiplier: scala.Double + chargingTimeMultiplier : scala.Double, + drivingTimeMultiplier : scala.Double, + insufficientRangeMultiplier : scala.Double, + queueingTimeMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - chargingTimeMultiplier = - if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") - else -0.01666667, - drivingTimeMultiplier = - if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") - else -0.01666667, - insufficientRangeMultiplier = - if (c.hasPathOrNull("insufficientRangeMultiplier")) - c.getDouble("insufficientRangeMultiplier") - else -60.0, - queueingTimeMultiplier = - if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") - else -0.01666667 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( + chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, + drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, + insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, + queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - params = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - mulitnomialLogit = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - if (c.hasPathOrNull("defaultVehicleChargingManager")) - c.getConfig("defaultVehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") - ) + defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") - ) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) ) } } - + case class Human( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int ) - object Human { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 ) } } - + case class Initialization( - filePath: java.lang.String, - initType: java.lang.String, - parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath : java.lang.String, + initType : java.lang.String, + parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) - object Initialization { - case class Parking( - filePath: java.lang.String + filePath : java.lang.String ) - object Parking { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet: scala.Double, - initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId: java.lang.String, - vehicleTypePrefix: java.lang.String + fractionOfInitialVehicleFleet : scala.Double, + initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId : java.lang.String, + vehicleTypePrefix : java.lang.String ) - object Procedural { - case class InitialLocation( - home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name: java.lang.String + home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name : java.lang.String ) - object InitialLocation { - case class Home( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object Home { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - if (c.hasPathOrNull("home")) c.getConfig("home") - else com.typesafe.config.ConfigFactory.parseString("home{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") - else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") - ), - vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = - if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - if (c.hasPathOrNull("procedural")) c.getConfig("procedural") - else com.typesafe.config.ConfigFactory.parseString("procedural{}") - ) + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) ) } } - + case class IterationStats( - timeBinSizeInSec: scala.Double + timeBinSizeInSec : scala.Double ) - object IterationStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name: java.lang.String, - timeout: scala.Int + demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name : java.lang.String, + timeout : scala.Int ) - object RepositioningManager { - case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider: scala.Double, - horizon: scala.Int, - numberOfClustersForDemand: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDemandForCAVs: scala.Double + fractionOfClosestClustersToConsider : scala.Double, + horizon : scala.Int, + numberOfClustersForDemand : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDemandForCAVs : scala.Double ) - object DemandFollowingRepositioningManager { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = - if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) - c.getDouble("fractionOfClosestClustersToConsider") - else 0.2, - horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = - if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 1, - sensitivityOfRepositioningToDemandForCAVs = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) - c.getDouble("sensitivityOfRepositioningToDemandForCAVs") - else 1 + fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, + horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, + sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDistance: scala.Double + predictionHorizon : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDistance : scala.Double ) - object InverseSquareDistanceRepositioningFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 0.4, - sensitivityOfRepositioningToDistance = - if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) - c.getDouble("sensitivityOfRepositioningToDistance") - else 0.9 + predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, + sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - if (c.hasPathOrNull("demandFollowingRepositioningManager")) - c.getConfig("demandFollowingRepositioningManager") - else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") - ), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager - .InverseSquareDistanceRepositioningFactor( - if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) - c.getConfig("inverseSquareDistanceRepositioningFactor") - else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object RideHailManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel: scala.Double, - numberOfCategories: scala.Int, - priceAdjustmentStrategy: java.lang.String, - surgeLevelAdaptionStep: scala.Double + minimumSurgeLevel : scala.Double, + numberOfCategories : scala.Int, + priceAdjustmentStrategy : java.lang.String, + surgeLevelAdaptionStep : scala.Double ) - object SurgePricing { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = - if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") - else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = - if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") - else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") - ), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - if (c.hasPathOrNull("cav")) c.getConfig("cav") - else com.typesafe.config.ConfigFactory.parseString("cav{}") - ), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - if (c.hasPathOrNull("charging")) c.getConfig("charging") - else com.typesafe.config.ConfigFactory.parseString("charging{}") - ), - defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = - if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = - if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - if (c.hasPathOrNull("human")) c.getConfig("human") - else com.typesafe.config.ConfigFactory.parseString("human{}") - ), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - if (c.hasPathOrNull("initialization")) c.getConfig("initialization") - else com.typesafe.config.ConfigFactory.parseString("initialization{}") - ), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") - else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") - ), - linkFleetStateAcrossIterations = - c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = - if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - rangeBufferForDispatchInMeters = - if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") - else 10000, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") - else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") - ), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") - else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") - ), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") - else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") - ) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), + defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), + linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) + ) + } + } + case class RideHailTransit( - modesToConsider: java.lang.String + modesToConsider : java.lang.String ) - object RideHailTransit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) - object TripBehaviors { - case class CarUsage( - minDistanceToTrainStop: scala.Double + minDistanceToTrainStop : scala.Double ) - object CarUsage { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = - if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path: java.lang.String, - additional_trip_utility: scala.Double, - destination_nest_scale_factor: scala.Double, - generate_secondary_activities: scala.Boolean, - intercept_file_path: java.lang.String, - max_destination_choice_set_size: scala.Int, - max_destination_distance_meters: scala.Double, - mode_nest_scale_factor: scala.Double, - trip_nest_scale_factor: scala.Double + activity_file_path : java.lang.String, + additional_trip_utility : scala.Double, + destination_nest_scale_factor : scala.Double, + generate_secondary_activities : scala.Boolean, + intercept_file_path : java.lang.String, + max_destination_choice_set_size : scala.Int, + max_destination_distance_meters : scala.Double, + mode_nest_scale_factor : scala.Double, + trip_nest_scale_factor : scala.Double ) - object MulitnomialLogit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = - if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = - if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = - if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") - else 1.0, - generate_secondary_activities = - c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = - if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = - if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") - else 20, - max_destination_distance_meters = - if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") - else 32000, - mode_nest_scale_factor = - if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = - if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, + generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, + max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, + mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") - else com.typesafe.config.ConfigFactory.parseString("carUsage{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) ) } } - + case class Vehicles( - downsamplingMethod: java.lang.String, - dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet: scala.Double, - fractionOfPeopleWithBicycle: scala.Double, - fuelTypesFilePath: java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, - linkSocAcrossIterations: scala.Boolean, - linkToGradePercentFilePath: java.lang.String, - meanPrivateVehicleStartingSOC: scala.Double, - meanRidehailVehicleStartingSOC: scala.Double, - sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile: java.lang.String, - vehicleAdjustmentMethod: java.lang.String, - vehicleTypesFilePath: java.lang.String, - vehiclesFilePath: java.lang.String + downsamplingMethod : java.lang.String, + dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet : scala.Double, + fractionOfPeopleWithBicycle : scala.Double, + fuelTypesFilePath : java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, + linkSocAcrossIterations : scala.Boolean, + linkToGradePercentFilePath : java.lang.String, + meanPrivateVehicleStartingSOC : scala.Double, + meanRidehailVehicleStartingSOC : scala.Double, + sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile : java.lang.String, + vehicleAdjustmentMethod : java.lang.String, + vehicleTypesFilePath : java.lang.String, + vehiclesFilePath : java.lang.String ) - object Vehicles { - case class DummySharedBike( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedBike { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedCar { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond: scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, - noRefuelThresholdOffsetInMeters: scala.Double, - remainingDistanceWrtBatteryCapacityThreshold: scala.Int + estimateOfMeanChargingDurationInSecond : scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, + noRefuelThresholdOffsetInMeters : scala.Double, + remainingDistanceWrtBatteryCapacityThreshold : scala.Int ) - object Enroute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = - if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) - c.getInt("estimateOfMeanChargingDurationInSecond") - else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = - if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) - c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") - else 500, - noRefuelThresholdOffsetInMeters = - if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") - else 32186.9, - remainingDistanceWrtBatteryCapacityThreshold = - if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) - c.getInt("remainingDistanceWrtBatteryCapacityThreshold") - else 2 + estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, + noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, + remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving - ], - fixed_non_reserving_fleet_by_taz: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz - ], - inexhaustible_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving - ], - managerType: java.lang.String, - name: java.lang.String, - parkingFilePath: java.lang.String, - reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], + fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], + inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], + managerType : java.lang.String, + name : java.lang.String, + parkingFilePath : java.lang.String, + reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) - object SharedFleets$Elm { - case class FixedNonReserving( - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String ) - object FixedNonReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize: scala.Int, - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String, - vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] + fleetSize : scala.Int, + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String, + vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] ) - object FixedNonReservingFleetByTaz { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = - if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) - else None + fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object InexhaustibleReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm - ], - name: java.lang.String, - repositionTimeBin: scala.Int, - statTimeBin: scala.Int + min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], + name : java.lang.String, + repositionTimeBin : scala.Int, + statTimeBin : scala.Int ) - object Reposition { - case class MinAvailabilityUndersupplyAlgorithm( - matchLimit: scala.Int + matchLimit : scala.Int ) - object MinAvailabilityUndersupplyAlgorithm { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm( - matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( + matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = - if (c.hasPathOrNull("min-availability-undersupply-algorithm")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) - ) - else None, - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = - if (c.hasPathOrNull("fixed-non-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReserving(c.getConfig("fixed-non-reserving")) - ) - else None, - fixed_non_reserving_fleet_by_taz = - if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) - ) - else None, - inexhaustible_reserving = - if (c.hasPathOrNull("inexhaustible-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) - ) - else None, - managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = - if (c.hasPathOrNull("reposition")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) - ) - else None + fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, + fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, + inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, + managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = - if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") - else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") - else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") - ), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") - else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") - ), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - if (c.hasPathOrNull("enroute")) c.getConfig("enroute") - else com.typesafe.config.ConfigFactory.parseString("enroute{}") - ), - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 1.0, - fractionOfPeopleWithBicycle = - if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = - if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") - else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( - "generateEmergencyHouseholdVehicleWhenPlansRequireIt" - ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = - c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = - if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = - if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") - else 1.0, - meanRidehailVehicleStartingSOC = - if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") - else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = - if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") - else "", - vehicleAdjustmentMethod = - if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = - if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") - else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = - if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") - else "/test/input/beamville/vehicles.csv" - ) - } - - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, + fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, + meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", + vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" + ) + } + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Agentsim.Agents.Vehicles - .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities( - if (c.hasPathOrNull("activities")) c.getConfig("activities") - else com.typesafe.config.ConfigFactory.parseString("activities{}") - ), - bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight( - if (c.hasPathOrNull("freight")) c.getConfig("freight") - else com.typesafe.config.ConfigFactory.parseString("freight{}") - ), - households = BeamConfig.Beam.Agentsim.Agents.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") - else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") - ), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") - else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") - ), - parking = BeamConfig.Beam.Agentsim.Agents.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - plans = BeamConfig.Beam.Agentsim.Agents.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - population = BeamConfig.Beam.Agentsim.Agents.Population( - if (c.hasPathOrNull("population")) c.getConfig("population") - else com.typesafe.config.ConfigFactory.parseString("population{}") - ), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( - if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") - else com.typesafe.config.ConfigFactory.parseString("ptFare{}") - ), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( - if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") - else com.typesafe.config.ConfigFactory.parseString("rideHail{}") - ), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") - else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") - ), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") - else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") - ), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), + bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), + households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), + parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor: scala.Double, - chargingPointCountScalingFactor: scala.Double, - chargingPointFilePath: java.lang.String, - helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds: scala.Int + chargingPointCostScalingFactor : scala.Double, + chargingPointCountScalingFactor : scala.Double, + chargingPointFilePath : java.lang.String, + helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds : scala.Int ) - object ChargingNetworkManager { - case class Helics( - bufferSize: scala.Int, - connectionEnabled: scala.Boolean, - coreInitString: java.lang.String, - coreType: java.lang.String, - dataInStreamPoint: java.lang.String, - dataOutStreamPoint: java.lang.String, - federateName: java.lang.String, - feedbackEnabled: scala.Boolean, - intLogLevel: scala.Int, - timeDeltaProperty: scala.Double + bufferSize : scala.Int, + connectionEnabled : scala.Boolean, + coreInitString : java.lang.String, + coreType : java.lang.String, + dataInStreamPoint : java.lang.String, + dataOutStreamPoint : java.lang.String, + federateName : java.lang.String, + feedbackEnabled : scala.Boolean, + intLogLevel : scala.Int, + timeDeltaProperty : scala.Double ) - object Helics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = - if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") - else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = - if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") - else "GridFed/PhysicalBounds", - dataOutStreamPoint = - if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", + dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled: scala.Boolean, - expansionFactor_charge_activity: scala.Double, - expansionFactor_home_activity: scala.Double, - expansionFactor_init_activity: scala.Double, - expansionFactor_wherever_activity: scala.Double, - expansionFactor_work_activity: scala.Double + enabled : scala.Boolean, + expansionFactor_charge_activity : scala.Double, + expansionFactor_home_activity : scala.Double, + expansionFactor_init_activity : scala.Double, + expansionFactor_wherever_activity : scala.Double, + expansionFactor_work_activity : scala.Double ) - object ScaleUp { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = - if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") - else 1.0, - expansionFactor_home_activity = - if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") - else 1.0, - expansionFactor_init_activity = - if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") - else 1.0, - expansionFactor_wherever_activity = - if (c.hasPathOrNull("expansionFactor_wherever_activity")) - c.getDouble("expansionFactor_wherever_activity") - else 1.0, - expansionFactor_work_activity = - if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") - else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, + expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, + expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, + expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, + expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = - if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") - else 1.0, - chargingPointCountScalingFactor = - if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") - else 1.0, - chargingPointFilePath = - if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - if (c.hasPathOrNull("helics")) c.getConfig("helics") - else com.typesafe.config.ConfigFactory.parseString("helics{}") - ), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") - else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") - ), - timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, + chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, + chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), + timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution: scala.Int, - upperBoundResolution: scala.Int + lowerBoundResolution : scala.Int, + upperBoundResolution : scala.Int ) - object H3taz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile: java.lang.String + frequencyAdjustmentFile : java.lang.String ) - object Scenarios { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = - if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") - else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay: scala.Int, - interval: scala.Int + initialDelay : scala.Int, + interval : scala.Int ) - object ScheduleMonitorTask { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath: java.lang.String, - parkingCostScalingFactor: scala.Double, - parkingFilePath: java.lang.String, - parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor: scala.Double + filePath : java.lang.String, + parkingCostScalingFactor : scala.Double, + parkingFilePath : java.lang.String, + parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor : scala.Double ) - object Taz { - case class ParkingManager( - displayPerformanceTimings: scala.Boolean, - level: java.lang.String, - method: java.lang.String, - parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings : scala.Boolean, + level : java.lang.String, + method : java.lang.String, + parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) - object ParkingManager { - case class Parallel( - numberOfClusters: scala.Int + numberOfClusters : scala.Int ) - object Parallel { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - level = if (c.hasPathOrNull("level")) c.getString("level") else "TAZ", - method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - if (c.hasPathOrNull("parallel")) c.getConfig("parallel") - else com.typesafe.config.ConfigFactory.parseString("parallel{}") - ) + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + level = if(c.hasPathOrNull("level")) c.getString("level") else "TAZ", + method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = - if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( - if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") - else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") - ), - parkingStallCountScalingFactor = - if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") - else 1.0 + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), + parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 ) } } - + case class Toll( - filePath: java.lang.String + filePath : java.lang.String ) - object Toll { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules: scala.Double, - rideHailPrice: scala.Double, - tollPrice: scala.Double, - transitCapacity: scala.Option[scala.Double], - transitPrice: scala.Double + fuelCapacityInJoules : scala.Double, + rideHailPrice : scala.Double, + tollPrice : scala.Double, + transitCapacity : scala.Option[scala.Double], + transitPrice : scala.Double ) - object Tuning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = - if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = - if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) - c.getDouble("agentSampleSizeAsFractionOfPopulation") - else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents( - if (c.hasPathOrNull("agents")) c.getConfig("agents") - else com.typesafe.config.ConfigFactory.parseString("agents{}") - ), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( - if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") - else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") - ), - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = - if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") - else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz( - if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") - else com.typesafe.config.ConfigFactory.parseString("h3taz{}") - ), - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = - if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - scenarios = BeamConfig.Beam.Agentsim.Scenarios( - if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") - else com.typesafe.config.ConfigFactory.parseString("scenarios{}") - ), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") - else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") - ), - schedulerParallelismWindow = - if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - taz = BeamConfig.Beam.Agentsim.Taz( - if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") - ), - thresholdForMakingParkingChoiceInMeters = - if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) - c.getInt("thresholdForMakingParkingChoiceInMeters") - else 100, - thresholdForWalkingInMeters = - if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll( - if (c.hasPathOrNull("toll")) c.getConfig("toll") - else com.typesafe.config.ConfigFactory.parseString("toll{}") - ), - tuning = BeamConfig.Beam.Agentsim.Tuning( - if (c.hasPathOrNull("tuning")) c.getConfig("tuning") - else com.typesafe.config.ConfigFactory.parseString("tuning{}") - ) + agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), + schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), + thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, + thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), + tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) ) } } - + case class Calibration( - counts: BeamConfig.Beam.Calibration.Counts, - google: BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio: scala.Double, - mode: BeamConfig.Beam.Calibration.Mode, - objectiveFunction: java.lang.String, - roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, - studyArea: BeamConfig.Beam.Calibration.StudyArea + counts : BeamConfig.Beam.Calibration.Counts, + google : BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio : scala.Double, + mode : BeamConfig.Beam.Calibration.Mode, + objectiveFunction : java.lang.String, + roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, + studyArea : BeamConfig.Beam.Calibration.StudyArea ) - object Calibration { - case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Int, - inputCountsFile: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Int, + inputCountsFile : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes ) - object Google { - case class TravelTimes( - enable: scala.Boolean, - iterationInterval: scala.Int, - minDistanceInMeters: scala.Double, - numDataPointsOver24Hours: scala.Int, - offPeakEnabled: scala.Boolean, - queryDate: java.lang.String, - tolls: scala.Boolean + enable : scala.Boolean, + iterationInterval : scala.Int, + minDistanceInMeters : scala.Double, + numDataPointsOver24Hours : scala.Int, + offPeakEnabled : scala.Boolean, + queryDate : java.lang.String, + tolls : scala.Boolean ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = - if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = - if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class Mode( - benchmarkFilePath: java.lang.String + benchmarkFilePath : java.lang.String ) - object Mode { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) - object RoadNetwork { - case class TravelTimes( - zoneBoundariesFilePath: java.lang.String, - zoneODTravelTimesFilePath: java.lang.String + zoneBoundariesFilePath : java.lang.String, + zoneODTravelTimesFilePath : java.lang.String ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = - if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = - if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class StudyArea( - enabled: scala.Boolean, - lat: scala.Double, - lon: scala.Double, - radius: scala.Double + enabled : scala.Boolean, + lat : scala.Double, + lon : scala.Double, + radius : scala.Double ) - object StudyArea { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - google = BeamConfig.Beam.Calibration.Google( - if (c.hasPathOrNull("google")) c.getConfig("google") - else com.typesafe.config.ConfigFactory.parseString("google{}") - ), - meanToCountsWeightRatio = - if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode( - if (c.hasPathOrNull("mode")) c.getConfig("mode") - else com.typesafe.config.ConfigFactory.parseString("mode{}") - ), - objectiveFunction = - if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") - else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( - if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") - else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") - ), - studyArea = BeamConfig.Beam.Calibration.StudyArea( - if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") - else com.typesafe.config.ConfigFactory.parseString("studyArea{}") - ) + counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), + meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), + objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), + studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) ) } } - + case class Cluster( - clusterType: scala.Option[java.lang.String], - enabled: scala.Boolean + clusterType : scala.Option[java.lang.String], + enabled : scala.Boolean ) - object Cluster { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor: BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval: scala.Int, - clearRoutedOutstandingWorkEnabled: scala.Boolean, - debugActorTimerIntervalInSec: scala.Int, - debugEnabled: scala.Boolean, - memoryConsumptionDisplayTimeoutInSec: scala.Int, - messageLogging: scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork: scala.Int, - stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation: BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives: scala.Boolean, - writeRealizedModeChoiceFile: scala.Boolean + actor : BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval : scala.Int, + clearRoutedOutstandingWorkEnabled : scala.Boolean, + debugActorTimerIntervalInSec : scala.Int, + debugEnabled : scala.Boolean, + memoryConsumptionDisplayTimeoutInSec : scala.Int, + messageLogging : scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork : scala.Int, + stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation : BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives : scala.Boolean, + writeRealizedModeChoiceFile : scala.Boolean ) - object Debug { - case class Actor( - logDepth: scala.Int + logDepth : scala.Int ) - object Actor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs: scala.Long, - checkMaxNumberOfMessagesEnabled: scala.Boolean, - defaultTimeoutMs: scala.Long, - enabled: scala.Boolean, - overallSimulationTimeoutMs: scala.Long, - thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs : scala.Long, + checkMaxNumberOfMessagesEnabled : scala.Boolean, + defaultTimeoutMs : scala.Long, + enabled : scala.Boolean, + overallSimulationTimeoutMs : scala.Long, + thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) - object StuckAgentDetection { - case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs: scala.Long, - triggerType: java.lang.String + actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs : scala.Long, + triggerType : java.lang.String ) - object Thresholds$Elm { - case class ActorTypeToMaxNumberOfMessages( - population: scala.Option[scala.Int], - rideHailAgent: scala.Option[scala.Int], - rideHailManager: scala.Option[scala.Int], - transitDriverAgent: scala.Option[scala.Int] + population : scala.Option[scala.Int], + rideHailAgent : scala.Option[scala.Int], + rideHailManager : scala.Option[scala.Int], + transitDriverAgent : scala.Option[scala.Int] ) - object ActorTypeToMaxNumberOfMessages { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = - if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = - BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") - else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") - ), - markAsStuckAfterMs = - if (c.hasPathOrNull("markAsStuckAfterMs")) - c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 20000, - triggerType = - if (c.hasPathOrNull("triggerType")) c.getString("triggerType") - else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), + markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, + triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = - if (c.hasPathOrNull("checkIntervalMs")) - c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 200, - checkMaxNumberOfMessagesEnabled = - !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = - if (c.hasPathOrNull("defaultTimeoutMs")) - c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = - if (c.hasPathOrNull("overallSimulationTimeoutMs")) - c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, + checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Debug.StuckAgentDetection - .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class TriggerMeasurer( - enabled: scala.Boolean, - writeStuckAgentDetectionConfig: scala.Boolean + enabled : scala.Boolean, + writeStuckAgentDetectionConfig : scala.Boolean ) - object TriggerMeasurer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = - !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram: scala.Boolean + createGCClassHistogram : scala.Boolean ) - object VmInformation { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor( - if (c.hasPathOrNull("actor")) c.getConfig("actor") - else com.typesafe.config.ConfigFactory.parseString("actor{}") - ), - agentTripScoresInterval = - if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = - c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = - if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = - if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) - c.getInt("memoryConsumptionDisplayTimeoutInSec") - else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = - if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) - c.getInt("secondsToWaitToClearRoutedOutstandingWork") - else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( - if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") - else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") - ), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( - if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") - else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") - ), - vmInformation = BeamConfig.Beam.Debug.VmInformation( - if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") - else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") - ), - writeModeChoiceAlternatives = - c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = - c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), + agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), + vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), + writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output: BeamConfig.Beam.Exchange.Output, - scenario: BeamConfig.Beam.Exchange.Scenario + output : BeamConfig.Beam.Exchange.Output, + scenario : BeamConfig.Beam.Exchange.Scenario ) - object Exchange { - case class Output( - activitySimSkimsEnabled: scala.Boolean, - geo: BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled : scala.Boolean, + geo : BeamConfig.Beam.Exchange.Output.Geo ) - object Output { - case class Geo( - filePath: scala.Option[java.lang.String] + filePath : scala.Option[java.lang.String] ) - object Geo { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = - c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo( - if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") - ) + activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) ) } } - + case class Scenario( - convertWgs2Utm: scala.Boolean, - fileFormat: java.lang.String, - folder: java.lang.String, - modeMap: scala.Option[scala.List[java.lang.String]], - source: java.lang.String, - urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm : scala.Boolean, + fileFormat : java.lang.String, + folder : java.lang.String, + modeMap : scala.Option[scala.List[java.lang.String]], + source : java.lang.String, + urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim ) - object Scenario { - case class Urbansim( - activitySimEnabled: scala.Boolean + activitySimEnabled : scala.Boolean ) - object Urbansim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ) + fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - scenario = BeamConfig.Beam.Exchange.Scenario( - if (c.hasPathOrNull("scenario")) c.getConfig("scenario") - else com.typesafe.config.ConfigFactory.parseString("scenario{}") - ) + output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) ) } } - + case class Experimental( - optimizer: BeamConfig.Beam.Experimental.Optimizer + optimizer : BeamConfig.Beam.Experimental.Optimizer ) - object Experimental { - case class Optimizer( - enabled: scala.Boolean + enabled : scala.Boolean ) - object Optimizer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer( - if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") - else com.typesafe.config.ConfigFactory.parseString("optimizer{}") - ) + optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) ) } } - + case class Input( - lastBaseOutputDir: java.lang.String, - simulationPrefix: java.lang.String + lastBaseOutputDir : java.lang.String, + simulationPrefix : java.lang.String ) - object Input { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn: scala.Boolean + keepConsoleAppenderOn : scala.Boolean ) - object Logger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level: java.lang.String + level : java.lang.String ) - object Metrics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation: scala.Boolean + writePlansAndStopSimulation : scala.Boolean ) - object Output { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = - c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory: scala.Boolean, - baseOutputDirectory: java.lang.String, - collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, - defaultWriteInterval: scala.Int, - displayPerformanceTimings: scala.Boolean, - events: BeamConfig.Beam.Outputs.Events, - generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval: scala.Int, - matsim: BeamConfig.Beam.Outputs.Matsim, - stats: BeamConfig.Beam.Outputs.Stats, - writeAnalysis: scala.Boolean, - writeEventsInterval: scala.Int, - writeGraphs: scala.Boolean, - writePlansInterval: scala.Int, - writeR5RoutesInterval: scala.Int + addTimestampToOutputDirectory : scala.Boolean, + baseOutputDirectory : java.lang.String, + collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, + defaultWriteInterval : scala.Int, + displayPerformanceTimings : scala.Boolean, + events : BeamConfig.Beam.Outputs.Events, + generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval : scala.Int, + matsim : BeamConfig.Beam.Outputs.Matsim, + stats : BeamConfig.Beam.Outputs.Stats, + writeAnalysis : scala.Boolean, + writeEventsInterval : scala.Int, + writeGraphs : scala.Boolean, + writePlansInterval : scala.Int, + writeR5RoutesInterval : scala.Int ) - object Outputs { - case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime: scala.Int, - startTime: scala.Int + endTime : scala.Int, + startTime : scala.Int ) - object GeneralizedLinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles: java.lang.String, - deleteRootFolderFiles: java.lang.String + deleteITERSFolderFiles : java.lang.String, + deleteRootFolderFiles : java.lang.String ) - object Matsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = - if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = - if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize: scala.Int + binSize : scala.Int ) - object Stats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = - !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = - if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = - !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( - "collectAndCreateBeamAnalysisAndGraphs" - ), - defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( - if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") - else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") - ), - generalizedLinkStatsInterval = - if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ), - stats = BeamConfig.Beam.Outputs.Stats( - if (c.hasPathOrNull("stats")) c.getConfig("stats") - else com.typesafe.config.ConfigFactory.parseString("stats{}") - ), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), + defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), + generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), + stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim: BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager: BeamConfig.Beam.Physsim.EventManager, - events: BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia: scala.Boolean, - eventsSampling: scala.Double, - flowCapacityFactor: scala.Double, - initializeRouterWithFreeFlowTimes: scala.Boolean, - inputNetworkFilePath: java.lang.String, - jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize: scala.Int, - linkStatsWriteInterval: scala.Int, - maxLinkLengthToApplySpeedScalingFactor: scala.Double, - name: java.lang.String, - network: BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath: java.lang.String, - parbprsim: BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize: scala.Double, - quick_fix_minCarSpeedInMetersPerSecond: scala.Double, - relaxation: BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim: scala.Boolean, - speedScalingFactor: scala.Double, - storageCapacityFactor: scala.Double, - writeEventsInterval: scala.Int, - writePlansInterval: scala.Int, - writeRouteHistoryInterval: scala.Int + bprsim : BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager : BeamConfig.Beam.Physsim.EventManager, + events : BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia : scala.Boolean, + eventsSampling : scala.Double, + flowCapacityFactor : scala.Double, + initializeRouterWithFreeFlowTimes : scala.Boolean, + inputNetworkFilePath : java.lang.String, + jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize : scala.Int, + linkStatsWriteInterval : scala.Int, + maxLinkLengthToApplySpeedScalingFactor : scala.Double, + name : java.lang.String, + network : BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath : java.lang.String, + parbprsim : BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize : scala.Double, + quick_fix_minCarSpeedInMetersPerSecond : scala.Double, + relaxation : BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim : scala.Boolean, + speedScalingFactor : scala.Double, + storageCapacityFactor : scala.Double, + writeEventsInterval : scala.Int, + writePlansInterval : scala.Int, + writeRouteHistoryInterval : scala.Int ) - object Physsim { - case class Bprsim( - inFlowAggregationTimeWindowInSeconds: scala.Int, - minFlowToUseBPRFunction: scala.Int, - travelTimeFunction: java.lang.String + inFlowAggregationTimeWindowInSeconds : scala.Int, + minFlowToUseBPRFunction : scala.Int, + travelTimeFunction : java.lang.String ) - object Bprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = - if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) - c.getInt("inFlowAggregationTimeWindowInSeconds") - else 900, - minFlowToUseBPRFunction = - if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, + minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor: scala.Double + congestionFactor : scala.Double ) - object CchRoutingAssignment { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax: scala.Int, - departureTimeShiftMin: scala.Int, - fractionOfEventsToDuplicate: scala.Double + departureTimeShiftMax : scala.Int, + departureTimeShiftMin : scala.Int, + fractionOfEventsToDuplicate : scala.Double ) - object DuplicatePTE { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = - if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = - if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = - if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads: scala.Int, - `type`: java.lang.String + numberOfThreads : scala.Int, + `type` : java.lang.String ) - object EventManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) - object Jdeqsim { - case class AgentSimPhysSimInterfaceDebugger( - enabled: scala.Boolean + enabled : scala.Boolean ) - object AgentSimPhysSimInterfaceDebugger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, - capacityPlansWriteInterval: scala.Int, - enabled: scala.Boolean, - minRoadCapacity: scala.Int, - minSpeedMetersPerSec: scala.Int, - speedAdjustmentFactor: scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, + capacityPlansWriteInterval : scala.Int, + enabled : scala.Boolean, + minRoadCapacity : scala.Int, + minSpeedMetersPerSec : scala.Int, + speedAdjustmentFactor : scala.Double ) - object Cacc { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = - if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) - c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") - else 1.3, - capacityPlansWriteInterval = - if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = - if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = - if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, + capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( - if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") - else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") - ), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - if (c.hasPathOrNull("cacc")) c.getConfig("cacc") - else com.typesafe.config.ConfigFactory.parseString("cacc{}") - ) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) ) } } - + case class Network( - maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) - object Network { - case class MaxSpeedInference( - enabled: scala.Boolean, - `type`: java.lang.String + enabled : scala.Boolean, + `type` : java.lang.String ) - object MaxSpeedInference { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled: scala.Boolean, - livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled : scala.Boolean, + livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) - object OverwriteRoadTypeProperties { - case class LivingStreet( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object LivingStreet { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Minor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Motorway { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object MotorwayLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Primary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object PrimaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Residential { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Secondary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object SecondaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Tertiary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TertiaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Trunk { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TrunkLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Unclassified { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") - else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") - ), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - if (c.hasPathOrNull("minor")) c.getConfig("minor") - else com.typesafe.config.ConfigFactory.parseString("minor{}") - ), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - if (c.hasPathOrNull("motorway")) c.getConfig("motorway") - else com.typesafe.config.ConfigFactory.parseString("motorway{}") - ), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") - else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") - ), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - if (c.hasPathOrNull("primary")) c.getConfig("primary") - else com.typesafe.config.ConfigFactory.parseString("primary{}") - ), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") - else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") - ), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - if (c.hasPathOrNull("residential")) c.getConfig("residential") - else com.typesafe.config.ConfigFactory.parseString("residential{}") - ), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - if (c.hasPathOrNull("secondary")) c.getConfig("secondary") - else com.typesafe.config.ConfigFactory.parseString("secondary{}") - ), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") - else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") - ), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") - else com.typesafe.config.ConfigFactory.parseString("tertiary{}") - ), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") - else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") - ), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - if (c.hasPathOrNull("trunk")) c.getConfig("trunk") - else com.typesafe.config.ConfigFactory.parseString("trunk{}") - ), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") - else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") - ), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") - else com.typesafe.config.ConfigFactory.parseString("unclassified{}") - ) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( - if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") - else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") - ), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") - else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") - ) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) ) } } - + case class Parbprsim( - numberOfClusters: scala.Int, - syncInterval: scala.Int + numberOfClusters : scala.Int, + syncInterval : scala.Int ) - object Parbprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier: scala.Double, - enabled: scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime: scala.Int + additionalTravelTimeMultiplier : scala.Double, + enabled : scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime : scala.Int ) - object PickUpDropOffAnalysis { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = - if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") - else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = - if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) - c.getInt("secondsFromPickUpPropOffToAffectTravelTime") - else 600 + additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 ) } } - + case class Relaxation( - experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type`: java.lang.String + experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type` : java.lang.String ) - object Relaxation { - case class Experiment20( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment20 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment21 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment30 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment40 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment50 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment51 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment52 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( - if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") - else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") - ), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( - if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") - else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") - ), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( - if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") - else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") - ), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( - if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") - else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") - ), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( - if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") - else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") - ), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( - if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") - else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") - ), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( - if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") - else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") - ), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim( - if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") - else com.typesafe.config.ConfigFactory.parseString("bprsim{}") - ), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( - if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") - else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") - ), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( - if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") - else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") - ), - eventManager = BeamConfig.Beam.Physsim.EventManager( - if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") - else com.typesafe.config.ConfigFactory.parseString("eventManager{}") - ), - events = BeamConfig.Beam.Physsim.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - eventsForFullVersionOfVia = - !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = - !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = - if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") - else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( - if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") - else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") - ), - linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = - if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = - if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) - c.getDouble("maxLinkLengthToApplySpeedScalingFactor") - else 50.0, - name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - overwriteLinkParamPath = - if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim( - if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") - else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") - ), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") - else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") - ), - ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = - if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) - c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") - else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation( - if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") - else com.typesafe.config.ConfigFactory.parseString("relaxation{}") - ), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = - if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = - if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), + eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), + events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), + linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, + name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), + ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1: scala.Double, - ModuleProbability_2: scala.Double, - ModuleProbability_3: scala.Double, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - clearModes: BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation: scala.Double, - maxAgentPlanMemorySize: scala.Int + ModuleProbability_1 : scala.Double, + ModuleProbability_2 : scala.Double, + ModuleProbability_3 : scala.Double, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + clearModes : BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation : scala.Double, + maxAgentPlanMemorySize : scala.Int ) - object Replanning { - case class ClearModes( - iteration: scala.Int, - modes: scala.Option[scala.List[java.lang.String]], - strategy: java.lang.String + iteration : scala.Int, + modes : scala.Option[scala.List[java.lang.String]], + strategy : java.lang.String ) - object ClearModes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes( - if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") - else com.typesafe.config.ConfigFactory.parseString("clearModes{}") - ), - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getDouble("fractionOfIterationsToDisableInnovation") - else Double.PositiveInfinity, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim: BeamConfig.Beam.Router.Skim + skim : BeamConfig.Beam.Router.Skim ) - object Router { - case class Skim( - activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims: scala.Int, - origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval: scala.Int, - writeSkimsInterval: scala.Int + activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims : scala.Int, + origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval : scala.Int, + writeSkimsInterval : scala.Int ) - object Skim { - case class ActivitySimSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object ActivitySimSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object DriveTimeSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") - else "skimsTravelTimeObservedVsSimulated", - name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", + name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String, - poolingTravelTimeOveheadFactor: scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, - writeFullSkimsInterval: scala.Int + fileBaseName : java.lang.String, + name : java.lang.String, + poolingTravelTimeOveheadFactor : scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, + writeFullSkimsInterval : scala.Int ) - object OriginDestinationSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = - if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") - else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = - if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) - c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") - else 0, - writeFullSkimsInterval = - if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, + writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName: java.lang.String, - geoHierarchy: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + geoHierarchy : java.lang.String, + name : java.lang.String ) - object TazSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object TransitCrowdingSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") - else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") - ), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") - else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") - ), - keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") - else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") - ), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( - if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") - else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") - ), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") - else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") - ), - writeAggregatedSkimsInterval = - if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), + keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), + writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim( - if (c.hasPathOrNull("skim")) c.getConfig("skim") - else com.typesafe.config.ConfigFactory.parseString("skim{}") - ) + skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) ) } } - + case class Routing( - baseDate: java.lang.String, - carRouter: java.lang.String, - gh: BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS: scala.Int, - overrideNetworkTravelTimesUsingSkims: scala.Boolean, - r5: BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor: scala.Double, - startingIterationForTravelTimesMSA: scala.Int, - transitOnStreetNetwork: scala.Boolean, - writeRoutingStatistic: scala.Boolean + baseDate : java.lang.String, + carRouter : java.lang.String, + gh : BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS : scala.Int, + overrideNetworkTravelTimesUsingSkims : scala.Boolean, + r5 : BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor : scala.Double, + startingIterationForTravelTimesMSA : scala.Int, + transitOnStreetNetwork : scala.Boolean, + writeRoutingStatistic : scala.Boolean ) - object Routing { - case class Gh( - useAlternativeRoutes: scala.Boolean + useAlternativeRoutes : scala.Boolean ) - object Gh { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath: java.lang.String, - bikeLaneScaleFactor: scala.Double, - departureWindow: scala.Double, - directory: java.lang.String, - directory2: scala.Option[java.lang.String], - linkRadiusMeters: scala.Double, - mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples: scala.Int, - osmMapdbFile: java.lang.String, - travelTimeNoiseFraction: scala.Double + bikeLaneLinkIdsFilePath : java.lang.String, + bikeLaneScaleFactor : scala.Double, + departureWindow : scala.Double, + directory : java.lang.String, + directory2 : scala.Option[java.lang.String], + linkRadiusMeters : scala.Double, + mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples : scala.Int, + osmMapdbFile : java.lang.String, + suboptimalMinutes : scala.Int, + transitAlternativeList : java.lang.String, + travelTimeNoiseFraction : scala.Double ) - object R5 { - case class MNetBuilder( - fromCRS: java.lang.String, - toCRS: java.lang.String + fromCRS : java.lang.String, + toCRS : java.lang.String ) - object MNetBuilder { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike: scala.Int + bike : scala.Int ) - object MaxDistanceLimitByModeInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = - if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = - if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( - if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") - else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") - ), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") - ), - numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmMapdbFile = - if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") - else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = - if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 - ) - } - } - + bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), + numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", + suboptimalMinutes = if(c.hasPathOrNull("suboptimalMinutes")) c.getInt("suboptimalMinutes") else 0, + transitAlternativeList = if(c.hasPathOrNull("transitAlternativeList")) c.getString("transitAlternativeList") else "OPTIMAL", + travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh( - if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") - ), - minimumPossibleSkimBasedTravelTimeInS = - if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) - c.getInt("minimumPossibleSkimBasedTravelTimeInS") - else 60, - overrideNetworkTravelTimesUsingSkims = - c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( - "overrideNetworkTravelTimesUsingSkims" - ), - r5 = BeamConfig.Beam.Routing.R5( - if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") - ), - skimTravelTimesScalingFactor = - if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = - if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") - else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), + minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, + overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), + r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), + skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric: BeamConfig.Beam.Sim.Metric, - termination: BeamConfig.Beam.Sim.Termination + metric : BeamConfig.Beam.Sim.Metric, + termination : BeamConfig.Beam.Sim.Termination ) - object Sim { - case class Metric( - collector: BeamConfig.Beam.Sim.Metric.Collector + collector : BeamConfig.Beam.Sim.Metric.Collector ) - object Metric { - case class Collector( - influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics: java.lang.String + influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics : java.lang.String ) - object Collector { - case class InfluxDbSimulationMetricCollector( - connectionString: java.lang.String, - database: java.lang.String + connectionString : java.lang.String, + database : java.lang.String ) - object InfluxDbSimulationMetricCollector { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = - if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = - BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - if (c.hasPathOrNull("influxDbSimulationMetricCollector")) - c.getConfig("influxDbSimulationMetricCollector") - else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") - ), - metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), + metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector( - if (c.hasPathOrNull("collector")) c.getConfig("collector") - else com.typesafe.config.ConfigFactory.parseString("collector{}") - ) + collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) ) } } - + case class Termination( - criterionName: java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName : java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) - object Termination { - case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration: scala.Int, - minLastIteration: scala.Int, - relativeTolerance: scala.Double + maxLastIteration : scala.Int, + minLastIteration : scala.Int, + relativeTolerance : scala.Double ) - object TerminateAtRideHailFleetStoredElectricityConvergence { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = - if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = - BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) - c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") - else - com.typesafe.config.ConfigFactory - .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") - ) + criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric( - if (c.hasPathOrNull("metric")) c.getConfig("metric") - else com.typesafe.config.ConfigFactory.parseString("metric{}") - ), - termination = BeamConfig.Beam.Sim.Termination( - if (c.hasPathOrNull("termination")) c.getConfig("termination") - else com.typesafe.config.ConfigFactory.parseString("termination{}") - ) + metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), + termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) ) } } - + case class Spatial( - boundingBoxBuffer: scala.Int, - localCRS: java.lang.String + boundingBoxBuffer : scala.Int, + localCRS : java.lang.String ) - object Spatial { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear ) - object Urbansim { - case class BackgroundODSkimsCreator( - calculationTimeoutHours: scala.Int, - enabled: scala.Boolean, - maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes: scala.Int, - peakHours: scala.Option[scala.List[scala.Double]], - routerType: java.lang.String, - skimsGeoType: java.lang.String, - skimsKind: java.lang.String + calculationTimeoutHours : scala.Int, + enabled : scala.Boolean, + maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes : scala.Int, + peakHours : scala.Option[scala.List[scala.Double]], + routerType : java.lang.String, + skimsGeoType : java.lang.String, + skimsKind : java.lang.String ) - object BackgroundODSkimsCreator { - case class MaxTravelDistanceInMeters( - bike: scala.Int, - walk: scala.Int + bike : scala.Int, + walk : scala.Int ) - object MaxTravelDistanceInMeters { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive: scala.Boolean, - transit: scala.Boolean, - walk: scala.Boolean + drive : scala.Boolean, + transit : scala.Boolean, + walk : scala.Boolean ) - object ModesToBuild { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = - if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") - ), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") - else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") - ), - numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), + numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes: scala.Double, - bike: scala.Double, - car: scala.Double, - drive_transit: scala.Double, - walk: scala.Double, - walk_transit: scala.Double + allModes : scala.Double, + bike : scala.Double, + car : scala.Double, + drive_transit : scala.Double, + walk : scala.Double, + walk_transit : scala.Double ) - object FractionOfModesToClear { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") - else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") - ), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( - if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") - else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") - ) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) ) } } - + case class WarmStart( - path: java.lang.String, - prepareData: scala.Boolean, - samplePopulationIntegerFlag: scala.Int, - skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type`: java.lang.String + path : java.lang.String, + prepareData : scala.Boolean, + samplePopulationIntegerFlag : scala.Int, + skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type` : java.lang.String ) - object WarmStart { - case class SkimsFilePaths$Elm( - skimType: java.lang.String, - skimsFilePath: java.lang.String + skimType : java.lang.String, + skimsFilePath : java.lang.String ) - object SkimsFilePaths$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if (c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = - if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = - if (c.hasPathOrNull("skimsFilePaths")) - scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) - else None, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if(c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim( - if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") - else com.typesafe.config.ConfigFactory.parseString("agentsim{}") - ), - calibration = BeamConfig.Beam.Calibration( - if (c.hasPathOrNull("calibration")) c.getConfig("calibration") - else com.typesafe.config.ConfigFactory.parseString("calibration{}") - ), - cluster = BeamConfig.Beam.Cluster( - if (c.hasPathOrNull("cluster")) c.getConfig("cluster") - else com.typesafe.config.ConfigFactory.parseString("cluster{}") - ), - debug = BeamConfig.Beam.Debug( - if (c.hasPathOrNull("debug")) c.getConfig("debug") - else com.typesafe.config.ConfigFactory.parseString("debug{}") - ), - exchange = BeamConfig.Beam.Exchange( - if (c.hasPathOrNull("exchange")) c.getConfig("exchange") - else com.typesafe.config.ConfigFactory.parseString("exchange{}") - ), - experimental = BeamConfig.Beam.Experimental( - if (c.hasPathOrNull("experimental")) c.getConfig("experimental") - else com.typesafe.config.ConfigFactory.parseString("experimental{}") - ), - input = BeamConfig.Beam.Input( - if (c.hasPathOrNull("input")) c.getConfig("input") - else com.typesafe.config.ConfigFactory.parseString("input{}") - ), - inputDirectory = - if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger( - if (c.hasPathOrNull("logger")) c.getConfig("logger") - else com.typesafe.config.ConfigFactory.parseString("logger{}") - ), - metrics = BeamConfig.Beam.Metrics( - if (c.hasPathOrNull("metrics")) c.getConfig("metrics") - else com.typesafe.config.ConfigFactory.parseString("metrics{}") - ), - output = BeamConfig.Beam.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - outputs = BeamConfig.Beam.Outputs( - if (c.hasPathOrNull("outputs")) c.getConfig("outputs") - else com.typesafe.config.ConfigFactory.parseString("outputs{}") - ), - physsim = BeamConfig.Beam.Physsim( - if (c.hasPathOrNull("physsim")) c.getConfig("physsim") - else com.typesafe.config.ConfigFactory.parseString("physsim{}") - ), - replanning = BeamConfig.Beam.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - router = BeamConfig.Beam.Router( - if (c.hasPathOrNull("router")) c.getConfig("router") - else com.typesafe.config.ConfigFactory.parseString("router{}") - ), - routing = BeamConfig.Beam.Routing( - if (c.hasPathOrNull("routing")) c.getConfig("routing") - else com.typesafe.config.ConfigFactory.parseString("routing{}") - ), - sim = BeamConfig.Beam.Sim( - if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") - ), - spatial = BeamConfig.Beam.Spatial( - if (c.hasPathOrNull("spatial")) c.getConfig("spatial") - else com.typesafe.config.ConfigFactory.parseString("spatial{}") - ), - urbansim = BeamConfig.Beam.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart( - if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") - else com.typesafe.config.ConfigFactory.parseString("warmStart{}") - ) + actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), + calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), + cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), + debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), + exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), + experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), + input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), + inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), + metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), + output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), + physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), + replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), + routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), + sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), + spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), + urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) ) } } - + case class Matsim( - conversion: BeamConfig.Matsim.Conversion, - modules: BeamConfig.Matsim.Modules + conversion : BeamConfig.Matsim.Conversion, + modules : BeamConfig.Matsim.Modules ) - object Matsim { - case class Conversion( - defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles: scala.Boolean, - matsimNetworkFile: java.lang.String, - osmFile: java.lang.String, - populationFile: java.lang.String, - scenarioDirectory: java.lang.String, - shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile: java.lang.String + defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles : scala.Boolean, + matsimNetworkFile : java.lang.String, + osmFile : java.lang.String, + populationFile : java.lang.String, + scenarioDirectory : java.lang.String, + shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile : java.lang.String ) - object Conversion { - case class DefaultHouseholdIncome( - currency: java.lang.String, - period: java.lang.String, - value: scala.Int + currency : java.lang.String, + period : java.lang.String, + value : scala.Int ) - object DefaultHouseholdIncome { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if (c.hasPathOrNull("period")) c.getString("period") else "year", - value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if(c.hasPathOrNull("period")) c.getString("period") else "year", + value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile: java.lang.String, - tazIdFieldName: java.lang.String + shapeFile : java.lang.String, + tazIdFieldName : java.lang.String ) - object ShapeConfig { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") - else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") - ), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = - if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = - if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = - if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") - else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( - if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") - else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") - ), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode: BeamConfig.Matsim.Modules.ChangeMode, - controler: BeamConfig.Matsim.Modules.Controler, - counts: BeamConfig.Matsim.Modules.Counts, - global: BeamConfig.Matsim.Modules.Global, - households: BeamConfig.Matsim.Modules.Households, - linkStats: BeamConfig.Matsim.Modules.LinkStats, - network: BeamConfig.Matsim.Modules.Network, - parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, - plans: BeamConfig.Matsim.Modules.Plans, - qsim: BeamConfig.Matsim.Modules.Qsim, - strategy: BeamConfig.Matsim.Modules.Strategy, - transit: BeamConfig.Matsim.Modules.Transit, - vehicles: BeamConfig.Matsim.Modules.Vehicles + changeMode : BeamConfig.Matsim.Modules.ChangeMode, + controler : BeamConfig.Matsim.Modules.Controler, + counts : BeamConfig.Matsim.Modules.Counts, + global : BeamConfig.Matsim.Modules.Global, + households : BeamConfig.Matsim.Modules.Households, + linkStats : BeamConfig.Matsim.Modules.LinkStats, + network : BeamConfig.Matsim.Modules.Network, + parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, + plans : BeamConfig.Matsim.Modules.Plans, + qsim : BeamConfig.Matsim.Modules.Qsim, + strategy : BeamConfig.Matsim.Modules.Strategy, + transit : BeamConfig.Matsim.Modules.Transit, + vehicles : BeamConfig.Matsim.Modules.Vehicles ) - object Modules { - case class ChangeMode( - modes: java.lang.String + modes : java.lang.String ) - object ChangeMode { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat: java.lang.String, - firstIteration: scala.Int, - lastIteration: scala.Int, - mobsim: java.lang.String, - outputDirectory: java.lang.String, - overwriteFiles: java.lang.String + eventsFileFormat : java.lang.String, + firstIteration : scala.Int, + lastIteration : scala.Int, + mobsim : java.lang.String, + outputDirectory : java.lang.String, + overwriteFiles : java.lang.String ) - object Controler { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = - if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Double, - inputCountsFile: java.lang.String, - outputformat: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Double, + inputCountsFile : java.lang.String, + outputformat : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem: java.lang.String, - randomSeed: scala.Int + coordinateSystem : java.lang.String, + randomSeed : scala.Int ) - object Global { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile: java.lang.String, - inputHouseholdAttributesFile: java.lang.String + inputFile : java.lang.String, + inputHouseholdAttributesFile : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = - if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = - if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") - else "/test/input/beamville/householdAttributes.xml" + inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations: scala.Int, - writeLinkStatsInterval: scala.Int + averageLinkStatsOverIterations : scala.Int, + writeLinkStatsInterval : scala.Int ) - object LinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = - if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = - if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile: java.lang.String + inputNetworkFile : java.lang.String ) - object Network { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = - if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") - else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents: scala.Int, - numberOfThreads: scala.Int, - oneThreadPerHandler: scala.Boolean, - synchronizeOnSimSteps: scala.Boolean + estimatedNumberOfEvents : scala.Int, + numberOfThreads : scala.Int, + oneThreadPerHandler : scala.Boolean, + synchronizeOnSimSteps : scala.Boolean ) - object ParallelEventHandling { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = - if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta: scala.Long, - earlyDeparture: scala.Long, - lateArrival: scala.Long, - learningRate: scala.Long, - parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing: scala.Long, - traveling: scala.Long, - waiting: scala.Long, - writeExperiencedPlans: scala.Boolean + BrainExpBeta : scala.Long, + earlyDeparture : scala.Long, + lateArrival : scala.Long, + learningRate : scala.Long, + parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing : scala.Long, + traveling : scala.Long, + waiting : scala.Long, + writeExperiencedPlans : scala.Boolean ) - object PlanCalcScore { - case class Parameterset$Elm( - activityType: java.lang.String, - priority: scala.Int, - scoringThisActivityAtAll: scala.Boolean, - `type`: java.lang.String, - typicalDuration: java.lang.String, - typicalDurationScoreComputation: java.lang.String + activityType : java.lang.String, + priority : scala.Int, + scoringThisActivityAtAll : scala.Boolean, + `type` : java.lang.String, + typicalDuration : java.lang.String, + typicalDurationScoreComputation : java.lang.String ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = - !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = - if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") - else "uniform" + activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = - if (c.hasPathOrNull("BrainExpBeta")) - c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) - else 2, - earlyDeparture = - if (c.hasPathOrNull("earlyDeparture")) - c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, - lateArrival = - if (c.hasPathOrNull("lateArrival")) - c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) - else -18, - learningRate = - if (c.hasPathOrNull("learningRate")) - c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) - else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = - if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) - else 6, - traveling = - if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) - else -6, - waiting = - if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, + BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, + earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, + learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, + traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, + waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.PlanCalcScore - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Plans( - inputPersonAttributesFile: java.lang.String, - inputPlansFile: java.lang.String + inputPersonAttributesFile : java.lang.String, + inputPlansFile : java.lang.String ) - object Plans { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = - if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") - else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = - if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") - else "/test/input/beamville/population.xml" + inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime: java.lang.String, - snapshotperiod: java.lang.String, - startTime: java.lang.String + endTime : java.lang.String, + snapshotperiod : java.lang.String, + startTime : java.lang.String ) - object Qsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1: scala.Int, - ModuleProbability_2: scala.Int, - ModuleProbability_3: scala.Int, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - fractionOfIterationsToDisableInnovation: scala.Int, - maxAgentPlanMemorySize: scala.Int, - parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval: java.lang.String + ModuleProbability_1 : scala.Int, + ModuleProbability_2 : scala.Int, + ModuleProbability_3 : scala.Int, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + fractionOfIterationsToDisableInnovation : scala.Int, + maxAgentPlanMemorySize : scala.Int, + parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval : java.lang.String ) - object Strategy { - case class Parameterset$Elm( - disableAfterIteration: scala.Int, - strategyName: java.lang.String, - `type`: java.lang.String, - weight: scala.Int + disableAfterIteration : scala.Int, + strategyName : java.lang.String, + `type` : java.lang.String, + weight : scala.Int ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getInt("fractionOfIterationsToDisableInnovation") - else 999999, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = - if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") - else "WorstPlanForRemovalSelector" - ) - } - - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" + ) + } + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.Strategy - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Transit( - transitModes: java.lang.String, - useTransit: scala.Boolean, - vehiclesFile: java.lang.String + transitModes : java.lang.String, + useTransit : scala.Boolean, + vehiclesFile : java.lang.String ) - object Transit { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile: java.lang.String + vehiclesFile : java.lang.String ) - object Vehicles { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode( - if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") - else com.typesafe.config.ConfigFactory.parseString("changeMode{}") - ), - controler = BeamConfig.Matsim.Modules.Controler( - if (c.hasPathOrNull("controler")) c.getConfig("controler") - else com.typesafe.config.ConfigFactory.parseString("controler{}") - ), - counts = BeamConfig.Matsim.Modules.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - global = BeamConfig.Matsim.Modules.Global( - if (c.hasPathOrNull("global")) c.getConfig("global") - else com.typesafe.config.ConfigFactory.parseString("global{}") - ), - households = BeamConfig.Matsim.Modules.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - linkStats = BeamConfig.Matsim.Modules.LinkStats( - if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") - else com.typesafe.config.ConfigFactory.parseString("linkStats{}") - ), - network = BeamConfig.Matsim.Modules.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( - if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") - else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") - ), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( - if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") - else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") - ), - plans = BeamConfig.Matsim.Modules.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - qsim = BeamConfig.Matsim.Modules.Qsim( - if (c.hasPathOrNull("qsim")) c.getConfig("qsim") - else com.typesafe.config.ConfigFactory.parseString("qsim{}") - ), - strategy = BeamConfig.Matsim.Modules.Strategy( - if (c.hasPathOrNull("strategy")) c.getConfig("strategy") - else com.typesafe.config.ConfigFactory.parseString("strategy{}") - ), - transit = BeamConfig.Matsim.Modules.Transit( - if (c.hasPathOrNull("transit")) c.getConfig("transit") - else com.typesafe.config.ConfigFactory.parseString("transit{}") - ), - vehicles = BeamConfig.Matsim.Modules.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) + changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), + controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), + counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), + households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), + network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), + plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), + strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), + transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), + vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion( - if (c.hasPathOrNull("conversion")) c.getConfig("conversion") - else com.typesafe.config.ConfigFactory.parseString("conversion{}") - ), - modules = BeamConfig.Matsim.Modules( - if (c.hasPathOrNull("modules")) c.getConfig("modules") - else com.typesafe.config.ConfigFactory.parseString("modules{}") - ) + conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), + modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam( - if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") - ), - matsim = BeamConfig.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ) + beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), + matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) ) } - private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - - private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - - private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { + private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ( - (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number] - ) throw $_expE(cv, "double") + if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - - private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { + private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException( - cv.origin.lineNumber + + new java.lang.RuntimeException(cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) - ) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) } - - private def $_str(cv: com.typesafe.config.ConfigValue) = + private def $_str(cv:com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } + From f762a3e9ccc75151acbefa2d1f12913d41bcfd42 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 5 Apr 2022 21:21:34 -0700 Subject: [PATCH 068/307] setting up new scenarios --- src/main/R/gemini/gemini-main.R | 2 +- src/main/R/gemini/gemini-processing.R | 23 ++++++--------------- src/main/python/gemini/events_processing.py | 8 ++++--- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 818dd2eebdc..7f37c8e45b8 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -68,7 +68,7 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) ##### # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') -scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base') +scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') scenarioBaselineLabel <- 'Scenario4a-Base' #all.loads <- all.loads[!is.na(loadType)] ########################################## diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 55ae90b61cf..61ead526f6a 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -21,8 +21,8 @@ shpFile <- pp(workDir, "/shapefile/Oakland+Alameda+TAZ/Transportation_Analysis_Z oaklandCbg <- st_read(shpFile) ### -#eventsraw <- readCsv(pp(workDir, "/2021Aug22-Oakland/BASE0/events-raw/2.events.BASE0.csv.gz")) -events <- readCsv(pp(workDir, "/2022Feb/BATCH1/events/filtered.0.events.SC4.csv.gz")) +eventsraw <- readCsv(pp(workDir, "/0.events.csv.gz")) +events <- readCsv(pp(workDir, "/filtered.0.events.csv.gz")) ## temp workdir <- "/Users/haitamlaarabi/Data/GEMINI/enroute-scenario3" @@ -667,19 +667,6 @@ b <- sum(rse100[startsWith(parkingZoneId, "AO")]$fuel) b <- rse100_3[startsWith(parkingZoneId, "AO"),.(fuel3=mean(fuel)),by=.(chargingPointType)] a <- rse100[startsWith(parkingZoneId, "AO"),.(fuel2=mean(fuel)),by=.(chargingPointType)] -##### - -sc4 <- readCsv(pp(workDir, "/2021Oct29/BATCH1/events/filtered.3.events.SC4.csv.gz")) -sc4Bis <- readCsv(pp(workDir, "/2021Oct29/BATCH1/events/filtered.3.events.SC4Bis.csv.gz")) - -ref4 <- sc4[type=="RefuelSessionEvent"] -ref4Bis <- sc4[type=="RefuelSessionEvent"] - -mean(ref4[time >= 0 && time < 7 * 3600]$fuel) -mean(ref4[time > 22]$fuel) - -test1 <- ref4[grepl("emergency", vehicle)] -test2 <- ref4Bis[grepl("emergency", vehicle)] ### @@ -735,7 +722,8 @@ summarizingCharging2 <- function(DATA) { chgSummary[,shareFuel:=sumFuel/chgSummaryTotFuel][,-c("sumFuel")][order(actType)] } -events0 <- readCsv(pp(workDir, "/2022Mars-Calibration/filtered.0.events.SC4a.csv.gz")) +events00 <- readCsv(pp(workDir, "/2022Feb/BATCH1/events/filtered.0.events.SC4b.csv.gz")) +events01 <- readCsv(pp(workDir, "/2022Feb/BATCH1/events/filtered.0.events.SC4b2.csv.gz")) events1 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-1.csv.gz")) events2 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-2.csv.gz")) @@ -790,7 +778,8 @@ events8 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-8.csv.gz")) # Public L3,1.8%,weekday # Home L1+L2,77.5,weekday -summarizingCharging(events0) +summarizingCharging(events00) +summarizingCharging(events01) summarizingCharging(events1) summarizingCharging(events2) diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 1fb475c5d5b..896d9dabfa9 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,7 +1,9 @@ import pandas as pd import os -filename = '~/Data/GEMINI/2022Feb/BATCH1/events-raw/0.events.SC4b.csv.gz' +work_directory = '~/Data/GEMINI/2022Feb/BATCH1' +#filename = work_directory + '/events-raw/0.events.SC4b2.csv.gz' +filename = '~/Data/GEMINI/0.events.csv.gz' full_filename = os.path.expanduser(filename) compression = None if filename.endswith(".gz"): @@ -15,6 +17,6 @@ "locationY", "locationX", "duration", "vehicleType", "person", "fuel", "parkingZoneId", "pricingModel", "actType"] ] - -data_filtered2.to_csv('~/Data/GEMINI/2022Feb/BATCH1/events/filtered.0.events.SC4b.csv.gz') +data_filtered2.to_csv('~/Data/GEMINI/filtered.0.events.csv.gz') +#data_filtered2.to_csv(work_directory + '/events/filtered.0.events.SC4b2.csv.gz') print("END") From d9df61ad7d2b130a8ebbf833b3647dc71fee18f6 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 6 Apr 2022 19:14:15 +0600 Subject: [PATCH 069/307] Config changes --- test/input/relaxation-network-scenario/beam.conf | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/input/relaxation-network-scenario/beam.conf b/test/input/relaxation-network-scenario/beam.conf index 824d71ab9a9..cad22724ceb 100644 --- a/test/input/relaxation-network-scenario/beam.conf +++ b/test/input/relaxation-network-scenario/beam.conf @@ -14,10 +14,13 @@ beam.spatial = { beam.physsim.inputNetworkFilePath = ${beam.routing.r5.directory}"/physsim-network.xml" beam.physsim.network.removeIslands = false +beam.physsim.flowCapacityFactor = 0.1 +beam.physsim.writeEventsInterval = 1 +beam.physsim.events.fileOutputFormats = "xml,csv" beam.agentsim.taz.filePath=${beam.inputDirectory}"/taz-centers.csv" beam.agentsim.firstIteration = 0 -beam.agentsim.lastIteration = 2 +beam.agentsim.lastIteration = 3 beam.agentsim.startTime = "00:00:00" beam.agentsim.endTime = "30:00:00" @@ -44,19 +47,23 @@ beam.agentsim.agents.vehicles { beam.replanning = { maxAgentPlanMemorySize = 4 Module_1 = "SelectExpBeta" - ModuleProbability_1 = 0.7 + ModuleProbability_1 = 0.9 Module_2 = "ClearRoutes" ModuleProbability_2 = 0.1 Module_3 = "ClearModes" - ModuleProbability_3 = 0.1 + ModuleProbability_3 = 0.0 Module_4 = "TimeMutator" - ModuleProbability_4 = 0.1 + ModuleProbability_4 = 0.0 } beam.outputs.defaultWriteInterval = 1 beam.outputs.collectAndCreateBeamAnalysisAndGraphs = false beam.outputs.writeR5RoutesInterval = 1 +#beam.outputs.events.fileOutputFormats = "csv,xml" # valid options: xml(.gz) , csv(.gz), none - DEFAULT: csv.gz +# Events Writing Logging Levels: +#beam.outputs.events.eventsToWrite = "PersonDepartureEvent,PersonArrivalEvent,ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,TeleportationEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent" + beam.calibration.counts = { countsScaleFactor = 10.355 writeCountsInterval = 0 @@ -74,6 +81,7 @@ beam.routing { osmMapdbFile = ${beam.inputDirectory}"/r5/osm.mapdb" mNetBuilder.fromCRS = "epsg:4326" # WGS84 mNetBuilder.toCRS = ${beam.spatial.localCRS} + #travelTimeNoiseFraction = 0.25 } } From d3b0df68aade95d95094fee80e01f5cab80bf59c Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 11 Apr 2022 16:15:00 -0700 Subject: [PATCH 070/307] updating python script --- src/main/python/gemini/events_processing.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 896d9dabfa9..8d967bd53e3 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,14 +1,13 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022Feb/BATCH1' -#filename = work_directory + '/events-raw/0.events.SC4b2.csv.gz' -filename = '~/Data/GEMINI/0.events.csv.gz' -full_filename = os.path.expanduser(filename) +work_directory = '~/Data/GEMINI/2022Feb/BATCH1/' +filename = '0.events.SC4b2.csv.gz' +full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) compression = None -if filename.endswith(".gz"): +if full_filename.endswith(".gz"): compression = 'gzip' -data = pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) +data = pd.read_csv(full_filename, sep=",", index_col=None, header=0, compression=compression) data_filtered = data.loc[ data.type.isin(["RefuelSessionEvent", "ChargingPlugInEvent", "ChargingPlugOutEvent", "actstart"]) ] @@ -17,6 +16,5 @@ "locationY", "locationX", "duration", "vehicleType", "person", "fuel", "parkingZoneId", "pricingModel", "actType"] ] -data_filtered2.to_csv('~/Data/GEMINI/filtered.0.events.csv.gz') -#data_filtered2.to_csv(work_directory + '/events/filtered.0.events.SC4b2.csv.gz') +data_filtered2.to_csv(work_directory + "events/filtered." + filename) print("END") From e696cd1b0297f02e40a3b2d962c416480564e6f8 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 12 Apr 2022 17:34:30 -0700 Subject: [PATCH 071/307] adding profiler to deploy --- build.gradle | 4 ++-- gradle.deploy.properties | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f0199365510..64d173025f3 100755 --- a/build.gradle +++ b/build.gradle @@ -692,8 +692,8 @@ task createDockerfile(type: Dockerfile, dependsOn: dockerSyncBuildContext) { task buildImageWithoutTags(type: DockerBuildImage, dependsOn: createDockerfile) {} task buildImage(type: DockerTagImage, dependsOn: buildImageWithoutTags) { - repository = "beammodel/beam" - tag = version + repository = "haitamlaarabi/beam" + tag = 'gemini-develop-enroute-overnight-charging-v1' targetImageId buildImageWithoutTags.getImageId() } diff --git a/gradle.deploy.properties b/gradle.deploy.properties index 931362e09be..053d3a2ab3b 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -12,6 +12,7 @@ maxRAM=740g # storageSize (in GiB) = any number between 64 and 256 storageSize=256 runHelics=false +profiler_type=cpumem #r5.8xlarge (32/256) #c5.9xlarge (36/72) -> 5 instances -> $1.53 per Hour From 1dab7c5118dc009e20e84fcd6fb8d71bfa32315e Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 12 Apr 2022 18:16:15 -0700 Subject: [PATCH 072/307] testing fix to lookUpVehicle --- .../agentsim/infrastructure/ChargingNetwork.scala | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index acece6d2905..76451735c8d 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -26,11 +26,13 @@ import scala.util.Random */ class ChargingNetwork[GEO: GeoLevel](val chargingZones: Map[Id[ParkingZoneId], ParkingZone[GEO]]) extends ParkingNetwork[GEO](chargingZones) { - import ChargingNetwork._ override protected val searchFunctions: Option[InfrastructureFunctions[GEO]] = None + protected val beamVehicleIdToChargingVehicleMap: mutable.HashMap[Id[BeamVehicle], ChargingVehicle] = + mutable.HashMap.empty + protected val chargingZoneKeyToChargingStationMap: Map[Id[ParkingZoneId], ChargingStation] = chargingZones.map { case (zoneId, zone) => zoneId -> ChargingStation(zone) } @@ -68,7 +70,7 @@ class ChargingNetwork[GEO: GeoLevel](val chargingZones: Map[Id[ParkingZoneId], P * @return charging vehicle */ def lookupVehicle(vehicleId: Id[BeamVehicle]): Option[ChargingVehicle] = - chargingZoneKeyToChargingStationMap.values.view.flatMap(_.lookupVehicle(vehicleId)).headOption + beamVehicleIdToChargingVehicleMap.get(vehicleId) /** * clear charging vehicle map @@ -87,8 +89,8 @@ class ChargingNetwork[GEO: GeoLevel](val chargingZones: Map[Id[ParkingZoneId], P activityType: String, theSender: ActorRef ): Option[ChargingVehicle] = lookupStation(request.stall.parkingZoneId) - .map( - _.connect( + .map { chargingStation => + val chargingVehicle = chargingStation.connect( request.tick, request.vehicle, request.stall, @@ -98,7 +100,9 @@ class ChargingNetwork[GEO: GeoLevel](val chargingZones: Map[Id[ParkingZoneId], P request.shiftDuration, theSender ) - ) + beamVehicleIdToChargingVehicleMap.put(chargingVehicle.vehicle.id, chargingVehicle) + chargingVehicle + } /** * @param vehicleId vehicle to end charge @@ -121,6 +125,7 @@ class ChargingNetwork[GEO: GeoLevel](val chargingZones: Map[Id[ParkingZoneId], P */ def disconnectVehicle(vehicleId: Id[BeamVehicle], tick: Int): Option[ChargingVehicle] = { lookupVehicle(vehicleId) map { chargingVehicle => + beamVehicleIdToChargingVehicleMap.remove(vehicleId) chargingVehicle.chargingStation.disconnect(chargingVehicle.vehicle.id, tick) } getOrElse { logger.debug(s"Vehicle $vehicleId is already disconnected") From 3492078d980cae92afdc617d90f0b60c44ffdfcc Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Thu, 21 Apr 2022 21:04:10 +0300 Subject: [PATCH 073/307] empty commit From 5513905a776a993a4b23f1a26504b458e378b923 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 21 Apr 2022 18:30:50 -0700 Subject: [PATCH 074/307] update scripts --- src/main/R/common/helpers.R | 138 +++++++ src/main/R/freight/freight-processing.R | 361 +++++++++++++----- src/main/R/gemini/gemini-main.R | 19 +- src/main/R/gemini/gemini-processing.R | 92 +++-- src/main/R/gemini/gemini-utils.R | 16 +- src/main/python/gemini/debugging.py | 1 - src/main/python/gemini/events_processing.py | 4 +- .../nrel_to_beam_charging_infrastruture.py | 60 +-- .../unlimited_charging_infrastructure.py | 18 +- 9 files changed, 515 insertions(+), 194 deletions(-) diff --git a/src/main/R/common/helpers.R b/src/main/R/common/helpers.R index 5c53f2af497..e674f2cf6dd 100644 --- a/src/main/R/common/helpers.R +++ b/src/main/R/common/helpers.R @@ -66,3 +66,141 @@ sankeyDiagram <- function(source, target, value, title) { } +clusteringFreightBy <- function(data,cols,dataCbg,numClusters,labelData) { + data[,hour:=as.integer(arrivalTime/3600)%%24] + data_asSf <- st_as_sf(data,coords=cols,crs=4326,agr="constant") + data_withCBG_asSf <- st_intersection(data_asSf,dataCbg) + data_withCBG_asSf$X <- st_coordinates(data_withCBG_asSf$geometry)[,1] + data_withCBG_asSf$Y <- st_coordinates(data_withCBG_asSf$geometry)[,2] + data_withCBG <- data.table::as.data.table(data_withCBG_asSf) + data_withCBG[,cluster:=kmeans(data_withCBG[,.(X,Y)],numClusters)$cluster] + result <- data_withCBG[,.(count=.N,x2=mean(X),y2=mean(Y)),by=.(hour,cluster)] + result$label <- labelData + result +} + +assignPostMilesGeometries <- function(TRUCK_DATA, POSTMILES_SHP) { + getElementWithoutFlag <- function(list_elements, flag) { + i <- 1 + while(list_elements[i] == '') { + i <- i+1 + } + return(list_elements[i]) + } + TRUCK_DATA$X <- 0.0 + TRUCK_DATA$Y <- 0.0 + ### GEOCODING ### + #TRUCK_DATA$lon <- 0.0 + #TRUCK_DATA$lat <- 0.0 + #TRUCK_DATA$geoAddress <- "" + #nrow(TRUCK_DATA) + postmiles <- st_read(POSTMILES_SHP) + for(i in 1:nrow(TRUCK_DATA)) { + county <- TRUCK_DATA$COUNTY[i] + cnty <- TRUCK_DATA$CNTY[i] + dist <- TRUCK_DATA$DIST[i] + rte <- TRUCK_DATA$RTE[i] + leg <- TRUCK_DATA$LEG[i] + pm <- TRUCK_DATA$POST_MILE[i] + filteredPM <- postmiles %>% filter(County == cnty, + District == dist, + Route == rte, + startsWith(as.character(PMc), as.character(pm))) + if(nrow(filteredPM) == 0) { + filteredPM <- postmiles %>% filter(County == cnty, District == dist, Route == rte) + } + if(nrow(filteredPM) > 1) { + pm_numeric <- 0 + if(!is.na(as.numeric(pm))) { + pm_numeric <- as.numeric(pm) + } else { + element <- getElementWithoutFlag(unlist(strsplit(pm, "R")), "R") + element <- getElementWithoutFlag(unlist(strsplit(element, "L")), "L") + element <- getElementWithoutFlag(unlist(strsplit(element, "T")), "T") + element <- getElementWithoutFlag(unlist(strsplit(element, "M")), "M") + pm_numeric <- as.numeric(element) + } + filteredPM <- filteredPM %>% rowwise() %>% mutate(diff = abs(as.numeric(PM) - pm_numeric)) + filteredPM <- filteredPM %>% filter(diff == min(filteredPM$diff)) + } + if(nrow(filteredPM) > 0) { + TRUCK_DATA$X[i] <- st_coordinates(filteredPM$geometry[1])[1] + TRUCK_DATA$Y[i] <- st_coordinates(filteredPM$geometry[1])[2] + } + # address <- paste(county, " County, California, USA", sep="") + # descriptions <- unlist(strsplit(TRUCK_DATA$DESCRIPTION[i],",")) + # if(length(descriptions) > 1) { + # address <- paste(str_trim(descriptions[2]), ", ", str_trim(descriptions[1]), ", ", address, sep="") + # } else { + # address <- paste(str_trim(descriptions), ", ", address, sep="") + # } + # address <- ", CA" + # address <- paste(TRUCK_DATA$DESCRIPTION[i], ", ", address, sep="") + # address <- gsub("RTE.", "route", address) + # address <- gsub("JCT.", "", address) + # print(address) + # result <- geocode(address, output = "latlona", source = "google") + # TRUCK_DATA$lon[i] <- as.numeric(result[1]) + # TRUCK_DATA$lat[i] <- as.numeric(result[2]) + # TRUCK_DATA$geoAddress[i] <- as.character(result[3]) + # print(TRUCK_DATA[i]) + } + data.table::fwrite(TRUCK_DATA, normalizePath(pp(freightDir,"/validation/2017_truck_aadtt_geocoded.csv")), quote=T) + print("END OF assignPostMilesGeometries") + return(TRUCK_DATA) +} + +assignLinkIdToTruckAADTT <- function(NETWORK_CLEANED, NETWORK_CRS, TRUCK_AADTT, MAX_DISTANCE_IN_METER, EXPANSION_FACTOR) { + network_sf <- st_transform(st_as_sf( + NETWORK_CLEANED, + coords = c("fromLocationX", "fromLocationY"), + crs = NETWORK_CRS, + agr = "constant"), 4326) + + truck_aadtt_sf <- st_as_sf( + TRUCK_AADTT, + coords = c("X", "Y"), + crs = 4326, + agr = "constant") + + network_sf$tempDistance <- NA + truck_aadtt_sf$linkId <- NA + expansionFactor <- EXPANSION_FACTOR + maxDistanceToSearch <- MAX_DISTANCE_IN_METER + counter1 <- 0 + counter2 <- 0 + for (row in 1:nrow(truck_aadtt_sf)) { + if(row %% 100 == 0) { + print(paste(row, " entries have been processed so far!")) + } + current_pm <- truck_aadtt_sf[row,] + currentDist <- 20 + current_pm_links <- st_is_within_distance(current_pm, network_sf, dist = currentDist) + list_of_links <- current_pm_links[1][[1]] + while(length(list_of_links) < 1 & currentDist < maxDistanceToSearch) { + currentDist <- currentDist * 2 + current_pm_links <- st_is_within_distance(current_pm, network_sf, dist = currentDist) + list_of_links = current_pm_links[1][[1]] + } + selected_links <- network_sf[list_of_links,] + if (length(list_of_links) == 0){ + counter1 <- counter1 + 1 + print("no links!!!") + } else if (length(list_of_links) == 1){ + truck_aadtt_sf$linkId[row] <- network_sf[list_of_links,]$linkId + network_sf <- network_sf[-list_of_links,] + counter2 <- counter2 + 1 + } else { + selected_pm <- truck_aadtt_sf[row,] + selected_network <- network_sf[selected_links,] + selected_network$tempDistance <- st_distance(selected_network, selected_pm) + selected_network_filtered <- slice(selected_network, which.min(tempDistance)) + truck_aadtt_sf$linkId[row] <- selected_network_filtered$linkId + network_sf <- network_sf %>% filter(linkId != selected_network_filtered$linkId) + counter2 <- counter2 + 1 + } + } + print(paste("# unmatched links ", counter1)) + print(paste("# matched links ", counter2)) + return(truck_aadtt_sf) +} \ No newline at end of file diff --git a/src/main/R/freight/freight-processing.R b/src/main/R/freight/freight-processing.R index 03e5a2c885e..d4b406207be 100644 --- a/src/main/R/freight/freight-processing.R +++ b/src/main/R/freight/freight-processing.R @@ -10,23 +10,116 @@ library(ggmap) library(sf) library(stringr) -workDir <- normalizePath("~/Data/SMART") -activitySimDir <- normalizePath("~/Data/ACTIVITYSIM") -events <- readCsv(pp(workDir, "/5.events.csv.gz")) -unloading <- events[actType=="Unloading"] -nrow(unloading[type=="actstart"]) -nrow(unloading[type=="actend"]) -warehouse <- events[actType=="Warehouse"] -nrow(warehouse[type=="actstart"]) -nrow(warehouse[type=="actend"]) -pt <- events[type=="PathTraversal"][,c("time","type","vehicleType","vehicle","secondaryFuelLevel", +activitySimDir <- normalizePath("~/Data/ACTIVITYSIM") +freightDir <- normalizePath("~/Data/FREIGHT") +validationDir <- normalizePath("~/Data/FREIGHT/validation") +freightWorkDir <- normalizePath(paste(validationDir,"/beam",sep="")) + +# events <- readCsv(pp(freightWorkDir, "/0.events.csv")) +# events_filtered <- events[(actType %in% c("Warehouse", "Unloading", "Loading")) | (type=="PathTraversal" & startsWith(vehicle,"freight"))] +# write.csv( +# events_filtered, +# file = pp(freightWorkDir, "/filtered.0.events.csv"), +# row.names=F, +# quote=T) +events_filtered <- readCsv(pp(freightWorkDir, "/filtered.0.events.new.csv")) +pt <- events_filtered[type=="PathTraversal"][,c("time","type","vehicleType","vehicle","secondaryFuelLevel", "primaryFuelLevel","driver","mode","seatingCapacity","startX", "startY", "endX", "endY", "capacity", "arrivalTime", "departureTime", "secondaryFuel", "secondaryFuelType", "primaryFuelType", "numPassengers", "length", "primaryFuel")] freight_pt <- pt[startsWith(vehicle,"freight")] -nrow(freight_pt) + +if (nrow(freight_pt[grepl("-emergency-",vehicle)]) > 0) { + println("This is a bug") +} +print(paste("# vehicles: ", length(unique(freight_pt$vehicle)))) +print("By category: ") +freight_pt[,.N,by=.(vehicle, vehicleType)][,.(count=.N),by=.(vehicleType)] + +# nrow(freight_pt) +# all_pt_x <- data.table::as.data.table(rbind(b2b_pt,b2c_pt)[,c("time","vehicle","departureTime","arrivalTime","label")]) +# all_pt_1 <- all_pt_x[,-c("arrivalTime")][order(time),`:=`(IDX = 1:.N),by=vehicle] +# all_pt_2 <- all_pt_x[,-c("departureTime")][order(time),`:=`(IDX = 1+1:.N),by=vehicle] +# all_pt <- all_pt_1[all_pt_2, on=c("vehicle", "IDX", "label")][!is.na(arrivalTime)&!is.na(departureTime)] +# all_pt[,`:=`(stopDuration = departureTime - arrivalTime)] +# all_pt[,.(mean(stopDuration)),by=.(label)] +# unloading <- events[actType=="Unloading"] +# warehouse <- events[actType=="Warehouse"] +# nrow(unloading[type=="actstart"]) +# nrow(unloading[type=="actend"]) +# nrow(warehouse[type=="actstart"]) +# nrow(warehouse[type=="actend"]) +## + +## *************************** +#FRISM +## *************************** +freightWorkDir <- normalizePath(paste(freightDir,"/Outputs(All SF)_0322_2022_merged",sep="")) +carriers <- readCsv(pp(freightWorkDir, "/freight-merged-carriers.csv")) +payload <- readCsv(pp(freightWorkDir, "/freight-merged-payload-plans.csv")) +tours <- readCsv(pp(freightWorkDir, "/freight-merged-tours.csv")) + +print(paste("# carriers:", length(unique(carriers$carrierId)))) +print(paste("# tours:", length(unique(carriers$tourId)))) +print(paste("# vehicles:", length(unique(carriers$vehicleId)))) +print("By category: ") +carriers[,.N,by=.(vehicleId, vehicleTypeId)][,.(count=.N),by=.(vehicleTypeId)] + +plans <- rbind(plansb2b,plansb2c)[,c("payloadId","sequenceRank","tourId","payloadType","estimatedTimeOfArrivalInSec","arrivalTimeWindowInSec_lower","business")] +tours <- rbind(toursb2b,toursb2c)[,c("tourId","departureTimeInSec","business")] + +p <- plans[tours, on=c("tourId","business")] +pRank2 <- p[sequenceRank==2] +pRank2$negativeTravelTime <- pRank2$estimatedTimeOfArrivalInSec - pRank2$departureTimeInSec - pRank2$arrivalTimeWindowInSec_lower +p2 <- p[,diff:=estimatedTimeOfArrivalInSec-arrivalTimeWindowInSec_lower-departureTimeInSec] + +write.csv( + pRank2[negativeTravelTime<0], + file = pp(freightDir, "/10percent/negativeTravelTime.csv"), + row.names=FALSE, + quote=FALSE, + na="0") + +toursb2$hour <- toursb2c$departureTimeInSec/3600.0 +ggplot(toursb2b[,.N,by=hour]) + geom_line(aes(hour, N)) + +payload$business <- "B2B" +payload[startsWith(payloadId,"b2c")]$business <- "B2C" +payload[,time24:=estimatedTimeOfArrivalInSec%%(24*3600),][,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(time24),"30 min")), business)] %>% + ggplot(aes(timeBin, N, colour=business)) + + geom_line() + + scale_x_datetime("Hour", + breaks=scales::date_breaks("2 hour"), + labels=scales::date_format("%H", tz = dateTZ)) + + scale_y_continuous("Activity", breaks = scales::pretty_breaks()) + + scale_colour_manual("Supply Chain", values = c("#eca35b", "#20b2aa")) + + theme_marain() + + theme(legend.title = element_text(size = 10), + legend.text = element_text(size = 10), + axis.text.x = element_text(angle = 0, hjust = 1)) + + +payload_carriers <- payload[carriers, on="tourId"] +payload_carriers$vehicleCategory <- "LightDutyTruck" +payload_carriers[vehicleTypeId == "FREIGHT-2"]$vehicleCategory <- "HeavyDutyTruck" +p <- payload_carriers[,time24:=estimatedTimeOfArrivalInSec%%(24*3600),][,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(time24),"30 min")), vehicleCategory)] %>% + ggplot(aes(timeBin, N, colour=vehicleCategory)) + + geom_line() + + scale_x_datetime("Hour", + breaks=scales::date_breaks("2 hour"), + labels=scales::date_format("%H", tz = dateTZ)) + + scale_y_continuous("Activity", breaks = scales::pretty_breaks()) + + scale_colour_manual("Vehicle Category", values = c("#eca35b", "#20b2aa")) + + theme_marain() + + theme(legend.title = element_text(size = 10), + legend.text = element_text(size = 10), + axis.text.x = element_text(angle = 0, hjust = 1)) +ggsave(pp(freightWorkDir,'/output/frism-activity-by-category.png'),p,width=6,height=3,units='in') + + +## MODE SPLIT # pt$mode2 <- "Transit" # pt[mode=="car"]$mode2 <- "Car" # pt[mode=="car"&startsWith(vehicle,"rideHailVehicle")]$mode2 <- "Ridehail" @@ -34,76 +127,41 @@ nrow(freight_pt) # pt[mode=="walk"]$mode2 <- "Walk" # pt[mode=="bike"]$mode2 <- "Bike" # summary <- pt[,.(VMTInMiles=mean(length)/1609.34,fuelInKW=(mean(primaryFuel+secondaryFuel))*2.77778e-7),by=.(mode2)] -# - - -factor.remap <- c('Walk'='Walk','Bike'='Bike','Ridehail'='Ridehail','Car'='Car','Transit'='Public Transit', 'Freight'='Freight') -factor.colors <- c('Walk'='#669900','Bike'='#FFB164','Ridehail'='#B30C0C','Car'='#8A8A8A','Transit'='#0066CC','Freight'="#660099") -factor.colors.remapped <- factor.colors -ggplot(summary, aes(x="",y=VMTInMiles,fill=mode2))+ - geom_bar(stat='identity')+ - labs(y='',x='Scenario',fill='Mode',title='Mobility Metrics')+ - theme_marain()+ - theme(axis.text.x = element_text(angle = 0, hjust=0.5),strip.text = element_text(size=rel(1.2)))+ - scale_fill_manual(values = factor.colors.remapped) - - -source("~/Documents/Workspace/scripts/common/keys.R") -register_google(key = google_api_key_1) -oaklandMap <- ggmap::get_googlemap("oakland california", zoom = 13, maptype = "roadmap") -shpFile <- pp(activitySimDir, "/__San_Francisco_Bay_Region_2010_Census_Block_Groups-shp/641aa0d4-ce5b-4a81-9c30-8790c4ab8cfb202047-1-wkkklf.j5ouj.shp") -sfBayCbg <- st_read(shpFile) -# ggplot(data = oaklandCbg) + geom_sf()+ -# coord_sf( xlim = c(-130, -60),ylim = c(20, 50)) - - - -freight_pt[,hour:=as.integer(arrivalTime/3600)%%24] -##1 -# freight_pt_withCBG <- data.table::as.data.table(st_intersection(freight_pt_asSf,sfBayCbg)) -# freight_pt_summary <- freight_pt_withCBG[,.(count=.N),by=.(blkgrpid)] -# freight_pt_withCBG_asSf <- st_join(sfBayCbg, freight_pt_asSf) -# data <- freight_pt_withCBG_asSf %>% -# group_by(blkgrpid) %>% -# summarize(geometry = st_union(geometry)) -# ggplot() + -# geom_sf(data = data, aes(fill = blkgrpid)) + -# theme(legend.position = "none") +# factor.remap <- c('Walk'='Walk','Bike'='Bike','Ridehail'='Ridehail','Car'='Car','Transit'='Public Transit', 'Freight'='Freight') +# factor.colors <- c('Walk'='#669900','Bike'='#FFB164','Ridehail'='#B30C0C','Car'='#8A8A8A','Transit'='#0066CC','Freight'="#660099") +# factor.colors.remapped <- factor.colors +# ggplot(summary, aes(x="",y=VMTInMiles,fill=mode2))+ +# geom_bar(stat='identity')+ +# labs(y='',x='Scenario',fill='Mode',title='Mobility Metrics')+ +# theme_marain()+ +# theme(axis.text.x = element_text(angle = 0, hjust=0.5),strip.text = element_text(size=rel(1.2)))+ +# scale_fill_manual(values = factor.colors.remapped) + + +# *************************** +# B2B vs B2C +# *************************** +b2b_pt <- freight_pt[grepl("b2b",vehicle)][,label:="B2B"] +b2c_pt <- freight_pt[grepl("b2c",vehicle)][,label:="B2C"] -##2 +## FREIGHT B2C GEO DISTRIBUTION OF STOPS #countyNames <- c('Alameda County','Contra Costa County','Marin County','Napa County','Santa Clara County','San Francisco County','San Mateo County','Sonoma County','Solano County') source("~/Documents/Workspace/scripts/common/keys.R") register_google(key = google_api_key_1) oakland_map <- ggmap::get_googlemap("alameda california", zoom = 9, maptype = "roadmap",color = "bw", style = c(feature = "all", element = "labels", visibility = "off")) - -clusteringFreightBy <- function(data,cols,dataCbg,numClusters,labelData) { - data_asSf <- st_as_sf(data,coords=cols,crs=4326,agr="constant") - data_withCBG_asSf <- st_intersection(data_asSf,dataCbg) - data_withCBG_asSf$X <- st_coordinates(data_withCBG_asSf$geometry)[,1] - data_withCBG_asSf$Y <- st_coordinates(data_withCBG_asSf$geometry)[,2] - data_withCBG <- data.table::as.data.table(data_withCBG_asSf) - data_withCBG[,cluster:=kmeans(data_withCBG[,.(X,Y)],numClusters)$cluster] - result <- data_withCBG[,.(count=.N,x2=mean(X),y2=mean(Y)),by=.(hour,cluster)] - result$label <- labelData - result -} - -b2b_pt <- freight_pt[grepl("b2b",vehicle)][,label:="B2B"] -b2c_pt <- freight_pt[grepl("b2c",vehicle)][,label:="B2C"] - +shpFile <- pp(activitySimDir, "/__San_Francisco_Bay_Region_2010_Census_Block_Groups-shp/641aa0d4-ce5b-4a81-9c30-8790c4ab8cfb202047-1-wkkklf.j5ouj.shp") +sfBayCbg <- st_read(shpFile) b2b_pt_stops <- clusteringFreightBy(b2b_pt,c("endX","endY"),sfBayCbg,50,"B2B") b2c_pt_stops <- clusteringFreightBy(b2c_pt,c("endX","endY"),sfBayCbg,50,"B2C") - -# Plot it to_plot <- rbind(b2c_pt_stops) -hours_to_show <- c(8, 12, 16) +hours_to_show <- c(8, 14, 20) toplot <- to_plot[hour %in% hours_to_show] toplot$hour.label <- "" toplot[hour==8]$hour.label <- "8am" -toplot[hour==12]$hour.label <- "12pm" -toplot[hour==16]$hour.label <- "4pm" +toplot[hour==14]$hour.label <- "2pm" +toplot[hour==20]$hour.label <- "8pm" #toplot[hour==20]$hour.label <- "8pm" -hour.label_order <- c("8am", "12pm", "4pm") +hour.label_order <- c("8am", "2pm", "8pm") # counties <- data.table(urbnmapr::counties)[county_name%in%countyNames] #,xlim=c(-122.36,-122.20),ylim=c(37.70,37.81) p <- oakland_map %>% @@ -123,9 +181,10 @@ p <- oakland_map %>% strip.text.x = element_text(size = 10)) + facet_wrap(~factor(hour.label, levels=hour.label_order)) + guides(color= guide_legend(), size=guide_legend()) -ggsave(pp(workDir,'/b2c-stops.png'),p,width=9,height=5,units='in') +ggsave(pp(freightWorkDir,'/output/b2c-stops.png'),p,width=9,height=5,units='in') +## FREIGHT B2B GEO DISTRIBUTION OF STOPS toplot <- rbind(b2b_pt_stops) p <- oakland_map %>% ggmap() + @@ -142,18 +201,12 @@ p <- oakland_map %>% axis.ticks.x = element_blank(), axis.ticks.y = element_blank(), strip.text.x = element_text(size = 10)) -ggsave(pp(workDir,'/b2b-stops.png'),p,width=4,height=5,units='in') - +ggsave(pp(freightWorkDir,'/b2b-stops.png'),p,width=4,height=5,units='in') -to_plot <- rbind(b2c_pt_stops,b2b_pt_stops)[,.(stopsPerHour=sum(cluster)),by=.(label,hour)] -ggplot(to_plot) + geom_line(aes(hour, stopsPerHour, colour=label)) +## FREIGHT ACTIVITY to_plot <- rbind(b2b_pt,b2c_pt) -to_plot$timeBin <- as.integer(to_plot$time/1800) - - -to_plot <- rbind(b2b_pt,b2c_pt) -p <- to_plot[,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(arrivalTime),"15 min")), label)] %>% +p <- to_plot[,time24:=arrivalTime%%(24*3600),][,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(time24),"30 min")), label)] %>% ggplot(aes(timeBin, N, colour=label)) + geom_line() + scale_x_datetime("Hour", @@ -165,12 +218,10 @@ p <- to_plot[,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(arrivalTime),"15 min")), theme(legend.title = element_text(size = 10), legend.text = element_text(size = 10), axis.text.x = element_text(angle = 0, hjust = 1)) -ggsave(pp(workDir,'/freight-activity.png'),p,width=6,height=3,units='in') - +ggsave(pp(freightWorkDir,'/freight-activity.png'),p,width=6,height=3,units='in') +## FREIGHT AVG VMT to_plot <- rbind(b2b_pt,b2c_pt)[,.(VMT=mean(length)/1609.3),by=.(label)] -ggplot(to_plot, ) - p <- ggplot(to_plot, aes(x=label,y=VMT,fill=label))+ geom_bar(stat='identity')+ labs(y='Miles',x='',title='Avg VMT')+ @@ -180,30 +231,150 @@ p <- ggplot(to_plot, aes(x=label,y=VMT,fill=label))+ axis.text.x = element_blank(), legend.title = element_text(size = 10), legend.text = element_text(size = 10)) -ggsave(pp(workDir,'/freight-avg-vmt.png'),p,width=4,height=3,units='in') +ggsave(pp(freightWorkDir,'/freight-avg-vmt.png'),p,width=4,height=3,units='in') + + +# *************************** +# LDT vs HDT +# *************************** +ldt_pt <- freight_pt[vehicleType == "FREIGHT-1"][,category:="LightDutyTruck"] +hdt_pt <- freight_pt[vehicleType == "FREIGHT-2"][,category:="HeavyDutyTruck"] + +## FREIGHT ACTIVITY BY TRUCK CATEGORY +to_plot <- rbind(ldt_pt,hdt_pt) +p <- to_plot[,time24:=arrivalTime%%(24*3600),][,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(time24),"30 min")), category)] %>% + ggplot(aes(timeBin, N, colour=category)) + + geom_line() + + scale_x_datetime("Hour", + breaks=scales::date_breaks("2 hour"), + labels=scales::date_format("%H", tz = dateTZ)) + + scale_y_continuous("Activity", breaks = scales::pretty_breaks()) + + scale_colour_manual("Vehicle Category", values = c("#eca35b", "#20b2aa")) + + theme_marain() + + theme(legend.title = element_text(size = 10), + legend.text = element_text(size = 10), + axis.text.x = element_text(angle = 0, hjust = 1)) +ggsave(pp(freightWorkDir,'/freight-activity-by-category.png'),p,width=6,height=3,units='in') + +## FREIGHT AVG VMT BY TRUCK CATEGORY +to_plot <- rbind(ldt_pt,hdt_pt)[,.(VMT=mean(length)/1609.3),by=.(category)] +p <- ggplot(to_plot, aes(x=category,y=VMT,fill=category))+ + geom_bar(stat='identity')+ + labs(y='Miles',x='',title='Avg VMT')+ + scale_fill_manual("Vehicle Category", values = c("#eca35b", "#20b2aa")) + + theme_marain()+ + theme(strip.text = element_text(size = 10), + axis.text.x = element_blank(), + legend.title = element_text(size = 10), + legend.text = element_text(size = 10)) +ggsave(pp(freightWorkDir,'/freight-avg-vmt-by-category.png'),p,width=4,height=3,units='in') + + + +################ *************************** +################ validation CALTrans +################ *************************** + +##### PREPARING NETWORK AND MATCH IT WITH POSTMILE AND TRUCK AADTT DATA +#"primary","secondary","tertiary" +network <- readCsv(normalizePath(paste(freightDir,"/validation/beam/network.csv",sep=""))) +network_cleaned <- network[ + linkModes %in% c("car;bike", "car;walk;bike") & attributeOrigType %in% c("motorway","trunk","primary", "secondary")][ + ,-c("numberOfLanes", "attributeOrigId", "fromNodeId", "toNodeId", "toLocationX", "toLocationY")] +counties <- data.table::data.table( + COUNTY = c("Alameda", "Contra Costa", "Marin", "Napa", "Santa Clara", + "San Francisco", "San Mateo", "Solano", "Sonoma"), + CNTY=c("ALA", "CC", "MRN", "NAP", "SCL", "SF", "SM", "SOL", "SON") +) +linkStats <- readCsv(normalizePath(paste(freightDir,"/validation/beam/0.linkstats.new.csv.gz",sep=""))) + +#data.table::fwrite(network_cleaned, pp(freightDir,"/validation/network_cleaned.csv"), quote=F) + +# truck_aadtt_2017 <- readCsv(normalizePath(paste(freightDir,"/validation/2017_truck_aadtt.csv",sep=""))) +# truck_aadtt_2017_sfbay <- assignPostMilesGeometries(truck_aadtt_2017[counties, on=c("CNTY"="CNTY")], +# pp(freightDir, "/validation/ds1901_shp/ds1901.shp")) +truck_aadtt_2017_sfbay <- data.table::fread( + normalizePath(paste(freightDir,"/validation/2017_truck_aadtt_geocoded.csv",sep="")), + header=T, + sep=",") + +truck_aadtt_with_linkId <- assignLinkIdToTruckAADTT(network_cleaned, 26910, truck_aadtt_2017_sfbay, 500, 2) +ata.table::fwrite(truck_aadtt_with_linkId, pp(freightDir,"/validation/truck_aadtt_with_linkId.csv"), quote=F) +truck_aadtt_with_linkData <- merge(data.table::as.data.table(truck_aadtt_with_linkId), network_cleaned, by="linkId") + + +##### PREPARING BEAM/LINKSTAT DATA +#linkstats_noFreight <- readCsv(normalizePath(paste(freightDir,"/validation/beam/0.linkstats.nofreight.csv.gz",sep=""))) +#linkstats_wFreight <- readCsv(normalizePath(paste(freightDir,"/validation/beam/0.linkstats.withfreight.csv.gz",sep=""))) +#totVolume <- sum(linkstats_wFreight$volume) - sum(linkstats_noFreight$volume) +#totAADTT <- sum(truck_aadtt_2017_bay_area$TRUCK_AADT) +lsWFreight <- linkstats_wFreight[,.(volumeWithFreight=sum(volume),lengthInMeter=first(length)),by=.(link)] +lsNoFreight <- linkstats_noFreight[,.(volumeNoFreight=sum(volume)),by=.(link)] +linkStats <- lsWFreight[lsNoFreight, on=c("link")] +linkStats$truck_volume <- linkStats$volumeWithFreight - linkStats$volumeNoFreight +linkStats$vehicle_volume <- linkStats$volumeWithFreight +linkStats$truck_share <- linkStats$truck_volume/linkStats$vehicle_volume +linkStats <- linkStats[,-c("volumeWithFreight","volumeNoFreight")] +linkStats[is.na(truck_share)]$truck_share <- 0.0 +linkStats[is.infinite(truck_share)]$truck_share <- 0.0 + + +##### MERGING +truck_aadtt_with_linkStats <- merge(truck_aadtt_with_linkData, linkStats, by.x="linkId", by.y="link") + +sum(truck_aadtt_with_linkStats$TRUCK_AADT) +sum(truck_aadtt_with_linkStats$truck_volume) + +LinkStatsWithLocation <- linkStats[network_cleaned, on=c("link"="linkId")] + +LinkStats_as_sf <- st_transform(st_as_sf( + LinkStatsWithLocation, + coords = c("fromLocationX", "fromLocationY"), + crs = 26910, + agr = "constant"), 4326) + + +LinkStats_withTaz <- data.table::as.data.table(st_intersection(LinkStats_as_sf, st_buffer(sfBayTAZs, 0))) +LinkStats_withTaz <- LinkStats_withTaz[counties, on="county"] + +countyStats <- LinkStats_withTaz[,.(truck_volume=sum(truck_volume),vehicle_volume=sum(vehicle_volume)),by=.(county)][counties, on="county"] +unique_counties <- unique(countyStats$cnty) +SF_truck_aadtt_2017 <- truck_aadtt_2017[CNTY %in% unique_counties] +dist_truck_aadtt_2017 <- SF_truck_aadtt_2017[,.(TRUCK_AADT=mean(TRUCK_AADT),VEHICLE_AADT=mean(VEHICLE_AADT)),by=.(DIST)] -to_plot <- rbind(b2b_pt,b2c_pt)[,.(VMT=mean(primaryFuel+secondaryFuel)*2.77778e-7),by=.(label)] +county_truck_aadtt_2017 <- SF_truck_aadtt_2017[,.(TRUCK_AADT=sum(TRUCK_AADT),VEHICLE_AADT=sum(VEHICLE_AADT)),by=.(CNTY)] -all_pt_x <- data.table::as.data.table(rbind(b2b_pt,b2c_pt)[,c("time","vehicle","departureTime","arrivalTime","label")]) -all_pt_1 <- all_pt_x[,-c("arrivalTime")][order(time),`:=`(IDX = 1:.N),by=vehicle] -all_pt_2 <- all_pt_x[,-c("departureTime")][order(time),`:=`(IDX = 1+1:.N),by=vehicle] +truckBEAM_truckAADTT <- countyStats[county_truck_aadtt_2017, on=c("cnty"="CNTY")] -all_pt <- all_pt_1[all_pt_2, on=c("vehicle", "IDX", "label")][!is.na(arrivalTime)&!is.na(departureTime)] -all_pt[,`:=`(stopDuration = departureTime - arrivalTime)] -all_pt[,.(mean(stopDuration)),by=.(label)] +truckBEAM_truckAADTT %>% ggplot(aes(county)) + + geom_bar(truck_volume, ) -all_pt_1 <- all_pt[order(time),`:=`(IDX = 1:.N),by=vehicle] -all_pt_2 <- all_pt[order(time),`:=`(IDX = 1:.N),by=vehicle] -all_pt[,,by=.(vehicle)] +sfBayTAZs <- st_read(pp(freightDir, "/validation/TAZs/Transportation_Analysis_Zones.shp")) -all_pt_x[vehicle=="freight-vehicle-freightVehicle-b2b-1640"] +################ *************************** +################ validation HPMS +################ *************************** +sf_hpms <- st_read(pp(freightDir, "/validation/sf_hpms_inventory_clipped.geojson")) +Volume_beam <- sum(linkStats$TruckVolume) +Volume_hpms <- sum(sf_hpms$AADT_Combi+sf_hpms$AADT_Singl) +VMT_beam <- sum(linkStats$TruckVolume * linkStats$length/1609) +VMT_hpms <- (sum((sf_hpms$AADT_Combi+sf_hpms$AADT_Singl) * as.numeric(st_length(sf_hpms))/1609)) +Volume_beam/Volume_hpms +VMT_beam/VMT_hpms +freight_pt[,.(VMT=sum(length)/1609.0),by=.(vehicleType)] +freight_pt[,.(tourMT=sum(length)/1609.0),by=.(vehicle,vehicleType)][,.(avgTourMT=mean(tourMT)),by=.(vehicleType)] +write.csv( + freight_pt, + file = pp(freightWorkDir, "/freight.pt.0.events.csv"), + row.names=F, + quote=T) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 7f37c8e45b8..dfcc1fbce4b 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -27,7 +27,7 @@ expFactor <- (6.015/0.6015) severity_order <- c("Public <1MW", "Public 1-5MW", "Public >5MW", "Ridehail Depot <1MW", "Ridehail Depot 1-5MW", "Ridehail Depot >5MW") extreme_lab_order <- c("<1MW", "1-5MW", ">5MW") -dataDir <- normalizePath("~/Data/GEMINI/2022Feb/BATCH1") +dataDir <- normalizePath("~/Data/GEMINI/2022-04-20") #events <- readCsv(pp(dataDir, "/events/0.events.BASE.csv.gz")) #eventsDir <- paste(dataDir, "/events",sep="") resultsDir <- paste(dataDir, "/results",sep="") @@ -60,16 +60,13 @@ for(j in 1:nrow(publicLoads)){ scens <- as.data.table(readCsv(pp(resultsDir,'/../scenarios.csv'))) all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) -# sc2 <- all.sessions[code=="SC2"&!startsWith(parkingZoneId,"X")] -# sc3 <- all.sessions[code=="SC3"&!startsWith(parkingZoneId,"X")] -# nrow(sc2)*900/3600 -# nrow(sc3)*900/3600 ##### # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') -scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') -scenarioBaselineLabel <- 'Scenario4a-Base' +# scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') +scenarioNames <- c('Base A') +scenarioBaselineLabel <- 'Base A' #all.loads <- all.loads[!is.na(loadType)] ########################################## # LOADS & ENERGY @@ -206,7 +203,7 @@ p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadTy facet_wrap(~factor(name,scenarioNames),ncol = 2) ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units='in') -all.loads[name%in%scenarioNames,.(fuel=sum(fuel)),by=.(name)] + ## public daily charging by scenario toplot <- join.on(all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','name')],all.loads[site=='public'&name%in%scenarioNames][,.(tot.kw=sum(kw)),by=c('name')],'name','name') p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=kw/tot.kw*100,fill=factor(loadType, levels = names(chargingTypes.colors))))+ @@ -215,7 +212,7 @@ p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=kw/tot.kw*100,fill=factor( scale_fill_manual(values = chargingTypes.colors, name = "") + labs(x = "", y = "Share of Charging (%)", fill="load severity", title="Public Charging") + theme(axis.text.x = element_text(angle = 0, hjust=0.5), strip.text = element_text(size=rel(1.2))) -#theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) + #theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) ggsave(pp(plotsDir,'/public-daily-charging-by-scenario.png'),p,width=5,height=3,units='in') @@ -247,7 +244,7 @@ p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=value,fill=factor(severity theme_marain()+ scale_fill_manual(values = c(brewer.pal(3, "Blues"), brewer.pal(3, "Reds"))) + theme(axis.text.x = element_text(angle=0, hjust=0.5), strip.text = element_text(size=rel(1.2))) -#theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) + #theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) ggsave(pp(plotsDir,'/energy-charged-by-scenario.png'),p,width=8,height=3,units='in') @@ -262,7 +259,7 @@ p <- ggplot(xfc.metric,aes(x=factor(name,scenarioNames),y=xfc.hours,fill=factor( theme_marain()+ scale_fill_manual(values = c(brewer.pal(3, "Blues")[c(1,3)], brewer.pal(3, "Reds")[c(1,3)])) + theme(axis.text.x = element_text(angle=0, hjust=0.5),strip.text = element_text(size=rel(1.2))) -#theme(axis.text.x = element_text(angle = 30, hjust=1),strip.text = element_text(size=rel(1.2))) + #theme(axis.text.x = element_text(angle = 30, hjust=1),strip.text = element_text(size=rel(1.2))) ggsave(pp(plotsDir,'/xfc-hours-per-site-per-day.png'),p,width=5,height=3,units='in') diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 61ead526f6a..55313323c95 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -21,8 +21,21 @@ shpFile <- pp(workDir, "/shapefile/Oakland+Alameda+TAZ/Transportation_Analysis_Z oaklandCbg <- st_read(shpFile) ### -eventsraw <- readCsv(pp(workDir, "/0.events.csv.gz")) -events <- readCsv(pp(workDir, "/filtered.0.events.csv.gz")) +#eventsraw <- readCsv(pp(workDir, "/0.events.csv.gz")) +events1 <- readCsv(pp(workDir, "/2022Feb/BATCH1/events/filtered.0.events.SC4b.csv.gz")) +events2 <- readCsv(pp(workDir, "/2022Feb/BATCH1/events/filtered.0.events.SC6.csv.gz")) + + +infra <- readCsv(pp(workDir, "/2022-04/infrastructure/4a_output_2022_Apr_13_pubClust.csv")) +infra[, c("GEOM", "locationX", "locationY") := tstrsplit(geometry, " ", fixed=TRUE)] +infra <- infra[,-c("geometry", "GEOM")] +write.csv( + infra, + file = pp(workDir, "/2022-04/infrastructure/4a_output_2022_Apr_13_pubClust_XY.csv"), + row.names=FALSE, + quote=FALSE) + + ## temp workdir <- "/Users/haitamlaarabi/Data/GEMINI/enroute-scenario3" @@ -34,7 +47,7 @@ workdir <- "/Users/haitamlaarabi/Data/GEMINI/enroute-scenario3" # row.names=FALSE, # quote=FALSE, # na="0") -# +# # enroute <- readCsv(pp(workdir,"/enroute.0.events.csv.gz")) # enroute.ref <- enroute[type=="RefuelSessionEvent"] # write.csv( @@ -58,7 +71,7 @@ enroute.ref.sum$scenario <- "Enroute" ref <- data.table::data.table(rbind(default.ref.sum,enroute.ref.sum)) -ref %>% +ref %>% ggplot(aes(chargingPointType, shareFuel, fill=scenario)) + geom_bar(stat='identity',position='dodge') + theme_marain() + @@ -76,7 +89,7 @@ ref.change <- data.table::data.table( relativeEnergy=c((enroute.ref.nonfc/default.ref.nonfc)-1,(enroute.ref.fc/default.ref.fc)-1) ) -p <- ref.change %>% +p <- ref.change %>% ggplot(aes(scenario, relativeEnergy, fill=scenario)) + geom_bar(stat='identity',position='dodge') + theme_marain() + @@ -91,7 +104,7 @@ ref[chargingPointType=="dcfast(50.0|DC)"]$chargingPoint <- "Fast" ref[chargingPointType=="ultrafast(250.0|DC)"]$chargingPoint <- "XFC" chargingPoint_order <- c("Level1/2","Fast","XFC") -ref %>% +ref %>% ggplot(aes(factor(chargingPoint, levels=chargingPoint_order), shareFuel, fill=scenario)) + geom_bar(stat='identity',position='dodge') + theme_marain() + @@ -305,7 +318,7 @@ oakland_charging_events_merged_with_urbansim_tripIds_scaledUpby10 <- scaleUpAllS # quote=FALSE, # na="") # -# +# # initInfra_1_5_updated_constrained_non_AlamedaOakland[startsWith(reservedFor, "household")] # # initInfra_1_5[household_id == 1800619] @@ -434,9 +447,6 @@ write.csv( na="") -test <- readCsv(pp(workDir, "/2021Aug22-Oakland/stations/gemini-base-scenario-2-charging-with-household-infra16.csv")) - - ##### chargingBehaviorFunc <- function(DT) { rseSum <- DT[,.(fuel=sum(fuel)),by=.(parkingType,chargingPointType)] @@ -514,8 +524,8 @@ charging050 <- charging050[,fuel_100_050:=fuel100/fuel050][,fuel_100_050_W:=coef # charging <- rse100[,.(fuel100=sum(fuel)),by=.(parkingType, chargingPointType)] # charging_100_010 <- data.table( -# chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", -# "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", +# chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", +# "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", # "publicfc(150.0|DC)", "publicxfc(250.0|DC)"), # coef_100_010=c(8.02,6.87,9.00,6.41,8.17,10.33)) # charging010 <- rse010[,.(fuel010=sum(fuel)),by=.(parkingType,chargingPointType)][ @@ -523,11 +533,11 @@ charging050 <- charging050[,fuel_100_050:=fuel100/fuel050][,fuel_100_050_W:=coef # charging_100_010,on=c("chargingPointType")][ # ,fuel_100_010:=fuel100/fuel010][ # ,fuel_100_010_W:=coef_100_010*fuel_100_010] -# -# +# +# # charging_100_025 <- data.table( -# chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", -# "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", +# chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", +# "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", # "publicfc(150.0|DC)", "publicxfc(250.0|DC)"), # coef_100_025=c(2.95,2.56,3.69,2.65,3.18,4.53)) # charging025 <- rse025[,.(fuel025=sum(fuel)),by=.(parkingType,chargingPointType)][ @@ -535,11 +545,11 @@ charging050 <- charging050[,fuel_100_050:=fuel100/fuel050][,fuel_100_050_W:=coef # charging_100_025,on=c("chargingPointType")][ # ,fuel_100_025:=fuel100/fuel025][ # ,fuel_100_025_W:=coef_100_025*fuel_100_025] -# -# +# +# # charging_100_050 <- data.table( -# chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", -# "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", +# chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", +# "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", # "publicfc(150.0|DC)", "publicxfc(250.0|DC)"), # coef_100_050=c(1.33,1.20,1.88,1.35,1.67,2.28)) # charging050 <- rse050[,.(fuel050=sum(fuel)),by=.(parkingType,chargingPointType)][ @@ -547,12 +557,12 @@ charging050 <- charging050[,fuel_100_050:=fuel100/fuel050][,fuel_100_050_W:=coef # charging_100_050,on=c("chargingPointType")][ # ,fuel_100_050:=fuel100/fuel050][ # ,fuel_100_050_W:=coef_100_050*fuel_100_050] -# -# +# +# # charging <- charging[charging010, on=c("parkingType","chargingPointType")] # charging <- charging[charging025, on=c("parkingType","chargingPointType")] # charging <- charging[charging050, on=c("parkingType","chargingPointType")] -# +# # publiclevel2(7.2|AC) # publicfc(150.0|DC) # worklevel2(7.2|AC) @@ -563,8 +573,8 @@ charging050 <- charging050[,fuel_100_050:=fuel100/fuel050][,fuel_100_050_W:=coef #c(3.82, 141.68, 112.27, 9.02, 5.64, 64.84) #c(10.0,10.0,10.0,10.0,10.0,10.0) charging_0_010 <- data.table( - chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", - "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", + chargingPointType=c("homelevel1(1.8|AC)", "homelevel2(7.2|AC)", + "worklevel2(7.2|AC)","publiclevel2(7.2|AC)", "publicfc(150.0|DC)", "publicxfc(250.0|DC)"), fuel0_010_coef=c(8.02,6.87,9.00,6.41,8.17,10.33)) charging <- charging[charging_0_010,on=c("chargingPointType")][,fuel0_010:=fuel0/fuel001][,fuel0_010_t:=fuel0_010_coef*fuel0_010] @@ -619,9 +629,9 @@ test3All$time2 <- test3All$time%%(24*3600) #time<=14*3600&time>=10*3600, test3All[,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(time),"15 min")), actType2)] %>% ggplot(aes(timeBin, N, colour=actType2)) + - geom_line() + - scale_x_datetime("time", - breaks=scales::date_breaks("2 hour"), + geom_line() + + scale_x_datetime("time", + breaks=scales::date_breaks("2 hour"), labels=scales::date_format("%H", tz = dateTZ)) + scale_y_continuous(breaks = scales::pretty_breaks()) + theme_classic() + @@ -640,9 +650,9 @@ looTest2[ActivityType=="atwork"]$actType2 <- "work" looTest2[ActivityType=="Home"]$actType2 <- "home" looTest2[departure_time<=16&departure_time>=8,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(departure_time*3600),"1 hour")), actType2)] %>% ggplot(aes(timeBin, N, colour=actType2)) + - geom_line() + - scale_x_datetime("time", - breaks=scales::date_breaks("2 hour"), + geom_line() + + scale_x_datetime("time", + breaks=scales::date_breaks("2 hour"), labels=scales::date_format("%H", tz = dateTZ)) + scale_y_continuous(breaks = scales::pretty_breaks()) + theme_classic() + @@ -679,11 +689,11 @@ chargingEvents <- events.sim[,-c("type", "IDX")] nrow(chargingEvents[duration==0]) nrow(chargingEvents[duration>0]) -chargingEvents[duration<1800&duration>0] %>% ggplot(aes(duration)) + +chargingEvents[duration<1800&duration>0] %>% ggplot(aes(duration)) + theme_classic() + geom_histogram(bins = 30) -test <- chargingEvents[duration==0] +test <- chargingEvents[duration==0] test$kindOfVehicle <- "real" test[startsWith(vehicle,"VirtualCar")]$kindOfVehicle <- "virtual" @@ -737,7 +747,7 @@ events8 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-8.csv.gz")) # ev <- events1[startsWith(vehicleType, "ev-")] # phev <- events1[startsWith(vehicleType, "phev-")] # virtual <- events1[startsWith(vehicleType, "VirtualCarType")] -# +# # allEv <- rbind(ev,phev) # allEVSummary <- allEv[,.(.N),by=.(vehicle,vehicleType)] # allEVSummary$vehType <- "Car" @@ -745,14 +755,14 @@ events8 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-8.csv.gz")) # allEVSummary[grepl("SUV",vehicleType)]$vehType <- "SUV" # allEVSummary[grepl("Pickup",vehicleType)]$vehType <- "Pickup" # allEVSummary[,.N,by=.(vehType)] -# -# +# +# # n_ev <- length(unique(ev$vehicle)) # n_phev <- length(unique(phev$vehicle)) # n_virtual <- length(unique(virtual$vehicle)) # n_ev_virtual <- n_virtual*(n_ev/(n_ev+n_phev)) # n_phev_virtual <- n_virtual*(n_phev/(n_ev+n_phev)) -# +# # tot <- n_ev + n_phev + n_ev_virtual + n_phev_virtual # home_l1 <- c(214111.2,211923.08,208621.38,202296.8,194829.95,187391.03,179245.57,171491.27,164053.89,156328.68,149317.28,142827.17,136334.76,129988.95,123245.08,117163.17,110797.83,104364.94,98190.02,92319.37,86389.21,80431.88,74753.37,69292.44,62771.91,57877.63,52755.43,48026.31,42823.35,38926.68,35399.17,33372.94,32068.76,31352.66,30194.87,28925.32,27057.94,26295.52,25438.38,25708.78,26050.95,27227.11,27994.12,29514.74,32059.96,34931.46,37853.67,41214.31,44844.4,49689.12,54051.58,56591.05,58572.11,61640.34,64870.28,67340.67,70304.79,75464.69,82198.98,87824.1,96141.41,106715.73,117904.53,126863.88,136510.25,146884.4,157953.02,167726.08,179445.74,194061.4,210797.06,224026.44,236691.85,247128.19,255858.86,260320.45,263116.93,265472.88,268295.78,270321.62,271914.39,272345.16,271250.72,272341.52,271938.5,273983.09,274960.99,273487.06,271519.02,268411.56,265309.26,260089.08,254698.2,248714.27,241775.97,234571.86) @@ -761,7 +771,7 @@ events8 <- readCsv(pp(workDir, "/2022Mars-Calibration/0.events.b1-8.csv.gz")) # work_l2 <- c(2652.38,2488.76,2540.62,2572.39,2072.72,1872.36,1807.87,1945.27,1776.29,1547.8,1435.27,1562.15,1498.42,1460.53,2251.85,3499,5391.65,6120.19,6930.83,9421.13,15780.72,18806.46,24901.78,32720.76,48371.92,57512.69,74029.8,90552.08,125095.25,143729.09,173419.71,198975.58,246980.46,251954.92,256120.84,250745.85,254545.87,240578.38,223418.84,207430.87,190271.9,167443.04,150213.27,133096.22,119458.84,107286.2,95935.88,85443.66,77644.96,71057.83,66784.16,66993.52,66857.46,62364.67,61714.21,59384.28,56212.14,52570.95,49901.92,48116.44,45140.64,41447.78,42206.57,39041.89,37433.23,34350.84,31920.26,30529.58,28071.62,26228.93,24383.74,22007.31,20483.44,17821.87,17092.18,17393.01,16069.11,14293.97,12657.19,11710.86,10525.33,8932.18,8141.25,7892.47,7812.86,6883.76,6105.46,5509.72,5533.07,4846.82,4352.89,4475.37,4098.18,3458.24,3196.06,2820.21) # public_l2 <- c(19788.76,18253.6,15948.36,14610.69,13154.36,12062.03,10948.83,10387.54,9408.3,8252.05,6699.28,5991.59,5558.33,5303.43,5069,4458.53,4354.81,4287.25,3674.87,3940.49,5068.23,6015.32,7886.53,9011.21,13842.34,16395.02,18872.87,21881.2,25059.47,27813.08,32476.95,37535.23,47378.52,51027.56,55825.96,57967.57,65746.17,70316.27,73245.57,72648.68,76039.95,75117.16,76287.96,76544.59,76267.29,74199.54,75421.25,76531.96,79423.55,79431.21,78182.71,75911.15,76946.27,75698.35,75548.89,75372.07,75104.91,71943.68,70442.19,68094.09,72936.12,72580.56,70357.99,73058.22,73292.64,71539.89,69061.84,70978.03,72952.01,72969.42,76923.5,81983.69,87958.83,90399.75,90921.8,94572.56,97035.49,93019.79,88844.68,85019.96,78802.37,73560.37,64138.86,58119.14,50942.78,46139.02,42267.61,36899.5,33431.12,30559.24,29203,29484.51,26575.88,24058.79,23409.67,21778.24) # public_l3 <- c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,392.5,725.1,185.05,0,0.19,947.28,1440.06,4366.86,5009.1,4164.97,2661.76,4667.31,3887.1,8270.8,7615.17,14079.25,14335.69,11754.3,10793.05,13989.31,11593.17,13399.51,15847.89,17059.26,15505.72,14141.45,14448.21,16772.97,13977.83,16665.23,17113.04,16727.62,18224.13,21393.59,17138.68,16346.03,13321.24,13832.77,17703.98,17284.69,14626,18584.28,20115.24,16532.61,13048.34,11299.61,10443.42,9273.77,9134.84,12408.02,16232.54,17234.55,14942.52,9471.07,11043.17,13640.25,16696.61,14306.41,11058.68,8682.63,5775.34,3623.39,3078.95,2567.03,1351.45,392.31,392.31,392.31,418.33,784.62,624.82,392.31,392.31,279.59,0) -# +# # tot <- sum(home_l1) + sum(home_l2) + sum(work_l1) + sum(work_l2) + sum(public_l2) + sum(public_l3) # sum(home_l1)/tot # sum(home_l2)/tot @@ -815,9 +825,9 @@ mnl_param <- readCsv(pp(workDir, "/2022Mars-Calibration/mnl-param-beamLog.csv")) sampled <- mnl[mnlStatus=="sampled"] chosen <- mnl[mnlStatus=="chosen"] -mnl_param$result <- mnl_param$RangeAnxietyCost * -0.5 + - mnl_param$WalkingEgressCost * -0.086 + - mnl_param$ParkingTicketCost * -0.5 + +mnl_param$result <- mnl_param$RangeAnxietyCost * -0.5 + + mnl_param$WalkingEgressCost * -0.086 + + mnl_param$ParkingTicketCost * -0.5 + mnl_param$HomeActivityPrefersResidentialParking * 5.0 requestIds <- unique(mnl_param[grepl("Home", activityType)]$requestId) diff --git a/src/main/R/gemini/gemini-utils.R b/src/main/R/gemini/gemini-utils.R index 2dca2fd9501..c78dc547e23 100644 --- a/src/main/R/gemini/gemini-utils.R +++ b/src/main/R/gemini/gemini-utils.R @@ -14,18 +14,18 @@ loadTypes <- data.table::data.table( "homelevel1(1.8|AC)", "homelevel2(7.2|AC)", "worklevel2(7.2|AC)", "publiclevel2(7.2|AC)", - "publicfc(50.0|DC)", - "depotfc(150.0|DC)", - "publicfc(150.0|DC)", + "publicfc(50.0|DC)", + "depotfc(150.0|DC)", + "publicfc(150.0|DC)", "depotxfc(200.0|DC)", "depotxfc(300.0|DC)", "depotxfc(400.0|DC)", "publicfc(200.0|DC)", "publicxfc(200.0|DC)", "publicxfc(300.0|DC)", "publicxfc(400.0|DC)"), loadType = c("Home-L1", "Home-L2", "Work-L2", "Public-L2", - "DCFC", - "DCFC", "DCFC", - "XFC", "XFC", "XFC", + "DCFC", + "DCFC", + "XFC", "XFC", "XFC", "XFC", "XFC", "XFC", "XFC")) nextTimePoisson <- function(rate) { @@ -183,12 +183,12 @@ generateReadyToPlot <- function(resultsDirName, loadTypes, countyNames) { chargingTypes <- data.table() if (!file.exists(pp(sim.xfc.temp.file,"-loads.csv"))) { code <- unlist(strsplit(sim.xfc.file, "\\."))[3] - + sessions <- readCsv(sim.xfc.file) sessions[(depot),taz:=-kmeans(sessions[(depot)][,.(x,y)],20)$cluster] sessions[,code:=code] write.csv(sessions,file = pp(sim.xfc.temp.file,"-sessions.csv"),row.names=FALSE,quote=FALSE,na="0") - + loads <- extractLoads(sessions, loadTypes, countyNames) loads[,hour.bin2:=hour.bin%%24] loads[,code:=code] diff --git a/src/main/python/gemini/debugging.py b/src/main/python/gemini/debugging.py index 02608f320f1..82a58c5435c 100644 --- a/src/main/python/gemini/debugging.py +++ b/src/main/python/gemini/debugging.py @@ -1,4 +1,3 @@ -import helper import os mnl_lines = ["mnlStatus,requestId,parkingZoneId,chargingPointType,parkingType,costInDollars\n"] diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 8d967bd53e3..ffa1d08a954 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,8 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022Feb/BATCH1/' -filename = '0.events.SC4b2.csv.gz' +work_directory = '~/Data/GEMINI/2022-04-20/' +filename = '0.events.4aBase.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) compression = None if full_filename.endswith(".gz"): diff --git a/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py b/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py index 3c9b3c71cc5..6c307fad3c8 100644 --- a/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py +++ b/src/main/python/gemini/nrel_to_beam_charging_infrastruture.py @@ -2,34 +2,44 @@ import os import random from tqdm import tqdm - -nrel_file_input = os.path.expanduser('~/Data/GEMINI/2022Feb/siting/init1-7_2022_Feb_03_wgs84.csv') -smart_file_input = os.path.expanduser("~/Data/GEMINI/stations/taz-parking-sparse-fast-limited-l2-150-lowtech-b.csv") -nrel_file_converted_input = os.path.expanduser(nrel_file_input.split(".")[0] + "_converted.csv") -smart_file_updated_input = os.path.expanduser(smart_file_input.split(".")[0] + "_updated.csv") -smart_file_with_fees_input = os.path.expanduser(nrel_file_input.split(".")[0] + "_withFees.csv.gz") +from pyproj import Proj, transform +from pyproj import Transformer +import numpy as np +pd.options.mode.chained_assignment = None -def read_file(filename): +def read_csv_file(filename): compression = None if filename.endswith(".gz"): compression = 'gzip' return pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) +workdir = "~/Data/GEMINI/2022-04/infrastructure/" +nrel_file_input = os.path.expanduser(workdir + '6_output_2022_Apr_13_pubClust.csv') +smart_file_input = os.path.expanduser("~/Data/GEMINI/stations/taz-parking-sparse-fast-limited-l2-150-lowtech-b.csv") +nrel_file_converted_input = os.path.expanduser(nrel_file_input.split(".")[0] + "_converted.csv") +smart_file_updated_input = os.path.expanduser(smart_file_input.split(".")[0] + "_updated.csv") +smart_file_with_fees_input = os.path.expanduser(nrel_file_input.split(".")[0] + "_withFees.csv.gz") + +transformer = Transformer.from_crs(7131, 4326, always_xy=True) + + def convert_nrel_data(nrel_file, nrel_file_converted): if not os.path.exists(nrel_file_converted): - data = read_file(nrel_file) - data2 = data[["subSpace", "pType", "chrgType", "field_1", "household_id", "X", "Y", "housingTypes", "propertytype", "propertysubtype", "county"]] + data = read_csv_file(nrel_file) + data2 = data[["subSpace", "pType", "chrgType", "household_id", "geometry", "housingTypes", "propertytype", "county"]] + data2[['geomType', 'lon', 'lat']] = data2["geometry"].str.split(" ", expand=True) + xx, yy = transformer.transform(data2["lon"].values, data2["lat"].values) + data2["X"] = xx + data2["Y"] = yy + data2 = data2.drop(columns=['geomType', "lon", "lat", "geometry"], errors='ignore') data2 = data2.rename(columns={ "chrgType": "chargingPointType", "pType": "parkingType", "subSpace": "taz", - "X": "locationX", - "Y": "locationY", "housingTypes": "housingType", "propertytype": "propertyType", - "propertysubtype": "propertySubType", "county": "county" }) data2["parkingZoneId"] = "" @@ -37,22 +47,23 @@ def convert_nrel_data(nrel_file, nrel_file_converted): data2["pricingModel"] = "Block" data2["feeInCents"] = 0 data2["numStalls"] = 1 - data2.loc[data2["household_id"].notna(), ['reservedFor']] = data2.loc[data2["household_id"].notna()].apply( - lambda row1: "household(" + str(int(row1["household_id"])) + ")", axis=1) - data2.loc[data2["field_1"].notna(), ['parkingZoneId']] = data2.loc[data2["field_1"].notna()].apply( - lambda row2: "PEV-" + str(int(row2["taz"])) + "-" + str(int(row2["field_1"])), axis=1) - nrel_data = data2.drop(columns=['household_id', 'field_1']) + data2.loc[data2["household_id"].notna(), ['reservedFor']] = \ + "household(" + data2.loc[data2["household_id"].notna(), "household_id"].astype(int).astype(str) + ")" + frequency = data2['parkingZoneId'].count() + set_of_ids = np.random.randint(1000000, 9999999, frequency) + data2['parkingZoneId'] = data2["taz"].astype(str) + "-" + set_of_ids.astype(str) + nrel_data = data2.drop(columns=['household_id']) nrel_data.to_csv(nrel_file_converted, index=False) print("Reading nrel infrastructure done!") return nrel_data else: - return read_file(nrel_file_converted) + return read_csv_file(nrel_file_converted) # Reading fees def reading_sf_bay_fees(smart_file, smart_file_updated): if not os.path.exists(smart_file_updated): - smart_data = read_file(smart_file) + smart_data = read_csv_file(smart_file) smart_data["chargingPointType"] = "NoCharger" smart_data.loc[(smart_data["chargingType"] == "WorkLevel2(7.2|AC)") & (smart_data["parkingType"] == "Public"), ['chargingPointType']] = "publiclevel2(7.2|AC)" smart_data.loc[(smart_data["chargingType"] == "WorkLevel2(7.2|AC)") & (smart_data["parkingType"] == "Workplace"), ['chargingPointType']] = "worklevel2(7.2|AC)" @@ -65,7 +76,7 @@ def reading_sf_bay_fees(smart_file, smart_file_updated): print("Reading Fees done!") return smart_data else: - return read_file(smart_file_updated) + return read_csv_file(smart_file_updated) def assign_fees_to_infrastructure(nrel_data, fees_data, smart_file_with_fees): @@ -91,13 +102,8 @@ def assign_fees_to_infrastructure(nrel_data, fees_data, smart_file_with_fees): cumulated = cumulated + float(row2.numStalls) / float(tot_stalls) if cumulated >= rd_prob: break - if "(150.0|DC)" in row["chargingPointType"]: - memorized_fee = memorized_fee * 1.6 - elif "(250.0|DC)" in row["chargingPointType"]: - memorized_fee = memorized_fee * 2.2 - elif "(400.0|DC)" in row["chargingPointType"]: - memorized_fee = memorized_fee * 3.1 - row["feeInCents"] = memorized_fee + power = float(row["chargingPointType"].split("(")[1].split("|")[0]) + row["feeInCents"] = memorized_fee * max(power/150.0, 1.0) output = pd.DataFrame.from_dict(df_dict) output.reset_index(drop=True, inplace=True) output.to_csv(smart_file_with_fees, index=False) diff --git a/src/main/python/gemini/unlimited_charging_infrastructure.py b/src/main/python/gemini/unlimited_charging_infrastructure.py index b31c9661042..4c4b948397b 100644 --- a/src/main/python/gemini/unlimited_charging_infrastructure.py +++ b/src/main/python/gemini/unlimited_charging_infrastructure.py @@ -1,7 +1,7 @@ #ADD MANY 50DC 150DC 250DC 350DC headerfile = "taz,parkingType,pricingModel,chargingPointType,numStalls,feeInCents,reservedFor" -with open('gemini_taz_unlimited_parking_stalls.csv', mode='w') as csv_writer: +with open('sfbay_taz_unlimited_parking_stalls.csv', mode='w') as csv_writer: csv_writer.write(headerfile+"\n") for x in range(1, 1455): @@ -10,7 +10,7 @@ csv_writer.write(f"{x},Public,Block,NoCharger,9999999,0,Any" + "\n") -with open('gemini_taz_unlimited_charging_point.csv', mode='w') as csv_writer: +with open('sfbay_taz_unlimited_charging_point.csv', mode='w') as csv_writer: csv_writer.write(headerfile+"\n") for x in range(1, 1455): @@ -20,18 +20,18 @@ csv_writer.write(f"{x},Workplace,Block,WorkLevel2(7.2|AC),9999999,14.4,Any" + "\n") csv_writer.write(f"{x},Public,Block,PublicLevel2(7.2|AC),9999999,19.3,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicFC(50|DC),9999999,306.73,Any" + "\n") csv_writer.write(f"{x},Public,Block,PublicFC(150|DC),9999999,490.98,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicXFC(250|DC),9999999,675.05,Any" + "\n") - csv_writer.write(f"{x},Public,Block,PublicXFC(400|DC),9999999,950.52,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicFC(200|DC),9999999,654.64,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicXFC(300|DC),9999999,981.96,Any" + "\n") + csv_writer.write(f"{x},Public,Block,PublicXFC(400|DC),9999999,1309.28,Any" + "\n") -with open('gemini_taz_unlimited_depots.csv', mode='w') as csv_writer: +with open('sfbay_taz_unlimited_depots.csv', mode='w') as csv_writer: csv_writer.write(headerfile+"\n") for x in range(1, 1455): csv_writer.write(f"{x},Public,FlatFee,DepotFC(150.0|DC),9999999,490.98,ridehail(GlobalRHM)" + "\n") - csv_writer.write(f"{x},Public,FlatFee,DepotXFC(250.0|DC),9999999,675.05,ridehail(GlobalRHM)" + "\n") - csv_writer.write(f"{x},Public,FlatFee,DepotXFC(400.0|DC),9999999,950.52,ridehail(GlobalRHM)" + "\n") - + csv_writer.write(f"{x},Public,FlatFee,DepotXFC(200.0|DC),9999999,654.64,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotXFC(300.0|DC),9999999,981.96,ridehail(GlobalRHM)" + "\n") + csv_writer.write(f"{x},Public,FlatFee,DepotXFC(400.0|DC),9999999,1309.28,ridehail(GlobalRHM)" + "\n") From 74dc9e9591051137f83757786b5f167fa8aeed76 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 25 Apr 2022 20:12:12 +0600 Subject: [PATCH 075/307] Create and store network route for a person plan if it is empty --- .../agents/modalbehaviors/ChoosesMode.scala | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index 56a885ad8cd..bb9da727d62 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -30,13 +30,16 @@ import beam.sim.{BeamServices, Geofence} import beam.utils.logging.pattern.ask import beam.utils.plan.sampling.AvailableModeUtils._ import org.matsim.api.core.v01.Id +import org.matsim.api.core.v01.network.Link import org.matsim.api.core.v01.population.{Activity, Leg} -import org.matsim.core.population.routes.NetworkRoute +import org.matsim.core.population.routes.{NetworkRoute, RouteUtils} import org.matsim.core.utils.misc.Time import java.util.concurrent.atomic.AtomicReference +import scala.collection.JavaConverters import scala.concurrent.duration._ import scala.concurrent.{ExecutionContext, Future} +import scala.jdk.CollectionConverters.asJavaIterableConverter /** * BEAM @@ -736,6 +739,29 @@ trait ChoosesMode { routingFinished = true ) } + + // If person plan doesn't have a route for an activity create and save it + for { + activity <- nextActivity(choosesModeData.personData) + leg <- _experiencedBeamPlan.getTripContaining(activity).leg if leg.getRoute == null + } yield { + val links = + response.itineraries + .flatMap(_.beamLegs) + .find(_.mode == BeamMode.CAR) + .map { beamLeg => + beamLeg.travelPath.linkIds + .map(id => Id.create(id, classOf[Link])) + .toList + } + .getOrElse(List.empty) + + if (links.nonEmpty) { + val route = RouteUtils.createNetworkRoute(JavaConverters.seqAsJavaList(links), beamScenario.network) + leg.setRoute(route) + } + } + stay() using newData case Event(theRideHailResult: RideHailResponse, choosesModeData: ChoosesModeData) => From 541e7e0523fd86843a58786170f648025339ad09 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 27 Apr 2022 01:25:14 -0700 Subject: [PATCH 076/307] fixing overnight charging at public chargers --- .../agentsim/infrastructure/ParkingFunctions.scala | 14 ++++++++++---- .../agentsim/infrastructure/ParkingInquiry.scala | 2 -- .../agentsim/infrastructure/ScaleUpCharging.scala | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 6aee5412d8a..99227351ac6 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -124,7 +124,7 @@ class ParkingFunctions[GEO: GeoLevel]( case Some(result) => result case _ => inquiry.parkingActivityType match { - case ParkingActivityType.Init | ParkingActivityType.Home => + case ParkingActivityType.Home => val newStall = ParkingStall.defaultResidentialStall(inquiry.destinationUtm.loc, GeoLevel[GEO].defaultGeoId) ParkingZoneSearch.ParkingZoneSearchResult(newStall, DefaultParkingZone) case _ => @@ -213,11 +213,17 @@ class ParkingFunctions[GEO: GeoLevel]( */ protected def getPreferredParkingTypes(inquiry: ParkingInquiry): Set[ParkingType] = { // a lookup for valid parking types based on this inquiry - if (inquiry.searchMode == ParkingSearchMode.EnRouteCharging) Set(ParkingType.Public) - else { + if (inquiry.searchMode == ParkingSearchMode.EnRouteCharging) { + Set(ParkingType.Public) + } else if (inquiry.searchMode == ParkingSearchMode.Init) { + inquiry.parkingActivityType match { + case ParkingActivityType.Home => Set(ParkingType.Residential) + case ParkingActivityType.Work => Set(ParkingType.Workplace) + case _ => Set(ParkingType.Public) + } + } else { inquiry.parkingActivityType match { case ParkingActivityType.Home => Set(ParkingType.Residential, ParkingType.Public) - case ParkingActivityType.Init => Set(ParkingType.Residential, ParkingType.Public) case ParkingActivityType.Work => Set(ParkingType.Workplace, ParkingType.Public) case ParkingActivityType.Charge => Set(ParkingType.Workplace, ParkingType.Public, ParkingType.Residential) case _ => Set(ParkingType.Public) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala index 46ec3029157..331a4e3276c 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingInquiry.scala @@ -65,7 +65,6 @@ object ParkingInquiry extends LazyLogging { object ParkingActivityType extends Enum[ParkingActivityType] { val values: immutable.IndexedSeq[ParkingActivityType] = findValues case object Charge extends ParkingActivityType - case object Init extends ParkingActivityType case object Wherever extends ParkingActivityType case object Home extends ParkingActivityType case object Work extends ParkingActivityType @@ -75,7 +74,6 @@ object ParkingInquiry extends LazyLogging { def activityTypeStringToEnum(activityType: String): ParkingActivityType = { activityType.toLowerCase match { case "home" => ParkingActivityType.Home - case "init" => ParkingActivityType.Init case "work" => ParkingActivityType.Work case "charge" => ParkingActivityType.Charge case "wherever" => ParkingActivityType.Wherever diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 9441b803fcc..9259f40a356 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -45,7 +45,6 @@ trait ScaleUpCharging extends { else { Map( ParkingActivityType.Home -> cnmConfig.scaleUp.expansionFactor_home_activity, - ParkingActivityType.Init -> cnmConfig.scaleUp.expansionFactor_init_activity, ParkingActivityType.Work -> cnmConfig.scaleUp.expansionFactor_work_activity, ParkingActivityType.Charge -> cnmConfig.scaleUp.expansionFactor_charge_activity, ParkingActivityType.Wherever -> cnmConfig.scaleUp.expansionFactor_wherever_activity From 1281139af63f60099ef10d89a471c9621d77ff91 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 27 Apr 2022 15:44:24 -0700 Subject: [PATCH 077/307] merging develop --- build.gradle | 2 +- .../agents/household/HouseholdActor.scala | 165 ++++++++++-------- .../household/HouseholdFleetManager.scala | 9 +- .../scala/beam/sim/config/BeamConfig.scala | 6 - 4 files changed, 96 insertions(+), 86 deletions(-) diff --git a/build.gradle b/build.gradle index 59caaf95dfd..00e4717e40c 100755 --- a/build.gradle +++ b/build.gradle @@ -693,7 +693,7 @@ task buildImageWithoutTags(type: DockerBuildImage, dependsOn: createDockerfile) task buildImage(type: DockerTagImage, dependsOn: buildImageWithoutTags) { repository = "haitamlaarabi/beam" - tag = 'gemini-develop-enroute-overnight-charging-v1' + tag = 'gemini-develop-overnight-v1' targetImageId buildImageWithoutTags.getImageId() } diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index 1eaec39efbb..da16db4ec5e 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -164,6 +164,9 @@ object HouseholdActor { implicit val executionContext: ExecutionContext = context.dispatcher implicit val debug: Debug = beamServices.beamConfig.beam.debug + protected val generateEmergencyHousehold: Boolean = + beamScenario.beamConfig.beam.agentsim.agents.vehicles.generateEmergencyHouseholdVehicleWhenPlansRequireIt + override val supervisorStrategy: OneForOneStrategy = OneForOneStrategy(maxNrOfRetries = 0) { case _: Exception => Stop @@ -193,7 +196,7 @@ object HouseholdActor { private var personAndActivityToCav: Map[(Id[Person], Activity), BeamVehicle] = Map() private var personAndActivityToLegs: Map[(Id[Person], Activity), List[BeamLeg]] = Map() private var householdMembersToLocationTypeAndLocation: Map[Id[Person], (ParkingActivityType, String, Coord)] = Map() - private val trackingVehicleAssignmentAtInitialization = mutable.HashMap.empty[Id[BeamVehicle], Id[Person]] + private val trackingCAVAssignmentAtInitialization = mutable.HashMap.empty[Id[BeamVehicle], Id[Person]] private val householdVehicleCategories = List(Car, Bike) private var whoDrivesThisVehicle: Map[Id[BeamVehicle], Id[Person]] = Map() @@ -203,33 +206,44 @@ object HouseholdActor { override def loggedReceive: Receive = { case TriggerWithId(InitializeTrigger(tick), triggerId) => - householdMembersToLocationTypeAndLocation = household.members - .flatMap(person => - person.getSelectedPlan.getPlanElements.asScala.headOption - .flatMap { - case act: Activity => - Some( - person.getId -> (ParkingInquiry.activityTypeStringToEnum(act.getType), act.getType, act.getCoord) - ) - case _ => None - } - ) - .toMap - if (!householdMembersToLocationTypeAndLocation.exists(_._2._1 == ParkingActivityType.Home)) + householdMembersToLocationTypeAndLocation = household.members.flatMap { person => + if (isFreightCarrier) { + val vehicleIdFromPlans = Id.create( + beamServices.matsimServices.getScenario.getPopulation.getPersonAttributes + .getAttribute(person.getId.toString, "vehicle") + .toString, + classOf[BeamVehicle] + ) + whoDrivesThisVehicle = whoDrivesThisVehicle + (vehicleIdFromPlans -> person.getId) + } + person.getSelectedPlan.getPlanElements.asScala.headOption + .flatMap { + case act: Activity => + Some(person.getId -> (ParkingInquiry.activityTypeStringToEnum(act.getType), act.getType, act.getCoord)) + case _ => None + } + }.toMap + + if (!householdMembersToLocationTypeAndLocation.exists(_._2._1 == ParkingActivityType.Home)) { householdMembersToLocationTypeAndLocation ++= Map( Id.createPersonId("") -> (ParkingActivityType.Home, "Home", fallbackHomeCoord) ) + } - val vehiclesByCategory = + val vehiclesByCategories = vehicles.filter(_._2.beamVehicleType.automationLevel <= 3).groupBy(_._2.beamVehicleType.vehicleCategory) - //We should create a vehicle manager for cars and bikes for all households in case they are generated during the simulation - val vehiclesByAllCategories = vehicleCategories - .map(cat => cat -> vehiclesByCategory.getOrElse(cat, Map[Id[BeamVehicle], BeamVehicle]())) - .toMap + val vehiclesByAllCategories = if (isFreightCarrier) { + vehiclesByCategories + } else { + //We should create a vehicle manager for cars and bikes for + //all households in case they are generated during the simulation + householdVehicleCategories + .map(cat => cat -> Map[Id[BeamVehicle], BeamVehicle]()) + .toMap ++ vehiclesByCategories + } + val fleetManagers = vehiclesByAllCategories.map { case (category, vehiclesInCategory) => - val emergencyGenerator = - new EmergencyHouseholdVehicleGenerator(household, beamScenario, vehiclesAdjustment, category) val fleetManager = context.actorOf( Props( @@ -238,7 +252,9 @@ object HouseholdActor { chargingNetworkManager, vehiclesInCategory, householdMembersToLocationTypeAndLocation, - Some(emergencyGenerator) + if (generateEmergencyHousehold) + Some(new EmergencyHouseholdVehicleGenerator(household, beamScenario, vehiclesAdjustment, category)) + else None, whoDrivesThisVehicle, beamServices.beamConfig.beam.debug ) @@ -284,7 +300,7 @@ object HouseholdActor { .find(_._2._1 == ParkingActivityType.Home) .map(_._1) .getOrElse(householdMembersToLocationTypeAndLocation.keys.head) - trackingVehicleAssignmentAtInitialization.put(cav.id, personId) + trackingCAVAssignmentAtInitialization.put(cav.id, personId) val (_, _, location) = householdMembersToLocationTypeAndLocation(personId) cav.spaceTime = SpaceTime(location, 0) schedulerRef ! ScheduleTrigger(InitializeTrigger(0), cavDriverRef) @@ -560,7 +576,7 @@ object HouseholdActor { } def sendParkingOrChargingInquiry(vehicle: BeamVehicle, triggerId: Long): Future[Any] = { - val personId = trackingVehicleAssignmentAtInitialization(vehicle.id) + val personId = trackingCAVAssignmentAtInitialization(vehicle.id) val (_, activityType, location) = householdMembersToLocationTypeAndLocation(personId) val inquiry = ParkingInquiry.init( SpaceTime(location, 0), @@ -591,42 +607,27 @@ object HouseholdActor { private val realDistribution: UniformRealDistribution = new UniformRealDistribution() realDistribution.reseedRandomGenerator(beamScenario.beamConfig.matsim.modules.global.randomSeed) - private val generateEmergencyHousehold = - beamScenario.beamConfig.beam.agentsim.agents.vehicles.generateEmergencyHouseholdVehicleWhenPlansRequireIt - - def createVehicle( + def sampleVehicleTypeForEmergencyUse( personId: Id[Person], - vehicleIndex: Int, category: VehicleCategory, - whenWhere: SpaceTime, - manager: ActorRef - ): Option[BeamVehicle] = { - val vehicleTypeMaybe = - if (generateEmergencyHousehold && defaultCategory == category) { - category match { - case VehicleCategory.Car => - vehiclesAdjustment - .sampleVehicleTypesForHousehold( - 1, - VehicleCategory.Car, - household.getIncome.getIncome, - household.getMemberIds.size(), - householdPopulation = null, - whenWhere.loc, - realDistribution - ) - .headOption - .orElse { - beamScenario.vehicleTypes.get( - Id.create( - beamScenario.beamConfig.beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId, - classOf[BeamVehicleType] - ) - ) - } - case VehicleCategory.Bike => - beamScenario.vehicleTypes - .get( + whenWhere: SpaceTime + ): Option[BeamVehicleType] = { + if (defaultCategory == category) { + category match { + case VehicleCategory.Car => + vehiclesAdjustment + .sampleVehicleTypesForHousehold( + 1, + VehicleCategory.Car, + household.getIncome.getIncome, + household.getMemberIds.size(), + householdPopulation = null, + whenWhere.loc, + realDistribution + ) + .headOption + .orElse { + beamScenario.vehicleTypes.get( Id.create( beamScenario.beamConfig.beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId, classOf[BeamVehicleType] @@ -641,23 +642,37 @@ object HouseholdActor { classOf[BeamVehicleType] ) ) - None - } - } else None - vehicleTypeMaybe map { vehicleType => - val vehicle = new BeamVehicle( - Id.createVehicleId(personId.toString + "-emergency-" + vehicleIndex), - new Powertrain(vehicleType.primaryFuelConsumptionInJoulePerMeter), - vehicleType - ) - beamScenario.privateVehicles.put(vehicle.id, vehicle) - vehicle.initializeFuelLevelsFromUniformDistribution( - beamScenario.beamConfig.beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC - ) - vehicle.setManager(Some(manager)) - vehicle.spaceTime = whenWhere - vehicle - } + case _ => + logger.warn( + s"Person $personId is requiring a vehicle that belongs to category $category that is neither Car nor Bike" + ) + None + } + } else None + } + + def createAndAddVehicle( + vehicleType: BeamVehicleType, + personId: Id[Person], + vehicleIndex: Int, + whenWhere: SpaceTime, + manager: ActorRef + ): BeamVehicle = { + val vehicleManagerId = + VehicleManager.createOrGetReservedFor(household.getId.toString, VehicleManager.TypeEnum.Household).managerId + val vehicle = new BeamVehicle( + Id.createVehicleId(personId.toString + "-emergency-" + vehicleIndex), + new Powertrain(vehicleType.primaryFuelConsumptionInJoulePerMeter), + vehicleType, + new AtomicReference[Id[VehicleManager]](vehicleManagerId) + ) + vehicle.initializeFuelLevelsFromUniformDistribution( + beamScenario.beamConfig.beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC + ) + beamScenario.privateVehicles.put(vehicle.id, vehicle) + vehicle.setManager(Some(manager)) + vehicle.spaceTime = whenWhere + vehicle } } } diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index fab7bfdde52..cc951d2871e 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -200,6 +200,11 @@ class HouseholdFleetManager( inquiry.whereWhen, self ) + logger.warn( + s"No vehicles available for category ${category} available for " + + s"person ${inquiry.personId.toString}, creating a new vehicle with id ${vehicle.id.toString}" + ) + // Create a vehicle out of thin air nextVehicleIndex += 1 val mobilityRequester = sender() @@ -214,10 +219,6 @@ class HouseholdFleetManager( Some(vehicle), triggerId = inquiry.triggerId ) - logger.warn( - s"No vehicles available for category ${category} available for " + - s"person ${inquiry.personId.toString}, creating a new vehicle with id ${vehicle.id.toString}" - ) responseFuture.collect { case ParkingInquiryResponse(stall, _, otherTriggerId) => vehicle.useParkingStall(stall) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index b00734a44ec..2d3a1e7bd4b 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -715,11 +715,8 @@ object BeamConfig { } case class Parking( -<<<<<<< HEAD estimatedMinParkingDuration: scala.Double, -======= fractionOfSameTypeZones: scala.Double, ->>>>>>> origin/develop maxSearchRadius: scala.Double, minNumberOfSameTypeZones: scala.Int, minSearchRadius: scala.Double, @@ -778,14 +775,11 @@ object BeamConfig { def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( -<<<<<<< HEAD estimatedMinParkingDuration = if (c.hasPathOrNull("estimatedMinParkingDuration")) c.getDouble("estimatedMinParkingDuration") else 60.0, -======= fractionOfSameTypeZones = if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, ->>>>>>> origin/develop maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, minNumberOfSameTypeZones = if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, From 708e6abb8f806427e070e4b89735f025ba2f41c2 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 28 Apr 2022 00:27:30 -0700 Subject: [PATCH 078/307] fmt --- src/main/R/gemini/gemini-main.R | 8 ++++--- src/main/R/gemini/gemini-processing.R | 4 ++-- src/main/python/gemini/events_processing.py | 4 ++-- src/main/resources/beam-template.conf | 1 + .../agents/household/HouseholdActor.scala | 9 +++++++- .../household/HouseholdFleetManager.scala | 9 +++++++- .../agents/parking/ChoosesParking.scala | 15 +++++-------- .../scala/beam/sim/config/BeamConfig.scala | 21 +++++++++++++++++++ 8 files changed, 52 insertions(+), 19 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index dfcc1fbce4b..b994de91e24 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -27,7 +27,7 @@ expFactor <- (6.015/0.6015) severity_order <- c("Public <1MW", "Public 1-5MW", "Public >5MW", "Ridehail Depot <1MW", "Ridehail Depot 1-5MW", "Ridehail Depot >5MW") extreme_lab_order <- c("<1MW", "1-5MW", ">5MW") -dataDir <- normalizePath("~/Data/GEMINI/2022-04-20") +dataDir <- normalizePath("~/Data/GEMINI/2022-04-28") #events <- readCsv(pp(dataDir, "/events/0.events.BASE.csv.gz")) #eventsDir <- paste(dataDir, "/events",sep="") resultsDir <- paste(dataDir, "/results",sep="") @@ -65,8 +65,10 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') -scenarioNames <- c('Base A') -scenarioBaselineLabel <- 'Base A' +#scenarioNames <- c('5b1', '5b2', '5b3', '5b4') +#scenarioBaselineLabel <- '5b4' +scenarioNames <- c('Base', 'BaseXFC', 'HighEV') +scenarioBaselineLabel <- 'BaseXFC' #all.loads <- all.loads[!is.na(loadType)] ########################################## # LOADS & ENERGY diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 55313323c95..c50b66b718d 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -22,8 +22,8 @@ oaklandCbg <- st_read(shpFile) ### #eventsraw <- readCsv(pp(workDir, "/0.events.csv.gz")) -events1 <- readCsv(pp(workDir, "/2022Feb/BATCH1/events/filtered.0.events.SC4b.csv.gz")) -events2 <- readCsv(pp(workDir, "/2022Feb/BATCH1/events/filtered.0.events.SC6.csv.gz")) +events1 <- readCsv(pp(workDir, "/2022-04-27-Calibration/events/filtered.0.events.5b4.csv.gz")) +events2 <- readCsv(pp(workDir, "/2022-04-28/events/filtered.0.events.5bBase.csv.gz")) infra <- readCsv(pp(workDir, "/2022-04/infrastructure/4a_output_2022_Apr_13_pubClust.csv")) diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index ffa1d08a954..8a2d48fecdf 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,8 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022-04-20/' -filename = '0.events.4aBase.csv.gz' +work_directory = '~/Data/GEMINI/2022-04-28/' +filename = '0.events.6HighEV.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) compression = None if full_filename.endswith(".gz"): diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 3c70ebac53f..c56f1932cf5 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -311,6 +311,7 @@ beam.agentsim.agents.vehicles.enroute.estimateOfMeanChargingDurationInSecond = 1 beam.agentsim.agents.vehicles.enroute.remainingDistanceWrtBatteryCapacityThreshold = 2 # this represents +/- the number of times an agent will enroute when ranger is x times lower than the remaining distance beam.agentsim.agents.vehicles.destination.work.refuelRequiredThresholdInMeters = 64373.8 # 40 miles beam.agentsim.agents.vehicles.destination.secondary.refuelRequiredThresholdInMeters = 32180.0 # 20 miles +beam.agentsim.agents.vehicles.destination.home.refuelRequiredThresholdInMeters = 128747.6 # 80 miles beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters = 128720.0 # 80 miles # these must be one of the shared vehicle types beam.agentsim.agents.vehicles.dummySharedCar.vehicleTypeId = "sharedVehicle-sharedCar" diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index da16db4ec5e..96062bdf38d 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -586,7 +586,14 @@ object HouseholdActor { triggerId = triggerId, searchMode = ParkingSearchMode.Init ) - if (vehicle.isEV) chargingNetworkManager ? inquiry else parkingManager ? inquiry + if ( + vehicle.isEV && vehicle.isRefuelNeeded( + beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.home.refuelRequiredThresholdInMeters, + beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters + ) + ) + chargingNetworkManager ? inquiry + else parkingManager ? inquiry } def dieIfNoChildren(): Unit = { diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index cc951d2871e..eedce38f1ed 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -18,6 +18,7 @@ import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse} import beam.agentsim.scheduler.BeamAgentScheduler.CompletionNotice import beam.agentsim.scheduler.HasTriggerId import beam.agentsim.scheduler.Trigger.TriggerWithId +import beam.sim.config.BeamConfig import beam.sim.config.BeamConfig.Beam.Debug import beam.utils.logging.pattern.ask import beam.utils.logging.{ExponentialLazyLogging, LoggingMessageActor} @@ -35,6 +36,7 @@ class HouseholdFleetManager( homeAndStartingWorkLocations: Map[Id[Person], (ParkingActivityType, String, Coord)], maybeEmergencyHouseholdVehicleGenerator: Option[EmergencyHouseholdVehicleGenerator], whoDrivesThisVehicle: Map[Id[BeamVehicle], Id[Person]], // so far only freight module is using this collection + beamConfig: BeamConfig, implicit val debug: Debug ) extends LoggingMessageActor with ExponentialLazyLogging { @@ -98,7 +100,12 @@ class HouseholdFleetManager( triggerId = triggerId, searchMode = ParkingSearchMode.Init ) - if (vehicle.isEV) (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) + if ( + vehicle.isEV && vehicle.isRefuelNeeded( + beamConfig.beam.agentsim.agents.vehicles.destination.home.refuelRequiredThresholdInMeters, + beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters + ) + ) (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) else (parkingManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) } } diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 96ccbdf908d..eaf4b0441b8 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -243,19 +243,14 @@ trait ChoosesParking extends { } private def isRefuelAtDestinationNeeded(vehicle: BeamVehicle, activityType: String): Boolean = { + val conf = beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination ParkingInquiry.activityTypeStringToEnum(activityType) match { - case ParkingActivityType.Home => true + case ParkingActivityType.Home => + vehicle.isRefuelNeeded(conf.home.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) case ParkingActivityType.Work => - // multiplying - vehicle.isRefuelNeeded( - beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.work.refuelRequiredThresholdInMeters, - beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters - ) + vehicle.isRefuelNeeded(conf.work.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) case _ => - vehicle.isRefuelNeeded( - beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.secondary.refuelRequiredThresholdInMeters, - beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters - ) + vehicle.isRefuelNeeded(conf.secondary.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) } } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 2d3a1e7bd4b..eb92c570031 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -1580,6 +1580,7 @@ object BeamConfig { object Vehicles { case class Destination( + home: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home, noRefuelThresholdInMeters: scala.Int, secondary: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary, work: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work @@ -1587,6 +1588,22 @@ object BeamConfig { object Destination { + case class Home( + refuelRequiredThresholdInMeters: scala.Double + ) + + object Home { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) + c.getDouble("refuelRequiredThresholdInMeters") + else 128747.6 + ) + } + } + case class Secondary( refuelRequiredThresholdInMeters: scala.Int ) @@ -1622,6 +1639,10 @@ object BeamConfig { def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( + home = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), noRefuelThresholdInMeters = if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, secondary = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary( From 80313718c6de18fe42fd298f142d7acd0a8d863a Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 28 Apr 2022 00:36:38 -0700 Subject: [PATCH 079/307] updating scripts. (controling charging at home in previous commit) --- src/main/R/gemini/gemini-main.R | 6 ++--- src/main/R/gemini/gemini-processing.R | 25 ++++++++++++++++++++- src/main/R/gemini/gemini-utils.R | 8 +++---- src/main/python/gemini/events_processing.py | 4 ++++ src/main/python/gemini/helper.py | 7 ------ 5 files changed, 34 insertions(+), 16 deletions(-) delete mode 100644 src/main/python/gemini/helper.py diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index b994de91e24..47b0623828b 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -215,7 +215,7 @@ p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=kw/tot.kw*100,fill=factor( labs(x = "", y = "Share of Charging (%)", fill="load severity", title="Public Charging") + theme(axis.text.x = element_text(angle = 0, hjust=0.5), strip.text = element_text(size=rel(1.2))) #theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/public-daily-charging-by-scenario.png'),p,width=5,height=3,units='in') +ggsave(pp(plotsDir,'/public-daily-charging-by-scenario.png'),p,width=7,height=3,units='in') @@ -247,7 +247,7 @@ p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=value,fill=factor(severity scale_fill_manual(values = c(brewer.pal(3, "Blues"), brewer.pal(3, "Reds"))) + theme(axis.text.x = element_text(angle=0, hjust=0.5), strip.text = element_text(size=rel(1.2))) #theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/energy-charged-by-scenario.png'),p,width=8,height=3,units='in') +ggsave(pp(plotsDir,'/energy-charged-by-scenario.png'),p,width=10,height=3,units='in') @@ -262,7 +262,7 @@ p <- ggplot(xfc.metric,aes(x=factor(name,scenarioNames),y=xfc.hours,fill=factor( scale_fill_manual(values = c(brewer.pal(3, "Blues")[c(1,3)], brewer.pal(3, "Reds")[c(1,3)])) + theme(axis.text.x = element_text(angle=0, hjust=0.5),strip.text = element_text(size=rel(1.2))) #theme(axis.text.x = element_text(angle = 30, hjust=1),strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/xfc-hours-per-site-per-day.png'),p,width=5,height=3,units='in') +ggsave(pp(plotsDir,'/xfc-hours-per-site-per-day.png'),p,width=7,height=3,units='in') diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index c50b66b718d..22436234fec 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -20,11 +20,34 @@ oaklandMap <- ggmap::get_googlemap("oakland california", zoom = 13, maptype = "r shpFile <- pp(workDir, "/shapefile/Oakland+Alameda+TAZ/Transportation_Analysis_Zones.shp") oaklandCbg <- st_read(shpFile) +vehicles1 <- readCsv(pp(workDir, "/vehicles.4Base.csv")) +vehicles1$stateOfCharge <- as.double(vehicles1$stateOfCharge) +vehicles1[is.na(stateOfCharge)]$stateOfCharge <- 0.5 +vehicles1[is.infinite(stateOfCharge)]$stateOfCharge <- 0.5 + +vehicles2 <- readCsv(pp(workDir, "/2.final_vehicles.5bBase.csv")) +vehicles2$stateOfCharge <- as.double(vehicles2$stateOfCharge) +vehicles2[is.na(stateOfCharge)]$stateOfCharge <- 0.5 +vehicles2[is.infinite(stateOfCharge)]$stateOfCharge <- 0.5 +vehicles2$stateOfCharge <- abs(vehicles2$stateOfCharge) +vehicles2[stateOfCharge < 0.2]$stateOfCharge <- 0.2 +vehicles2[stateOfCharge > 1]$stateOfCharge <- 1.0 + +vehicles3 <- rbind(vehicles1, vehicles2)[ + ,.(stateOfCharge=min(stateOfCharge)) + ,by=.(vehicleId,vehicleTypeId,householdId)] + +write.csv( + vehicles3, + file = pp(workDir, "/new.vehicles.5bBase.csv"), + row.names=FALSE, + quote=FALSE) + ### #eventsraw <- readCsv(pp(workDir, "/0.events.csv.gz")) events1 <- readCsv(pp(workDir, "/2022-04-27-Calibration/events/filtered.0.events.5b4.csv.gz")) events2 <- readCsv(pp(workDir, "/2022-04-28/events/filtered.0.events.5bBase.csv.gz")) - +test <- events2[type=="RefuelSessionEvent"][time-duration == 0] infra <- readCsv(pp(workDir, "/2022-04/infrastructure/4a_output_2022_Apr_13_pubClust.csv")) infra[, c("GEOM", "locationX", "locationY") := tstrsplit(geometry, " ", fixed=TRUE)] diff --git a/src/main/R/gemini/gemini-utils.R b/src/main/R/gemini/gemini-utils.R index c78dc547e23..098967663e3 100644 --- a/src/main/R/gemini/gemini-utils.R +++ b/src/main/R/gemini/gemini-utils.R @@ -4,7 +4,7 @@ library(data.table) nbOfBinsInHour <- 3600/900 binsInterval <- 1/nbOfBinsInHour siteXFCInKW <- 1000 -plugXFCInKW <- 250 +plugXFCInKW <- 200 time.bins <- data.table(time=seq(0,61,by=binsInterval)*3600,quarter.hour=seq(0,61,by=binsInterval)) chargingTypes.colors <- c("goldenrod2", "#66CCFF", "#669900", "#660099", "#FFCC33", "#CC3300", "#0066CC") @@ -14,16 +14,14 @@ loadTypes <- data.table::data.table( "homelevel1(1.8|AC)", "homelevel2(7.2|AC)", "worklevel2(7.2|AC)", "publiclevel2(7.2|AC)", - "publicfc(50.0|DC)", + "publicfc(50.0|DC)", "publicxfc(50.0|DC)", "publicfc(150.0|DC)", "depotfc(150.0|DC)", - "publicfc(150.0|DC)", "depotxfc(200.0|DC)", "depotxfc(300.0|DC)", "depotxfc(400.0|DC)", "publicfc(200.0|DC)", "publicxfc(200.0|DC)", "publicxfc(300.0|DC)", "publicxfc(400.0|DC)"), loadType = c("Home-L1", "Home-L2", "Work-L2", "Public-L2", - "DCFC", - "DCFC", + "DCFC", "DCFC", "DCFC", "DCFC", "XFC", "XFC", "XFC", "XFC", "XFC", "XFC", "XFC")) diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 8a2d48fecdf..151e4d9a3a3 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -4,17 +4,21 @@ work_directory = '~/Data/GEMINI/2022-04-28/' filename = '0.events.6HighEV.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) +print("reading " + filename) compression = None if full_filename.endswith(".gz"): compression = 'gzip' data = pd.read_csv(full_filename, sep=",", index_col=None, header=0, compression=compression) +print("filtering 1/2...") data_filtered = data.loc[ data.type.isin(["RefuelSessionEvent", "ChargingPlugInEvent", "ChargingPlugOutEvent", "actstart"]) ] +print("filtering 2/2...") data_filtered2 = data_filtered[ ["vehicle", "time", "type", "parkingTaz", "chargingPointType", "parkingType", "locationY", "locationX", "duration", "vehicleType", "person", "fuel", "parkingZoneId", "pricingModel", "actType"] ] +print("writing...") data_filtered2.to_csv(work_directory + "events/filtered." + filename) print("END") diff --git a/src/main/python/gemini/helper.py b/src/main/python/gemini/helper.py deleted file mode 100644 index 78ee1545f72..00000000000 --- a/src/main/python/gemini/helper.py +++ /dev/null @@ -1,7 +0,0 @@ -import pandas as pd - -def read_file(filename): - compression = None - if filename.endswith(".gz"): - compression = 'gzip' - return pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) \ No newline at end of file From 3e342d2b14a12601a6cbc7190fbbced89d801ff3 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 28 Apr 2022 01:18:32 -0700 Subject: [PATCH 080/307] adding maxChargingSessionsInSeconds --- src/main/R/gemini/gemini-processing.R | 4 ++-- src/main/resources/beam-template.conf | 3 ++- .../agentsim/agents/household/HouseholdActor.scala | 1 + .../DefaultRideHailDepotParkingManager.scala | 2 +- .../agentsim/infrastructure/ChargingFunctions.scala | 8 ++++---- .../agentsim/infrastructure/ChargingNetwork.scala | 4 ++-- .../ChargingNetworkManagerHelper.scala | 7 ++++++- .../infrastructure/DefaultRidehailFunctions.scala | 4 ++-- .../infrastructure/HierarchicalParkingManager.scala | 12 ++++++------ .../infrastructure/InfrastructureFunctions.scala | 4 ++-- .../infrastructure/InfrastructureUtils.scala | 2 +- .../infrastructure/ParallelParkingManager.scala | 6 +++--- .../agentsim/infrastructure/ParkingFunctions.scala | 4 ++-- .../infrastructure/ParkingManagerBenchmark.scala | 2 +- .../infrastructure/ZonalParkingManager.scala | 8 ++++---- .../infrastructure/parking/ParkingZoneSearch.scala | 6 +++--- .../infrastructure/parking/PricingModel.scala | 4 ++-- src/main/scala/beam/sim/config/BeamConfig.scala | 10 +++++++--- .../HierarchicalParkingManagerSpec.scala | 12 ++++++------ .../infrastructure/ZonalParkingManagerSpec.scala | 2 +- 20 files changed, 58 insertions(+), 47 deletions(-) diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 22436234fec..a21796fc285 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -22,8 +22,8 @@ oaklandCbg <- st_read(shpFile) vehicles1 <- readCsv(pp(workDir, "/vehicles.4Base.csv")) vehicles1$stateOfCharge <- as.double(vehicles1$stateOfCharge) -vehicles1[is.na(stateOfCharge)]$stateOfCharge <- 0.5 -vehicles1[is.infinite(stateOfCharge)]$stateOfCharge <- 0.5 +vehicles1[is.na(stateOfCharge)]$stateOfCharge <- 1.0 +vehicles1[is.infinite(stateOfCharge)]$stateOfCharge <- 1.0 vehicles2 <- readCsv(pp(workDir, "/2.final_vehicles.5bBase.csv")) vehicles2$stateOfCharge <- as.double(vehicles2$stateOfCharge) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index c56f1932cf5..c69d8bb7914 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -169,7 +169,7 @@ beam.agentsim.agents.parking.rangeAnxietyBuffer = "double | 20000.0" # if our re beam.agentsim.agents.parking.minSearchRadius = "double | 250.00" # something small enough that, on average, we see 2 orders of magnitude of samples at most beam.agentsim.agents.parking.maxSearchRadius = "double | 8046.72" # something large enough that we do not strand our drivers in an oasis beam.agentsim.agents.parking.searchMaxDistanceRelativeToEllipseFoci = "double | 4.0" # something large enough that we do not travel longer than the actual distance to destination -beam.agentsim.agents.parking.estimatedMinParkingDuration = "double | 60.0" # in seconds, something small enough but has meaningful impact on pricing +beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds = "double | 60.0" # in seconds, something small enough but has meaningful impact on pricing beam.agentsim.agents.parking.fractionOfSameTypeZones = "double | 0.5" beam.agentsim.agents.parking.minNumberOfSameTypeZones = "int | 10" @@ -353,6 +353,7 @@ beam.agentsim.agents.vehicles.sharedFleets = [ beam.agentsim.chargingNetworkManager { timeStepInSeconds = "int | 300" + maxChargingSessionsInSeconds = "int | 43200" chargingPointCountScalingFactor = "double | 1.0" chargingPointCostScalingFactor = "double | 1.0" chargingPointFilePath = "" diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index 96062bdf38d..2a59f77ea8d 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -256,6 +256,7 @@ object HouseholdActor { Some(new EmergencyHouseholdVehicleGenerator(household, beamScenario, vehiclesAdjustment, category)) else None, whoDrivesThisVehicle, + beamServices.beamConfig, beamServices.beamConfig.beam.debug ) ), diff --git a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala index c3aaf4231d1..5de281ce1b7 100644 --- a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala @@ -378,7 +378,7 @@ object DefaultRideHailDepotParkingManager { beamServices.beamScenario.fuelTypePrices, beamServices.beamConfig.beam.agentsim.agents.rideHail, beamServices.skims, - beamServices.beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration + beamServices.beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 23450a3bcc7..1dba82b43cd 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -33,7 +33,7 @@ class ChargingFunctions[GEO: GeoLevel]( mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, skims: Option[Skims], fuelPrice: Map[FuelType, Double], - estimatedMinParkingDuration: Double + estimatedMinParkingDurationInSeconds: Double ) extends ParkingFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -49,7 +49,7 @@ class ChargingFunctions[GEO: GeoLevel]( boundingBox, seed, mnlParkingConfig, - estimatedMinParkingDuration + estimatedMinParkingDurationInSeconds ) { /** @@ -169,8 +169,8 @@ class ChargingFunctions[GEO: GeoLevel]( case _ => inquiry.parkingDuration.toInt } val parkingDuration: Option[Int] = - if (tempParkingDuration < estimatedMinParkingDuration) - Some(estimatedMinParkingDuration.toInt) // at least a small duration of charging + if (tempParkingDuration < estimatedMinParkingDurationInSeconds) + Some(estimatedMinParkingDurationInSeconds.toInt) // at least a small duration of charging else Some(tempParkingDuration) val addedEnergy: Double = diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index dd4f075ab54..a62223fadb2 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -181,7 +181,7 @@ object ChargingNetwork extends LazyLogging { beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, skims, fuelPrice, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) ) } @@ -474,7 +474,7 @@ object ChargingNetwork extends LazyLogging { // first charging cycle true case Some(cycle) - if startTime >= cycle.endTime && chargingStatus.last.status == Connected || (chargingStatus.last.status == Disconnected && chargingStatus.last.time >= endTime) => + if (startTime >= cycle.endTime && chargingStatus.last.status == Connected) || (chargingStatus.last.status == Disconnected && chargingStatus.last.time >= endTime) => // either a new cycle or an unplug cycle arriving in the middle of the current cycle true // other cases where an unnecessary charging session happens when a vehicle is already charged or unplugged diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index 21dfb56d2b7..9d451650677 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -76,7 +76,12 @@ trait ChargingNetworkManagerHelper extends { ): Option[ScheduleTrigger] = { assume(endTime - startTime >= 0, s"timeInterval should not be negative! startTime $startTime endTime $endTime") // Calculate the energy to charge each vehicle connected to the a charging station - val updatedEndTime = chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow).getOrElse(endTime) + val endOfMaxSessionTime = + chargingVehicle.chargingSessions.headOption + .map(_.startTime + cnmConfig.maxChargingSessionsInSeconds) + .getOrElse(endTime) + val endOfShiftTime = chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow).getOrElse(endTime) + val updatedEndTime = Math.min(endOfMaxSessionTime, endOfShiftTime) val duration = Math.max(0, updatedEndTime - startTime) val maxCycleDuration = Math.min( nextTimeBin(startTime) - startTime, diff --git a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala index 4c40ce77d0d..6387f6972f2 100644 --- a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala @@ -36,7 +36,7 @@ class DefaultRidehailFunctions[GEO: GeoLevel]( fuelTypePrices: Map[FuelType, Double], rideHailConfig: BeamConfig.Beam.Agentsim.Agents.RideHail, skims: Skims, - estimatedMinParkingDuration: Double + estimatedMinParkingDurationInSeconds: Double ) extends InfrastructureFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -51,7 +51,7 @@ class DefaultRidehailFunctions[GEO: GeoLevel]( minNumberOfSameTypeZones, boundingBox, seed, - estimatedMinParkingDuration + estimatedMinParkingDurationInSeconds ) { private val vehicleIdToEndRefuelTick: mutable.Map[VehicleId, Int] = mutable.Map.empty[VehicleId, Int] diff --git a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala index 906f071cb51..18f40f0f05f 100644 --- a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala @@ -37,7 +37,7 @@ class HierarchicalParkingManager( boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - estimatedMinParkingDuration: Double, + estimatedMinParkingDurationInSeconds: Double, checkThatNumberOfStallsMatch: Boolean = false ) extends ParkingNetwork[Link](parkingZones) { @@ -76,7 +76,7 @@ class HierarchicalParkingManager( boundingBox, seed, mnlParkingConfig, - estimatedMinParkingDuration + estimatedMinParkingDurationInSeconds ) val DefaultParkingZone: ParkingZone[Link] = @@ -283,7 +283,7 @@ object HierarchicalParkingManager { boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - estimatedMinParkingDuration: Double, + estimatedMinParkingDurationInSeconds: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork[Link] = { new HierarchicalParkingManager( @@ -296,7 +296,7 @@ object HierarchicalParkingManager { boundingBox, seed, mnlParkingConfig, - estimatedMinParkingDuration, + estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch ) } @@ -311,7 +311,7 @@ object HierarchicalParkingManager { boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - estimatedMinParkingDuration: Double, + estimatedMinParkingDurationInSeconds: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork[Link] = HierarchicalParkingManager( @@ -324,7 +324,7 @@ object HierarchicalParkingManager { boundingBox, seed, mnlParkingConfig, - estimatedMinParkingDuration, + estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch ) diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala index 838072c13a7..d123b353448 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureFunctions.scala @@ -34,7 +34,7 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( minNumberOfSameTypeZones: Int, boundingBox: Envelope, seed: Int, - estimatedMinParkingDuration: Double + estimatedMinParkingDurationInSeconds: Double ) extends StrictLogging { protected val zoneCollections: Map[Id[GEO], ParkingZoneCollection[GEO]] = @@ -103,7 +103,7 @@ abstract class InfrastructureFunctions[GEO: GeoLevel]( boundingBox, distanceFunction, enrouteDuration, - estimatedMinParkingDuration, + estimatedMinParkingDurationInSeconds, fractionOfSameTypeZones, minNumberOfSameTypeZones ) diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala index 39f9ca2f808..932e2b073a4 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala @@ -182,7 +182,7 @@ object InfrastructureUtils extends LazyLogging { envelopeInUTM, beamConfig.matsim.modules.global.randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) case "PARALLEL" => ParallelParkingManager.init( diff --git a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala index dbeedbc5603..5881609fe26 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala @@ -42,7 +42,7 @@ class ParallelParkingManager( minNumberOfSameTypeZones: Int, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - estimatedMinParkingDuration: Double + estimatedMinParkingDurationInSeconds: Double ) extends ParkingNetwork[TAZ](parkingZones) { override protected val searchFunctions: Option[InfrastructureFunctions[TAZ]] = None @@ -79,7 +79,7 @@ class ParallelParkingManager( minNumberOfSameTypeZones, seed, mnlParkingConfig, - estimatedMinParkingDuration + estimatedMinParkingDurationInSeconds ) Worker(parkingNetwork, cluster) } @@ -191,7 +191,7 @@ object ParallelParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, seed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 1204518dbab..42c156d35c6 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -28,7 +28,7 @@ class ParkingFunctions[GEO: GeoLevel]( boundingBox: Envelope, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - estimatedMinParkingDuration: Double + estimatedMinParkingDurationInSeconds: Double ) extends InfrastructureFunctions[GEO]( geoQuadTree, idToGeoMapping, @@ -43,7 +43,7 @@ class ParkingFunctions[GEO: GeoLevel]( minNumberOfSameTypeZones, boundingBox, seed, - estimatedMinParkingDuration + estimatedMinParkingDurationInSeconds ) { override protected val mnlMultiplierParameters: Map[ParkingMNL.Parameters, UtilityFunctionOperation] = Map( diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala index 13f312cda54..41b083d3761 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala @@ -228,7 +228,7 @@ object ParkingManagerBenchmark extends StrictLogging { boundingBox, seed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) parkingNetwork diff --git a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala index 8988b335d94..89e945d5d0f 100755 --- a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala @@ -49,7 +49,7 @@ object ZonalParkingManager extends LazyLogging { minNumberOfSameTypeZones: Int, seed: Int, mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - estimatedMinParkingDuration: Double + estimatedMinParkingDurationInSeconds: Double ): ZonalParkingManager[GEO] = { new ZonalParkingManager(parkingZones) { if (maxSearchRadius < minSearchRadius) { @@ -73,7 +73,7 @@ object ZonalParkingManager extends LazyLogging { boundingBox, seed, mnlParkingConfig, - estimatedMinParkingDuration + estimatedMinParkingDurationInSeconds ) ) } @@ -106,7 +106,7 @@ object ZonalParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, beamConfig.matsim.modules.global.randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) } @@ -151,7 +151,7 @@ object ZonalParkingManager extends LazyLogging { 10, seed, mnlParkingConfig, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 489b5a879a7..85952cd4e37 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -52,7 +52,7 @@ object ParkingZoneSearch { boundingBox: Envelope, distanceFunction: (Coord, Coord) => Double, enrouteDuration: Double, - estimatedMinParkingDuration: Double, + estimatedMinParkingDurationInSeconds: Double, fractionOfSameTypeZones: Double, minNumberOfSameTypeZones: Int, searchExpansionFactor: Double = 2.0 @@ -179,13 +179,13 @@ object ParkingZoneSearch { PricingModel.evaluateParkingTicket( pricingModel, config.enrouteDuration.toInt, - config.estimatedMinParkingDuration + config.estimatedMinParkingDurationInSeconds ) case Some(pricingModel) => PricingModel.evaluateParkingTicket( pricingModel, params.parkingDuration.toInt, - config.estimatedMinParkingDuration + config.estimatedMinParkingDurationInSeconds ) } val parkingAlternative: ParkingAlternative[GEO] = diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala index 62069062a61..fc81b6aaa5e 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala @@ -70,13 +70,13 @@ object PricingModel { def evaluateParkingTicket( pricingModel: PricingModel, parkingDurationInSeconds: Int, - estimatedMinParkingDuration: Double + estimatedMinParkingDurationInSeconds: Double ): Double = { pricingModel match { case FlatFee(costInDollars) => costInDollars case Block(costInDollars, intervalSeconds) => (math.max( - estimatedMinParkingDuration, + estimatedMinParkingDurationInSeconds, parkingDurationInSeconds.toDouble ) / intervalSeconds.toDouble) * costInDollars } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index eb92c570031..a16c5684a49 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -715,7 +715,7 @@ object BeamConfig { } case class Parking( - estimatedMinParkingDuration: scala.Double, + estimatedMinParkingDurationInSeconds: scala.Double, fractionOfSameTypeZones: scala.Double, maxSearchRadius: scala.Double, minNumberOfSameTypeZones: scala.Int, @@ -775,8 +775,9 @@ object BeamConfig { def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - estimatedMinParkingDuration = - if (c.hasPathOrNull("estimatedMinParkingDuration")) c.getDouble("estimatedMinParkingDuration") + estimatedMinParkingDurationInSeconds = + if (c.hasPathOrNull("estimatedMinParkingDurationInSeconds")) + c.getDouble("estimatedMinParkingDurationInSeconds") else 60.0, fractionOfSameTypeZones = if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, @@ -2013,6 +2014,7 @@ object BeamConfig { chargingPointCountScalingFactor: scala.Double, chargingPointFilePath: java.lang.String, helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + maxChargingSessionsInSeconds: scala.Int, scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, timeStepInSeconds: scala.Int ) @@ -2103,6 +2105,8 @@ object BeamConfig { if (c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}") ), + maxChargingSessionsInSeconds = + if (c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") diff --git a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala index e823fbe113a..9896bb9b61f 100644 --- a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala @@ -79,7 +79,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) } { @@ -122,7 +122,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) @@ -182,7 +182,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) } { @@ -257,7 +257,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) } { @@ -345,7 +345,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) } { @@ -400,7 +400,7 @@ class HierarchicalParkingManagerSpec boundingBox, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index 4f2d67b772f..8b6c72fc9f9 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -444,7 +444,7 @@ class ZonalParkingManagerSpec beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, randomSeed, beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDuration + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) assertParkingResponse( From cabb861752ef1470f6d538a806b9cebe884dfe93 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 28 Apr 2022 04:14:28 -0700 Subject: [PATCH 081/307] change to script --- src/main/R/gemini/gemini-main.R | 2 +- src/main/python/gemini/events_processing.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 47b0623828b..fcb75fe5b28 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -27,7 +27,7 @@ expFactor <- (6.015/0.6015) severity_order <- c("Public <1MW", "Public 1-5MW", "Public >5MW", "Ridehail Depot <1MW", "Ridehail Depot 1-5MW", "Ridehail Depot >5MW") extreme_lab_order <- c("<1MW", "1-5MW", ">5MW") -dataDir <- normalizePath("~/Data/GEMINI/2022-04-28") +dataDir <- normalizePath("~/Data/GEMINI/2022-04-28-Calibration") #events <- readCsv(pp(dataDir, "/events/0.events.BASE.csv.gz")) #eventsDir <- paste(dataDir, "/events",sep="") resultsDir <- paste(dataDir, "/results",sep="") diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 151e4d9a3a3..47a2f6e3727 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,8 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022-04-28/' -filename = '0.events.6HighEV.csv.gz' +work_directory = '~/Data/GEMINI/2022-04-28-Calibration/' +filename = '0.events.5b4.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None From c46f08bb234e8fe37fc862ca8c5b847fd4ec0e47 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 28 Apr 2022 18:01:08 -0700 Subject: [PATCH 082/307] fix --- src/main/R/gemini/gemini-main.R | 12 ++++++------ src/main/resources/beam-template.conf | 1 + .../ChargingNetworkManager.scala | 18 +++++++++++++----- .../ChargingNetworkManagerHelper.scala | 2 +- .../infrastructure/ParkingFunctions.scala | 2 +- .../scala/beam/sim/config/BeamConfig.scala | 3 +++ 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index fcb75fe5b28..6395135f699 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -65,10 +65,10 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') -#scenarioNames <- c('5b1', '5b2', '5b3', '5b4') -#scenarioBaselineLabel <- '5b4' -scenarioNames <- c('Base', 'BaseXFC', 'HighEV') -scenarioBaselineLabel <- 'BaseXFC' +scenarioNames <- c('5b1', '5b2', '5b3', '5b4') +scenarioBaselineLabel <- '5b4' +# scenarioNames <- c('Base', 'BaseXFC', 'HighEV') +# scenarioBaselineLabel <- 'Base' #all.loads <- all.loads[!is.na(loadType)] ########################################## # LOADS & ENERGY @@ -195,8 +195,8 @@ ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units= ## ************************************** ## public charging by scenario -p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% - ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ +p <- all.loads[hour.bin <= 24][site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin','name')] %>% + ggplot(aes(x=hour.bin,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ theme_marain() + geom_area(colour="black", size=0.3) + scale_fill_manual(values = chargingTypes.colors, name = "") + diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index c69d8bb7914..7ba1357c517 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -354,6 +354,7 @@ beam.agentsim.agents.vehicles.sharedFleets = [ beam.agentsim.chargingNetworkManager { timeStepInSeconds = "int | 300" maxChargingSessionsInSeconds = "int | 43200" + overnightChargingEnabled = "boolean | false" chargingPointCountScalingFactor = "double | 1.0" chargingPointCostScalingFactor = "double | 1.0" chargingPointFilePath = "" diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 5026e89209b..ff36c3500a4 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -10,6 +10,7 @@ import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.{NotApplicable, ShiftStatus} import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingStatus, ChargingVehicle} +import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.EnRouteCharging import beam.agentsim.infrastructure.power.{PowerController, SitePowerManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} @@ -85,11 +86,18 @@ class ChargingNetworkManager( case inquiry: ParkingInquiry => log.debug(s"Received parking inquiry: $inquiry") - chargingNetworkHelper.get(inquiry.reservedFor.managerId).processParkingInquiry(inquiry) match { - case Some(parkingResponse) => - inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) - sender() ! parkingResponse - case _ => (parkingNetworkManager ? inquiry).pipeTo(sender()) + if ( + (inquiry.searchMode == ParkingSearchMode.Init && !cnmConfig.overnightChargingEnabled) || + chargingNetworkHelper + .get(inquiry.reservedFor.managerId) + .processParkingInquiry(inquiry) + .map { parkingResponse => + inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) + sender() ! parkingResponse + } + .isEmpty + ) { + (parkingNetworkManager ? inquiry).pipeTo(sender()) } case TriggerWithId(InitializeTrigger(_), triggerId) => diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index 9d451650677..62facb725e0 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -17,7 +17,7 @@ trait ChargingNetworkManagerHelper extends { this: ChargingNetworkManager => private lazy val endOfSimulationTime: Int = DateUtils.getEndOfTime(beamConfig) - private lazy val cnmConfig: Agentsim.ChargingNetworkManager = beamConfig.beam.agentsim.chargingNetworkManager + protected lazy val cnmConfig: Agentsim.ChargingNetworkManager = beamConfig.beam.agentsim.chargingNetworkManager private lazy val parallelismWindow: Int = beamConfig.beam.agentsim.schedulerParallelismWindow protected val vehicle2InquiryMap: TrieMap[Id[BeamVehicle], ParkingInquiry] = TrieMap() diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 42c156d35c6..641b5a63807 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -218,7 +218,7 @@ class ParkingFunctions[GEO: GeoLevel]( inquiry.parkingActivityType match { case ParkingActivityType.Home => Set(ParkingType.Residential) case ParkingActivityType.Work => Set(ParkingType.Workplace) - case _ => Set(ParkingType.Public) + case _ => Set() } } else { inquiry.parkingActivityType match { diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index a16c5684a49..cc19c2755f8 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -2015,6 +2015,7 @@ object BeamConfig { chargingPointFilePath: java.lang.String, helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, maxChargingSessionsInSeconds: scala.Int, + overnightChargingEnabled: scala.Boolean, scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, timeStepInSeconds: scala.Int ) @@ -2107,6 +2108,8 @@ object BeamConfig { ), maxChargingSessionsInSeconds = if (c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, + overnightChargingEnabled = + c.hasPathOrNull("overnightChargingEnabled") && c.getBoolean("overnightChargingEnabled"), scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") From 6c74a539f1a05672b53811728581a7054623aef8 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 28 Apr 2022 18:08:21 -0700 Subject: [PATCH 083/307] overnight charging check --- .../agents/household/HouseholdActor.scala | 4 +++- .../household/HouseholdFleetManager.scala | 4 +++- .../ChargingNetworkManager.scala | 18 +++++------------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index 2a59f77ea8d..bd598b774b6 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -588,7 +588,9 @@ object HouseholdActor { searchMode = ParkingSearchMode.Init ) if ( - vehicle.isEV && vehicle.isRefuelNeeded( + vehicle.isEV && + beamScenario.beamConfig.beam.agentsim.chargingNetworkManager.overnightChargingEnabled && + vehicle.isRefuelNeeded( beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.home.refuelRequiredThresholdInMeters, beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters ) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index eedce38f1ed..48cdf4aa5ae 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -101,7 +101,9 @@ class HouseholdFleetManager( searchMode = ParkingSearchMode.Init ) if ( - vehicle.isEV && vehicle.isRefuelNeeded( + vehicle.isEV && + beamConfig.beam.agentsim.chargingNetworkManager.overnightChargingEnabled && + vehicle.isRefuelNeeded( beamConfig.beam.agentsim.agents.vehicles.destination.home.refuelRequiredThresholdInMeters, beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters ) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index ff36c3500a4..5026e89209b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -10,7 +10,6 @@ import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.{NotApplicable, ShiftStatus} import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingStatus, ChargingVehicle} -import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.EnRouteCharging import beam.agentsim.infrastructure.power.{PowerController, SitePowerManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} @@ -86,18 +85,11 @@ class ChargingNetworkManager( case inquiry: ParkingInquiry => log.debug(s"Received parking inquiry: $inquiry") - if ( - (inquiry.searchMode == ParkingSearchMode.Init && !cnmConfig.overnightChargingEnabled) || - chargingNetworkHelper - .get(inquiry.reservedFor.managerId) - .processParkingInquiry(inquiry) - .map { parkingResponse => - inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) - sender() ! parkingResponse - } - .isEmpty - ) { - (parkingNetworkManager ? inquiry).pipeTo(sender()) + chargingNetworkHelper.get(inquiry.reservedFor.managerId).processParkingInquiry(inquiry) match { + case Some(parkingResponse) => + inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) + sender() ! parkingResponse + case _ => (parkingNetworkManager ? inquiry).pipeTo(sender()) } case TriggerWithId(InitializeTrigger(_), triggerId) => From 1ff39826ce1d2a1d6c6727fd355e35e98047bab9 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 28 Apr 2022 18:34:46 -0700 Subject: [PATCH 084/307] fix compile --- .../scala/beam/agentsim/infrastructure/ScaleUpCharging.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 9259f40a356..92fb10db4c2 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -12,9 +12,8 @@ import beam.agentsim.infrastructure.taz.{TAZ, TAZTreeMap} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger import beam.agentsim.scheduler.Trigger.TriggerWithId -import beam.sim.config.BeamConfig.Beam.Agentsim +import beam.utils.BeamVehicleUtils.toPowerInKW import beam.utils.MathUtils.roundUniformly -import beam.utils.BeamVehicleUtils.{readBeamVehicleTypeFile, readVehiclesFile, toPowerInKW} import beam.utils.{MathUtils, VehicleIdGenerator} import org.apache.commons.math3.distribution.EnumeratedDistribution import org.apache.commons.math3.random.MersenneTwister @@ -35,7 +34,6 @@ trait ScaleUpCharging extends { private lazy val rand: Random = new Random(beamConfig.matsim.modules.global.randomSeed) private lazy val mersenne: MersenneTwister = new MersenneTwister(beamConfig.matsim.modules.global.randomSeed) - private lazy val cnmConfig: Agentsim.ChargingNetworkManager = beamConfig.beam.agentsim.chargingNetworkManager private lazy val timeStepByHour = beamConfig.beam.agentsim.chargingNetworkManager.timeStepInSeconds / 3600.0 private lazy val virtualParkingInquiries: TrieMap[Int, ParkingInquiry] = TrieMap() private lazy val vehicleRequests = mutable.HashMap.empty[(Id[TAZ], ParkingActivityType), List[VehicleRequestInfo]] From 0cadba0126af8f2d83eb4e1fb045d1dacce23ef9 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 28 Apr 2022 21:05:50 -0700 Subject: [PATCH 085/307] potential bug fix --- src/main/R/gemini/gemini-main.R | 9 ++++++--- src/main/R/gemini/gemini-utils.R | 6 ++++-- src/main/python/gemini/events_processing.py | 4 ++-- .../agentsim/infrastructure/ChargingNetwork.scala | 12 ++++++++++-- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 6395135f699..fd7203ae5da 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -66,7 +66,7 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') scenarioNames <- c('5b1', '5b2', '5b3', '5b4') -scenarioBaselineLabel <- '5b4' + # scenarioNames <- c('Base', 'BaseXFC', 'HighEV') # scenarioBaselineLabel <- 'Base' #all.loads <- all.loads[!is.na(loadType)] @@ -75,6 +75,7 @@ scenarioBaselineLabel <- '5b4' ########################################## ## Baseline XFC hours per site per day +scenarioBaselineLabel <- '5b1' toplot <- all.loads[name==scenarioBaselineLabel] toplot[,panel:=revalue(factor(site),c('public'='Public','depot'='Ridehail CAV Depot'))] p <- toplot[,.(kw=sum(kw)),by=c('severity','hour.bin2', 'panel')] %>% @@ -88,6 +89,8 @@ p <- toplot[,.(kw=sum(kw)),by=c('severity','hour.bin2', 'panel')] %>% ggsave(pp(plotsDir,'/baseline-xfc-hours-per-site-per-day.png'),p,width=4,height=4,units='in') ## Baseline public charging +scenarioBaselineLabel <- '5b4' +toplot <- all.loads[name==scenarioBaselineLabel] toplot[,panel:=revalue(factor(site),c('public'='Public','depot'='Ridehail CAV Depot'))] p <- toplot[,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ @@ -195,8 +198,8 @@ ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units= ## ************************************** ## public charging by scenario -p <- all.loads[hour.bin <= 24][site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin','name')] %>% - ggplot(aes(x=hour.bin,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ +p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% + ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ theme_marain() + geom_area(colour="black", size=0.3) + scale_fill_manual(values = chargingTypes.colors, name = "") + diff --git a/src/main/R/gemini/gemini-utils.R b/src/main/R/gemini/gemini-utils.R index 098967663e3..0f8df876fd9 100644 --- a/src/main/R/gemini/gemini-utils.R +++ b/src/main/R/gemini/gemini-utils.R @@ -7,8 +7,10 @@ siteXFCInKW <- 1000 plugXFCInKW <- 200 time.bins <- data.table(time=seq(0,61,by=binsInterval)*3600,quarter.hour=seq(0,61,by=binsInterval)) -chargingTypes.colors <- c("goldenrod2", "#66CCFF", "#669900", "#660099", "#FFCC33", "#CC3300", "#0066CC") -names(chargingTypes.colors) <- c("XFC", "DCFC", "Public-L2", "Work-L2", "Work-L1", "Home-L2", "Home-L1") +#chargingTypes.colors <- c("goldenrod2", "#66CCFF", "#669900", "#660099", "#FFCC33", "#CC3300", "#0066CC") +#names(chargingTypes.colors) <- c("XFC", "DCFC", "Public-L2", "Work-L2", "Work-L1", "Home-L2", "Home-L1") +chargingTypes.colors <- c("goldenrod2", "#66CCFF", "#669900", "#660099", "#CC3300", "#0066CC") +names(chargingTypes.colors) <- c("XFC", "DCFC", "Public-L2", "Work-L2", "Home-L2", "Home-L1") loadTypes <- data.table::data.table( chargingPointType = c( "homelevel1(1.8|AC)", "homelevel2(7.2|AC)", diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 47a2f6e3727..e465aa4666b 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,8 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022-04-28-Calibration/' -filename = '0.events.5b4.csv.gz' +work_directory = '~/Data/GEMINI/2022-04-28-bis/' +filename = '3.events.5bBase.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index a62223fadb2..05a03cd19e5 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -309,7 +309,10 @@ object ChargingNetwork extends LazyLogging { ): ChargingVehicle = { vehicles.get(vehicle.id) match { case Some(chargingVehicle) => - logger.error("Trying to connect a vehicle already connected. Something is broken!") + logger.error( + s"Something is broken! Trying to connect a vehicle already connected at time $tick: vehicle $vehicle - " + + s"activityType $activityType - stall $stall - personId $personId - chargingInfo $chargingVehicle" + ) chargingVehicle case _ => val chargingVehicle = @@ -474,7 +477,7 @@ object ChargingNetwork extends LazyLogging { // first charging cycle true case Some(cycle) - if (startTime >= cycle.endTime && chargingStatus.last.status == Connected) || (chargingStatus.last.status == Disconnected && chargingStatus.last.time >= endTime) => + if startTime >= cycle.endTime && chargingStatus.last.status == Connected || (chargingStatus.last.status == Disconnected && chargingStatus.last.time >= endTime) => // either a new cycle or an unplug cycle arriving in the middle of the current cycle true // other cases where an unnecessary charging session happens when a vehicle is already charged or unplugged @@ -507,5 +510,10 @@ object ChargingNetwork extends LazyLogging { def calculateChargingSessionLengthAndEnergyInJoule: (Long, Double) = chargingSessions.foldLeft((0L, 0.0)) { case ((accA, accB), charging) => (accA + (charging.endTime - charging.startTime), accB + charging.energyToCharge) } + + override def toString: String = { + s"$arrivalTime - ${vehicle.id} - ${stall.parkingZoneId} - ${personId} - ${activityType} - " + + s"${chargingStatus.lastOption.getOrElse("None")} - ${chargingSessions.lastOption.getOrElse("None")}" + } } } From d3e1f1a8b89e68807aff0e6b5d0ad1da3c94b807 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 28 Apr 2022 22:41:15 -0700 Subject: [PATCH 086/307] updating script --- src/main/R/gemini/gemini-main.R | 6 ++++-- src/main/python/gemini/events_processing.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index fd7203ae5da..1bae62175c3 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -67,7 +67,7 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') scenarioNames <- c('5b1', '5b2', '5b3', '5b4') -# scenarioNames <- c('Base', 'BaseXFC', 'HighEV') +#scenarioNames <- c('Base', 'BaseXFC', 'HighEV') # scenarioBaselineLabel <- 'Base' #all.loads <- all.loads[!is.na(loadType)] ########################################## @@ -76,6 +76,7 @@ scenarioNames <- c('5b1', '5b2', '5b3', '5b4') ## Baseline XFC hours per site per day scenarioBaselineLabel <- '5b1' +#scenarioBaselineLabel <- 'Base' toplot <- all.loads[name==scenarioBaselineLabel] toplot[,panel:=revalue(factor(site),c('public'='Public','depot'='Ridehail CAV Depot'))] p <- toplot[,.(kw=sum(kw)),by=c('severity','hour.bin2', 'panel')] %>% @@ -89,7 +90,8 @@ p <- toplot[,.(kw=sum(kw)),by=c('severity','hour.bin2', 'panel')] %>% ggsave(pp(plotsDir,'/baseline-xfc-hours-per-site-per-day.png'),p,width=4,height=4,units='in') ## Baseline public charging -scenarioBaselineLabel <- '5b4' +# scenarioBaselineLabel <- '5b4' +scenarioBaselineLabel <- 'Base' toplot <- all.loads[name==scenarioBaselineLabel] toplot[,panel:=revalue(factor(site),c('public'='Public','depot'='Ridehail CAV Depot'))] p <- toplot[,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index e465aa4666b..47a2f6e3727 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,8 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022-04-28-bis/' -filename = '3.events.5bBase.csv.gz' +work_directory = '~/Data/GEMINI/2022-04-28-Calibration/' +filename = '0.events.5b4.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None From 19227cd4965aadc27d8762f69323f5f4499abc8c Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 3 May 2022 17:00:06 -0700 Subject: [PATCH 087/307] any chamges --- src/main/R/gemini/gemini-main.R | 54 +++++++++++---------- src/main/R/gemini/gemini-processing.R | 3 ++ src/main/python/gemini/events_processing.py | 4 +- src/main/python/gemini/helper.py | 7 +++ 4 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 src/main/python/gemini/helper.py diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 1bae62175c3..aba14419388 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -27,7 +27,7 @@ expFactor <- (6.015/0.6015) severity_order <- c("Public <1MW", "Public 1-5MW", "Public >5MW", "Ridehail Depot <1MW", "Ridehail Depot 1-5MW", "Ridehail Depot >5MW") extreme_lab_order <- c("<1MW", "1-5MW", ">5MW") -dataDir <- normalizePath("~/Data/GEMINI/2022-04-28-Calibration") +dataDir <- normalizePath("~/Data/GEMINI/2022-04-28") #events <- readCsv(pp(dataDir, "/events/0.events.BASE.csv.gz")) #eventsDir <- paste(dataDir, "/events",sep="") resultsDir <- paste(dataDir, "/results",sep="") @@ -65,18 +65,18 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') -scenarioNames <- c('5b1', '5b2', '5b3', '5b4') +# scenarioNames <- c('5b1', '5b2', '5b3', '5b4') -#scenarioNames <- c('Base', 'BaseXFC', 'HighEV') -# scenarioBaselineLabel <- 'Base' +scenarioNames <- c('BaseXFC', 'HighEV') +scenarioBaselineLabel <- 'BaseXFC' +#scenarioBaselineLabel <- '5b3' #all.loads <- all.loads[!is.na(loadType)] ########################################## # LOADS & ENERGY ########################################## ## Baseline XFC hours per site per day -scenarioBaselineLabel <- '5b1' -#scenarioBaselineLabel <- 'Base' +scenarioBaselineLabel <- 'BaseXFC' toplot <- all.loads[name==scenarioBaselineLabel] toplot[,panel:=revalue(factor(site),c('public'='Public','depot'='Ridehail CAV Depot'))] p <- toplot[,.(kw=sum(kw)),by=c('severity','hour.bin2', 'panel')] %>% @@ -87,11 +87,12 @@ p <- toplot[,.(kw=sum(kw)),by=c('severity','hour.bin2', 'panel')] %>% facet_wrap(~panel) + scale_fill_manual(values = c(brewer.pal(3, "Blues"), brewer.pal(3, "Reds"))) + theme(strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/baseline-xfc-hours-per-site-per-day.png'),p,width=4,height=4,units='in') +ggsave(pp(plotsDir,'/baseline-xfc-hours-per-site-per-day.png'),p,width=6,height=4,units='in') ## Baseline public charging -# scenarioBaselineLabel <- '5b4' -scenarioBaselineLabel <- 'Base' +scenarioBaselineLabel <- 'HighEV' +title_label <- paste("Public Charging - ", scenarioBaselineLabel, sep="") +file_name <- paste('/baseline-public-charging-', scenarioBaselineLabel, ".png", sep="") toplot <- all.loads[name==scenarioBaselineLabel] toplot[,panel:=revalue(factor(site),c('public'='Public','depot'='Ridehail CAV Depot'))] p <- toplot[,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% @@ -99,12 +100,13 @@ p <- toplot[,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% theme_marain() + geom_area(colour="black", size=0.3) + scale_fill_manual(values = chargingTypes.colors, name = "") + - labs(x = "hour", y = "GW", fill="load severity", title="Public Charging") + + labs(x = "hour", y = "GW", fill="load severity", title=title_label) + theme(strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/baseline-public-charging.png'),p,width=6,height=4,units='in') +ggsave(pp(plotsDir,file_name),p,width=6,height=4,units='in') ## Baseline ev charging loads by space time +scenarioBaselineLabel <- 'BaseXFC' toplot <- all.loads[name==scenarioBaselineLabel&hour.bin2%in%c(0, 6, 12, 18)] toplot$mw <- toplot$kw/1000 toplot$hour.bin2.label <- "12am" @@ -187,16 +189,16 @@ ggsave(pp(plotsDir,'/baseline-ev-charging-loads-by-space-time-in-oakland.png'),p ## ************************************** ## public charging by scenario -thelabeller <- c("Scenario2" = "Scenario2 (100% Population)", "Scenario2-010" = "Scenario2 (10% sample)", "Scenario2-025" = "Scenario2 (25% sample)", "Scenario2-050" = "Scenario2 (50% sample)") -p <- all.loads[region=="Oakland-Alameda"&site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% - ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ - theme_marain() + - geom_area(colour="black", size=0.3) + - scale_fill_manual(values = chargingTypes.colors, name = "") + - labs(x = "hour", y = "GW", fill="load severity", title="Public Charging") + - theme(strip.text = element_text(size=rel(1.2))) + - facet_wrap(~factor(name,scenarioNames),ncol = 2,labeller = labeller(.cols = thelabeller)) -ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units='in') +# thelabeller <- c("Scenario2" = "Scenario2 (100% Population)", "Scenario2-010" = "Scenario2 (10% sample)", "Scenario2-025" = "Scenario2 (25% sample)", "Scenario2-050" = "Scenario2 (50% sample)") +# p <- all.loads[region=="Oakland-Alameda"&site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% +# ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ +# theme_marain() + +# geom_area(colour="black", size=0.3) + +# scale_fill_manual(values = chargingTypes.colors, name = "") + +# labs(x = "hour", y = "GW", fill="load severity", title="Public Charging") + +# theme(strip.text = element_text(size=rel(1.2))) + +# facet_wrap(~factor(name,scenarioNames),ncol = 2,labeller = labeller(.cols = thelabeller)) +# ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units='in') ## ************************************** ## public charging by scenario @@ -208,7 +210,7 @@ p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadTy labs(x = "hour", y = "GW", fill="load severity", title="Public Charging") + theme(strip.text = element_text(size=rel(1.2))) + facet_wrap(~factor(name,scenarioNames),ncol = 2) -ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=5,units='in') +ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=4,units='in') ## public daily charging by scenario @@ -220,7 +222,7 @@ p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=kw/tot.kw*100,fill=factor( labs(x = "", y = "Share of Charging (%)", fill="load severity", title="Public Charging") + theme(axis.text.x = element_text(angle = 0, hjust=0.5), strip.text = element_text(size=rel(1.2))) #theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/public-daily-charging-by-scenario.png'),p,width=7,height=3,units='in') +ggsave(pp(plotsDir,'/public-daily-charging-by-scenario.png'),p,width=4,height=3,units='in') @@ -236,7 +238,7 @@ p <- ggplot(toplot,aes(x=hour.bin2,y=kw/1e6,fill=factor(severity, levels=severit labs(x = "hour", y = "GW", fill="Load Severity") + theme(strip.text = element_text(size=rel(1.2))) + facet_wrap(~factor(name,scenarioNames),ncol = 3) -ggsave(pp(plotsDir,'/xfc-loads-by-scenario.png'),p,width=12,height=7,units='in') +ggsave(pp(plotsDir,'/xfc-loads-by-scenario.png'),p,width=12,height=5,units='in') @@ -252,7 +254,7 @@ p <- ggplot(toplot,aes(x=factor(name,scenarioNames),y=value,fill=factor(severity scale_fill_manual(values = c(brewer.pal(3, "Blues"), brewer.pal(3, "Reds"))) + theme(axis.text.x = element_text(angle=0, hjust=0.5), strip.text = element_text(size=rel(1.2))) #theme(axis.text.x = element_text(angle = 30, hjust=1), strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/energy-charged-by-scenario.png'),p,width=10,height=3,units='in') +ggsave(pp(plotsDir,'/energy-charged-by-scenario.png'),p,width=8,height=3,units='in') @@ -267,7 +269,7 @@ p <- ggplot(xfc.metric,aes(x=factor(name,scenarioNames),y=xfc.hours,fill=factor( scale_fill_manual(values = c(brewer.pal(3, "Blues")[c(1,3)], brewer.pal(3, "Reds")[c(1,3)])) + theme(axis.text.x = element_text(angle=0, hjust=0.5),strip.text = element_text(size=rel(1.2))) #theme(axis.text.x = element_text(angle = 30, hjust=1),strip.text = element_text(size=rel(1.2))) -ggsave(pp(plotsDir,'/xfc-hours-per-site-per-day.png'),p,width=7,height=3,units='in') +ggsave(pp(plotsDir,'/xfc-hours-per-site-per-day.png'),p,width=6,height=3,units='in') diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index a21796fc285..8c889122ffa 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -20,6 +20,9 @@ oaklandMap <- ggmap::get_googlemap("oakland california", zoom = 13, maptype = "r shpFile <- pp(workDir, "/shapefile/Oakland+Alameda+TAZ/Transportation_Analysis_Zones.shp") oaklandCbg <- st_read(shpFile) +infra5aBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/4a_output_2022_Apr_13_pubClust_withFees_aggregated.csv")) +infra5bBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/4b_output_2022_Apr_13_pubClust_withFees_aggregated.csv")) + vehicles1 <- readCsv(pp(workDir, "/vehicles.4Base.csv")) vehicles1$stateOfCharge <- as.double(vehicles1$stateOfCharge) vehicles1[is.na(stateOfCharge)]$stateOfCharge <- 1.0 diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 47a2f6e3727..accd1f75a20 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,8 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022-04-28-Calibration/' -filename = '0.events.5b4.csv.gz' +work_directory = '~/Data/GEMINI/2022-04-28-bis/' +filename = '0.events.5bBase.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None diff --git a/src/main/python/gemini/helper.py b/src/main/python/gemini/helper.py new file mode 100644 index 00000000000..78ee1545f72 --- /dev/null +++ b/src/main/python/gemini/helper.py @@ -0,0 +1,7 @@ +import pandas as pd + +def read_file(filename): + compression = None + if filename.endswith(".gz"): + compression = 'gzip' + return pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) \ No newline at end of file From 178397005c38387437f0da334b74fc2e662170a8 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Fri, 13 May 2022 20:26:10 +0600 Subject: [PATCH 088/307] Update map and plans to improve network relaxation --- .../r5/relaxation-network-scenario.osm | 4 ++-- .../r5/relaxation-network-scenario.osm.pbf | 4 ++-- .../relaxation-network-scenario/urbansim_v2/plans.csv.gz | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm index e0b851efb87..5eb2351ab79 100644 --- a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm +++ b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b548e6cf8228a30ae35b164b989b9768b5943e43e5652d59a1afc11a5bed4118 -size 13573 +oid sha256:7b791ea1da21ac8bbd40dd78ee7681a5666e2e3230ea26ff5c93a3b8a4096f96 +size 13977 diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf index 2d8e2b61569..3df60eedf66 100644 --- a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf +++ b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c9fd1748a681f66597d0fd2083ec5e8bb2962bda74178a4d828eb62c2dfd3ab -size 634 +oid sha256:cb8eafaa71156d756f179e30bcf4e1448db04915e502e2a51fd3621fba1ab2a9 +size 641 diff --git a/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz b/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz index fc067879dfa..2217d30665d 100644 --- a/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz +++ b/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:64cdcdd9936968649b2f4591d3472aa789f164abe781c652857ce0f3ad41bfc6 +oid sha256:cbf20511d771d8a8c9a8f7d6104b245503e13137b45140128a6143d418c0860f size 21637 From 4a19ea49ebd581c3b5f1da8736071d2923e9d23f Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 16 May 2022 16:28:32 +0600 Subject: [PATCH 089/307] Fix OSM map tags --- .../r5/relaxation-network-scenario.osm | 4 ++-- .../r5/relaxation-network-scenario.osm.pbf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm index 5eb2351ab79..013a6cd172d 100644 --- a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm +++ b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b791ea1da21ac8bbd40dd78ee7681a5666e2e3230ea26ff5c93a3b8a4096f96 -size 13977 +oid sha256:dd8bcc6d2379bbd8a0b015ec65140f8f78f7cf724cf7fa43ab23bef814bfda4f +size 14031 diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf index 3df60eedf66..4d5fbde6870 100644 --- a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf +++ b/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb8eafaa71156d756f179e30bcf4e1448db04915e502e2a51fd3621fba1ab2a9 -size 641 +oid sha256:6e12417373342550a8451432f7f6d06cedb47d6fb7a0627386746df6c6959c02 +size 627 From 61d9be5237a070afdc3800f387e28bf62ce7825c Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Tue, 17 May 2022 20:51:11 +0600 Subject: [PATCH 090/307] Finishing network relaxation spec --- .../integration/NetworkRelaxationSpec.scala | 114 ++++++++---------- .../beam.conf | 15 ++- .../beamFuelTypes.csv | 0 .../r5/dummy.zip | 0 .../r5/fares.dat | 0 .../r5/network-relaxation-scenario.osm} | 0 .../r5/network-relaxation-scenario.osm.pbf} | 0 .../r5/tolls.dat | 0 .../taz-centers.csv | 0 .../urbansim_v2/blocks.csv.gz | 0 .../urbansim_v2/households.csv.gz | 0 .../urbansim_v2/persons.csv.gz | 0 .../urbansim_v2/plans.csv.gz | 3 + .../vehicleTypes.csv | 0 .../vehicles.csv | 0 .../urbansim_v2/plans.csv.gz | 3 - 16 files changed, 60 insertions(+), 75 deletions(-) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/beam.conf (89%) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/beamFuelTypes.csv (100%) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/r5/dummy.zip (100%) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/r5/fares.dat (100%) rename test/input/{relaxation-network-scenario/r5/relaxation-network-scenario.osm => network-relaxation-scenario/r5/network-relaxation-scenario.osm} (100%) rename test/input/{relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf => network-relaxation-scenario/r5/network-relaxation-scenario.osm.pbf} (100%) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/r5/tolls.dat (100%) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/taz-centers.csv (100%) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/urbansim_v2/blocks.csv.gz (100%) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/urbansim_v2/households.csv.gz (100%) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/urbansim_v2/persons.csv.gz (100%) create mode 100644 test/input/network-relaxation-scenario/urbansim_v2/plans.csv.gz rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/vehicleTypes.csv (100%) rename test/input/{relaxation-network-scenario => network-relaxation-scenario}/vehicles.csv (100%) delete mode 100644 test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz diff --git a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala index fe84b0de87e..ac0ba9bbe48 100644 --- a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala +++ b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala @@ -1,43 +1,29 @@ package beam.integration import akka.actor.ActorSystem -import beam.agentsim.infrastructure.taz.CsvTaz -import beam.sim.{BeamHelper, BeamServices} -import beam.sim.common.GeoUtilsImpl import beam.sim.config.{BeamConfig, MatSimBeamConfigBuilder} -import beam.utils.{ConfigConsistencyComparator, FileUtils, InputConsistencyCheck, LoggingUtil} -import org.scalatest.wordspec.AnyWordSpecLike -import beam.utils.TestConfigUtils.testConfig -import beam.utils.csv.CsvWriter -import beam.utils.matsim_conversion.{ConversionConfig, MatsimConversionTool} -import beam.utils.scenario.{HouseholdId, HouseholdInfo, VehicleInfo} -import beam.utils.scenario.generic.writers.CsvPersonInfoWriter.{headers, logger} -import beam.utils.scenario.urbansim.censusblock.entities.{ - Activity, - Female, - InputPersonInfo, - InputPlanElement, - Leg, - Male -} +import beam.sim.{BeamHelper, BeamServices} +import beam.utils.csv.{CsvWriter, GenericCsvReader} +import beam.utils.scenario.VehicleInfo +import beam.utils.scenario.urbansim.censusblock.entities._ +import beam.utils.{FileUtils, LoggingUtil} import ch.qos.logback.classic.util.ContextInitializer import com.google.inject.Injector import com.typesafe.config.ConfigFactory -import org.matsim.api.core.v01.Coord -import org.matsim.core.network.NetworkUtils import org.matsim.core.scenario.MutableScenario +import org.scalatest.wordspec.AnyWordSpecLike +import org.scalatest.matchers.should.Matchers._ -import java.io.File -import java.nio.file.Paths +import java.io.{Closeable, File} import scala.util.Random class NetworkRelaxationScenarioGenerator { - val scenarioDir = new File("test/input/relaxation-network-scenario/urbansim_v2") + val scenarioDir = new File("test/input/network-relaxation-scenario/urbansim_v2") def generateHouseholds(count: Int = 2000) = { println(s"Generating $count households") val csvWriter = new CsvWriter( - scenarioDir + "/households.csv", + scenarioDir + "/households.csv.gz", Seq("household_id", "income", "cars", "block_id") ) try { @@ -56,7 +42,7 @@ class NetworkRelaxationScenarioGenerator { VehicleInfo(i.toString, "Car", None, i.toString) } val csvWriter = new CsvWriter( - "test/input/relaxation-network-scenario/vehicles.csv", + scenarioDir.getPath + "/vehicles.csv.gz", Seq("vehicleId", "vehicleTypeId", "stateOfCharge", "householdId") ) try { @@ -84,7 +70,8 @@ class NetworkRelaxationScenarioGenerator { None ) } - val csvWriter = new CsvWriter(scenarioDir.getPath + "/persons.csv", Seq("person_id", "household_id", "age", "sex")) + val csvWriter = + new CsvWriter(scenarioDir.getPath + "/persons.csv.gz", Seq("person_id", "household_id", "age", "sex")) try { persons.foreach { person => csvWriter.write( @@ -118,8 +105,6 @@ class NetworkRelaxationScenarioGenerator { val plans = for (i <- 1 to count) yield { // Home = -0.03763798759, 0.00975476975 // Work = 0.04874384139, 0.01013286711 - - // TODO wgs2utm = Seq( InputPlanElement( tripId = Some(i.toString), @@ -130,7 +115,7 @@ class NetworkRelaxationScenarioGenerator { ActivityType = Some("Home"), x = Some(161827.4228835071), y = Some(1079.7224574150498), - departureTime = Some(8) + departureTime = Some(8 + Random.nextDouble() * 4) ), InputPlanElement( tripId = Some(i.toString), @@ -156,9 +141,7 @@ class NetworkRelaxationScenarioGenerator { ) ) } - println(plans) - - val csvWriter = new CsvWriter(scenarioDir.getPath + "/plans.csv", headers) + val csvWriter = new CsvWriter(scenarioDir.getPath + "/plans.csv.gz", headers) try { plans.flatten.foreach { plan => csvWriter.write( @@ -179,10 +162,10 @@ class NetworkRelaxationScenarioGenerator { } def generate() = { -// generateHouseholds() + generateHouseholds() generateVehicles() -// generatePersons() -// generatePlans() + generatePersons() + generatePlans() } } @@ -190,38 +173,27 @@ object NetworkRelaxationScenarioGenerator extends App { new NetworkRelaxationScenarioGenerator().generate() } +case class LinkStatsCsvRow(link: Int, volume: Double) + +object LinkStatsCsvRow { + + def toCsvRow(rec: java.util.Map[String, String]): LinkStatsCsvRow = + LinkStatsCsvRow(rec.get("link").toInt, rec.get("volume").toDouble) +} + class NetworkRelaxationSpec extends AnyWordSpecLike with BeamHelper { + val lastIteration = 15 System.setProperty(ContextInitializer.CONFIG_FILE_PROPERTY, "logback-test.xml") "Network relaxation" should { "pass" in { val config = ConfigFactory - .parseFile(new File("test/input/relaxation-network-scenario/beam.conf")) + .parseFile(new File("test/input/network-relaxation-scenario/beam.conf")) .resolve() val configBuilder = new MatSimBeamConfigBuilder(config) val matsimConfig = configBuilder.buildMatSimConf() val beamConfig = BeamConfig(config) - val geoUtils = new GeoUtilsImpl(beamConfig) - - // Home = -0.03763798759, 0.00975476975 - // Work = 0.04874384139, 0.01013286711 - - println(geoUtils.wgs2Utm(new Coord(-0.03763798759, 0.00975476975))) - println(geoUtils.wgs2Utm(new Coord(0.04874384139, 0.01013286711))) - - val networkCoordinator = buildNetworkCoordinator(beamConfig) - val boundingBox = NetworkUtils.getBoundingBox(networkCoordinator.network.getNodes.values()) - val minX = boundingBox(0) - val maxX = boundingBox(2) - val minY = boundingBox(1) - val maxY = boundingBox(3) - - val midX = (maxX + minX) / 2 - val midY = (maxY + minY) / 2 - -// println(new Coord(midX, midY)) - val (scenarioBuilt, beamScenario, _) = buildBeamServicesAndScenario(beamConfig, matsimConfig) val scenario: MutableScenario = scenarioBuilt val outputDir = FileUtils.setConfigOutputFile(beamConfig, matsimConfig) @@ -230,13 +202,6 @@ class NetworkRelaxationSpec extends AnyWordSpecLike with BeamHelper { val beamServices: BeamServices = buildBeamServices(injector) LoggingUtil.initLogger(outputDir, beamConfig.beam.logger.keepConsoleAppenderOn) - println(s"Beam output directory is: $outputDir") - logger.info(ConfigConsistencyComparator.getMessage.getOrElse("")) - - val errors = InputConsistencyCheck.checkConsistency(beamConfig) - if (errors.nonEmpty) { - logger.error("Input consistency check failed:\n" + errors.mkString("\n")) - } runBeam( beamServices, @@ -245,7 +210,28 @@ class NetworkRelaxationSpec extends AnyWordSpecLike with BeamHelper { outputDir, true ) - fail + + val linkStats = new File(outputDir, s"ITERS/it.$lastIteration/$lastIteration.linkstats.csv.gz") + + val (iter: Iterator[LinkStatsCsvRow], toClose: Closeable) = + GenericCsvReader.readAs[LinkStatsCsvRow](linkStats.toString, LinkStatsCsvRow.toCsvRow, _ => true) + val result = + try { + iter.toVector + } finally { + toClose.close() + } + + val routes = List( + Set(0, 26, 24), + Set(4, 28, 22), + Set(2, 30, 20), + Set(6, 32, 8) + ) + + val sums = routes.map(route => result.filter(row => route.contains(row.link)).map(_.volume).sum) + + sums.foreach(_ should be > 500.0) } } } diff --git a/test/input/relaxation-network-scenario/beam.conf b/test/input/network-relaxation-scenario/beam.conf similarity index 89% rename from test/input/relaxation-network-scenario/beam.conf rename to test/input/network-relaxation-scenario/beam.conf index cad22724ceb..9f34ec18fe6 100644 --- a/test/input/relaxation-network-scenario/beam.conf +++ b/test/input/network-relaxation-scenario/beam.conf @@ -2,7 +2,7 @@ include "../common/akka.conf" include "../common/metrics.conf" include "../common/matsim.conf" -beam.inputDirectory = "test/input/relaxation-network-scenario" +beam.inputDirectory = "test/input/network-relaxation-scenario" ################################################################## # SPATIAL @@ -14,18 +14,18 @@ beam.spatial = { beam.physsim.inputNetworkFilePath = ${beam.routing.r5.directory}"/physsim-network.xml" beam.physsim.network.removeIslands = false -beam.physsim.flowCapacityFactor = 0.1 +beam.physsim.flowCapacityFactor = 0.05 beam.physsim.writeEventsInterval = 1 beam.physsim.events.fileOutputFormats = "xml,csv" beam.agentsim.taz.filePath=${beam.inputDirectory}"/taz-centers.csv" beam.agentsim.firstIteration = 0 -beam.agentsim.lastIteration = 3 +beam.agentsim.lastIteration = 15 beam.agentsim.startTime = "00:00:00" beam.agentsim.endTime = "30:00:00" -beam.agentsim.simulationName = "relaxation-network-scenario" +beam.agentsim.simulationName = "network-relaxation-scenario" beam.agentsim.agents.plans = { inputPersonAttributesFilePath = "" inputPlansFilePath = "" @@ -47,9 +47,9 @@ beam.agentsim.agents.vehicles { beam.replanning = { maxAgentPlanMemorySize = 4 Module_1 = "SelectExpBeta" - ModuleProbability_1 = 0.9 + ModuleProbability_1 = 0.8 Module_2 = "ClearRoutes" - ModuleProbability_2 = 0.1 + ModuleProbability_2 = 0.2 Module_3 = "ClearModes" ModuleProbability_3 = 0.0 Module_4 = "TimeMutator" @@ -58,7 +58,7 @@ beam.replanning = { beam.outputs.defaultWriteInterval = 1 beam.outputs.collectAndCreateBeamAnalysisAndGraphs = false -beam.outputs.writeR5RoutesInterval = 1 +beam.outputs.writeR5RoutesInterval = 0 #beam.outputs.events.fileOutputFormats = "csv,xml" # valid options: xml(.gz) , csv(.gz), none - DEFAULT: csv.gz # Events Writing Logging Levels: @@ -81,7 +81,6 @@ beam.routing { osmMapdbFile = ${beam.inputDirectory}"/r5/osm.mapdb" mNetBuilder.fromCRS = "epsg:4326" # WGS84 mNetBuilder.toCRS = ${beam.spatial.localCRS} - #travelTimeNoiseFraction = 0.25 } } diff --git a/test/input/relaxation-network-scenario/beamFuelTypes.csv b/test/input/network-relaxation-scenario/beamFuelTypes.csv similarity index 100% rename from test/input/relaxation-network-scenario/beamFuelTypes.csv rename to test/input/network-relaxation-scenario/beamFuelTypes.csv diff --git a/test/input/relaxation-network-scenario/r5/dummy.zip b/test/input/network-relaxation-scenario/r5/dummy.zip similarity index 100% rename from test/input/relaxation-network-scenario/r5/dummy.zip rename to test/input/network-relaxation-scenario/r5/dummy.zip diff --git a/test/input/relaxation-network-scenario/r5/fares.dat b/test/input/network-relaxation-scenario/r5/fares.dat similarity index 100% rename from test/input/relaxation-network-scenario/r5/fares.dat rename to test/input/network-relaxation-scenario/r5/fares.dat diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm b/test/input/network-relaxation-scenario/r5/network-relaxation-scenario.osm similarity index 100% rename from test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm rename to test/input/network-relaxation-scenario/r5/network-relaxation-scenario.osm diff --git a/test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf b/test/input/network-relaxation-scenario/r5/network-relaxation-scenario.osm.pbf similarity index 100% rename from test/input/relaxation-network-scenario/r5/relaxation-network-scenario.osm.pbf rename to test/input/network-relaxation-scenario/r5/network-relaxation-scenario.osm.pbf diff --git a/test/input/relaxation-network-scenario/r5/tolls.dat b/test/input/network-relaxation-scenario/r5/tolls.dat similarity index 100% rename from test/input/relaxation-network-scenario/r5/tolls.dat rename to test/input/network-relaxation-scenario/r5/tolls.dat diff --git a/test/input/relaxation-network-scenario/taz-centers.csv b/test/input/network-relaxation-scenario/taz-centers.csv similarity index 100% rename from test/input/relaxation-network-scenario/taz-centers.csv rename to test/input/network-relaxation-scenario/taz-centers.csv diff --git a/test/input/relaxation-network-scenario/urbansim_v2/blocks.csv.gz b/test/input/network-relaxation-scenario/urbansim_v2/blocks.csv.gz similarity index 100% rename from test/input/relaxation-network-scenario/urbansim_v2/blocks.csv.gz rename to test/input/network-relaxation-scenario/urbansim_v2/blocks.csv.gz diff --git a/test/input/relaxation-network-scenario/urbansim_v2/households.csv.gz b/test/input/network-relaxation-scenario/urbansim_v2/households.csv.gz similarity index 100% rename from test/input/relaxation-network-scenario/urbansim_v2/households.csv.gz rename to test/input/network-relaxation-scenario/urbansim_v2/households.csv.gz diff --git a/test/input/relaxation-network-scenario/urbansim_v2/persons.csv.gz b/test/input/network-relaxation-scenario/urbansim_v2/persons.csv.gz similarity index 100% rename from test/input/relaxation-network-scenario/urbansim_v2/persons.csv.gz rename to test/input/network-relaxation-scenario/urbansim_v2/persons.csv.gz diff --git a/test/input/network-relaxation-scenario/urbansim_v2/plans.csv.gz b/test/input/network-relaxation-scenario/urbansim_v2/plans.csv.gz new file mode 100644 index 00000000000..2a3c865828b --- /dev/null +++ b/test/input/network-relaxation-scenario/urbansim_v2/plans.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b1d131f185f6fc1f734725bb521c30a397c0c180d57b1d643a9d1423087cf4d +size 44096 diff --git a/test/input/relaxation-network-scenario/vehicleTypes.csv b/test/input/network-relaxation-scenario/vehicleTypes.csv similarity index 100% rename from test/input/relaxation-network-scenario/vehicleTypes.csv rename to test/input/network-relaxation-scenario/vehicleTypes.csv diff --git a/test/input/relaxation-network-scenario/vehicles.csv b/test/input/network-relaxation-scenario/vehicles.csv similarity index 100% rename from test/input/relaxation-network-scenario/vehicles.csv rename to test/input/network-relaxation-scenario/vehicles.csv diff --git a/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz b/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz deleted file mode 100644 index 2217d30665d..00000000000 --- a/test/input/relaxation-network-scenario/urbansim_v2/plans.csv.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cbf20511d771d8a8c9a8f7d6104b245503e13137b45140128a6143d418c0860f -size 21637 From cd6d2412a56723985de03aeaabe3cda3500d7326 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 24 May 2022 01:47:01 -0700 Subject: [PATCH 091/307] stopping charging at home end time, and sampling from both charging and parking stalls --- .../agents/household/HouseholdActor.scala | 10 +++---- .../infrastructure/ChargingFunctions.scala | 30 +++++-------------- .../ChargingNetworkManager.scala | 19 ++++++++---- .../ChargingNetworkManagerHelper.scala | 5 +--- .../infrastructure/ParkingFunctions.scala | 4 +-- 5 files changed, 28 insertions(+), 40 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index bd598b774b6..63191c35c31 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -216,12 +216,10 @@ object HouseholdActor { ) whoDrivesThisVehicle = whoDrivesThisVehicle + (vehicleIdFromPlans -> person.getId) } - person.getSelectedPlan.getPlanElements.asScala.headOption - .flatMap { - case act: Activity => - Some(person.getId -> (ParkingInquiry.activityTypeStringToEnum(act.getType), act.getType, act.getCoord)) - case _ => None - } + person.getSelectedPlan.getPlanElements.asScala.find(_.isInstanceOf[Activity]) map { element => + val act = element.asInstanceOf[Activity] + person.getId -> (ParkingInquiry.activityTypeStringToEnum(act.getType), act.getType, act.getCoord) + } }.toMap if (!householdMembersToLocationTypeAndLocation.exists(_._2._1 == ParkingActivityType.Home)) { diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index ad206744f2e..529b13c647b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -122,16 +122,17 @@ class ChargingFunctions( zone: ParkingZone, inquiry: ParkingInquiry ): Boolean = { - if (zone.chargingPointType.isEmpty) - throw new RuntimeException("ChargingFunctions expect only stalls with charging points") - val isEV: Boolean = inquiry.beamVehicle.forall(_.isEV) +// if (zone.chargingPointType.isEmpty) +// throw new RuntimeException("ChargingFunctions expect only stalls with charging points") +// val isEV: Boolean = inquiry.beamVehicle.forall(_.isEV) val rideHailFastChargingOnly: Boolean = ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone, inquiry) val enrouteFastChargingOnly: Boolean = ifEnrouteThenFastChargingOnly(zone, inquiry) val overnightStaySlowChargingOnly: Boolean = ifHomeOrWorkOrOvernightThenSlowChargingOnly(zone, inquiry) val validChargingCapability: Boolean = hasValidChargingCapability(zone, inquiry.beamVehicle) val preferredParkingTypes = getPreferredParkingTypes(inquiry) val canCarParkHere: Boolean = canThisCarParkHere(zone, inquiry, preferredParkingTypes) - isEV && rideHailFastChargingOnly && validChargingCapability && canCarParkHere && enrouteFastChargingOnly && overnightStaySlowChargingOnly + /*isEV && */ + rideHailFastChargingOnly && validChargingCapability && canCarParkHere && enrouteFastChargingOnly && overnightStaySlowChargingOnly } /** @@ -210,25 +211,8 @@ class ChargingFunctions( override protected def processParkingZoneSearchResult( inquiry: ParkingInquiry, parkingZoneSearchResult: Option[ParkingZoneSearchResult] - ): Option[ParkingZoneSearchResult] = parkingZoneSearchResult match { - case None if inquiry.searchMode == ParkingSearchMode.EnRouteCharging => - // did not find a stall with a fast charging point, return a dummy stall - Some( - ParkingZoneSearch.ParkingZoneSearchResult( - ParkingStall.lastResortStall( - new Envelope( - inquiry.originUtm.get.loc.getX + 2000, - inquiry.originUtm.get.loc.getX - 2000, - inquiry.originUtm.get.loc.getY + 2000, - inquiry.originUtm.get.loc.getY - 2000 - ), - new Random(seed) - ), - DefaultParkingZone - ) - ) - case resultMaybe => resultMaybe - } + ): Option[ParkingZoneSearchResult] = + super[ParkingFunctions].processParkingZoneSearchResult(inquiry, parkingZoneSearchResult) /** * sample location of a parking stall with a TAZ area diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index dc50f27a223..93f9f1a3010 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -22,9 +22,10 @@ import beam.utils.logging.LoggingMessageActor import beam.utils.logging.pattern.ask import com.typesafe.scalalogging.LazyLogging import org.matsim.api.core.v01.Id -import org.matsim.api.core.v01.population.Person +import org.matsim.api.core.v01.population.{Activity, Person} import java.util.concurrent.TimeUnit +import scala.collection.JavaConverters._ import scala.concurrent.duration._ import scala.language.postfixOps @@ -53,6 +54,14 @@ class ChargingNetworkManager( private var timeSpentToPlanEnergyDispatchTrigger: Long = 0 private var nHandledPlanEnergyDispatchTrigger: Int = 0 + protected val chargingEndTimeInSeconds: Map[Id[Person], Int] = + beamServices.matsimServices.getScenario.getPopulation.getPersons.asScala.map { case (personId, person) => + personId -> (person.getSelectedPlan.getPlanElements.asScala + .find(_.isInstanceOf[Activity]) + .map(_.asInstanceOf[Activity].getEndTime) + .getOrElse(0.0) + (24 * 3600.0)).toInt + }.toMap + private val maybeDebugReport: Option[Cancellable] = if (beamServices.beamConfig.beam.debug.debugEnabled) { Some(context.system.scheduler.scheduleWithFixedDelay(10.seconds, 30.seconds, self, DebugReport)(context.dispatcher)) } else { @@ -85,11 +94,11 @@ class ChargingNetworkManager( case inquiry: ParkingInquiry => log.debug(s"Received parking inquiry: $inquiry") - chargingNetworkHelper.get(inquiry.reservedFor.managerId).processParkingInquiry(inquiry) match { - case Some(parkingResponse) => - inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) + chargingNetworkHelper.get(inquiry.reservedFor.managerId).processParkingInquiry(inquiry) foreach { + parkingResponse => + if (parkingResponse.stall.chargingPointType.isDefined) + inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) sender() ! parkingResponse - case _ => (parkingNetworkManager ? inquiry).pipeTo(sender()) } case TriggerWithId(InitializeTrigger(_), triggerId) => diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index 62facb725e0..91719d34675 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -76,10 +76,7 @@ trait ChargingNetworkManagerHelper extends { ): Option[ScheduleTrigger] = { assume(endTime - startTime >= 0, s"timeInterval should not be negative! startTime $startTime endTime $endTime") // Calculate the energy to charge each vehicle connected to the a charging station - val endOfMaxSessionTime = - chargingVehicle.chargingSessions.headOption - .map(_.startTime + cnmConfig.maxChargingSessionsInSeconds) - .getOrElse(endTime) + val endOfMaxSessionTime = chargingEndTimeInSeconds(chargingVehicle.personId) val endOfShiftTime = chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow).getOrElse(endTime) val updatedEndTime = Math.min(endOfMaxSessionTime, endOfShiftTime) val duration = Math.max(0, updatedEndTime - startTime) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index eaf8a0cb144..eb03d8c4229 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -126,7 +126,7 @@ class ParkingFunctions( case Some(result) => result case _ => inquiry.parkingActivityType match { - case ParkingActivityType.Home => + case ParkingActivityType.Home && inquiry.searchMode != ParkingSearchMode.EnRouteCharging => val newStall = ParkingStall.defaultResidentialStall(inquiry.destinationUtm.loc) ParkingZoneSearch.ParkingZoneSearchResult(newStall, DefaultParkingZone) case _ => @@ -211,7 +211,7 @@ class ParkingFunctions( inquiry.parkingActivityType match { case ParkingActivityType.Home => Set(ParkingType.Residential) case ParkingActivityType.Work => Set(ParkingType.Workplace) - case _ => Set() + case _ => Set(ParkingType.Public) } } else { inquiry.parkingActivityType match { From 15cb6a49e803f3ab865a60154d7a66b5db91ca38 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 24 May 2022 01:56:39 -0700 Subject: [PATCH 092/307] adding all stalls to chargingnetwork --- .../beam/agentsim/infrastructure/ChargingFunctions.scala | 2 -- .../beam/agentsim/infrastructure/ChargingNetwork.scala | 1 - .../agentsim/infrastructure/InfrastructureUtils.scala | 9 ++++----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 529b13c647b..bb4143b6d0f 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -14,8 +14,6 @@ import com.vividsolutions.jts.geom.Envelope import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.collections.QuadTree -import scala.util.Random - class ChargingFunctions( geoQuadTree: QuadTree[TAZ], idToGeoMapping: scala.collection.Map[Id[TAZ], TAZ], diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index ed50790cda2..380be8401c0 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -12,7 +12,6 @@ import beam.sim.BeamServices import beam.sim.config.BeamConfig import com.typesafe.scalalogging.LazyLogging import com.vividsolutions.jts.geom.Envelope -import org.matsim.api.core.v01.network.Link import org.matsim.api.core.v01.population.Person import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.collections.QuadTree diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala index cd02dff1b15..073eb38ec63 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala @@ -36,7 +36,6 @@ object InfrastructureUtils extends LazyLogging { implicit val geo: GeoUtils = beamServices.geo implicit val boundingBox: Envelope = envelopeInUTM val beamConfig = beamServices.beamConfig - val parkingManagerCfg = beamConfig.beam.agentsim.taz.parkingManager val mainParkingFile: String = beamConfig.beam.agentsim.taz.parkingFilePath val parkingStallCountScalingFactor: Double = beamConfig.beam.agentsim.taz.parkingStallCountScalingFactor @@ -80,7 +79,7 @@ object InfrastructureUtils extends LazyLogging { } // CHARGING STALLS ARE LOADED HERE - val allChargingStalls = loadStalls( + val allStalls = loadStalls( mainChargingFile, vehicleManagersParkingFiles, beamScenario.tazTreeMap.tazQuadTree, @@ -90,8 +89,8 @@ object InfrastructureUtils extends LazyLogging { beamScenario.beamConfig, Some(beamServices) ) - val chargingStalls = loadChargingStalls(allChargingStalls) - val rideHailChargingStalls = loadRideHailChargingStalls(allChargingStalls) + val chargingStalls = loadChargingStalls(allStalls) + val rideHailChargingStalls = loadRideHailChargingStalls(allStalls) // CHARGING ZONES ARE BUILT HERE logger.info(s"building charging networks...") @@ -271,6 +270,6 @@ object InfrastructureUtils extends LazyLogging { stalls: Map[Id[ParkingZoneId], ParkingZone] ): Map[Id[ParkingZoneId], ParkingZone] = { import VehicleManager._ - stalls.filter(x => x._2.chargingPointType.nonEmpty && x._2.reservedFor.managerType != TypeEnum.RideHail) + stalls.filter(x => x._2.reservedFor.managerType != TypeEnum.RideHail) } } From 85890b3497e6b6fdfa59b2475d6684d82fcd6bb6 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Tue, 24 May 2022 18:17:51 +0600 Subject: [PATCH 093/307] Cleanup NetworkRelaxationScenarioGenerator --- .../integration/NetworkRelaxationSpec.scala | 37 +++++++------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala index ac0ba9bbe48..b605bd0441c 100644 --- a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala +++ b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala @@ -20,6 +20,16 @@ import scala.util.Random class NetworkRelaxationScenarioGenerator { val scenarioDir = new File("test/input/network-relaxation-scenario/urbansim_v2") + def generateBlocks() = { + println(s"Generating blocks") + val csvWriter = new CsvWriter( + scenarioDir + "/blocks.csv.gz", + Seq("block_id", "x", "y") + ) + csvWriter.write("1", "166648.21039213781", "998.9706301352383") + csvWriter.close() + } + def generateHouseholds(count: Int = 2000) = { println(s"Generating $count households") val csvWriter = new CsvWriter( @@ -36,29 +46,6 @@ class NetworkRelaxationScenarioGenerator { } - def generateVehicles(count: Int = 2000) = { - println(s"Generating $count vehicles") - val vehicles = for (i <- 1 to count) yield { - VehicleInfo(i.toString, "Car", None, i.toString) - } - val csvWriter = new CsvWriter( - scenarioDir.getPath + "/vehicles.csv.gz", - Seq("vehicleId", "vehicleTypeId", "stateOfCharge", "householdId") - ) - try { - vehicles.foreach { vehicle => - csvWriter.write( - vehicle.vehicleId, - vehicle.vehicleTypeId, - vehicle.initialSoc, - vehicle.householdId - ) - } - } finally { - csvWriter.close() - } - } - def generatePersons(count: Int = 2000) = { println(s"Generating $count persons") val persons = for (i <- 1 to count) yield { @@ -162,8 +149,10 @@ class NetworkRelaxationScenarioGenerator { } def generate() = { + scenarioDir.mkdir() + + generateBlocks() generateHouseholds() - generateVehicles() generatePersons() generatePlans() } From 73dc02bbcb3c9fac709fc506d3980aac87b9817f Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 24 May 2022 15:36:08 -0700 Subject: [PATCH 094/307] and fixing compilation errors --- prepare_for_pack/prepare_archive.sh | 13 - src/main/python/gemini/debugging.py | 28 -- src/main/python/gemini/helper.py | 7 - .../nhts_analysis/get-NHTS-mode_choice.py | 279 ------------------ .../infrastructure/ParkingFunctions.scala | 2 +- .../parking/ParkingZoneSearch.scala | 45 +-- .../infrastructure/parking/PricingModel.scala | 8 +- 7 files changed, 30 insertions(+), 352 deletions(-) delete mode 100644 prepare_for_pack/prepare_archive.sh delete mode 100644 src/main/python/gemini/debugging.py delete mode 100644 src/main/python/gemini/helper.py delete mode 100644 src/main/python/nhts_analysis/get-NHTS-mode_choice.py diff --git a/prepare_for_pack/prepare_archive.sh b/prepare_for_pack/prepare_archive.sh deleted file mode 100644 index 1d3ba2bfd1b..00000000000 --- a/prepare_for_pack/prepare_archive.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -gemini_path='production/sfbay/gemini' -rm -rf production/ -mkdir -p $gemini_path -cp ../$gemini_path -R production/sfbay -echo 'folder content updated' - -rm production.zip -echo 'old archive deleted' - -zip -r production.zip production - diff --git a/src/main/python/gemini/debugging.py b/src/main/python/gemini/debugging.py deleted file mode 100644 index 82a58c5435c..00000000000 --- a/src/main/python/gemini/debugging.py +++ /dev/null @@ -1,28 +0,0 @@ -import os - -mnl_lines = ["mnlStatus,requestId,parkingZoneId,chargingPointType,parkingType,costInDollars\n"] -mnl_search_lines = ["parkingZoneId,geoId,parkingType,chargingPointType,pricingModel,reservedFor,stallsAvailable," - "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,requestId,isEV,rideHailFastChargingOnly," - "validChargingCapability,hasAvailability,validParkingType,isValidTime,isValidVehicleManager\n"] -mnl_param_lines = ["parkingZoneId,geoId,parkingType,chargingPointType,pricingModel,reservedFor,stallsAvailable," - "maxStalls,vehicleId,parkingDuration,activityType,valueOfTime,requestId,costInDollars,RangeAnxietyCost," - "WalkingEgressCost,ParkingTicketCost,HomeActivityPrefersResidentialParking\n"] -output_log_file = os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/beamLog.out.txt') -with open(output_log_file) as infile: - for line in infile: - if "SAMPLED: " in line: - mnl_lines.append("sampled,"+line.split("SAMPLED: ")[1]) - elif "CHOSEN: " in line: - mnl_lines.append("chosen,"+line.split("CHOSEN: ")[1]) - elif "SEARCH: " in line: - mnl_search_lines.append(line.split("SEARCH: ")[1]) - elif "PARAM: " in line: - mnl_param_lines.append(line.split("PARAM: ")[1]) - -with open(os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-beamLog.csv'), 'w') as f: - f.writelines(mnl_lines) -with open(os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-search-beamLog.csv'), 'w') as f: - f.writelines(mnl_search_lines) -with open(os.path.expanduser('~/Data/GEMINI/2022Mars-Calibration/mnl-param-beamLog.csv'), 'w') as f: - f.writelines(mnl_param_lines) -print("END") diff --git a/src/main/python/gemini/helper.py b/src/main/python/gemini/helper.py deleted file mode 100644 index 78ee1545f72..00000000000 --- a/src/main/python/gemini/helper.py +++ /dev/null @@ -1,7 +0,0 @@ -import pandas as pd - -def read_file(filename): - compression = None - if filename.endswith(".gz"): - compression = 'gzip' - return pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) \ No newline at end of file diff --git a/src/main/python/nhts_analysis/get-NHTS-mode_choice.py b/src/main/python/nhts_analysis/get-NHTS-mode_choice.py deleted file mode 100644 index 49eaff36622..00000000000 --- a/src/main/python/nhts_analysis/get-NHTS-mode_choice.py +++ /dev/null @@ -1,279 +0,0 @@ -import pandas as pd - -import numpy as np -import scipy.ndimage -import geopandas as gpd - -# %% -trips_all = pd.read_csv('https://beam-outputs.s3.amazonaws.com/new_city/nhts/trippub.csv.gz', - usecols=[0, 1, 2, 3, 4, 5, 6, 7, 17, 26, 28, 58, 59, 60, 61, 64, 69, 70, 71, 72, 73, 74, 84, 89, 93, - 102, 103]) - -persons_all = pd.read_csv('https://beam-outputs.s3.amazonaws.com/new_city/nhts/perpub.csv.gz') - - -#%% - -modenames = {1:'Walk',2:'Bike',3:'Car',4:'Car',5:'Car',6:'Car',7:'Car',8:'Car',9:'Car',11:'Bus', - 13:'Bus', 14:'Bus', 15:'Rail', 16:'Subway',17:'Ridehail',20:'Ferry'} - -for cbsa in ['35620']:#persons_all.HH_CBSA.unique(): - trips = trips_all.loc[(trips_all['HH_CBSA'] == cbsa) , :] - - - valid = (trips.TRPMILES > 0) & (trips.TDWKND == 2) & (trips.TRPTRANS != 19) - - - - trips = trips.loc[valid, :] - trips['UniquePID'] = trips.HOUSEID * 100 + trips.PERSONID - trips['startHour'] = np.floor(trips.STRTTIME / 100) + np.mod(trips.STRTTIME, 100) / 60 - trips['endHour'] = np.floor(trips.ENDTIME / 100) + np.mod(trips.ENDTIME, 100) / 60 - trips['toWork'] = (trips.WHYTO == 3) | (trips.WHYTO == 4) - trips['fromWork'] = (trips.WHYFROM == 3) | (trips.WHYFROM == 4) - trips['mode'] = [modenames.get(val, 'Other') for val in trips['TRPTRANS']] - trips['distbin'] = np.digitize(trips.TRPMILES,np.logspace(-1.5,2,30)) - - - workInvolved = (trips.TRIPPURP == 'HBW') - workTrips = trips.loc[workInvolved, :] - - persons = persons_all.loc[(persons_all['HH_CBSA'] == cbsa), :] - - valid = (persons.TRAVDAY > 1) & (persons.TRAVDAY < 7) - - persons = persons.loc[valid,:] - persons['UniquePID'] = persons.HOUSEID * 100 + persons.PERSONID - - workPIDs = set(workTrips.UniquePID) - workerTrips = trips.loc[trips['UniquePID'].isin(workPIDs),:] - - - bydist = trips[['mode','distbin','WTTRDFIN']].groupby(['distbin','mode']).sum().unstack().fillna(0)['WTTRDFIN'] - bydist['dist'] = ((np.append(np.logspace(-1.5,2,30),150))) - bydist.set_index('dist', drop=True, inplace=True) - -#%% - -events = pd.read_csv('https://beam-outputs.s3.amazonaws.com/output/newyork/nyc-200k-baseline__2020-09-07_17-51-04_naj/ITERS/it.10/10.events.csv.gz', index_col=None) - - -pathTraversal = events.loc[(events['type'] == 'PathTraversal')].dropna(how='all', axis=1) #(events['mode'] == 'car') - - -modechoice = events.loc[events.type=='ModeChoice'].dropna(how='all', axis=1) - -mccats = {'walk_transit':'transit', 'drive_transit':'transit','ride_hail_transit':'transit','ride_hail':'ridehail','ride_hail_pooled':'ridehail', - 'walk':'walk','car':'car','bike':'bike'} - -modechoice['mode'] = [mccats.get(val, 'Other') for val in modechoice['mode']] - -bydistbeam = modechoice[['mode','distbin','person']].groupby(['distbin','mode']).count().unstack().fillna(0)['person'] - -pathTraversal['mode_extended'] = pathTraversal['mode'] -pathTraversal['isRH'] = ((pathTraversal['driver'].str.contains('rideHail')== True)) -pathTraversal['isCAV'] = ((pathTraversal['vehicleType'].str.contains('CAV')==True)) -pathTraversal.loc[pathTraversal['isRH'], 'mode_extended'] += '_RH' -pathTraversal.loc[pathTraversal['isCAV'], 'mode_extended'] += '_CAV' -# pathTraversal.loc[pathTraversal.mode == "tram","mode"] = "rail" - -pathTraversal['trueOccupancy'] = pathTraversal['numPassengers'] -pathTraversal.loc[pathTraversal['mode_extended'] == 'car', 'trueOccupancy'] += 1 -pathTraversal.loc[pathTraversal['mode_extended'] == 'walk', 'trueOccupancy'] += 1 -pathTraversal.loc[pathTraversal['mode_extended'] == 'bike', 'trueOccupancy'] += 1 -pathTraversal['vehicleMiles'] = pathTraversal['length']/1609.34 -pathTraversal['passengerMiles'] = (pathTraversal['length'] * pathTraversal['trueOccupancy'])/1609.34 -pathTraversal['vehicleHours'] = (pathTraversal['arrivalTime'] - pathTraversal['departureTime'])/3600. -pathTraversal['passengerHours'] = pathTraversal['vehicleHours'] * pathTraversal['trueOccupancy'] - -pathTraversal['hour'] = np.floor(pathTraversal.time / 3600.0) - - -#%% -mcd = pd.read_csv('https://beam-outputs.s3.amazonaws.com/output/newyork/nyc-200k-baseline__2020-09-07_17-51-04_naj/ITERS/it.10/10.modeChoiceDetailed.csv.gz') -mcdg = mcd[['altType','personId','altTime']].groupby(['personId','altTime']).agg('first') - - -#%% -from gtfspy import import_gtfs -from gtfspy import gtfs -from gtfspy import osm_transfers -import os - -imported_database_path = "test_db_kuopio.sqlite" -if not os.path.exists(imported_database_path): # reimport only if the imported database does not already exist - print("Importing gtfs zip file") - import_gtfs.import_gtfs(["../../../../test/input/newyork/r5-prod/NYC_Subway_20200109.zip", - "../../../../test/input/newyork/r5-prod/MTA_Manhattan_20200123.zip", - "../../../../test/input/newyork/r5-prod/MTA_Bronx_20200121.zip", - "../../../../test/input/newyork/r5-prod/MTA_Brooklyn_20200118.zip", - "../../../../test/input/newyork/r5-prod/MTA_Queens_20200118.zip", - "../../../../test/input/newyork/r5-prod/MTA_Staten_Island_20200118.zip"], - # "../../../../test/input/newyork/r5-prod/NJ_Transit_Bus_20200210.zip"], # input: list of GTFS zip files (or directories) - imported_database_path, # output: where to create the new sqlite3 database - print_progress=True, # whether to print progress when importing data - location_name="New York") - -G = gtfs.GTFS(imported_database_path) -route_shapes = G.get_all_route_shapes() -gdf = pd.DataFrame(route_shapes).set_index('name') - - -#%% - -occ = pd.read_csv("https://beam-outputs.s3.amazonaws.com/output/newyork/nyc-200k-baseline__2020-09-07_17-51-04_naj/ITERS/it.10/10.transitOccupancyByStop.csv") - -#%% -goodroute = "" -goodcol = "" -for col in occ.columns: - if col.startswith("MTA") | col.startswith("NYC_Subway"): - route = col.split('_')[-2] - if route in gdf.index: - print(route) - goodroute = route - goodcol = col - print(occ[col]) - else: - print("BAD") - -#%% -occ2 = occ.unstack().dropna(how='all').to_frame() -occ2['line'] = occ2.index.get_level_values(0).str.split('_').str[-2] -occ2['stop'] = occ2.index.get_level_values(1) - -routeridership = occ2.groupby(['line','stop']).agg(['sum','size']) - - -#%% -from zipfile import ZipFile - -gtfs = dict() -for zipname in os.listdir('../../../../test/input/newyork/r5-prod/'): - if zipname.endswith(".zip"): - zip_file = ZipFile('../../../../test/input/newyork/r5-prod/' + zipname) - files = dict() - text_files = zip_file.infolist() - for text_file in text_files: - files[text_file.filename.split('.')[0]] = pd.read_csv(zip_file.open(text_file.filename)) - gtfs[zipname.split('.')[0]] = files - -#%% -rows = [] -for col in occ.columns: - if ':' in col: - agency = col.split(':')[0] - trip = col.split(':')[1] - if agency in gtfs: - val = gtfs[agency]['trips'].loc[gtfs[agency]['trips'].trip_id == trip] - if val.size > 0: - val = val.iloc[0].to_dict() - val['occ'] = occ.loc[~occ[col].isna(),col].values - val['nStops'] = len(val['occ']) - val['agency'] = agency - rows.append(val) - -b = pd.DataFrame(rows) - - -#%% -collected = dict() - -for name, group in b.groupby(['route_id','direction_id','shape_id','nStops']): - try: - collected[name] = {'occupancy': group['occ'].mean(), 'headsign': group.iloc[0]['trip_headsign'], 'trips':group.shape[0]} - except: - bad = group - print("BAD "+ group.iloc[0]['trip_headsign']) - -collected = pd.DataFrame(collected).transpose() -collected.index.set_names(['route_id','direction_id','shape_id','nStops'], inplace=True).reset_index() -#%% -shapes = gtfs[agency]['shapes'].groupby('shape_id') - -#%% - -shape = 'M010235' -gdf = gpd.GeoDataFrame(shapes.get_group(shape), geometry = gpd.points_from_xy(shapes.get_group(shape).shape_pt_lon,shapes.get_group(shape).shape_pt_lat)) - - -#%% -campoModes = {1:"Walk",2:"Car",3:"Car",4:"Car",5:"Car",6:"Car",7:"Car",8:"Car",9:"Car",10:"Car",11:"Car",12:"Transit",14:"Ridehail",15:"Bike"} -campo = pd.read_csv('/Users/zaneedell/Downloads/austin-trips.csv') -date = pd.to_datetime({"year": campo['5. Year'], "month": campo['3. Month'], "day": campo['4. Day']}) -campo['date'] = date -campo['weekday'] = campo.date.dt.weekday -campo['mode'] = campo.loc[:,'26. Mode of Travel'].fillna(0).apply(lambda x: campoModes.get(int(x),'Other')) -campo.loc[campo['27. Other Mode'] == "RIDE AUSTIN", 'mode'] = "Ridehail" -campo.loc[campo['27. Other Mode'] == "UBER ", 'mode'] = "Ridehail" -campo.loc[campo['27. Other Mode'] == "UBER", 'mode'] = "Ridehail" -campo.loc[campo['27. Other Mode'] == "TRANSIT/TRAIN", 'mode'] = "Transit" -campo.loc[campo['27. Other Mode'] == "BUS/TRANSIT", 'mode'] = "Transit" -campo.loc[campo['27. Other Mode'] == "TRAIN", 'mode'] = "Transit" -campo.loc[campo['27. Other Mode'] == "Tram", 'mode'] = "Transit" - -campo['isWeekday'] = campo.date.dt.dayofweek <= 4 -campo['29. HH Members'].fillna(1.0, inplace=True) - - -campo['weight'] = 1 -campo.loc[campo['mode'] == "Car", "weight"] = campo.loc[campo['mode'] == "Car",'28. Number of People'] -campo.loc[campo['weight'] > 50, 'weight'] = 1 -campo.loc[(campo['mode'] == "Car") & (campo['weight'] == 2), 'mode'] = 'HOV2' -campo.loc[(campo['mode'] == "Car") & (campo['weight'] > 2), 'mode'] = 'HOV3' -modesplitCampo = campo.loc[campo.isWeekday, :].groupby('mode')['weight'].sum() -(modesplitCampo / modesplitCampo.loc[modesplitCampo.index != 'Other'].sum()).to_csv('/Users/zaneedell/Desktop/austin-gpra-pipeline/modesplit-pass.csv') -modesplitCampo2 = campo.loc[campo.isWeekday, :].groupby('mode')['29. HH Members'].sum() -(modesplitCampo2 / modesplitCampo2.loc[modesplitCampo2.index != 'Other'].sum()).to_csv('/Users/zaneedell/Desktop/austin-gpra-pipeline/modesplit-hh.csv') -(campo.loc[campo.isWeekday, 'mode'].value_counts() / sum((campo['mode'] != "Other") & campo.isWeekday)).to_csv('/Users/zaneedell/Desktop/austin-gpra-pipeline/modesplit-vehicleweighted.csv') - -campo.to_csv('/Users/zaneedell/Desktop/austin-gpra-pipeline/survey.csv.gz', compression='gzip') - - - - - -#%% -from shapely import geometry - -def combineRows(rows): - out = [{'personId': rows['6. Person Number'].iloc[0], - 'purpose': rows['25. Purpose'].iloc[0], - 'startLoc': geometry.Point(rows['21. Longitude'].iloc[0], rows['22. Latitude'].iloc[0]), - 'startCity': rows['12. Location City'].iloc[0], - 'prevPurpose': 1, - 'departureTime': rows['53. Departure Hour'].iloc[0] + rows['54. Departure Minute'].iloc[0] / 60 - }] - ind = 1 - for idx in range(len(rows)-1): - trip = dict() - trip['personId'] = rows['6. Person Number'].iloc[ind] - trip['startLoc'] = geometry.Point(rows['21. Longitude'].iloc[ind], rows['22. Latitude'].iloc[ind]) - trip['startCity'] = rows['12. Location City'].iloc[ind] - tripPurp = rows['25. Purpose'].iloc[ind] - out[-1]['purpose'] = tripPurp - trip['prevPurpose'] = tripPurp - if tripPurp == 11: - out[-1]['mode'] = out[-1]['mode'] = rows['mode'].iloc[ind] - else: - if 'mode' in out[-1]: - out[-1]['mode'] += ('->' + rows['mode'].iloc[ind]) - else: - out[-1]['mode'] = rows['mode'].iloc[ind] - trip['departureTime'] = rows['53. Departure Hour'].iloc[ind] + rows['54. Departure Minute'].iloc[ind] / 60 - out[-1]['endLoc'] = geometry.Point(rows['21. Longitude'].iloc[ind], rows['22. Latitude'].iloc[ind]) - out[-1]['endCity'] = rows['12. Location City'].iloc[ind] - out[-1]['arrivalTime'] = rows['51. Arrival Hour'].iloc[ind] + rows['52. Arrival Minute'].iloc[ind] / 60 - if ind < (len(rows) -1): - out.append(trip) - ind += 1 - return pd.DataFrame(out) - - -out = campo.groupby(['2. Sample Number', '6. Person Number']).apply(combineRows) -out['tourType'] = "NHB" -out.loc[out.prevPurpose == 1, "tourType"] = "HBO" -out.loc[out.purpose == 1, "tourType"] = "HBO" -out.loc[(out.prevPurpose == 1) & (out.purpose == 3), "tourType"] = "HBW" -out.loc[(out.prevPurpose == 3) & (out.purpose == 1), "tourType"] = "HBW" -modeSplitByPurpose = out.value_counts(['tourType','mode']).unstack(level=0).fillna(0) \ No newline at end of file diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index eb03d8c4229..ab8d9ee5fc4 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -126,7 +126,7 @@ class ParkingFunctions( case Some(result) => result case _ => inquiry.parkingActivityType match { - case ParkingActivityType.Home && inquiry.searchMode != ParkingSearchMode.EnRouteCharging => + case ParkingActivityType.Home if inquiry.searchMode != ParkingSearchMode.EnRouteCharging => val newStall = ParkingStall.defaultResidentialStall(inquiry.destinationUtm.loc) ParkingZoneSearch.ParkingZoneSearchResult(newStall, DefaultParkingZone) case _ => diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 8a8632b9915..365653437ac 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -112,7 +112,8 @@ object ParkingZoneSearch { parkingType: ParkingType, parkingZone: ParkingZone, coord: Coord, - costInDollars: Double + costInDollars: Double, + parkingDuration: Int ) /** @@ -170,24 +171,31 @@ object ParkingZoneSearch { } yield { // wrap ParkingZone in a ParkingAlternative val stallLocation: Coord = parkingZoneLocSamplingFunction(parkingZone) - val stallPriceInDollars: Double = - parkingZone.pricingModel match { - case None => 0 - case Some(pricingModel) if params.searchMode == ParkingSearchMode.EnRouteCharging => - PricingModel.evaluateParkingTicket( - pricingModel, - config.enrouteDuration.toInt, - config.estimatedMinParkingDurationInSeconds - ) - case Some(pricingModel) => - PricingModel.evaluateParkingTicket( - pricingModel, - params.parkingDuration.toInt, - config.estimatedMinParkingDurationInSeconds - ) + // end-of-day parking durations are set to zero, which will be mis-interpreted here + val parkingDuration = Math.max( + config.estimatedMinParkingDurationInSeconds.toInt, // at least a small duration of charging + params.searchMode match { + case ParkingSearchMode.EnRouteCharging => config.enrouteDuration.toInt + case _ => params.parkingDuration.toInt } + ) + val stallPriceInDollars: Double = parkingZone.pricingModel + .map( + PricingModel.evaluateParkingTicket( + _, + parkingDuration + ) + ) + .getOrElse(0.0) val parkingAlternative: ParkingAlternative = - ParkingAlternative(zone, parkingZone.parkingType, parkingZone, stallLocation, stallPriceInDollars) + ParkingAlternative( + zone, + parkingZone.parkingType, + parkingZone, + stallLocation, + stallPriceInDollars, + parkingDuration + ) val parkingAlternativeUtility: Map[ParkingMNL.Parameters, Double] = parkingZoneMNLParamsFunction(parkingAlternative) ParkingSearchAlternative( @@ -213,7 +221,8 @@ object ParkingZoneSearch { ) mnl.sampleAlternative(alternativesToSample, params.random).map { result => - val ParkingAlternative(taz, parkingType, parkingZone, coordinate, costInDollars) = result.alternativeType + val ParkingAlternative(taz, parkingType, parkingZone, coordinate, costInDollars, _) = + result.alternativeType // create a new stall instance. you win! val parkingStall = ParkingStall( diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala index fc81b6aaa5e..ea968f8a121 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/PricingModel.scala @@ -69,16 +69,12 @@ object PricingModel { */ def evaluateParkingTicket( pricingModel: PricingModel, - parkingDurationInSeconds: Int, - estimatedMinParkingDurationInSeconds: Double + parkingDurationInSeconds: Int ): Double = { pricingModel match { case FlatFee(costInDollars) => costInDollars case Block(costInDollars, intervalSeconds) => - (math.max( - estimatedMinParkingDurationInSeconds, - parkingDurationInSeconds.toDouble - ) / intervalSeconds.toDouble) * costInDollars + (parkingDurationInSeconds.toDouble / intervalSeconds.toDouble) * costInDollars } } From 7b458d7084f995df50fde613e40b2c22beb7f75a Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 24 May 2022 15:50:04 -0700 Subject: [PATCH 095/307] fixing more compilation errors --- .../beam/agentsim/infrastructure/ChargingNetworkManager.scala | 4 +--- src/main/scala/beam/sim/BeamMobsim.scala | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 93f9f1a3010..03644a33894 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -37,7 +37,6 @@ class ChargingNetworkManager( beamServices: BeamServices, chargingNetwork: ChargingNetwork, rideHailNetwork: ChargingNetwork, - parkingNetworkManager: ActorRef, scheduler: ActorRef ) extends LoggingMessageActor with ActorLogging @@ -290,10 +289,9 @@ object ChargingNetworkManager extends LazyLogging { beamServices: BeamServices, chargingNetwork: ChargingNetwork, rideHailNetwork: ChargingNetwork, - parkingManager: ActorRef, scheduler: ActorRef ): Props = { - Props(new ChargingNetworkManager(beamServices, chargingNetwork, rideHailNetwork, parkingManager, scheduler)) + Props(new ChargingNetworkManager(beamServices, chargingNetwork, rideHailNetwork, scheduler)) } case class ChargingNetworkHelper(chargingNetwork: ChargingNetwork, rideHailNetwork: ChargingNetwork) { diff --git a/src/main/scala/beam/sim/BeamMobsim.scala b/src/main/scala/beam/sim/BeamMobsim.scala index f031f30aaa3..4a27ceb0d66 100755 --- a/src/main/scala/beam/sim/BeamMobsim.scala +++ b/src/main/scala/beam/sim/BeamMobsim.scala @@ -416,7 +416,7 @@ class BeamMobsimIteration( // Charging Network Manager private val chargingNetworkManager = context.actorOf( ChargingNetworkManager - .props(beamServices, nonRhChargingNetwork, rhChargingNetwork, parkingNetworkManager, scheduler) + .props(beamServices, nonRhChargingNetwork, rhChargingNetwork, scheduler) .withDispatcher("charging-network-manager-pinned-dispatcher"), "ChargingNetworkManager" ) From 8bc5f37000a1a7c38317ec0dfce89185a13d9c14 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 24 May 2022 18:41:49 -0700 Subject: [PATCH 096/307] more compilation errors --- .../infrastructure/ChargingFunctions.scala | 48 +++++++++++-------- .../infrastructure/ChargingNetwork.scala | 4 +- .../ChargingNetworkManager.scala | 3 +- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index bb4143b6d0f..92c94895fd4 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -55,12 +55,14 @@ class ChargingFunctions( * @return */ def ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone: ParkingZone, inquiry: ParkingInquiry): Boolean = { - inquiry.reservedFor match { - case VehicleManager.TypeEnum.RideHail if inquiry.parkingDuration <= 3600 => - ChargingPointType.isFastCharger(zone.chargingPointType.get) - case _ => - true // not a ride hail vehicle seeking charging or parking for two then it is fine to park at slow charger - } + zone.chargingPointType.forall(chargingPointType => + inquiry.reservedFor match { + case VehicleManager.TypeEnum.RideHail if inquiry.parkingDuration <= 3600 => + ChargingPointType.isFastCharger(chargingPointType) + case _ => + true // not a ride hail vehicle seeking charging or parking for two then it is fine to park at slow charger + } + ) } /** @@ -70,12 +72,12 @@ class ChargingFunctions( * @return */ def ifEnrouteThenFastChargingOnly(zone: ParkingZone, inquiry: ParkingInquiry): Boolean = { - inquiry.searchMode match { - case ParkingSearchMode.EnRouteCharging => - ChargingPointType.isFastCharger(zone.chargingPointType.get) - case _ => - true // if it is not Enroute charging then it does not matter - } + zone.chargingPointType.forall(chargingPointType => + inquiry.searchMode match { + case ParkingSearchMode.EnRouteCharging => ChargingPointType.isFastCharger(chargingPointType) + case _ => true // if it is not Enroute charging then it does not matter + } + ) } /** @@ -85,13 +87,15 @@ class ChargingFunctions( * @return */ def ifHomeOrWorkOrOvernightThenSlowChargingOnly(zone: ParkingZone, inquiry: ParkingInquiry): Boolean = { - if ( - inquiry.searchMode == ParkingSearchMode.Init || List(ParkingActivityType.Home, ParkingActivityType.Work).contains( - inquiry.parkingActivityType - ) - ) { - !ChargingPointType.isFastCharger(zone.chargingPointType.get) - } else true + zone.chargingPointType.forall(chargingPointType => + if ( + inquiry.parkingActivityType == ParkingActivityType.Home || + inquiry.parkingActivityType == ParkingActivityType.Work || + inquiry.searchMode == ParkingSearchMode.Init + ) { + !ChargingPointType.isFastCharger(chargingPointType) + } else true + ) } /** @@ -101,8 +105,10 @@ class ChargingFunctions( * @return */ def hasValidChargingCapability(zone: ParkingZone, beamVehicleMaybe: Option[BeamVehicle]): Boolean = { - beamVehicleMaybe.forall( - _.beamVehicleType.chargingCapability.forall(getPower(_) >= getPower(zone.chargingPointType.get)) + zone.chargingPointType.forall(chargingPointType => + beamVehicleMaybe.forall( + _.beamVehicleType.chargingCapability.forall(getPower(_) >= getPower(chargingPointType)) + ) ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 380be8401c0..ce0645efe1d 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -23,7 +23,7 @@ import scala.util.Random /** * Created by haitamlaarabi */ -class ChargingNetwork(val chargingZones: Map[Id[ParkingZoneId], ParkingZone]) extends ParkingNetwork(chargingZones) { +class ChargingNetwork(val parkingZones: Map[Id[ParkingZoneId], ParkingZone]) extends ParkingNetwork(parkingZones) { import ChargingNetwork._ override protected val searchFunctions: Option[InfrastructureFunctions] = None @@ -32,7 +32,7 @@ class ChargingNetwork(val chargingZones: Map[Id[ParkingZoneId], ParkingZone]) ex mutable.HashMap.empty protected val chargingZoneKeyToChargingStationMap: Map[Id[ParkingZoneId], ChargingStation] = - chargingZones.map { case (zoneId, zone) => zoneId -> ChargingStation(zone) } + parkingZones.filter(_._2.chargingPointType.isDefined).map { case (zoneId, zone) => zoneId -> ChargingStation(zone) } val chargingStations: List[ChargingStation] = chargingZoneKeyToChargingStationMap.values.toList diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 03644a33894..f3a6e61bd98 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -297,7 +297,8 @@ object ChargingNetworkManager extends LazyLogging { case class ChargingNetworkHelper(chargingNetwork: ChargingNetwork, rideHailNetwork: ChargingNetwork) { lazy val allChargingStations: List[ChargingStation] = - chargingNetwork.chargingStations ++ rideHailNetwork.chargingStations + chargingNetwork.chargingStations.filter(_.zone.chargingPointType.isDefined) ++ rideHailNetwork.chargingStations + .filter(_.zone.chargingPointType.isDefined) /** * @param managerId vehicle manager id From dd4e2c468fdf1167c496ef56f1d98b7d5300c25e Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Mon, 30 May 2022 14:33:43 +0300 Subject: [PATCH 097/307] utility notebooks --- ...atest runs from spreadsheet analysis.ipynb | 693 ++++++++++++++++++ .../latest runs from spreadsheet analysis.py | 150 ++++ jupyter/utility/latest_closed_PR.ipynb | 342 +++++++++ jupyter/utility/latest_closed_PR.py | 27 + 4 files changed, 1212 insertions(+) create mode 100644 jupyter/utility/latest runs from spreadsheet analysis.ipynb create mode 100644 jupyter/utility/latest runs from spreadsheet analysis.py create mode 100644 jupyter/utility/latest_closed_PR.ipynb create mode 100644 jupyter/utility/latest_closed_PR.py diff --git a/jupyter/utility/latest runs from spreadsheet analysis.ipynb b/jupyter/utility/latest runs from spreadsheet analysis.ipynb new file mode 100644 index 00000000000..fddf210b24a --- /dev/null +++ b/jupyter/utility/latest runs from spreadsheet analysis.ipynb @@ -0,0 +1,693 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "4a368145-a6f7-47c0-889b-096fc9f9ef6d", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "pd.set_option('display.max_rows', 500)\n", + "pd.set_option('display.max_columns', 500)\n", + "pd.set_option('display.width', 1000)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "e90da842-b59f-4717-881d-60ac1aebc814", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "there are roughly 898.0 runs since 2022-03-01 00:00:00\n", + "the latest run is from 2022-05-24 14:01:46\n", + "following data periods are included: ['2022-03', '2022-04', '2022-05']\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
StatusRun NameInstance IDInstance typeTimeHost nameWeb browserRegionBatchBranchCommitS3 UrlConfigMax RAMStacktraceDied ActorErrorWarningUnnamed: 18Unnamed: 19Unnamed: 20Unnamed: 21Month Period
10866Run Startedgemini-scenario-4-constrained-scaledUp-25perce...i-0e687a480c996abear5d.24xlarge2022-03-01 03:10:41ec2-52-15-53-54.us-east-2.compute.amazonaws.comhttp://ec2-52-15-53-54.us-east-2.compute.amazo...us-east-2a6523d0bgemini-develop360a0e6dd136cf70f6622c33505d39ff75d59638NaNproduction/sfbay/gemini/gemini-scenario-4-cons...740gNaNNaNNaNNaNLVJBLBUUDVULXEAGEQVKUNHZEUSLBDYHEQBIMKEURFEKDWMAEZLHTZTCVNWIKGTTTEWYXIILFYAMVGSUVIBVYPOHNAZPVEJKdevelopNaN2022-03
10867Run Startedgemini-scenario-4-constrained-scaledUp-25perce...i-09ab6664da0c975d6r5d.24xlarge2022-03-01 03:54:28ec2-18-119-162-84.us-east-2.compute.amazonaws.comhttp://ec2-18-119-162-84.us-east-2.compute.ama...us-east-2f44402b2gemini-develop360a0e6dd136cf70f6622c33505d39ff75d59638NaNproduction/sfbay/gemini/gemini-scenario-4-scal...740gNaNNaNNaNNaNLVJBLBUUDVULXEAGEQVKUNHZEUSLBDYHEQBIMKEURFEKDWMAEZLHTZTCVNWIKGTTTEWYXIILFYAMVGSUVIBVYPOHNAZPVEJKdevelopNaN2022-03
10868Run Startedgemini-scenario-4-constrained-scaledUp-40perce...i-077efab479b67af52r5d.24xlarge2022-03-01 03:54:29ec2-3-145-20-131.us-east-2.compute.amazonaws.comhttp://ec2-3-145-20-131.us-east-2.compute.amaz...us-east-27d851334gemini-develop360a0e6dd136cf70f6622c33505d39ff75d59638NaNproduction/sfbay/gemini/gemini-scenario-4-scal...740gNaNNaNNaNNaNLVJBLBUUDVULXEAGEQVKUNHZEUSLBDYHEQBIMKEURFEKDWMAEZLHTZTCVNWIKGTTTEWYXIILFYAMVGSUVIBVYPOHNAZPVEJKdevelopNaN2022-03
\n", + "
" + ], + "text/plain": [ + " Status Run Name Instance ID Instance type Time Host name Web browser Region Batch Branch Commit S3 Url Config Max RAM Stacktrace Died Actor Error Warning Unnamed: 18 Unnamed: 19 Unnamed: 20 Unnamed: 21 Month Period\n", + "10866 Run Started gemini-scenario-4-constrained-scaledUp-25perce... i-0e687a480c996abea r5d.24xlarge 2022-03-01 03:10:41 ec2-52-15-53-54.us-east-2.compute.amazonaws.com http://ec2-52-15-53-54.us-east-2.compute.amazo... us-east-2 a6523d0b gemini-develop 360a0e6dd136cf70f6622c33505d39ff75d59638 NaN production/sfbay/gemini/gemini-scenario-4-cons... 740g NaN NaN NaN NaN LVJBLBUUDVULXEAGEQVKUNHZEUSLBDYHEQBIMKEURFEKDWMA EZLHTZTCVNWIKGTTTEWYXIILFYAMVGSUVIBVYPOHNAZPVEJK develop NaN 2022-03\n", + "10867 Run Started gemini-scenario-4-constrained-scaledUp-25perce... i-09ab6664da0c975d6 r5d.24xlarge 2022-03-01 03:54:28 ec2-18-119-162-84.us-east-2.compute.amazonaws.com http://ec2-18-119-162-84.us-east-2.compute.ama... us-east-2 f44402b2 gemini-develop 360a0e6dd136cf70f6622c33505d39ff75d59638 NaN production/sfbay/gemini/gemini-scenario-4-scal... 740g NaN NaN NaN NaN LVJBLBUUDVULXEAGEQVKUNHZEUSLBDYHEQBIMKEURFEKDWMA EZLHTZTCVNWIKGTTTEWYXIILFYAMVGSUVIBVYPOHNAZPVEJK develop NaN 2022-03\n", + "10868 Run Started gemini-scenario-4-constrained-scaledUp-40perce... i-077efab479b67af52 r5d.24xlarge 2022-03-01 03:54:29 ec2-3-145-20-131.us-east-2.compute.amazonaws.com http://ec2-3-145-20-131.us-east-2.compute.amaz... us-east-2 7d851334 gemini-develop 360a0e6dd136cf70f6622c33505d39ff75d59638 NaN production/sfbay/gemini/gemini-scenario-4-scal... 740g NaN NaN NaN NaN LVJBLBUUDVULXEAGEQVKUNHZEUSLBDYHEQBIMKEURFEKDWMA EZLHTZTCVNWIKGTTTEWYXIILFYAMVGSUVIBVYPOHNAZPVEJK develop NaN 2022-03" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## reading exported csv\n", + "\n", + "# to get csv - save 'BEAM Deploy Status and Run Data' as csv\n", + "# if there is not enough permissions - save a copy and then save as csv\n", + "\n", + "data = pd.read_csv(\"../../../beam-production/jupyter/local_files/Copy of BEAM Deploy Status and Run Data - BEAM Instances.csv\", parse_dates=['Time'])\n", + "\n", + "# using only runs from specific data \n", + "min_time = pd.to_datetime(\"2022-03-01\") # yyyy-mm-dd\n", + "data = data[data['Time'] > min_time].copy()\n", + "\n", + "print(f\"there are roughly {len(data) / 2} runs since {min_time}\")\n", + "print(f\"the latest run is from {data['Time'].max()}\")\n", + "\n", + "data['Month Period'] = data['Time'].dt.strftime('%Y-%m')\n", + "print(f\"following data periods are included: {sorted(data['Month Period'].unique())}\")\n", + "\n", + "data.head(3)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "3ddba22a-3f5a-4b74-8c64-e6dd7b2371c3", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "removed columns: ['Batch', 'Commit', 'Config', 'Died Actor', 'Error', 'Instance ID', 'Max RAM', 'Region', 'S3 Url', 'Stacktrace', 'Status', 'Time', 'Unnamed: 18', 'Unnamed: 19', 'Unnamed: 20', 'Unnamed: 21', 'Warning', 'Web browser']\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Run NameMonth PeriodBranchInstance typeTime StartTime Stopduration_hours
Host name
ec2-13-58-100-43.us-east-2.compute.amazonaws.cominm/nyc-collaboration-plans-generation_irishwi...2022-05inm/nyc-code-change-with-plans-generationr5d.24xlarge2022-05-13 17:53:092022-05-13 17:53:090.0
ec2-13-58-112-199.us-east-2.compute.amazonaws.comrrp/gemini-calibration-23_heyrutvikATgmail_com2022-05rrp/hl/gemini-develop-overnightr5d.24xlarge2022-05-16 18:44:202022-05-16 20:53:452.0
ec2-13-58-116-208.us-east-2.compute.amazonaws.comrrp/gemini-calibration-6k-095_heyrutvikATgmail...2022-04rrp/hl/gemini-develop-enroute-overnight-chargingr5d.24xlarge2022-04-25 12:22:472022-04-25 13:08:560.0
\n", + "
" + ], + "text/plain": [ + " Run Name Month Period Branch Instance type Time Start Time Stop duration_hours\n", + "Host name \n", + "ec2-13-58-100-43.us-east-2.compute.amazonaws.com inm/nyc-collaboration-plans-generation_irishwi... 2022-05 inm/nyc-code-change-with-plans-generation r5d.24xlarge 2022-05-13 17:53:09 2022-05-13 17:53:09 0.0\n", + "ec2-13-58-112-199.us-east-2.compute.amazonaws.com rrp/gemini-calibration-23_heyrutvikATgmail_com 2022-05 rrp/hl/gemini-develop-overnight r5d.24xlarge 2022-05-16 18:44:20 2022-05-16 20:53:45 2.0\n", + "ec2-13-58-116-208.us-east-2.compute.amazonaws.com rrp/gemini-calibration-6k-095_heyrutvikATgmail... 2022-04 rrp/hl/gemini-develop-enroute-overnight-charging r5d.24xlarge 2022-04-25 12:22:47 2022-04-25 13:08:56 0.0" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## getting data frame with each row as one simulation\n", + "\n", + "take_first_columns = ['Run Name','Month Period','Branch','Instance type']\n", + "\n", + "df = data.groupby(\"Host name\").agg(list)\n", + "for col in take_first_columns:\n", + " df[col] = df.apply(lambda r: r[col][0], axis=1)\n", + "\n", + "df['Time Start'] = df.apply(lambda r: r['Time'][0], axis=1)\n", + "df['Time Stop'] = df.apply(lambda r: r['Time'][-1], axis=1)\n", + "\n", + "all_columns = set(df.columns)\n", + "taken_columns = take_first_columns + ['Time Start', 'Time Stop']\n", + "\n", + "df = df[taken_columns].copy()\n", + "\n", + "print(f\"removed columns: {list(sorted(all_columns - set(taken_columns)))}\")\n", + "\n", + "# fix for some wierd shift in the spreadsheet for few rows\n", + "for v in ['ec2-18-221-208-40.us-east-2.compute.amazonaws.com','ec2-3-144-69-95.us-east-2.compute.amazonaws.com','ec2-52-15-53-101.us-east-2.compute.amazonaws.com']:\n", + " df.replace(to_replace=v, value='r5d.24xlarge', inplace=True)\n", + "\n", + "df['duration_hours'] = (df['Time Stop'] - df['Time Start']).astype('timedelta64[h]')\n", + "\n", + "df.head(3)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "da44a8b3-71e8-4589-8af2-d90b8679f789", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array(['r5d.24xlarge', 'r5.xlarge', 'r5.24xlarge', 'r5.8xlarge',\n", + " 'm5.24xlarge', 'r5.2xlarge', 'm4.16xlarge', 'm5d.24xlarge'],\n", + " dtype=object)" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## just a check\n", + "df['Instance type'].unique()" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "516fb00d-5a15-4167-a062-58c67a32340d", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The total cost of all instances from df: 32355\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Run NameMonth PeriodBranchInstance typeTime StartTime Stopduration_hoursaws_price_costcost
Host name
ec2-13-58-100-43.us-east-2.compute.amazonaws.cominm/nyc-collaboration-plans-generation_irishwi...2022-05inm/nyc-code-change-with-plans-generationr5d.24xlarge2022-05-13 17:53:092022-05-13 17:53:090.06.9120.000
ec2-13-58-112-199.us-east-2.compute.amazonaws.comrrp/gemini-calibration-23_heyrutvikATgmail_com2022-05rrp/hl/gemini-develop-overnightr5d.24xlarge2022-05-16 18:44:202022-05-16 20:53:452.06.91213.824
ec2-13-58-116-208.us-east-2.compute.amazonaws.comrrp/gemini-calibration-6k-095_heyrutvikATgmail...2022-04rrp/hl/gemini-develop-enroute-overnight-chargingr5d.24xlarge2022-04-25 12:22:472022-04-25 13:08:560.06.9120.000
\n", + "
" + ], + "text/plain": [ + " Run Name Month Period Branch Instance type Time Start Time Stop duration_hours aws_price_cost cost\n", + "Host name \n", + "ec2-13-58-100-43.us-east-2.compute.amazonaws.com inm/nyc-collaboration-plans-generation_irishwi... 2022-05 inm/nyc-code-change-with-plans-generation r5d.24xlarge 2022-05-13 17:53:09 2022-05-13 17:53:09 0.0 6.912 0.000\n", + "ec2-13-58-112-199.us-east-2.compute.amazonaws.com rrp/gemini-calibration-23_heyrutvikATgmail_com 2022-05 rrp/hl/gemini-develop-overnight r5d.24xlarge 2022-05-16 18:44:20 2022-05-16 20:53:45 2.0 6.912 13.824\n", + "ec2-13-58-116-208.us-east-2.compute.amazonaws.com rrp/gemini-calibration-6k-095_heyrutvikATgmail... 2022-04 rrp/hl/gemini-develop-enroute-overnight-charging r5d.24xlarge 2022-04-25 12:22:47 2022-04-25 13:08:56 0.0 6.912 0.000" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## calculating a price in USD of each simulation\n", + "\n", + "instance_to_price = {'r5d.24xlarge':6.912, \n", + " 'm5d.24xlarge':5.424, \n", + " 'r5.xlarge':0.252, \n", + " 'r5.24xlarge':6.048,\n", + " 'r5.8xlarge':2.016, \n", + " 'm5.24xlarge':4.608, \n", + " 'r5.2xlarge':0.504, \n", + " 'm4.16xlarge':3.20\n", + " }\n", + "\n", + "missing_instance_types = set()\n", + "def get_price(row):\n", + " instance_type = row['Instance type']\n", + " if instance_type in instance_to_price :\n", + " return instance_to_price[instance_type]\n", + "\n", + " missing_instance_types.add(instance_type)\n", + " return 0.0\n", + "\n", + "df['aws_price_cost'] = df.apply(get_price, axis=1)\n", + "\n", + "if len(missing_instance_types) > 0:\n", + " print(f\"Can't find price for following instances: {missing_instance_types}\")\n", + " \n", + "df['cost'] = df['duration_hours'] * df['aws_price_cost']\n", + "print(f\"The total cost of all instances from df: {int(df['cost'].sum())}\")\n", + "df.head(3)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "8a66382a-4090-4da7-9c3c-8b26a4e35ed1", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
projectcost
5?? | zn0.235714
12rrp | hl0.175177
2?? | hl0.152532
1?? | Xuan0.131596
13rrp | rrp0.087588
11rrp | ??0.064089
0?? | ??0.049776
10inm | zn0.036958
3?? | rrp0.030585
6do | ??0.025913
9inm | inm0.009186
7do | do0.000890
4?? | test0.000000
8inm | ??0.000000
14rrp | zn0.000000
\n", + "
" + ], + "text/plain": [ + " project cost\n", + "5 ?? | zn 0.235714\n", + "12 rrp | hl 0.175177\n", + "2 ?? | hl 0.152532\n", + "1 ?? | Xuan 0.131596\n", + "13 rrp | rrp 0.087588\n", + "11 rrp | ?? 0.064089\n", + "0 ?? | ?? 0.049776\n", + "10 inm | zn 0.036958\n", + "3 ?? | rrp 0.030585\n", + "6 do | ?? 0.025913\n", + "9 inm | inm 0.009186\n", + "7 do | do 0.000890\n", + "4 ?? | test 0.000000\n", + "8 inm | ?? 0.000000\n", + "14 rrp | zn 0.000000" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "## grouping simulations by something\n", + "\n", + "def get_owner(row):\n", + " run_name = row['Run Name']\n", + " if '/' in run_name:\n", + " return run_name.split('/')[0]\n", + " return \"??\"\n", + "\n", + "# df['owner of run'] = df.apply(get_owner, axis=1)\n", + "\n", + "def get_branch_owner(row):\n", + " branch = row['Branch'].split('/')\n", + " if len(branch) > 1:\n", + " return branch[0]\n", + " return \"??\"\n", + "\n", + "def get_project(row):\n", + " owner = get_owner(row)\n", + " branch_owner = get_branch_owner(row)\n", + " return f\"{owner} | {branch_owner}\"\n", + " \n", + "\n", + "df[\"project\"] = df.apply(get_project, axis=1)\n", + "df_sum = (df.groupby(\"project\")['cost'].sum() / 32355).reset_index().sort_values(\"cost\", ascending=False)\n", + "df_sum" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7f0cf18c-8769-4dcb-90ba-f4f32ff8f170", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "873f8403-d146-4c77-829a-d29527564cd3", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/jupyter/utility/latest runs from spreadsheet analysis.py b/jupyter/utility/latest runs from spreadsheet analysis.py new file mode 100644 index 00000000000..8949dcc8367 --- /dev/null +++ b/jupyter/utility/latest runs from spreadsheet analysis.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[1]: + + +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt + +pd.set_option('display.max_rows', 500) +pd.set_option('display.max_columns', 500) +pd.set_option('display.width', 1000) + + +# In[3]: + + +## reading exported csv + +# to get csv - save 'BEAM Deploy Status and Run Data' as csv +# if there is not enough permissions - save a copy and then save as csv + +data = pd.read_csv("../../../beam-production/jupyter/local_files/Copy of BEAM Deploy Status and Run Data - BEAM Instances.csv", parse_dates=['Time']) + +# using only runs from specific data +min_time = pd.to_datetime("2022-03-01") # yyyy-mm-dd +data = data[data['Time'] > min_time].copy() + +print(f"there are roughly {len(data) / 2} runs since {min_time}") +print(f"the latest run is from {data['Time'].max()}") + +data['Month Period'] = data['Time'].dt.strftime('%Y-%m') +print(f"following data periods are included: {sorted(data['Month Period'].unique())}") + +data.head(3) + + +# In[4]: + + +## getting data frame with each row as one simulation + +take_first_columns = ['Run Name','Month Period','Branch','Instance type'] + +df = data.groupby("Host name").agg(list) +for col in take_first_columns: + df[col] = df.apply(lambda r: r[col][0], axis=1) + +df['Time Start'] = df.apply(lambda r: r['Time'][0], axis=1) +df['Time Stop'] = df.apply(lambda r: r['Time'][-1], axis=1) + +all_columns = set(df.columns) +taken_columns = take_first_columns + ['Time Start', 'Time Stop'] + +df = df[taken_columns].copy() + +print(f"removed columns: {list(sorted(all_columns - set(taken_columns)))}") + +# fix for some wierd shift in the spreadsheet for few rows +for v in ['ec2-18-221-208-40.us-east-2.compute.amazonaws.com','ec2-3-144-69-95.us-east-2.compute.amazonaws.com','ec2-52-15-53-101.us-east-2.compute.amazonaws.com']: + df.replace(to_replace=v, value='r5d.24xlarge', inplace=True) + +df['duration_hours'] = (df['Time Stop'] - df['Time Start']).astype('timedelta64[h]') + +df.head(3) + + +# In[5]: + + +## just a check +df['Instance type'].unique() + + +# In[6]: + + +## calculating a price in USD of each simulation + +instance_to_price = {'r5d.24xlarge':6.912, + 'm5d.24xlarge':5.424, + 'r5.xlarge':0.252, + 'r5.24xlarge':6.048, + 'r5.8xlarge':2.016, + 'm5.24xlarge':4.608, + 'r5.2xlarge':0.504, + 'm4.16xlarge':3.20 + } + +missing_instance_types = set() +def get_price(row): + instance_type = row['Instance type'] + if instance_type in instance_to_price : + return instance_to_price[instance_type] + + missing_instance_types.add(instance_type) + return 0.0 + +df['aws_price_cost'] = df.apply(get_price, axis=1) + +if len(missing_instance_types) > 0: + print(f"Can't find price for following instances: {missing_instance_types}") + +df['cost'] = df['duration_hours'] * df['aws_price_cost'] +print(f"The total cost of all instances from df: {int(df['cost'].sum())}") +df.head(3) + + +# In[17]: + + +## grouping simulations by something + +def get_owner(row): + run_name = row['Run Name'] + if '/' in run_name: + return run_name.split('/')[0] + return "??" + +# df['owner of run'] = df.apply(get_owner, axis=1) + +def get_branch_owner(row): + branch = row['Branch'].split('/') + if len(branch) > 1: + return branch[0] + return "??" + +def get_project(row): + owner = get_owner(row) + branch_owner = get_branch_owner(row) + return f"{owner} | {branch_owner}" + + +df["project"] = df.apply(get_project, axis=1) +df_sum = (df.groupby("project")['cost'].sum() / 32355).reset_index().sort_values("cost", ascending=False) +df_sum + + +# In[ ]: + + + + + +# In[ ]: + + + + diff --git a/jupyter/utility/latest_closed_PR.ipynb b/jupyter/utility/latest_closed_PR.ipynb new file mode 100644 index 00000000000..78359ee4573 --- /dev/null +++ b/jupyter/utility/latest_closed_PR.ipynb @@ -0,0 +1,342 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "2f38bd23-4f12-4924-9ab1-9797eab844d4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
urlidnode_idhtml_urldiff_urlpatch_urlissue_urlnumberstatelocked...assignee.following_urlassignee.gists_urlassignee.starred_urlassignee.subscriptions_urlassignee.organizations_urlassignee.repos_urlassignee.events_urlassignee.received_events_urlassignee.typeassignee.site_admin
0https://api.github.com/repos/LBNL-UCB-STI/beam...936187205PR_kwDOBFu0aM43zRVFhttps://github.com/LBNL-UCB-STI/beam/pull/3530https://github.com/LBNL-UCB-STI/beam/pull/3530...https://github.com/LBNL-UCB-STI/beam/pull/3530...https://api.github.com/repos/LBNL-UCB-STI/beam...3530closedFalse...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
1https://api.github.com/repos/LBNL-UCB-STI/beam...932712525PR_kwDOBFu0aM43mBBNhttps://github.com/LBNL-UCB-STI/beam/pull/3527https://github.com/LBNL-UCB-STI/beam/pull/3527...https://github.com/LBNL-UCB-STI/beam/pull/3527...https://api.github.com/repos/LBNL-UCB-STI/beam...3527closedFalse...NaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
\n", + "

2 rows × 314 columns

\n", + "
" + ], + "text/plain": [ + " url id \\\n", + "0 https://api.github.com/repos/LBNL-UCB-STI/beam... 936187205 \n", + "1 https://api.github.com/repos/LBNL-UCB-STI/beam... 932712525 \n", + "\n", + " node_id html_url \\\n", + "0 PR_kwDOBFu0aM43zRVF https://github.com/LBNL-UCB-STI/beam/pull/3530 \n", + "1 PR_kwDOBFu0aM43mBBN https://github.com/LBNL-UCB-STI/beam/pull/3527 \n", + "\n", + " diff_url \\\n", + "0 https://github.com/LBNL-UCB-STI/beam/pull/3530... \n", + "1 https://github.com/LBNL-UCB-STI/beam/pull/3527... \n", + "\n", + " patch_url \\\n", + "0 https://github.com/LBNL-UCB-STI/beam/pull/3530... \n", + "1 https://github.com/LBNL-UCB-STI/beam/pull/3527... \n", + "\n", + " issue_url number state locked \\\n", + "0 https://api.github.com/repos/LBNL-UCB-STI/beam... 3530 closed False \n", + "1 https://api.github.com/repos/LBNL-UCB-STI/beam... 3527 closed False \n", + "\n", + " ... assignee.following_url assignee.gists_url assignee.starred_url \\\n", + "0 ... NaN NaN NaN \n", + "1 ... NaN NaN NaN \n", + "\n", + " assignee.subscriptions_url assignee.organizations_url assignee.repos_url \\\n", + "0 NaN NaN NaN \n", + "1 NaN NaN NaN \n", + "\n", + " assignee.events_url assignee.received_events_url assignee.type \\\n", + "0 NaN NaN NaN \n", + "1 NaN NaN NaN \n", + "\n", + " assignee.site_admin \n", + "0 NaN \n", + "1 NaN \n", + "\n", + "[2 rows x 314 columns]" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
real_idhtml_urlclosed_attitle
03530https://github.com/LBNL-UCB-STI/beam/pull/35302022-05-27T13:30:00Zfixes protocol to release vehicle properly bef...
13527https://github.com/LBNL-UCB-STI/beam/pull/35272022-05-11T03:39:26ZHl/site power controller
23526https://github.com/LBNL-UCB-STI/beam/pull/35262022-05-10T17:31:43ZHl/site power controller
33525https://github.com/LBNL-UCB-STI/beam/pull/35252022-05-11T09:04:07ZUpdate dependencies better - for submodules
43522https://github.com/LBNL-UCB-STI/beam/pull/35222022-05-24T11:45:42ZCreate and store network route for a person pl...
...............
953336https://github.com/LBNL-UCB-STI/beam/pull/33362021-10-18T10:23:23Zfix RouteDumper
963334https://github.com/LBNL-UCB-STI/beam/pull/33342021-10-31T19:09:43Zchange slack notification from python script t...
973325https://github.com/LBNL-UCB-STI/beam/pull/33252021-10-11T09:11:36ZGet leg mode directly from Urbansim plans
983323https://github.com/LBNL-UCB-STI/beam/pull/33232021-10-05T08:35:13Z#3322 fixes mutation issue
993321https://github.com/LBNL-UCB-STI/beam/pull/33212021-10-05T14:54:45Zfix check docker is running for CCHRoutingAssi...
\n", + "

100 rows × 4 columns

\n", + "
" + ], + "text/plain": [ + " real_id html_url \\\n", + "0 3530 https://github.com/LBNL-UCB-STI/beam/pull/3530 \n", + "1 3527 https://github.com/LBNL-UCB-STI/beam/pull/3527 \n", + "2 3526 https://github.com/LBNL-UCB-STI/beam/pull/3526 \n", + "3 3525 https://github.com/LBNL-UCB-STI/beam/pull/3525 \n", + "4 3522 https://github.com/LBNL-UCB-STI/beam/pull/3522 \n", + ".. ... ... \n", + "95 3336 https://github.com/LBNL-UCB-STI/beam/pull/3336 \n", + "96 3334 https://github.com/LBNL-UCB-STI/beam/pull/3334 \n", + "97 3325 https://github.com/LBNL-UCB-STI/beam/pull/3325 \n", + "98 3323 https://github.com/LBNL-UCB-STI/beam/pull/3323 \n", + "99 3321 https://github.com/LBNL-UCB-STI/beam/pull/3321 \n", + "\n", + " closed_at title \n", + "0 2022-05-27T13:30:00Z fixes protocol to release vehicle properly bef... \n", + "1 2022-05-11T03:39:26Z Hl/site power controller \n", + "2 2022-05-10T17:31:43Z Hl/site power controller \n", + "3 2022-05-11T09:04:07Z Update dependencies better - for submodules \n", + "4 2022-05-24T11:45:42Z Create and store network route for a person pl... \n", + ".. ... ... \n", + "95 2021-10-18T10:23:23Z fix RouteDumper \n", + "96 2021-10-31T19:09:43Z change slack notification from python script t... \n", + "97 2021-10-11T09:11:36Z Get leg mode directly from Urbansim plans \n", + "98 2021-10-05T08:35:13Z #3322 fixes mutation issue \n", + "99 2021-10-05T14:54:45Z fix check docker is running for CCHRoutingAssi... \n", + "\n", + "[100 rows x 4 columns]" + ] + }, + "execution_count": 1, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from urllib.request import urlopen\n", + "import json\n", + "import pandas as pd\n", + "\n", + "response = urlopen(\"https://api.github.com/repos/LBNL-UCB-STI/beam/pulls?state=closed&sort=created&direction=descr&per_page=100\")\n", + "json_data = response.read().decode('utf-8', 'replace')\n", + "\n", + "d = json.loads(json_data)\n", + "df_r = pd.json_normalize(d)\n", + "display(df_r.head(2))\n", + "\n", + "df_r['real_id'] = df_r.apply(lambda r: r['html_url'].split('/')[-1], axis=1)\n", + "df = df_r[['real_id', 'html_url', 'closed_at', 'title']]\n", + "df" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5d9a96a5-0f60-49e8-b98d-498574d6d41e", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/jupyter/utility/latest_closed_PR.py b/jupyter/utility/latest_closed_PR.py new file mode 100644 index 00000000000..b4a71cd9274 --- /dev/null +++ b/jupyter/utility/latest_closed_PR.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[1]: + + +from urllib.request import urlopen +import json +import pandas as pd + +response = urlopen("https://api.github.com/repos/LBNL-UCB-STI/beam/pulls?state=closed&sort=created&direction=descr&per_page=100") +json_data = response.read().decode('utf-8', 'replace') + +d = json.loads(json_data) +df_r = pd.json_normalize(d) +display(df_r.head(2)) + +df_r['real_id'] = df_r.apply(lambda r: r['html_url'].split('/')[-1], axis=1) +df = df_r[['real_id', 'html_url', 'closed_at', 'title']] +df + + +# In[ ]: + + + + From f6b68aacbc0db5da97669826473f7f3b90519232 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 1 Jun 2022 20:15:55 -0700 Subject: [PATCH 098/307] making changes from gemini-develop-overnight --- .../beam/agentsim/agents/PersonAgent.scala | 31 +++++++------ .../agents/parking/ChoosesParking.scala | 45 +++++++++++++++---- .../infrastructure/ChargingNetwork.scala | 2 +- .../ChargingNetworkManager.scala | 8 ++++ .../ChargingNetworkManagerHelper.scala | 5 ++- 5 files changed, 65 insertions(+), 26 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 2e71bffa6d3..20672529d84 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -318,7 +318,7 @@ class PersonAgent( val networkHelper: NetworkHelper = beamServices.networkHelper val geo: GeoUtils = beamServices.geo - val minDistanceToTrainStop = + val minDistanceToTrainStop: Double = beamScenario.beamConfig.beam.agentsim.agents.tripBehaviors.carUsage.minDistanceToTrainStop val bodyType: BeamVehicleType = beamScenario.vehicleTypes( @@ -1135,15 +1135,9 @@ class PersonAgent( false } - val tempData = data.copy( - passengerSchedule = newPassengerSchedule, - currentLegPassengerScheduleIndex = 0, - currentVehicle = currentVehicleForNextState - ) - - val tick = _currentTick.get - val triggerId = _currentTriggerId.get def sendCompletionNoticeAndScheduleStartLegTrigger(): Unit = { + val tick = _currentTick.get + val triggerId = _currentTriggerId.get scheduler ! CompletionNotice( triggerId, if (nextLeg.beamLeg.endTime > lastTickOfSimulation) Vector.empty @@ -1152,19 +1146,24 @@ class PersonAgent( } // decide next state to go, whether we need to complete the trigger, start a leg or both - val (stateToGo, updatedData) = { - if (needEnroute) { - (ReadyToChooseParking, tempData.copy(enrouteData = tempData.enrouteData.copy(isInEnrouteState = true))) - } else if (nextLeg.beamLeg.mode == CAR || vehicle.isSharedVehicle) { - sendCompletionNoticeAndScheduleStartLegTrigger() - (ReleasingParkingSpot, tempData) + val stateToGo = { + if (nextLeg.beamLeg.mode == CAR || vehicle.isSharedVehicle) { + if (!needEnroute) sendCompletionNoticeAndScheduleStartLegTrigger() + ReleasingParkingSpot } else { sendCompletionNoticeAndScheduleStartLegTrigger() releaseTickAndTriggerId() - (WaitingToDrive, tempData) + WaitingToDrive } } + val updatedData = data.copy( + passengerSchedule = newPassengerSchedule, + currentLegPassengerScheduleIndex = 0, + currentVehicle = currentVehicleForNextState, + enrouteData = if (needEnroute) data.enrouteData.copy(isInEnrouteState = true) else data.enrouteData + ) + goto(stateToGo) using updatedData } nextState diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index eaf4b0441b8..deefb182c8b 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -287,6 +287,7 @@ trait ChoosesParking extends { case Event(TriggerWithId(StartLegTrigger(_, _), _), data) => stash() stay using data + case Event(UnhandledVehicle(tick, vehicleId, triggerId), data) => assume( vehicleId == currentBeamVehicle.id, @@ -298,10 +299,22 @@ trait ChoosesParking extends { ) handleReleasingParkingSpot(tick, currentBeamVehicle, None, id, parkingManager, eventsManager, triggerId) goto(WaitingToDrive) using data + + case Event(UnpluggingVehicle(tick, energyCharged, triggerId), data: BasePersonData) + if data.enrouteData.isInEnrouteState => + val vehicle = beamVehicles(data.restOfCurrentTrip.head.beamVehicleId).vehicle + log.debug( + s"Vehicle ${vehicle.id} [chosen for enroute] ended charging and it is not handled by the CNM at tick $tick" + ) + val energyMaybe = Some(energyCharged) + handleReleasingParkingSpot(tick, vehicle, energyMaybe, id, parkingManager, eventsManager, triggerId) + goto(ReadyToChooseParking) using data + case Event(UnpluggingVehicle(tick, energyCharged, triggerId), data) => log.debug(s"Vehicle ${currentBeamVehicle.id} ended charging and it is not handled by the CNM at tick $tick") val energyMaybe = Some(energyCharged) handleReleasingParkingSpot(tick, currentBeamVehicle, energyMaybe, id, parkingManager, eventsManager, triggerId) + releaseTickAndTriggerId() goto(WaitingToDrive) using data } @@ -309,20 +322,36 @@ trait ChoosesParking extends { case Event(TriggerWithId(StartLegTrigger(_, _), _), data) => stash() stay using data + case Event(StateTimeout, data: BasePersonData) => - val (tick, triggerId) = releaseTickAndTriggerId() - if (currentBeamVehicle.isConnectedToChargingPoint()) { + val nextLeg = data.restOfCurrentTrip.head + val vehicle = { + if (data.enrouteData.isInEnrouteState) beamVehicles(nextLeg.beamVehicleId).vehicle + else currentBeamVehicle + } + val (tick, triggerId) = (_currentTick.get, _currentTriggerId.get) + + if (vehicle.isConnectedToChargingPoint()) { log.debug("Sending ChargingUnplugRequest to ChargingNetworkManager at {}", tick) chargingNetworkManager ! ChargingUnplugRequest( tick, - currentBeamVehicle, + vehicle, triggerId ) goto(ReleasingChargingPoint) using data } else { - handleReleasingParkingSpot(tick, currentBeamVehicle, None, id, parkingManager, eventsManager, triggerId) - goto(WaitingToDrive) using data + val state = { + if (data.enrouteData.isInEnrouteState) + ReadyToChooseParking + else { + handleReleasingParkingSpot(tick, vehicle, None, id, parkingManager, eventsManager, triggerId) + releaseTickAndTriggerId() + WaitingToDrive + } + } + goto(state) using data } + case Event(StateTimeout, data) => val stall = currentBeamVehicle.stall.get parkingManager ! ReleaseParkingStall(stall, getCurrentTriggerIdOrGenerate) @@ -335,7 +364,6 @@ trait ChoosesParking extends { case Event(ParkingInquiryResponse(stall, _, _), data) => val distanceThresholdToIgnoreWalking = beamServices.beamConfig.beam.agentsim.thresholdForWalkingInMeters - val chargingPointMaybe = stall.chargingPointType val nextLeg = data.passengerSchedule.schedule.keys.drop(data.currentLegPassengerScheduleIndex).head currentBeamVehicle.setReservedParkingStall(Some(stall)) @@ -354,7 +382,7 @@ trait ChoosesParking extends { case data: BasePersonData if data.enrouteData.isInEnrouteState => val updatedEnrouteData = data.enrouteData.copy(hasReservedFastChargerStall = - chargingPointMaybe.exists(ChargingPointType.isFastCharger) + stall.chargingPointType.exists(ChargingPointType.isFastCharger) ) (data.copy(enrouteData = updatedEnrouteData), updatedEnrouteData.isEnrouting) case _ => @@ -362,7 +390,7 @@ trait ChoosesParking extends { } updatedData match { case data: BasePersonData if data.enrouteData.isInEnrouteState && !isEnrouting => - // continue normal workflow if enroute is not possible + // continue normal workflow if enroute is not possible or stalls are not available for selected parking val (tick, triggerId) = releaseTickAndTriggerId() scheduler ! CompletionNotice( triggerId, @@ -572,6 +600,7 @@ trait ChoosesParking extends { ) handleReleasingParkingSpot(tick, currentBeamVehicle, None, id, parkingManager, eventsManager, triggerId) + goto(WaitingToDrive) using data.copy( currentTrip = Some(EmbodiedBeamTrip(newCurrentTripLegs)), restOfCurrentTrip = newRestOfTrip.toList, diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index ce0645efe1d..3e1c83ac169 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -241,7 +241,7 @@ object ChargingNetwork extends LazyLogging { private var waitingLineInternal: mutable.PriorityQueue[ChargingVehicle] = mutable.PriorityQueue.empty[ChargingVehicle](Ordering.by((_: ChargingVehicle).arrivalTime).reverse) - private[ChargingNetwork] def numAvailableChargers: Int = + def numAvailableChargers: Int = zone.maxStalls - howManyVehiclesAreCharging - howManyVehiclesAreInGracePeriodAfterCharging private[ChargingNetwork] def connectedVehicles: Map[Id[BeamVehicle], ChargingVehicle] = diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index f3a6e61bd98..a0337b7c7ab 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -97,6 +97,14 @@ class ChargingNetworkManager( parkingResponse => if (parkingResponse.stall.chargingPointType.isDefined) inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) + val numAvailableChargers: Int = chargingNetworkHelper + .get(parkingResponse.stall.reservedFor.managerId) + .lookupStation(parkingResponse.stall.parkingZoneId) + .map(_.numAvailableChargers) + .getOrElse(0) + if (numAvailableChargers <= 0) { + logger.error(s"returning a stall with 0 availability. Something is broken. ${parkingResponse.stall}") + } sender() ! parkingResponse } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index 91719d34675..ad0860d9050 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -76,7 +76,10 @@ trait ChargingNetworkManagerHelper extends { ): Option[ScheduleTrigger] = { assume(endTime - startTime >= 0, s"timeInterval should not be negative! startTime $startTime endTime $endTime") // Calculate the energy to charge each vehicle connected to the a charging station - val endOfMaxSessionTime = chargingEndTimeInSeconds(chargingVehicle.personId) + val endOfMaxSessionTime = chargingEndTimeInSeconds.get(chargingVehicle.personId).getOrElse { + log.error(s"Something is broken. The person ${chargingVehicle.personId} is not tracked by CHM") + endTime + } val endOfShiftTime = chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow).getOrElse(endTime) val updatedEndTime = Math.min(endOfMaxSessionTime, endOfShiftTime) val duration = Math.max(0, updatedEndTime - startTime) From 5d7dc2ec861af8facc0cc13f05d44d59ad6847bb Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 1 Jun 2022 21:44:33 -0700 Subject: [PATCH 099/307] adding overnight parameter --- src/main/R/gemini/gemini-processing.R | 20 +++++++++++++++++-- src/main/resources/beam-template.conf | 1 + .../infrastructure/ChargingFunctions.scala | 18 +++++++++++------ .../infrastructure/ParkingFunctions.scala | 6 +++++- .../infrastructure/parking/ParkingMNL.scala | 5 ++++- .../scala/beam/sim/config/BeamConfig.scala | 5 +++++ 6 files changed, 45 insertions(+), 10 deletions(-) diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 8c889122ffa..fb9ed2102af 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -21,7 +21,13 @@ shpFile <- pp(workDir, "/shapefile/Oakland+Alameda+TAZ/Transportation_Analysis_Z oaklandCbg <- st_read(shpFile) infra5aBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/4a_output_2022_Apr_13_pubClust_withFees_aggregated.csv")) -infra5bBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/4b_output_2022_Apr_13_pubClust_withFees_aggregated.csv")) +infra5bBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/4b_output_2022_Apr_13_pubClust_withFees.csv.gz")) +infra5bBase[startsWith(reservedFor,"household")]$reservedFor <- "Any" +write.csv( + infra5bBase, + file = pp(workDir, "/2022-04-28/_models/infrastructure/4b_output_2022_Apr_13_pubClust_withFees.csv"), + row.names=FALSE, + quote=FALSE) vehicles1 <- readCsv(pp(workDir, "/vehicles.4Base.csv")) vehicles1$stateOfCharge <- as.double(vehicles1$stateOfCharge) @@ -47,7 +53,17 @@ write.csv( quote=FALSE) ### -#eventsraw <- readCsv(pp(workDir, "/0.events.csv.gz")) +test1 <- readCsv(pp(workDir, "/test/0.events.test1.csv.gz")) +test1H <- readCsv(pp(workDir, "/test/0.events.test1H.csv.gz")) +test2 <- readCsv(pp(workDir, "/test/0.events.test2.csv.gz")) +test <- readCsv(pp(workDir, "/test/0.events.csv.gz")) +householdVehicles <- readCsv(pp(workDir, "/test/householdVehicles.csv")) +refuelEvents <- test[type=="RefuelSessionEvent"] +parkEvents <- test[type=="ParkingEvent"] +householdVehicles$vehicleId <- as.character(householdVehicles$vehicleId) +res <- parkEvents[householdVehicles, on=c(vehicle="vehicleId")] +res2 <- rbind(res[startsWith(i.vehicleType,"ev-")], res[startsWith(i.vehicleType,"phev-")]) + events1 <- readCsv(pp(workDir, "/2022-04-27-Calibration/events/filtered.0.events.5b4.csv.gz")) events2 <- readCsv(pp(workDir, "/2022-04-28/events/filtered.0.events.5bBase.csv.gz")) test <- events2[type=="RefuelSessionEvent"][time-duration == 0] diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index cc968d5d203..885971552fd 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -164,6 +164,7 @@ beam.agentsim.agents.parking.mulitnomialLogit.params.rangeAnxietyMultiplier = "d beam.agentsim.agents.parking.mulitnomialLogit.params.distanceMultiplier = "double | -0.086" # based on 20m walk, VoT = $35/hr should be u=-1.0 beam.agentsim.agents.parking.mulitnomialLogit.params.parkingPriceMultiplier = "double | -0.005" # based on avg. parking prices up to $200! beam.agentsim.agents.parking.mulitnomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = "double | 1.0" # positive boost of 1.0 if true +beam.agentsim.agents.parking.mulitnomialLogit.params.overnightParkingPrefersChargingMultiplier = "double | 1.0" # positive boost of 1.0 if true beam.agentsim.agents.parking.mulitnomialLogit.params.enrouteDetourMultiplier = "double | 1.0" # based on skim travel time and the defined VoT for car trips beam.agentsim.agents.parking.rangeAnxietyBuffer = "double | 20000.0" # if our remaining range exceeds our remaining tour plus this many meters, then we feel no anxiety; default 20k beam.agentsim.agents.parking.minSearchRadius = "double | 250.00" # something small enough that, on average, we see 2 orders of magnitude of samples at most diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 92c94895fd4..83d95302b7b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -176,7 +176,7 @@ class ChargingFunctions( Some(estimatedMinParkingDurationInSeconds.toInt) // at least a small duration of charging else Some(tempParkingDuration) - val addedEnergy: Double = + val (addedEnergy, stateOfCharge): (Double, Double) = inquiry.beamVehicle match { case Some(beamVehicle) => parkingAlternative.parkingZone.chargingPointType match { @@ -189,10 +189,12 @@ class ChargingFunctions( 1e6, parkingDuration ) - addedEnergy - case None => 0.0 // no charger here + val stateOfCharge = + beamVehicle.primaryFuelLevelInJoules / beamVehicle.beamVehicleType.primaryFuelCapacityInJoule + (addedEnergy, stateOfCharge) + case None => (0.0, 0.0) // no charger here } - case None => 0.0 // no beamVehicle, assume agent has range + case None => (0.0, 0.0) // no beamVehicle, assume agent has range } val rangeAnxietyFactor: Double = @@ -202,9 +204,13 @@ class ChargingFunctions( } .getOrElse(0.0) // default no anxiety if no remaining trip data provided + val overnightParkingPrefersChargingFactor: Double = + if (inquiry.destinationUtm.time == 0) 1 - math.min(1.0, math.max(0.0, stateOfCharge)) else 0.0 + super[ParkingFunctions].setupMNLParameters(parkingAlternative, inquiry) ++ Map( - ParkingMNL.Parameters.EnrouteDetourCost -> enrouteFactor, - ParkingMNL.Parameters.RangeAnxietyCost -> rangeAnxietyFactor + ParkingMNL.Parameters.EnrouteDetourCost -> enrouteFactor, + ParkingMNL.Parameters.RangeAnxietyCost -> rangeAnxietyFactor, + ParkingMNL.Parameters.OvernightParkingPrefersCharging -> overnightParkingPrefersChargingFactor ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index ab8d9ee5fc4..eb1fef7cdab 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -59,6 +59,9 @@ class ParkingFunctions( ), ParkingMNL.Parameters.EnrouteDetourCost -> UtilityFunctionOperation.Multiplier( mnlParkingConfig.params.enrouteDetourMultiplier + ), + ParkingMNL.Parameters.OvernightParkingPrefersCharging -> UtilityFunctionOperation.Multiplier( + mnlParkingConfig.params.overnightParkingPrefersChargingMultiplier ) ) @@ -90,7 +93,8 @@ class ParkingFunctions( ParkingMNL.Parameters.WalkingEgressCost -> distanceFactor, ParkingMNL.Parameters.ParkingTicketCost -> parkingCostsPriceFactor, ParkingMNL.Parameters.HomeActivityPrefersResidentialParking -> homeActivityPrefersResidentialFactor, - ParkingMNL.Parameters.EnrouteDetourCost -> 0.0 + ParkingMNL.Parameters.EnrouteDetourCost -> 0.0, + ParkingMNL.Parameters.OvernightParkingPrefersCharging -> 0.0 ) params diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingMNL.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingMNL.scala index 205cc19006f..6d1e8eb7ee1 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingMNL.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingMNL.scala @@ -11,7 +11,8 @@ object ParkingMNL { Parameters.RangeAnxietyCost -> UtilityFunctionOperation.Multiplier(-1.0), Parameters.WalkingEgressCost -> UtilityFunctionOperation.Multiplier(-1.0), Parameters.EnrouteDetourCost -> UtilityFunctionOperation.Multiplier(-1.0), - Parameters.HomeActivityPrefersResidentialParking -> UtilityFunctionOperation.Multiplier(1.0) + Parameters.HomeActivityPrefersResidentialParking -> UtilityFunctionOperation.Multiplier(1.0), + Parameters.OvernightParkingPrefersCharging -> UtilityFunctionOperation.Multiplier(1.0) ) /** @@ -72,6 +73,7 @@ object ParkingMNL { final case object QueueingTimeCost extends Parameters with Serializable final case object ChargingTimeCost extends Parameters with Serializable final case object HomeActivityPrefersResidentialParking extends Parameters with Serializable + final case object OvernightParkingPrefersCharging extends Parameters with Serializable final case object EnrouteDetourCost extends Parameters with Serializable def shortName(parameter: Parameters): String = parameter match { @@ -83,6 +85,7 @@ object ParkingMNL { case QueueingTimeCost => "queue" case ChargingTimeCost => "charge" case HomeActivityPrefersResidentialParking => "home" + case OvernightParkingPrefersCharging => "overnight" case EnrouteDetourCost => "enroute" } } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index e4f22529cc5..15e1275d681 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -737,6 +737,7 @@ object BeamConfig { distanceMultiplier: scala.Double, enrouteDetourMultiplier: scala.Double, homeActivityPrefersResidentialParkingMultiplier: scala.Double, + overnightParkingPrefersChargingMultiplier: scala.Double, parkingPriceMultiplier: scala.Double, rangeAnxietyMultiplier: scala.Double ) @@ -755,6 +756,10 @@ object BeamConfig { if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, + overnightParkingPrefersChargingMultiplier = + if (c.hasPathOrNull("overnightParkingPrefersChargingMultiplier")) + c.getDouble("overnightParkingPrefersChargingMultiplier") + else 1.0, parkingPriceMultiplier = if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, rangeAnxietyMultiplier = From 2d2e74fd4c8ddd8d988b7b3fb7c4e2fe025ad671 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 1 Jun 2022 21:49:20 -0700 Subject: [PATCH 100/307] fix enrouteFactor --- .../scala/beam/agentsim/infrastructure/ChargingFunctions.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 83d95302b7b..0a8f835bf88 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -162,7 +162,7 @@ class ChargingFunctions( origin.time + travelTime1, beamVehicle.beamVehicleType ) - (travelTime1 + travelTime2) * inquiry.valueOfTime + ((travelTime1 + travelTime2) / ZonalParkingManager.HourInSeconds) * inquiry.valueOfTime case _ => 0.0 } From 36e02ea9000aacbabf060db86daf992cac73b8dd Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 2 Jun 2022 18:33:24 -0700 Subject: [PATCH 101/307] overnight charging fix --- .../beam/agentsim/infrastructure/ChargingFunctions.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 0a8f835bf88..45801f75418 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -199,13 +199,12 @@ class ChargingFunctions( val rangeAnxietyFactor: Double = inquiry.remainingTripData - .map { - _.rangeAnxiety(withAddedFuelInJoules = addedEnergy) - } + .map(_.rangeAnxiety(withAddedFuelInJoules = addedEnergy)) .getOrElse(0.0) // default no anxiety if no remaining trip data provided + val overnightParkingCheck = inquiry.remainingTripData.forall(_.remainingTourDistance == 0) val overnightParkingPrefersChargingFactor: Double = - if (inquiry.destinationUtm.time == 0) 1 - math.min(1.0, math.max(0.0, stateOfCharge)) else 0.0 + if (overnightParkingCheck) 1 - math.min(1.0, math.max(0.0, stateOfCharge)) else 0.0 super[ParkingFunctions].setupMNLParameters(parkingAlternative, inquiry) ++ Map( ParkingMNL.Parameters.EnrouteDetourCost -> enrouteFactor, From 38efc2022bdd1328cc8c5b44357d8e8384a5c967 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 2 Jun 2022 18:35:53 -0700 Subject: [PATCH 102/307] adding a comment --- .../scala/beam/agentsim/infrastructure/ChargingFunctions.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 45801f75418..86093bac04f 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -202,6 +202,7 @@ class ChargingFunctions( .map(_.rangeAnxiety(withAddedFuelInJoules = addedEnergy)) .getOrElse(0.0) // default no anxiety if no remaining trip data provided + // overnight charging is either at the beginning of the simulated day or end of the simulated day val overnightParkingCheck = inquiry.remainingTripData.forall(_.remainingTourDistance == 0) val overnightParkingPrefersChargingFactor: Double = if (overnightParkingCheck) 1 - math.min(1.0, math.max(0.0, stateOfCharge)) else 0.0 From e82133ef036c3dc331a847b3b4212f7cd12faf1f Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 3 Jun 2022 00:23:37 -0700 Subject: [PATCH 103/307] sample size --- src/main/resources/beam-template.conf | 1 + .../scala/beam/sim/config/BeamConfig.scala | 5600 ++++++----------- 2 files changed, 1978 insertions(+), 3623 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 885971552fd..4f77ffeb080 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -173,6 +173,7 @@ beam.agentsim.agents.parking.searchMaxDistanceRelativeToEllipseFoci = "double | beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds = "double | 60.0" # in seconds, something small enough but has meaningful impact on pricing beam.agentsim.agents.parking.fractionOfSameTypeZones = "double | 0.5" beam.agentsim.agents.parking.minNumberOfSameTypeZones = "int | 10" +beam.agentsim.agents.parking.overnightChargingSampleSize = "double | 0.5" #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 15e1275d681..a8a50bf5665 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,5220 +3,3574 @@ package beam.sim.config case class BeamConfig( - beam: BeamConfig.Beam, - matsim: BeamConfig.Matsim + beam : BeamConfig.Beam, + matsim : BeamConfig.Matsim ) - object BeamConfig { - case class Beam( - actorSystemName: java.lang.String, - agentsim: BeamConfig.Beam.Agentsim, - calibration: BeamConfig.Beam.Calibration, - cluster: BeamConfig.Beam.Cluster, - debug: BeamConfig.Beam.Debug, - exchange: BeamConfig.Beam.Exchange, - experimental: BeamConfig.Beam.Experimental, - input: BeamConfig.Beam.Input, - inputDirectory: java.lang.String, - logger: BeamConfig.Beam.Logger, - metrics: BeamConfig.Beam.Metrics, - output: BeamConfig.Beam.Output, - outputs: BeamConfig.Beam.Outputs, - physsim: BeamConfig.Beam.Physsim, - replanning: BeamConfig.Beam.Replanning, - router: BeamConfig.Beam.Router, - routing: BeamConfig.Beam.Routing, - sim: BeamConfig.Beam.Sim, - spatial: BeamConfig.Beam.Spatial, - urbansim: BeamConfig.Beam.Urbansim, - useLocalWorker: scala.Boolean, - warmStart: BeamConfig.Beam.WarmStart + actorSystemName : java.lang.String, + agentsim : BeamConfig.Beam.Agentsim, + calibration : BeamConfig.Beam.Calibration, + cluster : BeamConfig.Beam.Cluster, + debug : BeamConfig.Beam.Debug, + exchange : BeamConfig.Beam.Exchange, + experimental : BeamConfig.Beam.Experimental, + input : BeamConfig.Beam.Input, + inputDirectory : java.lang.String, + logger : BeamConfig.Beam.Logger, + metrics : BeamConfig.Beam.Metrics, + output : BeamConfig.Beam.Output, + outputs : BeamConfig.Beam.Outputs, + physsim : BeamConfig.Beam.Physsim, + replanning : BeamConfig.Beam.Replanning, + router : BeamConfig.Beam.Router, + routing : BeamConfig.Beam.Routing, + sim : BeamConfig.Beam.Sim, + spatial : BeamConfig.Beam.Spatial, + urbansim : BeamConfig.Beam.Urbansim, + useLocalWorker : scala.Boolean, + warmStart : BeamConfig.Beam.WarmStart ) - object Beam { - case class Agentsim( - agentSampleSizeAsFractionOfPopulation: scala.Double, - agents: BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime: java.lang.String, - firstIteration: scala.Int, - fractionOfPlansWithSingleActivity: scala.Double, - h3taz: BeamConfig.Beam.Agentsim.H3taz, - lastIteration: scala.Int, - populationAdjustment: java.lang.String, - randomSeedForPopulationSampling: scala.Option[scala.Int], - scenarios: BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow: scala.Int, - simulationName: java.lang.String, - snapLocationAndRemoveInvalidInputs: scala.Boolean, - taz: BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters: scala.Int, - thresholdForWalkingInMeters: scala.Int, - timeBinSize: scala.Int, - toll: BeamConfig.Beam.Agentsim.Toll, - tuning: BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation : scala.Double, + agents : BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime : java.lang.String, + firstIteration : scala.Int, + fractionOfPlansWithSingleActivity : scala.Double, + h3taz : BeamConfig.Beam.Agentsim.H3taz, + lastIteration : scala.Int, + populationAdjustment : java.lang.String, + randomSeedForPopulationSampling : scala.Option[scala.Int], + scenarios : BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow : scala.Int, + simulationName : java.lang.String, + snapLocationAndRemoveInvalidInputs : scala.Boolean, + taz : BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters : scala.Int, + thresholdForWalkingInMeters : scala.Int, + timeBinSize : scala.Int, + toll : BeamConfig.Beam.Agentsim.Toll, + tuning : BeamConfig.Beam.Agentsim.Tuning ) - object Agentsim { - case class Agents( - activities: BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType: java.lang.String, - freight: BeamConfig.Beam.Agentsim.Agents.Freight, - households: BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking: BeamConfig.Beam.Agentsim.Agents.Parking, - plans: BeamConfig.Beam.Agentsim.Agents.Plans, - population: BeamConfig.Beam.Agentsim.Agents.Population, - ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles + activities : BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType : java.lang.String, + freight : BeamConfig.Beam.Agentsim.Agents.Freight, + households : BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking : BeamConfig.Beam.Agentsim.Agents.Parking, + plans : BeamConfig.Beam.Agentsim.Agents.Plans, + population : BeamConfig.Beam.Agentsim.Agents.Population, + ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles ) - object Agents { - case class Activities( - activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] ) - object Activities { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = - if (c.hasPathOrNull("activityTypeToFixedDurationMap")) - scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) - else None + activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None ) } } - + case class Freight( - carrierParkingFilePath: scala.Option[java.lang.String], - carriersFilePath: java.lang.String, - convertWgs2Utm: scala.Boolean, - enabled: scala.Boolean, - generateFixedActivitiesDurations: scala.Boolean, - name: java.lang.String, - plansFilePath: java.lang.String, - reader: java.lang.String, - replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath: java.lang.String + carrierParkingFilePath : scala.Option[java.lang.String], + carriersFilePath : java.lang.String, + convertWgs2Utm : scala.Boolean, + enabled : scala.Boolean, + generateFixedActivitiesDurations : scala.Boolean, + name : java.lang.String, + plansFilePath : java.lang.String, + reader : java.lang.String, + replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath : java.lang.String ) - object Freight { - case class Replanning( - departureTime: scala.Int, - disableAfterIteration: scala.Int, - strategy: java.lang.String + departureTime : scala.Int, + disableAfterIteration : scala.Int, + strategy : java.lang.String ) - object Replanning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = - if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = - if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") - else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = - c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = - if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") - else "/test/input/beamville/freight/payload-plans.csv", - reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - toursFilePath = - if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") - else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", + reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath: java.lang.String, - inputHouseholdAttributesFilePath: java.lang.String + inputFilePath : java.lang.String, + inputHouseholdAttributesFilePath : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = - if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") - else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = - if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") - else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime: scala.Double, - highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts: scala.Int, - minimumValueOfTime: scala.Double, - modeChoiceClass: java.lang.String, - modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT: scala.Boolean, - overrideAutomationLevel: scala.Int, - poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] + defaultValueOfTime : scala.Double, + highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts : scala.Int, + minimumValueOfTime : scala.Double, + modeChoiceClass : java.lang.String, + modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT : scala.Boolean, + overrideAutomationLevel : scala.Int, + poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] ) - object ModalBehaviors { - case class HighTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) - object HighTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class Lccm( - filePath: java.lang.String + filePath : java.lang.String ) - object Lccm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) - object LowTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class ModeVotMultiplier( - CAV: scala.Double, - bike: scala.Double, - drive: scala.Double, - rideHail: scala.Double, - rideHailPooled: scala.Double, - rideHailTransit: scala.Double, - transit: scala.Double, - waiting: scala.Double, - walk: scala.Double + CAV : scala.Double, + bike : scala.Double, + drive : scala.Double, + rideHail : scala.Double, + rideHailPooled : scala.Double, + rideHailTransit : scala.Double, + transit : scala.Double, + waiting : scala.Double, + walk : scala.Double ) - object ModeVotMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor: scala.Double + params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor : scala.Double ) - object MulitnomialLogit { - case class Params( - bike_intercept: scala.Double, - bike_transit_intercept: scala.Double, - car_intercept: scala.Double, - cav_intercept: scala.Double, - drive_transit_intercept: scala.Double, - ride_hail_intercept: scala.Double, - ride_hail_pooled_intercept: scala.Double, - ride_hail_transit_intercept: scala.Double, - transfer: scala.Double, - transit_crowding: scala.Double, - transit_crowding_VOT_multiplier: scala.Double, - transit_crowding_VOT_threshold: scala.Double, - transit_crowding_percentile: scala.Double, - walk_intercept: scala.Double, - walk_transit_intercept: scala.Double + bike_intercept : scala.Double, + bike_transit_intercept : scala.Double, + car_intercept : scala.Double, + cav_intercept : scala.Double, + drive_transit_intercept : scala.Double, + ride_hail_intercept : scala.Double, + ride_hail_pooled_intercept : scala.Double, + ride_hail_transit_intercept : scala.Double, + transfer : scala.Double, + transit_crowding : scala.Double, + transit_crowding_VOT_multiplier : scala.Double, + transit_crowding_VOT_threshold : scala.Double, + transit_crowding_percentile : scala.Double, + walk_intercept : scala.Double, + walk_transit_intercept : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = - if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = - if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = - if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = - if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") - else 0.0, - ride_hail_transit_intercept = - if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") - else 0.0, - transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = - if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) - c.getDouble("transit_crowding_VOT_multiplier") - else 0.0, - transit_crowding_VOT_threshold = - if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") - else 0.5, - transit_crowding_percentile = - if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") - else 90.0, - walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = - if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, + ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, + transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, + transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, + transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, + walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ), - utility_scale_factor = - if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), + utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object PoolingMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = - if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") - ), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - if (c.hasPathOrNull("lccm")) c.getConfig("lccm") - else com.typesafe.config.ConfigFactory.parseString("lccm{}") - ), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") - ), - maximumNumberOfReplanningAttempts = - if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") - else 3, - minimumValueOfTime = - if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = - if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") - else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") - else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - overrideAutomationForVOTT = - c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = - if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") - else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") - ), - transitVehicleTypeVOTMultipliers = - if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) - scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) - else None - ) - } - } - + defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), + maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, + minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), + transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None + ) + } + } + case class ModeIncentive( - filePath: java.lang.String + filePath : java.lang.String ) - object ModeIncentive { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - estimatedMinParkingDurationInSeconds: scala.Double, - fractionOfSameTypeZones: scala.Double, - maxSearchRadius: scala.Double, - minNumberOfSameTypeZones: scala.Int, - minSearchRadius: scala.Double, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - rangeAnxietyBuffer: scala.Double, - searchMaxDistanceRelativeToEllipseFoci: scala.Double + estimatedMinParkingDurationInSeconds : scala.Double, + fractionOfSameTypeZones : scala.Double, + maxSearchRadius : scala.Double, + minNumberOfSameTypeZones : scala.Int, + minSearchRadius : scala.Double, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + overnightChargingSampleSize : scala.Double, + rangeAnxietyBuffer : scala.Double, + searchMaxDistanceRelativeToEllipseFoci : scala.Double ) - object Parking { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - distanceMultiplier: scala.Double, - enrouteDetourMultiplier: scala.Double, - homeActivityPrefersResidentialParkingMultiplier: scala.Double, - overnightParkingPrefersChargingMultiplier: scala.Double, - parkingPriceMultiplier: scala.Double, - rangeAnxietyMultiplier: scala.Double + distanceMultiplier : scala.Double, + enrouteDetourMultiplier : scala.Double, + homeActivityPrefersResidentialParkingMultiplier : scala.Double, + overnightParkingPrefersChargingMultiplier : scala.Double, + parkingPriceMultiplier : scala.Double, + rangeAnxietyMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = - if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = - if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = - if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) - c.getDouble("homeActivityPrefersResidentialParkingMultiplier") - else 1.0, - overnightParkingPrefersChargingMultiplier = - if (c.hasPathOrNull("overnightParkingPrefersChargingMultiplier")) - c.getDouble("overnightParkingPrefersChargingMultiplier") - else 1.0, - parkingPriceMultiplier = - if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = - if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, + overnightParkingPrefersChargingMultiplier = if(c.hasPathOrNull("overnightParkingPrefersChargingMultiplier")) c.getDouble("overnightParkingPrefersChargingMultiplier") else 1.0, + parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - estimatedMinParkingDurationInSeconds = - if (c.hasPathOrNull("estimatedMinParkingDurationInSeconds")) - c.getDouble("estimatedMinParkingDurationInSeconds") - else 60.0, - fractionOfSameTypeZones = - if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, - maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minNumberOfSameTypeZones = - if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, - minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - rangeAnxietyBuffer = - if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = - if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) - c.getDouble("searchMaxDistanceRelativeToEllipseFoci") - else 4.0 + estimatedMinParkingDurationInSeconds = if(c.hasPathOrNull("estimatedMinParkingDurationInSeconds")) c.getDouble("estimatedMinParkingDurationInSeconds") else 60.0, + fractionOfSameTypeZones = if(c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, + maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minNumberOfSameTypeZones = if(c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, + minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + overnightChargingSampleSize = if(c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0.5, + rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath: java.lang.String, - inputPlansFilePath: java.lang.String, - merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath : java.lang.String, + inputPlansFilePath : java.lang.String, + merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) - object Plans { - case class Merge( - fraction: scala.Double + fraction : scala.Double ) - object Merge { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = - if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") - else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = - if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") - else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - if (c.hasPathOrNull("merge")) c.getConfig("merge") - else com.typesafe.config.ConfigFactory.parseString("merge{}") - ) + inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) ) } } - + case class Population( - industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling: scala.Boolean + industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling : scala.Boolean ) - object Population { - case class IndustryRemovalProbabilty( - enabled: scala.Boolean, - inputFilePath: java.lang.String, - removalStrategy: java.lang.String + enabled : scala.Boolean, + inputFilePath : java.lang.String, + removalStrategy : java.lang.String ) - object IndustryRemovalProbabilty { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = - if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") - else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") - ), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath: java.lang.String + filePath : java.lang.String ) - object PtFare { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost: scala.Double, - defaultCostPerMile: scala.Double, - defaultCostPerMinute: scala.Double, - human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations: scala.Boolean, - name: java.lang.String, - pooledBaseCost: scala.Double, - pooledCostPerMile: scala.Double, - pooledCostPerMinute: scala.Double, - rangeBufferForDispatchInMeters: scala.Int, - repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost : scala.Double, + defaultCostPerMile : scala.Double, + defaultCostPerMinute : scala.Double, + human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations : scala.Boolean, + name : java.lang.String, + pooledBaseCost : scala.Double, + pooledCostPerMile : scala.Double, + pooledCostPerMinute : scala.Double, + rangeBufferForDispatchInMeters : scala.Int, + repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) - object RideHail { - case class AllocationManager( - alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm: java.lang.String, - maxExcessRideTime: scala.Double, - maxWaitingTimeInSec: scala.Int, - name: java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, - repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds: scala.Int + alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm : java.lang.String, + maxExcessRideTime : scala.Double, + maxWaitingTimeInSec : scala.Int, + name : java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, + repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds : scala.Int ) - object AllocationManager { - case class AlonsoMora( - maxRequestsPerVehicle: scala.Int + maxRequestsPerVehicle : scala.Int ) - object AlonsoMora { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = - if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, - demandWeight: scala.Double, - distanceWeight: scala.Double, - keepMaxTopNScores: scala.Int, - minDemandPercentageInRadius: scala.Double, - minScoreThresholdForRepositioning: scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, - percentageOfVehiclesToReposition: scala.Double, - produceDebugImages: scala.Boolean, - repositionCircleRadiusInMeters: scala.Double, - repositioningMethod: java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, - waitingTimeWeight: scala.Double + allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, + demandWeight : scala.Double, + distanceWeight : scala.Double, + keepMaxTopNScores : scala.Int, + minDemandPercentageInRadius : scala.Double, + minScoreThresholdForRepositioning : scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, + percentageOfVehiclesToReposition : scala.Double, + produceDebugImages : scala.Boolean, + repositionCircleRadiusInMeters : scala.Double, + repositioningMethod : java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, + waitingTimeWeight : scala.Double ) - object RepositionLowWaitingTimes { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( - "allowIncreasingRadiusIfDemandInRadiusLow" - ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = - if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") - else 0.1, - minScoreThresholdForRepositioning = - if (c.hasPathOrNull("minScoreThresholdForRepositioning")) - c.getDouble("minScoreThresholdForRepositioning") - else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = - if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) - c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") - else 1, - percentageOfVehiclesToReposition = - if (c.hasPathOrNull("percentageOfVehiclesToReposition")) - c.getDouble("percentageOfVehiclesToReposition") - else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = - if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") - else 3000, - repositioningMethod = - if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = - if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) - c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") - else 1200, - waitingTimeWeight = - if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, + minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, + percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, + repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, + waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") - else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") - ), - matchingAlgorithm = - if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") - else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = - if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = - if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) - c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") - else 1, - repositionLowWaitingTimes = - BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") - else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") - ), - requestBufferTimeoutInSeconds = - if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), + matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, + repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), + requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int, - valueOfTime: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int, + valueOfTime : scala.Int ) - object Cav { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 16090, - valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, + valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) - object Charging { - case class VehicleChargingManager( - defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager ) - object VehicleChargingManager { - case class DefaultVehicleChargingManager( - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit ) - object DefaultVehicleChargingManager { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - chargingTimeMultiplier: scala.Double, - drivingTimeMultiplier: scala.Double, - insufficientRangeMultiplier: scala.Double, - queueingTimeMultiplier: scala.Double + chargingTimeMultiplier : scala.Double, + drivingTimeMultiplier : scala.Double, + insufficientRangeMultiplier : scala.Double, + queueingTimeMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - chargingTimeMultiplier = - if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") - else -0.01666667, - drivingTimeMultiplier = - if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") - else -0.01666667, - insufficientRangeMultiplier = - if (c.hasPathOrNull("insufficientRangeMultiplier")) - c.getDouble("insufficientRangeMultiplier") - else -60.0, - queueingTimeMultiplier = - if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") - else -0.01666667 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( + chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, + drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, + insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, + queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - params = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - mulitnomialLogit = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - if (c.hasPathOrNull("defaultVehicleChargingManager")) - c.getConfig("defaultVehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") - ) + defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") - ) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) ) } } - + case class Human( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int ) - object Human { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 ) } } - + case class Initialization( - filePath: java.lang.String, - initType: java.lang.String, - parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath : java.lang.String, + initType : java.lang.String, + parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) - object Initialization { - case class Parking( - filePath: java.lang.String + filePath : java.lang.String ) - object Parking { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet: scala.Double, - initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId: java.lang.String, - vehicleTypePrefix: java.lang.String + fractionOfInitialVehicleFleet : scala.Double, + initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId : java.lang.String, + vehicleTypePrefix : java.lang.String ) - object Procedural { - case class InitialLocation( - home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name: java.lang.String + home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name : java.lang.String ) - object InitialLocation { - case class Home( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object Home { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - if (c.hasPathOrNull("home")) c.getConfig("home") - else com.typesafe.config.ConfigFactory.parseString("home{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") - else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") - ), - vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = - if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - if (c.hasPathOrNull("procedural")) c.getConfig("procedural") - else com.typesafe.config.ConfigFactory.parseString("procedural{}") - ) + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) ) } } - + case class IterationStats( - timeBinSizeInSec: scala.Double + timeBinSizeInSec : scala.Double ) - object IterationStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name: java.lang.String, - timeout: scala.Int + demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name : java.lang.String, + timeout : scala.Int ) - object RepositioningManager { - case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider: scala.Double, - horizon: scala.Int, - numberOfClustersForDemand: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDemandForCAVs: scala.Double + fractionOfClosestClustersToConsider : scala.Double, + horizon : scala.Int, + numberOfClustersForDemand : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDemandForCAVs : scala.Double ) - object DemandFollowingRepositioningManager { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = - if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) - c.getDouble("fractionOfClosestClustersToConsider") - else 0.2, - horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = - if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 1, - sensitivityOfRepositioningToDemandForCAVs = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) - c.getDouble("sensitivityOfRepositioningToDemandForCAVs") - else 1 + fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, + horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, + sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDistance: scala.Double + predictionHorizon : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDistance : scala.Double ) - object InverseSquareDistanceRepositioningFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 0.4, - sensitivityOfRepositioningToDistance = - if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) - c.getDouble("sensitivityOfRepositioningToDistance") - else 0.9 + predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, + sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - if (c.hasPathOrNull("demandFollowingRepositioningManager")) - c.getConfig("demandFollowingRepositioningManager") - else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") - ), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager - .InverseSquareDistanceRepositioningFactor( - if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) - c.getConfig("inverseSquareDistanceRepositioningFactor") - else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object RideHailManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel: scala.Double, - numberOfCategories: scala.Int, - priceAdjustmentStrategy: java.lang.String, - surgeLevelAdaptionStep: scala.Double + minimumSurgeLevel : scala.Double, + numberOfCategories : scala.Int, + priceAdjustmentStrategy : java.lang.String, + surgeLevelAdaptionStep : scala.Double ) - object SurgePricing { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = - if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") - else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = - if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") - else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") - ), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - if (c.hasPathOrNull("cav")) c.getConfig("cav") - else com.typesafe.config.ConfigFactory.parseString("cav{}") - ), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - if (c.hasPathOrNull("charging")) c.getConfig("charging") - else com.typesafe.config.ConfigFactory.parseString("charging{}") - ), - defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = - if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = - if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - if (c.hasPathOrNull("human")) c.getConfig("human") - else com.typesafe.config.ConfigFactory.parseString("human{}") - ), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - if (c.hasPathOrNull("initialization")) c.getConfig("initialization") - else com.typesafe.config.ConfigFactory.parseString("initialization{}") - ), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") - else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") - ), - linkFleetStateAcrossIterations = - c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = - if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - rangeBufferForDispatchInMeters = - if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") - else 10000, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") - else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") - ), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") - else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") - ), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") - else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") - ) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), + defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), + linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) + ) + } + } + case class RideHailTransit( - modesToConsider: java.lang.String + modesToConsider : java.lang.String ) - object RideHailTransit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) - object TripBehaviors { - case class CarUsage( - minDistanceToTrainStop: scala.Double + minDistanceToTrainStop : scala.Double ) - object CarUsage { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = - if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path: java.lang.String, - additional_trip_utility: scala.Double, - destination_nest_scale_factor: scala.Double, - generate_secondary_activities: scala.Boolean, - intercept_file_path: java.lang.String, - max_destination_choice_set_size: scala.Int, - max_destination_distance_meters: scala.Double, - mode_nest_scale_factor: scala.Double, - trip_nest_scale_factor: scala.Double + activity_file_path : java.lang.String, + additional_trip_utility : scala.Double, + destination_nest_scale_factor : scala.Double, + generate_secondary_activities : scala.Boolean, + intercept_file_path : java.lang.String, + max_destination_choice_set_size : scala.Int, + max_destination_distance_meters : scala.Double, + mode_nest_scale_factor : scala.Double, + trip_nest_scale_factor : scala.Double ) - object MulitnomialLogit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = - if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = - if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = - if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") - else 1.0, - generate_secondary_activities = - c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = - if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = - if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") - else 20, - max_destination_distance_meters = - if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") - else 32000, - mode_nest_scale_factor = - if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = - if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, + generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, + max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, + mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") - else com.typesafe.config.ConfigFactory.parseString("carUsage{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) ) } } - + case class Vehicles( - destination: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination, - downsamplingMethod: java.lang.String, - dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet: scala.Double, - fractionOfPeopleWithBicycle: scala.Double, - fuelTypesFilePath: java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, - linkSocAcrossIterations: scala.Boolean, - linkToGradePercentFilePath: java.lang.String, - meanPrivateVehicleStartingSOC: scala.Double, - meanRidehailVehicleStartingSOC: scala.Double, - sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile: java.lang.String, - vehicleAdjustmentMethod: java.lang.String, - vehicleTypesFilePath: java.lang.String, - vehiclesFilePath: java.lang.String + destination : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination, + downsamplingMethod : java.lang.String, + dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet : scala.Double, + fractionOfPeopleWithBicycle : scala.Double, + fuelTypesFilePath : java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, + linkSocAcrossIterations : scala.Boolean, + linkToGradePercentFilePath : java.lang.String, + meanPrivateVehicleStartingSOC : scala.Double, + meanRidehailVehicleStartingSOC : scala.Double, + sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile : java.lang.String, + vehicleAdjustmentMethod : java.lang.String, + vehicleTypesFilePath : java.lang.String, + vehiclesFilePath : java.lang.String ) - object Vehicles { - case class Destination( - home: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home, - noRefuelThresholdInMeters: scala.Int, - secondary: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary, - work: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work + home : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home, + noRefuelThresholdInMeters : scala.Int, + secondary : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary, + work : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work ) - object Destination { - case class Home( - refuelRequiredThresholdInMeters: scala.Double + refuelRequiredThresholdInMeters : scala.Double ) - object Home { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) - c.getDouble("refuelRequiredThresholdInMeters") - else 128747.6 + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getDouble("refuelRequiredThresholdInMeters") else 128747.6 ) } } - + case class Secondary( - refuelRequiredThresholdInMeters: scala.Int + refuelRequiredThresholdInMeters : scala.Int ) - object Secondary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary( - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180 + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 ) } } - + case class Work( - refuelRequiredThresholdInMeters: scala.Double + refuelRequiredThresholdInMeters : scala.Double ) - object Work { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work( - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) - c.getDouble("refuelRequiredThresholdInMeters") - else 64373.8 + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getDouble("refuelRequiredThresholdInMeters") else 64373.8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( - home = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( - if (c.hasPathOrNull("home")) c.getConfig("home") - else com.typesafe.config.ConfigFactory.parseString("home{}") - ), - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - secondary = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary( - if (c.hasPathOrNull("secondary")) c.getConfig("secondary") - else com.typesafe.config.ConfigFactory.parseString("secondary{}") - ), - work = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work( - if (c.hasPathOrNull("work")) c.getConfig("work") - else com.typesafe.config.ConfigFactory.parseString("work{}") - ) + home = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + secondary = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), + work = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work(if(c.hasPathOrNull("work")) c.getConfig("work") else com.typesafe.config.ConfigFactory.parseString("work{}")) ) } } - + case class DummySharedBike( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedBike { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedCar { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond: scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, - noRefuelThresholdOffsetInMeters: scala.Double, - refuelRequiredThresholdOffsetInMeters: scala.Int, - remainingDistanceWrtBatteryCapacityThreshold: scala.Int + estimateOfMeanChargingDurationInSecond : scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, + noRefuelThresholdOffsetInMeters : scala.Double, + refuelRequiredThresholdOffsetInMeters : scala.Int, + remainingDistanceWrtBatteryCapacityThreshold : scala.Int ) - object Enroute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = - if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) - c.getInt("estimateOfMeanChargingDurationInSecond") - else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = - if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) - c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") - else 500, - noRefuelThresholdOffsetInMeters = - if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") - else 32186.9, - refuelRequiredThresholdOffsetInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdOffsetInMeters")) - c.getInt("refuelRequiredThresholdOffsetInMeters") - else 0, - remainingDistanceWrtBatteryCapacityThreshold = - if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) - c.getInt("remainingDistanceWrtBatteryCapacityThreshold") - else 2 + estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, + noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, + refuelRequiredThresholdOffsetInMeters = if(c.hasPathOrNull("refuelRequiredThresholdOffsetInMeters")) c.getInt("refuelRequiredThresholdOffsetInMeters") else 0, + remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving - ], - fixed_non_reserving_fleet_by_taz: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz - ], - inexhaustible_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving - ], - managerType: java.lang.String, - name: java.lang.String, - parkingFilePath: java.lang.String, - reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], + fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], + inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], + managerType : java.lang.String, + name : java.lang.String, + parkingFilePath : java.lang.String, + reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) - object SharedFleets$Elm { - case class FixedNonReserving( - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String ) - object FixedNonReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize: scala.Int, - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String, - vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] + fleetSize : scala.Int, + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String, + vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] ) - object FixedNonReservingFleetByTaz { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = - if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) - else None + fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object InexhaustibleReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm - ], - name: java.lang.String, - repositionTimeBin: scala.Int, - statTimeBin: scala.Int + min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], + name : java.lang.String, + repositionTimeBin : scala.Int, + statTimeBin : scala.Int ) - object Reposition { - case class MinAvailabilityUndersupplyAlgorithm( - matchLimit: scala.Int + matchLimit : scala.Int ) - object MinAvailabilityUndersupplyAlgorithm { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm( - matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( + matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = - if (c.hasPathOrNull("min-availability-undersupply-algorithm")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) - ) - else None, - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = - if (c.hasPathOrNull("fixed-non-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReserving(c.getConfig("fixed-non-reserving")) - ) - else None, - fixed_non_reserving_fleet_by_taz = - if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) - ) - else None, - inexhaustible_reserving = - if (c.hasPathOrNull("inexhaustible-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) - ) - else None, - managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = - if (c.hasPathOrNull("reposition")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) - ) - else None + fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, + fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, + inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, + managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - destination = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( - if (c.hasPathOrNull("destination")) c.getConfig("destination") - else com.typesafe.config.ConfigFactory.parseString("destination{}") - ), - downsamplingMethod = - if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") - else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") - else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") - ), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") - else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") - ), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - if (c.hasPathOrNull("enroute")) c.getConfig("enroute") - else com.typesafe.config.ConfigFactory.parseString("enroute{}") - ), - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 1.0, - fractionOfPeopleWithBicycle = - if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = - if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") - else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( - "generateEmergencyHouseholdVehicleWhenPlansRequireIt" - ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = - c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = - if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = - if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") - else 1.0, - meanRidehailVehicleStartingSOC = - if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") - else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = - if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") - else "", - vehicleAdjustmentMethod = - if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = - if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") - else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = - if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") - else "/test/input/beamville/vehicles.csv" - ) - } - - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + destination = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination(if(c.hasPathOrNull("destination")) c.getConfig("destination") else com.typesafe.config.ConfigFactory.parseString("destination{}")), + downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, + fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, + meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", + vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" + ) + } + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Agentsim.Agents.Vehicles - .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities( - if (c.hasPathOrNull("activities")) c.getConfig("activities") - else com.typesafe.config.ConfigFactory.parseString("activities{}") - ), - bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight( - if (c.hasPathOrNull("freight")) c.getConfig("freight") - else com.typesafe.config.ConfigFactory.parseString("freight{}") - ), - households = BeamConfig.Beam.Agentsim.Agents.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") - else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") - ), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") - else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") - ), - parking = BeamConfig.Beam.Agentsim.Agents.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - plans = BeamConfig.Beam.Agentsim.Agents.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - population = BeamConfig.Beam.Agentsim.Agents.Population( - if (c.hasPathOrNull("population")) c.getConfig("population") - else com.typesafe.config.ConfigFactory.parseString("population{}") - ), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( - if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") - else com.typesafe.config.ConfigFactory.parseString("ptFare{}") - ), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( - if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") - else com.typesafe.config.ConfigFactory.parseString("rideHail{}") - ), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") - else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") - ), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") - else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") - ), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), + bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), + households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), + parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor: scala.Double, - chargingPointCountScalingFactor: scala.Double, - chargingPointFilePath: java.lang.String, - helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - maxChargingSessionsInSeconds: scala.Int, - overnightChargingEnabled: scala.Boolean, - scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds: scala.Int + chargingPointCostScalingFactor : scala.Double, + chargingPointCountScalingFactor : scala.Double, + chargingPointFilePath : java.lang.String, + helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + maxChargingSessionsInSeconds : scala.Int, + overnightChargingEnabled : scala.Boolean, + scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds : scala.Int ) - object ChargingNetworkManager { - case class Helics( - bufferSize: scala.Int, - connectionEnabled: scala.Boolean, - coreInitString: java.lang.String, - coreType: java.lang.String, - dataInStreamPoint: java.lang.String, - dataOutStreamPoint: java.lang.String, - federateName: java.lang.String, - feedbackEnabled: scala.Boolean, - intLogLevel: scala.Int, - timeDeltaProperty: scala.Double + bufferSize : scala.Int, + connectionEnabled : scala.Boolean, + coreInitString : java.lang.String, + coreType : java.lang.String, + dataInStreamPoint : java.lang.String, + dataOutStreamPoint : java.lang.String, + federateName : java.lang.String, + feedbackEnabled : scala.Boolean, + intLogLevel : scala.Int, + timeDeltaProperty : scala.Double ) - object Helics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = - if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") - else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = - if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") - else "GridFed/PhysicalBounds", - dataOutStreamPoint = - if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", + dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled: scala.Boolean, - expansionFactor_charge_activity: scala.Double, - expansionFactor_home_activity: scala.Double, - expansionFactor_init_activity: scala.Double, - expansionFactor_wherever_activity: scala.Double, - expansionFactor_work_activity: scala.Double + enabled : scala.Boolean, + expansionFactor_charge_activity : scala.Double, + expansionFactor_home_activity : scala.Double, + expansionFactor_init_activity : scala.Double, + expansionFactor_wherever_activity : scala.Double, + expansionFactor_work_activity : scala.Double ) - object ScaleUp { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = - if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") - else 1.0, - expansionFactor_home_activity = - if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") - else 1.0, - expansionFactor_init_activity = - if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") - else 1.0, - expansionFactor_wherever_activity = - if (c.hasPathOrNull("expansionFactor_wherever_activity")) - c.getDouble("expansionFactor_wherever_activity") - else 1.0, - expansionFactor_work_activity = - if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") - else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, + expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, + expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, + expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, + expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = - if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") - else 1.0, - chargingPointCountScalingFactor = - if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") - else 1.0, - chargingPointFilePath = - if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - if (c.hasPathOrNull("helics")) c.getConfig("helics") - else com.typesafe.config.ConfigFactory.parseString("helics{}") - ), - maxChargingSessionsInSeconds = - if (c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, - overnightChargingEnabled = - c.hasPathOrNull("overnightChargingEnabled") && c.getBoolean("overnightChargingEnabled"), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") - else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") - ), - timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, + chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, + chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), + maxChargingSessionsInSeconds = if(c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, + overnightChargingEnabled = c.hasPathOrNull("overnightChargingEnabled") && c.getBoolean("overnightChargingEnabled"), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), + timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution: scala.Int, - upperBoundResolution: scala.Int + lowerBoundResolution : scala.Int, + upperBoundResolution : scala.Int ) - object H3taz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile: java.lang.String + frequencyAdjustmentFile : java.lang.String ) - object Scenarios { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = - if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") - else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay: scala.Int, - interval: scala.Int + initialDelay : scala.Int, + interval : scala.Int ) - object ScheduleMonitorTask { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath: java.lang.String, - parkingCostScalingFactor: scala.Double, - parkingFilePath: java.lang.String, - parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor: scala.Double + filePath : java.lang.String, + parkingCostScalingFactor : scala.Double, + parkingFilePath : java.lang.String, + parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor : scala.Double ) - object Taz { - case class ParkingManager( - displayPerformanceTimings: scala.Boolean, - method: java.lang.String, - parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings : scala.Boolean, + method : java.lang.String, + parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) - object ParkingManager { - case class Parallel( - numberOfClusters: scala.Int + numberOfClusters : scala.Int ) - object Parallel { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - if (c.hasPathOrNull("parallel")) c.getConfig("parallel") - else com.typesafe.config.ConfigFactory.parseString("parallel{}") - ) + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = - if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( - if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") - else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") - ), - parkingStallCountScalingFactor = - if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") - else 1.0 + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), + parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 ) } } - + case class Toll( - filePath: java.lang.String + filePath : java.lang.String ) - object Toll { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules: scala.Double, - rideHailPrice: scala.Double, - tollPrice: scala.Double, - transitCapacity: scala.Option[scala.Double], - transitPrice: scala.Double + fuelCapacityInJoules : scala.Double, + rideHailPrice : scala.Double, + tollPrice : scala.Double, + transitCapacity : scala.Option[scala.Double], + transitPrice : scala.Double ) - object Tuning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = - if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = - if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) - c.getDouble("agentSampleSizeAsFractionOfPopulation") - else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents( - if (c.hasPathOrNull("agents")) c.getConfig("agents") - else com.typesafe.config.ConfigFactory.parseString("agents{}") - ), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( - if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") - else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") - ), - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = - if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") - else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz( - if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") - else com.typesafe.config.ConfigFactory.parseString("h3taz{}") - ), - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = - if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - randomSeedForPopulationSampling = - if (c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) - else None, - scenarios = BeamConfig.Beam.Agentsim.Scenarios( - if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") - else com.typesafe.config.ConfigFactory.parseString("scenarios{}") - ), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") - else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") - ), - schedulerParallelismWindow = - if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - snapLocationAndRemoveInvalidInputs = - c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), - taz = BeamConfig.Beam.Agentsim.Taz( - if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") - ), - thresholdForMakingParkingChoiceInMeters = - if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) - c.getInt("thresholdForMakingParkingChoiceInMeters") - else 100, - thresholdForWalkingInMeters = - if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll( - if (c.hasPathOrNull("toll")) c.getConfig("toll") - else com.typesafe.config.ConfigFactory.parseString("toll{}") - ), - tuning = BeamConfig.Beam.Agentsim.Tuning( - if (c.hasPathOrNull("tuning")) c.getConfig("tuning") - else com.typesafe.config.ConfigFactory.parseString("tuning{}") - ) + agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + randomSeedForPopulationSampling = if(c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) else None, + scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), + schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + snapLocationAndRemoveInvalidInputs = c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), + taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), + thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, + thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), + tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) ) } } - + case class Calibration( - counts: BeamConfig.Beam.Calibration.Counts, - google: BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio: scala.Double, - mode: BeamConfig.Beam.Calibration.Mode, - objectiveFunction: java.lang.String, - roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, - studyArea: BeamConfig.Beam.Calibration.StudyArea + counts : BeamConfig.Beam.Calibration.Counts, + google : BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio : scala.Double, + mode : BeamConfig.Beam.Calibration.Mode, + objectiveFunction : java.lang.String, + roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, + studyArea : BeamConfig.Beam.Calibration.StudyArea ) - object Calibration { - case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Int, - inputCountsFile: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Int, + inputCountsFile : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes ) - object Google { - case class TravelTimes( - enable: scala.Boolean, - iterationInterval: scala.Int, - minDistanceInMeters: scala.Double, - numDataPointsOver24Hours: scala.Int, - offPeakEnabled: scala.Boolean, - queryDate: java.lang.String, - tolls: scala.Boolean + enable : scala.Boolean, + iterationInterval : scala.Int, + minDistanceInMeters : scala.Double, + numDataPointsOver24Hours : scala.Int, + offPeakEnabled : scala.Boolean, + queryDate : java.lang.String, + tolls : scala.Boolean ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = - if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = - if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class Mode( - benchmarkFilePath: java.lang.String + benchmarkFilePath : java.lang.String ) - object Mode { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) - object RoadNetwork { - case class TravelTimes( - zoneBoundariesFilePath: java.lang.String, - zoneODTravelTimesFilePath: java.lang.String + zoneBoundariesFilePath : java.lang.String, + zoneODTravelTimesFilePath : java.lang.String ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = - if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = - if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class StudyArea( - enabled: scala.Boolean, - lat: scala.Double, - lon: scala.Double, - radius: scala.Double + enabled : scala.Boolean, + lat : scala.Double, + lon : scala.Double, + radius : scala.Double ) - object StudyArea { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - google = BeamConfig.Beam.Calibration.Google( - if (c.hasPathOrNull("google")) c.getConfig("google") - else com.typesafe.config.ConfigFactory.parseString("google{}") - ), - meanToCountsWeightRatio = - if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode( - if (c.hasPathOrNull("mode")) c.getConfig("mode") - else com.typesafe.config.ConfigFactory.parseString("mode{}") - ), - objectiveFunction = - if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") - else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( - if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") - else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") - ), - studyArea = BeamConfig.Beam.Calibration.StudyArea( - if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") - else com.typesafe.config.ConfigFactory.parseString("studyArea{}") - ) + counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), + meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), + objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), + studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) ) } } - + case class Cluster( - clusterType: scala.Option[java.lang.String], - enabled: scala.Boolean + clusterType : scala.Option[java.lang.String], + enabled : scala.Boolean ) - object Cluster { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor: BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval: scala.Int, - clearRoutedOutstandingWorkEnabled: scala.Boolean, - debugActorTimerIntervalInSec: scala.Int, - debugEnabled: scala.Boolean, - memoryConsumptionDisplayTimeoutInSec: scala.Int, - messageLogging: scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork: scala.Int, - stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation: BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives: scala.Boolean, - writeRealizedModeChoiceFile: scala.Boolean + actor : BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval : scala.Int, + clearRoutedOutstandingWorkEnabled : scala.Boolean, + debugActorTimerIntervalInSec : scala.Int, + debugEnabled : scala.Boolean, + memoryConsumptionDisplayTimeoutInSec : scala.Int, + messageLogging : scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork : scala.Int, + stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation : BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives : scala.Boolean, + writeRealizedModeChoiceFile : scala.Boolean ) - object Debug { - case class Actor( - logDepth: scala.Int + logDepth : scala.Int ) - object Actor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs: scala.Long, - checkMaxNumberOfMessagesEnabled: scala.Boolean, - defaultTimeoutMs: scala.Long, - enabled: scala.Boolean, - overallSimulationTimeoutMs: scala.Long, - thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs : scala.Long, + checkMaxNumberOfMessagesEnabled : scala.Boolean, + defaultTimeoutMs : scala.Long, + enabled : scala.Boolean, + overallSimulationTimeoutMs : scala.Long, + thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) - object StuckAgentDetection { - case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs: scala.Long, - triggerType: java.lang.String + actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs : scala.Long, + triggerType : java.lang.String ) - object Thresholds$Elm { - case class ActorTypeToMaxNumberOfMessages( - population: scala.Option[scala.Int], - rideHailAgent: scala.Option[scala.Int], - rideHailManager: scala.Option[scala.Int], - transitDriverAgent: scala.Option[scala.Int] + population : scala.Option[scala.Int], + rideHailAgent : scala.Option[scala.Int], + rideHailManager : scala.Option[scala.Int], + transitDriverAgent : scala.Option[scala.Int] ) - object ActorTypeToMaxNumberOfMessages { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = - if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = - BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") - else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") - ), - markAsStuckAfterMs = - if (c.hasPathOrNull("markAsStuckAfterMs")) - c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 20000, - triggerType = - if (c.hasPathOrNull("triggerType")) c.getString("triggerType") - else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), + markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, + triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = - if (c.hasPathOrNull("checkIntervalMs")) - c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 200, - checkMaxNumberOfMessagesEnabled = - !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = - if (c.hasPathOrNull("defaultTimeoutMs")) - c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = - if (c.hasPathOrNull("overallSimulationTimeoutMs")) - c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, + checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Debug.StuckAgentDetection - .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class TriggerMeasurer( - enabled: scala.Boolean, - writeStuckAgentDetectionConfig: scala.Boolean + enabled : scala.Boolean, + writeStuckAgentDetectionConfig : scala.Boolean ) - object TriggerMeasurer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = - !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram: scala.Boolean + createGCClassHistogram : scala.Boolean ) - object VmInformation { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor( - if (c.hasPathOrNull("actor")) c.getConfig("actor") - else com.typesafe.config.ConfigFactory.parseString("actor{}") - ), - agentTripScoresInterval = - if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = - c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = - if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = - if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) - c.getInt("memoryConsumptionDisplayTimeoutInSec") - else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = - if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) - c.getInt("secondsToWaitToClearRoutedOutstandingWork") - else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( - if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") - else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") - ), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( - if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") - else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") - ), - vmInformation = BeamConfig.Beam.Debug.VmInformation( - if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") - else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") - ), - writeModeChoiceAlternatives = - c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = - c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), + agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), + vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), + writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output: BeamConfig.Beam.Exchange.Output, - scenario: BeamConfig.Beam.Exchange.Scenario + output : BeamConfig.Beam.Exchange.Output, + scenario : BeamConfig.Beam.Exchange.Scenario ) - object Exchange { - case class Output( - activitySimSkimsEnabled: scala.Boolean, - geo: BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled : scala.Boolean, + geo : BeamConfig.Beam.Exchange.Output.Geo ) - object Output { - case class Geo( - filePath: scala.Option[java.lang.String] + filePath : scala.Option[java.lang.String] ) - object Geo { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = - c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo( - if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") - ) + activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) ) } } - + case class Scenario( - convertWgs2Utm: scala.Boolean, - fileFormat: java.lang.String, - folder: java.lang.String, - modeMap: scala.Option[scala.List[java.lang.String]], - source: java.lang.String, - urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm : scala.Boolean, + fileFormat : java.lang.String, + folder : java.lang.String, + modeMap : scala.Option[scala.List[java.lang.String]], + source : java.lang.String, + urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim ) - object Scenario { - case class Urbansim( - activitySimEnabled: scala.Boolean + activitySimEnabled : scala.Boolean ) - object Urbansim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ) + fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - scenario = BeamConfig.Beam.Exchange.Scenario( - if (c.hasPathOrNull("scenario")) c.getConfig("scenario") - else com.typesafe.config.ConfigFactory.parseString("scenario{}") - ) + output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) ) } } - + case class Experimental( - optimizer: BeamConfig.Beam.Experimental.Optimizer + optimizer : BeamConfig.Beam.Experimental.Optimizer ) - object Experimental { - case class Optimizer( - enabled: scala.Boolean + enabled : scala.Boolean ) - object Optimizer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer( - if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") - else com.typesafe.config.ConfigFactory.parseString("optimizer{}") - ) + optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) ) } } - + case class Input( - lastBaseOutputDir: java.lang.String, - simulationPrefix: java.lang.String + lastBaseOutputDir : java.lang.String, + simulationPrefix : java.lang.String ) - object Input { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn: scala.Boolean + keepConsoleAppenderOn : scala.Boolean ) - object Logger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level: java.lang.String + level : java.lang.String ) - object Metrics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation: scala.Boolean + writePlansAndStopSimulation : scala.Boolean ) - object Output { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = - c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory: scala.Boolean, - baseOutputDirectory: java.lang.String, - collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, - defaultWriteInterval: scala.Int, - displayPerformanceTimings: scala.Boolean, - events: BeamConfig.Beam.Outputs.Events, - generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval: scala.Int, - matsim: BeamConfig.Beam.Outputs.Matsim, - stats: BeamConfig.Beam.Outputs.Stats, - writeAnalysis: scala.Boolean, - writeEventsInterval: scala.Int, - writeGraphs: scala.Boolean, - writePlansInterval: scala.Int, - writeR5RoutesInterval: scala.Int + addTimestampToOutputDirectory : scala.Boolean, + baseOutputDirectory : java.lang.String, + collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, + defaultWriteInterval : scala.Int, + displayPerformanceTimings : scala.Boolean, + events : BeamConfig.Beam.Outputs.Events, + generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval : scala.Int, + matsim : BeamConfig.Beam.Outputs.Matsim, + stats : BeamConfig.Beam.Outputs.Stats, + writeAnalysis : scala.Boolean, + writeEventsInterval : scala.Int, + writeGraphs : scala.Boolean, + writePlansInterval : scala.Int, + writeR5RoutesInterval : scala.Int ) - object Outputs { - case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime: scala.Int, - startTime: scala.Int + endTime : scala.Int, + startTime : scala.Int ) - object GeneralizedLinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles: java.lang.String, - deleteRootFolderFiles: java.lang.String + deleteITERSFolderFiles : java.lang.String, + deleteRootFolderFiles : java.lang.String ) - object Matsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = - if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = - if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize: scala.Int + binSize : scala.Int ) - object Stats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = - !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = - if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = - !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( - "collectAndCreateBeamAnalysisAndGraphs" - ), - defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( - if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") - else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") - ), - generalizedLinkStatsInterval = - if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ), - stats = BeamConfig.Beam.Outputs.Stats( - if (c.hasPathOrNull("stats")) c.getConfig("stats") - else com.typesafe.config.ConfigFactory.parseString("stats{}") - ), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), + defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), + generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), + stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim: BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager: BeamConfig.Beam.Physsim.EventManager, - events: BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia: scala.Boolean, - eventsSampling: scala.Double, - flowCapacityFactor: scala.Double, - initializeRouterWithFreeFlowTimes: scala.Boolean, - inputNetworkFilePath: java.lang.String, - jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize: scala.Int, - linkStatsWriteInterval: scala.Int, - maxLinkLengthToApplySpeedScalingFactor: scala.Double, - name: java.lang.String, - network: BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath: java.lang.String, - parbprsim: BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize: scala.Double, - quick_fix_minCarSpeedInMetersPerSecond: scala.Double, - relaxation: BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim: scala.Boolean, - speedScalingFactor: scala.Double, - storageCapacityFactor: scala.Double, - writeEventsInterval: scala.Int, - writePlansInterval: scala.Int, - writeRouteHistoryInterval: scala.Int + bprsim : BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager : BeamConfig.Beam.Physsim.EventManager, + events : BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia : scala.Boolean, + eventsSampling : scala.Double, + flowCapacityFactor : scala.Double, + initializeRouterWithFreeFlowTimes : scala.Boolean, + inputNetworkFilePath : java.lang.String, + jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize : scala.Int, + linkStatsWriteInterval : scala.Int, + maxLinkLengthToApplySpeedScalingFactor : scala.Double, + name : java.lang.String, + network : BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath : java.lang.String, + parbprsim : BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize : scala.Double, + quick_fix_minCarSpeedInMetersPerSecond : scala.Double, + relaxation : BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim : scala.Boolean, + speedScalingFactor : scala.Double, + storageCapacityFactor : scala.Double, + writeEventsInterval : scala.Int, + writePlansInterval : scala.Int, + writeRouteHistoryInterval : scala.Int ) - object Physsim { - case class Bprsim( - inFlowAggregationTimeWindowInSeconds: scala.Int, - minFlowToUseBPRFunction: scala.Int, - travelTimeFunction: java.lang.String + inFlowAggregationTimeWindowInSeconds : scala.Int, + minFlowToUseBPRFunction : scala.Int, + travelTimeFunction : java.lang.String ) - object Bprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = - if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) - c.getInt("inFlowAggregationTimeWindowInSeconds") - else 900, - minFlowToUseBPRFunction = - if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, + minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor: scala.Double + congestionFactor : scala.Double ) - object CchRoutingAssignment { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax: scala.Int, - departureTimeShiftMin: scala.Int, - fractionOfEventsToDuplicate: scala.Double + departureTimeShiftMax : scala.Int, + departureTimeShiftMin : scala.Int, + fractionOfEventsToDuplicate : scala.Double ) - object DuplicatePTE { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = - if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = - if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = - if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads: scala.Int, - `type`: java.lang.String + numberOfThreads : scala.Int, + `type` : java.lang.String ) - object EventManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) - object Jdeqsim { - case class AgentSimPhysSimInterfaceDebugger( - enabled: scala.Boolean + enabled : scala.Boolean ) - object AgentSimPhysSimInterfaceDebugger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, - capacityPlansWriteInterval: scala.Int, - enabled: scala.Boolean, - minRoadCapacity: scala.Int, - minSpeedMetersPerSec: scala.Int, - speedAdjustmentFactor: scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, + capacityPlansWriteInterval : scala.Int, + enabled : scala.Boolean, + minRoadCapacity : scala.Int, + minSpeedMetersPerSec : scala.Int, + speedAdjustmentFactor : scala.Double ) - object Cacc { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = - if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) - c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") - else 1.3, - capacityPlansWriteInterval = - if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = - if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = - if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, + capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( - if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") - else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") - ), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - if (c.hasPathOrNull("cacc")) c.getConfig("cacc") - else com.typesafe.config.ConfigFactory.parseString("cacc{}") - ) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) ) } } - + case class Network( - maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) - object Network { - case class MaxSpeedInference( - enabled: scala.Boolean, - `type`: java.lang.String + enabled : scala.Boolean, + `type` : java.lang.String ) - object MaxSpeedInference { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled: scala.Boolean, - livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled : scala.Boolean, + livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) - object OverwriteRoadTypeProperties { - case class LivingStreet( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object LivingStreet { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Minor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Motorway { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object MotorwayLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Primary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object PrimaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Residential { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Secondary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object SecondaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Tertiary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TertiaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Trunk { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TrunkLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Unclassified { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") - else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") - ), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - if (c.hasPathOrNull("minor")) c.getConfig("minor") - else com.typesafe.config.ConfigFactory.parseString("minor{}") - ), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - if (c.hasPathOrNull("motorway")) c.getConfig("motorway") - else com.typesafe.config.ConfigFactory.parseString("motorway{}") - ), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") - else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") - ), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - if (c.hasPathOrNull("primary")) c.getConfig("primary") - else com.typesafe.config.ConfigFactory.parseString("primary{}") - ), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") - else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") - ), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - if (c.hasPathOrNull("residential")) c.getConfig("residential") - else com.typesafe.config.ConfigFactory.parseString("residential{}") - ), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - if (c.hasPathOrNull("secondary")) c.getConfig("secondary") - else com.typesafe.config.ConfigFactory.parseString("secondary{}") - ), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") - else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") - ), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") - else com.typesafe.config.ConfigFactory.parseString("tertiary{}") - ), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") - else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") - ), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - if (c.hasPathOrNull("trunk")) c.getConfig("trunk") - else com.typesafe.config.ConfigFactory.parseString("trunk{}") - ), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") - else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") - ), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") - else com.typesafe.config.ConfigFactory.parseString("unclassified{}") - ) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( - if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") - else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") - ), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") - else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") - ) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) ) } } - + case class Parbprsim( - numberOfClusters: scala.Int, - syncInterval: scala.Int + numberOfClusters : scala.Int, + syncInterval : scala.Int ) - object Parbprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier: scala.Double, - enabled: scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime: scala.Int + additionalTravelTimeMultiplier : scala.Double, + enabled : scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime : scala.Int ) - object PickUpDropOffAnalysis { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = - if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") - else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = - if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) - c.getInt("secondsFromPickUpPropOffToAffectTravelTime") - else 600 + additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 ) } } - + case class Relaxation( - experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type`: java.lang.String + experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type` : java.lang.String ) - object Relaxation { - case class Experiment20( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment20 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment21 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment30 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment40 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment50 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment51 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment52 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( - if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") - else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") - ), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( - if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") - else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") - ), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( - if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") - else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") - ), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( - if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") - else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") - ), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( - if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") - else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") - ), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( - if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") - else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") - ), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( - if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") - else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") - ), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim( - if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") - else com.typesafe.config.ConfigFactory.parseString("bprsim{}") - ), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( - if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") - else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") - ), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( - if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") - else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") - ), - eventManager = BeamConfig.Beam.Physsim.EventManager( - if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") - else com.typesafe.config.ConfigFactory.parseString("eventManager{}") - ), - events = BeamConfig.Beam.Physsim.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - eventsForFullVersionOfVia = - !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = - !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = - if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") - else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( - if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") - else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") - ), - linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = - if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = - if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) - c.getDouble("maxLinkLengthToApplySpeedScalingFactor") - else 50.0, - name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - overwriteLinkParamPath = - if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim( - if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") - else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") - ), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") - else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") - ), - ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = - if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) - c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") - else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation( - if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") - else com.typesafe.config.ConfigFactory.parseString("relaxation{}") - ), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = - if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = - if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), + eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), + events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), + linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, + name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), + ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1: scala.Double, - ModuleProbability_2: scala.Double, - ModuleProbability_3: scala.Double, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - clearModes: BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation: scala.Double, - maxAgentPlanMemorySize: scala.Int + ModuleProbability_1 : scala.Double, + ModuleProbability_2 : scala.Double, + ModuleProbability_3 : scala.Double, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + clearModes : BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation : scala.Double, + maxAgentPlanMemorySize : scala.Int ) - object Replanning { - case class ClearModes( - iteration: scala.Int, - modes: scala.Option[scala.List[java.lang.String]], - strategy: java.lang.String + iteration : scala.Int, + modes : scala.Option[scala.List[java.lang.String]], + strategy : java.lang.String ) - object ClearModes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes( - if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") - else com.typesafe.config.ConfigFactory.parseString("clearModes{}") - ), - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getDouble("fractionOfIterationsToDisableInnovation") - else Double.PositiveInfinity, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim: BeamConfig.Beam.Router.Skim + skim : BeamConfig.Beam.Router.Skim ) - object Router { - case class Skim( - activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims: scala.Int, - origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval: scala.Int, - writeSkimsInterval: scala.Int + activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims : scala.Int, + origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval : scala.Int, + writeSkimsInterval : scala.Int ) - object Skim { - case class ActivitySimSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object ActivitySimSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object DriveTimeSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") - else "skimsTravelTimeObservedVsSimulated", - name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", + name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String, - poolingTravelTimeOveheadFactor: scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, - writeFullSkimsInterval: scala.Int + fileBaseName : java.lang.String, + name : java.lang.String, + poolingTravelTimeOveheadFactor : scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, + writeFullSkimsInterval : scala.Int ) - object OriginDestinationSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = - if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") - else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = - if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) - c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") - else 0, - writeFullSkimsInterval = - if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, + writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName: java.lang.String, - geoHierarchy: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + geoHierarchy : java.lang.String, + name : java.lang.String ) - object TazSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object TransitCrowdingSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") - else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") - ), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") - else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") - ), - keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") - else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") - ), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( - if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") - else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") - ), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") - else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") - ), - writeAggregatedSkimsInterval = - if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), + keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), + writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim( - if (c.hasPathOrNull("skim")) c.getConfig("skim") - else com.typesafe.config.ConfigFactory.parseString("skim{}") - ) + skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) ) } } - + case class Routing( - baseDate: java.lang.String, - carRouter: java.lang.String, - gh: BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS: scala.Int, - overrideNetworkTravelTimesUsingSkims: scala.Boolean, - r5: BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor: scala.Double, - startingIterationForTravelTimesMSA: scala.Int, - transitOnStreetNetwork: scala.Boolean, - writeRoutingStatistic: scala.Boolean + baseDate : java.lang.String, + carRouter : java.lang.String, + gh : BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS : scala.Int, + overrideNetworkTravelTimesUsingSkims : scala.Boolean, + r5 : BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor : scala.Double, + startingIterationForTravelTimesMSA : scala.Int, + transitOnStreetNetwork : scala.Boolean, + writeRoutingStatistic : scala.Boolean ) - object Routing { - case class Gh( - useAlternativeRoutes: scala.Boolean + useAlternativeRoutes : scala.Boolean ) - object Gh { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath: java.lang.String, - bikeLaneScaleFactor: scala.Double, - departureWindow: scala.Double, - directory: java.lang.String, - directory2: scala.Option[java.lang.String], - linkRadiusMeters: scala.Double, - mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples: scala.Int, - osmMapdbFile: java.lang.String, - travelTimeNoiseFraction: scala.Double + bikeLaneLinkIdsFilePath : java.lang.String, + bikeLaneScaleFactor : scala.Double, + departureWindow : scala.Double, + directory : java.lang.String, + directory2 : scala.Option[java.lang.String], + linkRadiusMeters : scala.Double, + mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples : scala.Int, + osmMapdbFile : java.lang.String, + travelTimeNoiseFraction : scala.Double ) - object R5 { - case class MNetBuilder( - fromCRS: java.lang.String, - toCRS: java.lang.String + fromCRS : java.lang.String, + toCRS : java.lang.String ) - object MNetBuilder { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike: scala.Int + bike : scala.Int ) - object MaxDistanceLimitByModeInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = - if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = - if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( - if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") - else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") - ), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") - ), - numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmMapdbFile = - if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") - else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = - if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), + numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh( - if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") - ), - minimumPossibleSkimBasedTravelTimeInS = - if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) - c.getInt("minimumPossibleSkimBasedTravelTimeInS") - else 60, - overrideNetworkTravelTimesUsingSkims = - c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( - "overrideNetworkTravelTimesUsingSkims" - ), - r5 = BeamConfig.Beam.Routing.R5( - if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") - ), - skimTravelTimesScalingFactor = - if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = - if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") - else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), + minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, + overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), + r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), + skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric: BeamConfig.Beam.Sim.Metric, - termination: BeamConfig.Beam.Sim.Termination + metric : BeamConfig.Beam.Sim.Metric, + termination : BeamConfig.Beam.Sim.Termination ) - object Sim { - case class Metric( - collector: BeamConfig.Beam.Sim.Metric.Collector + collector : BeamConfig.Beam.Sim.Metric.Collector ) - object Metric { - case class Collector( - influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics: java.lang.String + influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics : java.lang.String ) - object Collector { - case class InfluxDbSimulationMetricCollector( - connectionString: java.lang.String, - database: java.lang.String + connectionString : java.lang.String, + database : java.lang.String ) - object InfluxDbSimulationMetricCollector { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = - if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = - BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - if (c.hasPathOrNull("influxDbSimulationMetricCollector")) - c.getConfig("influxDbSimulationMetricCollector") - else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") - ), - metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), + metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector( - if (c.hasPathOrNull("collector")) c.getConfig("collector") - else com.typesafe.config.ConfigFactory.parseString("collector{}") - ) + collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) ) } } - + case class Termination( - criterionName: java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName : java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) - object Termination { - case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration: scala.Int, - minLastIteration: scala.Int, - relativeTolerance: scala.Double + maxLastIteration : scala.Int, + minLastIteration : scala.Int, + relativeTolerance : scala.Double ) - object TerminateAtRideHailFleetStoredElectricityConvergence { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = - if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = - BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) - c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") - else - com.typesafe.config.ConfigFactory - .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") - ) + criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric( - if (c.hasPathOrNull("metric")) c.getConfig("metric") - else com.typesafe.config.ConfigFactory.parseString("metric{}") - ), - termination = BeamConfig.Beam.Sim.Termination( - if (c.hasPathOrNull("termination")) c.getConfig("termination") - else com.typesafe.config.ConfigFactory.parseString("termination{}") - ) + metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), + termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) ) } } - + case class Spatial( - boundingBoxBuffer: scala.Int, - localCRS: java.lang.String + boundingBoxBuffer : scala.Int, + localCRS : java.lang.String ) - object Spatial { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear ) - object Urbansim { - case class BackgroundODSkimsCreator( - calculationTimeoutHours: scala.Int, - enabled: scala.Boolean, - maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes: scala.Int, - peakHours: scala.Option[scala.List[scala.Double]], - routerType: java.lang.String, - skimsGeoType: java.lang.String, - skimsKind: java.lang.String + calculationTimeoutHours : scala.Int, + enabled : scala.Boolean, + maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes : scala.Int, + peakHours : scala.Option[scala.List[scala.Double]], + routerType : java.lang.String, + skimsGeoType : java.lang.String, + skimsKind : java.lang.String ) - object BackgroundODSkimsCreator { - case class MaxTravelDistanceInMeters( - bike: scala.Int, - walk: scala.Int + bike : scala.Int, + walk : scala.Int ) - object MaxTravelDistanceInMeters { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive: scala.Boolean, - transit: scala.Boolean, - walk: scala.Boolean + drive : scala.Boolean, + transit : scala.Boolean, + walk : scala.Boolean ) - object ModesToBuild { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = - if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") - ), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") - else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") - ), - numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), + numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes: scala.Double, - bike: scala.Double, - car: scala.Double, - drive_transit: scala.Double, - walk: scala.Double, - walk_transit: scala.Double + allModes : scala.Double, + bike : scala.Double, + car : scala.Double, + drive_transit : scala.Double, + walk : scala.Double, + walk_transit : scala.Double ) - object FractionOfModesToClear { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") - else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") - ), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( - if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") - else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") - ) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) ) } } - + case class WarmStart( - path: java.lang.String, - prepareData: scala.Boolean, - samplePopulationIntegerFlag: scala.Int, - skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type`: java.lang.String + path : java.lang.String, + prepareData : scala.Boolean, + samplePopulationIntegerFlag : scala.Int, + skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type` : java.lang.String ) - object WarmStart { - case class SkimsFilePaths$Elm( - skimType: java.lang.String, - skimsFilePath: java.lang.String + skimType : java.lang.String, + skimsFilePath : java.lang.String ) - object SkimsFilePaths$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if (c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = - if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = - if (c.hasPathOrNull("skimsFilePaths")) - scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) - else None, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if(c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim( - if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") - else com.typesafe.config.ConfigFactory.parseString("agentsim{}") - ), - calibration = BeamConfig.Beam.Calibration( - if (c.hasPathOrNull("calibration")) c.getConfig("calibration") - else com.typesafe.config.ConfigFactory.parseString("calibration{}") - ), - cluster = BeamConfig.Beam.Cluster( - if (c.hasPathOrNull("cluster")) c.getConfig("cluster") - else com.typesafe.config.ConfigFactory.parseString("cluster{}") - ), - debug = BeamConfig.Beam.Debug( - if (c.hasPathOrNull("debug")) c.getConfig("debug") - else com.typesafe.config.ConfigFactory.parseString("debug{}") - ), - exchange = BeamConfig.Beam.Exchange( - if (c.hasPathOrNull("exchange")) c.getConfig("exchange") - else com.typesafe.config.ConfigFactory.parseString("exchange{}") - ), - experimental = BeamConfig.Beam.Experimental( - if (c.hasPathOrNull("experimental")) c.getConfig("experimental") - else com.typesafe.config.ConfigFactory.parseString("experimental{}") - ), - input = BeamConfig.Beam.Input( - if (c.hasPathOrNull("input")) c.getConfig("input") - else com.typesafe.config.ConfigFactory.parseString("input{}") - ), - inputDirectory = - if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger( - if (c.hasPathOrNull("logger")) c.getConfig("logger") - else com.typesafe.config.ConfigFactory.parseString("logger{}") - ), - metrics = BeamConfig.Beam.Metrics( - if (c.hasPathOrNull("metrics")) c.getConfig("metrics") - else com.typesafe.config.ConfigFactory.parseString("metrics{}") - ), - output = BeamConfig.Beam.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - outputs = BeamConfig.Beam.Outputs( - if (c.hasPathOrNull("outputs")) c.getConfig("outputs") - else com.typesafe.config.ConfigFactory.parseString("outputs{}") - ), - physsim = BeamConfig.Beam.Physsim( - if (c.hasPathOrNull("physsim")) c.getConfig("physsim") - else com.typesafe.config.ConfigFactory.parseString("physsim{}") - ), - replanning = BeamConfig.Beam.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - router = BeamConfig.Beam.Router( - if (c.hasPathOrNull("router")) c.getConfig("router") - else com.typesafe.config.ConfigFactory.parseString("router{}") - ), - routing = BeamConfig.Beam.Routing( - if (c.hasPathOrNull("routing")) c.getConfig("routing") - else com.typesafe.config.ConfigFactory.parseString("routing{}") - ), - sim = BeamConfig.Beam.Sim( - if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") - ), - spatial = BeamConfig.Beam.Spatial( - if (c.hasPathOrNull("spatial")) c.getConfig("spatial") - else com.typesafe.config.ConfigFactory.parseString("spatial{}") - ), - urbansim = BeamConfig.Beam.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart( - if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") - else com.typesafe.config.ConfigFactory.parseString("warmStart{}") - ) + actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), + calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), + cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), + debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), + exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), + experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), + input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), + inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), + metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), + output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), + physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), + replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), + routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), + sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), + spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), + urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) ) } } - + case class Matsim( - conversion: BeamConfig.Matsim.Conversion, - modules: BeamConfig.Matsim.Modules + conversion : BeamConfig.Matsim.Conversion, + modules : BeamConfig.Matsim.Modules ) - object Matsim { - case class Conversion( - defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles: scala.Boolean, - matsimNetworkFile: java.lang.String, - osmFile: java.lang.String, - populationFile: java.lang.String, - scenarioDirectory: java.lang.String, - shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile: java.lang.String + defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles : scala.Boolean, + matsimNetworkFile : java.lang.String, + osmFile : java.lang.String, + populationFile : java.lang.String, + scenarioDirectory : java.lang.String, + shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile : java.lang.String ) - object Conversion { - case class DefaultHouseholdIncome( - currency: java.lang.String, - period: java.lang.String, - value: scala.Int + currency : java.lang.String, + period : java.lang.String, + value : scala.Int ) - object DefaultHouseholdIncome { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if (c.hasPathOrNull("period")) c.getString("period") else "year", - value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if(c.hasPathOrNull("period")) c.getString("period") else "year", + value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile: java.lang.String, - tazIdFieldName: java.lang.String + shapeFile : java.lang.String, + tazIdFieldName : java.lang.String ) - object ShapeConfig { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") - else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") - ), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = - if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = - if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = - if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") - else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( - if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") - else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") - ), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode: BeamConfig.Matsim.Modules.ChangeMode, - controler: BeamConfig.Matsim.Modules.Controler, - counts: BeamConfig.Matsim.Modules.Counts, - global: BeamConfig.Matsim.Modules.Global, - households: BeamConfig.Matsim.Modules.Households, - linkStats: BeamConfig.Matsim.Modules.LinkStats, - network: BeamConfig.Matsim.Modules.Network, - parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, - plans: BeamConfig.Matsim.Modules.Plans, - qsim: BeamConfig.Matsim.Modules.Qsim, - strategy: BeamConfig.Matsim.Modules.Strategy, - transit: BeamConfig.Matsim.Modules.Transit, - vehicles: BeamConfig.Matsim.Modules.Vehicles + changeMode : BeamConfig.Matsim.Modules.ChangeMode, + controler : BeamConfig.Matsim.Modules.Controler, + counts : BeamConfig.Matsim.Modules.Counts, + global : BeamConfig.Matsim.Modules.Global, + households : BeamConfig.Matsim.Modules.Households, + linkStats : BeamConfig.Matsim.Modules.LinkStats, + network : BeamConfig.Matsim.Modules.Network, + parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, + plans : BeamConfig.Matsim.Modules.Plans, + qsim : BeamConfig.Matsim.Modules.Qsim, + strategy : BeamConfig.Matsim.Modules.Strategy, + transit : BeamConfig.Matsim.Modules.Transit, + vehicles : BeamConfig.Matsim.Modules.Vehicles ) - object Modules { - case class ChangeMode( - modes: java.lang.String + modes : java.lang.String ) - object ChangeMode { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat: java.lang.String, - firstIteration: scala.Int, - lastIteration: scala.Int, - mobsim: java.lang.String, - outputDirectory: java.lang.String, - overwriteFiles: java.lang.String + eventsFileFormat : java.lang.String, + firstIteration : scala.Int, + lastIteration : scala.Int, + mobsim : java.lang.String, + outputDirectory : java.lang.String, + overwriteFiles : java.lang.String ) - object Controler { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = - if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Double, - inputCountsFile: java.lang.String, - outputformat: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Double, + inputCountsFile : java.lang.String, + outputformat : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem: java.lang.String, - randomSeed: scala.Int + coordinateSystem : java.lang.String, + randomSeed : scala.Int ) - object Global { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile: java.lang.String, - inputHouseholdAttributesFile: java.lang.String + inputFile : java.lang.String, + inputHouseholdAttributesFile : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = - if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = - if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") - else "/test/input/beamville/householdAttributes.xml" + inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations: scala.Int, - writeLinkStatsInterval: scala.Int + averageLinkStatsOverIterations : scala.Int, + writeLinkStatsInterval : scala.Int ) - object LinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = - if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = - if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile: java.lang.String + inputNetworkFile : java.lang.String ) - object Network { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = - if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") - else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents: scala.Int, - numberOfThreads: scala.Int, - oneThreadPerHandler: scala.Boolean, - synchronizeOnSimSteps: scala.Boolean + estimatedNumberOfEvents : scala.Int, + numberOfThreads : scala.Int, + oneThreadPerHandler : scala.Boolean, + synchronizeOnSimSteps : scala.Boolean ) - object ParallelEventHandling { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = - if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta: scala.Long, - earlyDeparture: scala.Long, - lateArrival: scala.Long, - learningRate: scala.Long, - parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing: scala.Long, - traveling: scala.Long, - waiting: scala.Long, - writeExperiencedPlans: scala.Boolean + BrainExpBeta : scala.Long, + earlyDeparture : scala.Long, + lateArrival : scala.Long, + learningRate : scala.Long, + parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing : scala.Long, + traveling : scala.Long, + waiting : scala.Long, + writeExperiencedPlans : scala.Boolean ) - object PlanCalcScore { - case class Parameterset$Elm( - activityType: java.lang.String, - priority: scala.Int, - scoringThisActivityAtAll: scala.Boolean, - `type`: java.lang.String, - typicalDuration: java.lang.String, - typicalDurationScoreComputation: java.lang.String + activityType : java.lang.String, + priority : scala.Int, + scoringThisActivityAtAll : scala.Boolean, + `type` : java.lang.String, + typicalDuration : java.lang.String, + typicalDurationScoreComputation : java.lang.String ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = - !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = - if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") - else "uniform" + activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = - if (c.hasPathOrNull("BrainExpBeta")) - c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) - else 2, - earlyDeparture = - if (c.hasPathOrNull("earlyDeparture")) - c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, - lateArrival = - if (c.hasPathOrNull("lateArrival")) - c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) - else -18, - learningRate = - if (c.hasPathOrNull("learningRate")) - c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) - else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = - if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) - else 6, - traveling = - if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) - else -6, - waiting = - if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, + BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, + earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, + learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, + traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, + waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.PlanCalcScore - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Plans( - inputPersonAttributesFile: java.lang.String, - inputPlansFile: java.lang.String + inputPersonAttributesFile : java.lang.String, + inputPlansFile : java.lang.String ) - object Plans { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = - if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") - else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = - if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") - else "/test/input/beamville/population.xml" + inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime: java.lang.String, - snapshotperiod: java.lang.String, - startTime: java.lang.String + endTime : java.lang.String, + snapshotperiod : java.lang.String, + startTime : java.lang.String ) - object Qsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1: scala.Int, - ModuleProbability_2: scala.Int, - ModuleProbability_3: scala.Int, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - fractionOfIterationsToDisableInnovation: scala.Int, - maxAgentPlanMemorySize: scala.Int, - parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval: java.lang.String + ModuleProbability_1 : scala.Int, + ModuleProbability_2 : scala.Int, + ModuleProbability_3 : scala.Int, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + fractionOfIterationsToDisableInnovation : scala.Int, + maxAgentPlanMemorySize : scala.Int, + parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval : java.lang.String ) - object Strategy { - case class Parameterset$Elm( - disableAfterIteration: scala.Int, - strategyName: java.lang.String, - `type`: java.lang.String, - weight: scala.Int + disableAfterIteration : scala.Int, + strategyName : java.lang.String, + `type` : java.lang.String, + weight : scala.Int ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getInt("fractionOfIterationsToDisableInnovation") - else 999999, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = - if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") - else "WorstPlanForRemovalSelector" - ) - } - - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" + ) + } + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.Strategy - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Transit( - transitModes: java.lang.String, - useTransit: scala.Boolean, - vehiclesFile: java.lang.String + transitModes : java.lang.String, + useTransit : scala.Boolean, + vehiclesFile : java.lang.String ) - object Transit { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile: java.lang.String + vehiclesFile : java.lang.String ) - object Vehicles { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode( - if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") - else com.typesafe.config.ConfigFactory.parseString("changeMode{}") - ), - controler = BeamConfig.Matsim.Modules.Controler( - if (c.hasPathOrNull("controler")) c.getConfig("controler") - else com.typesafe.config.ConfigFactory.parseString("controler{}") - ), - counts = BeamConfig.Matsim.Modules.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - global = BeamConfig.Matsim.Modules.Global( - if (c.hasPathOrNull("global")) c.getConfig("global") - else com.typesafe.config.ConfigFactory.parseString("global{}") - ), - households = BeamConfig.Matsim.Modules.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - linkStats = BeamConfig.Matsim.Modules.LinkStats( - if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") - else com.typesafe.config.ConfigFactory.parseString("linkStats{}") - ), - network = BeamConfig.Matsim.Modules.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( - if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") - else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") - ), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( - if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") - else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") - ), - plans = BeamConfig.Matsim.Modules.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - qsim = BeamConfig.Matsim.Modules.Qsim( - if (c.hasPathOrNull("qsim")) c.getConfig("qsim") - else com.typesafe.config.ConfigFactory.parseString("qsim{}") - ), - strategy = BeamConfig.Matsim.Modules.Strategy( - if (c.hasPathOrNull("strategy")) c.getConfig("strategy") - else com.typesafe.config.ConfigFactory.parseString("strategy{}") - ), - transit = BeamConfig.Matsim.Modules.Transit( - if (c.hasPathOrNull("transit")) c.getConfig("transit") - else com.typesafe.config.ConfigFactory.parseString("transit{}") - ), - vehicles = BeamConfig.Matsim.Modules.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) + changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), + controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), + counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), + households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), + network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), + plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), + strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), + transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), + vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion( - if (c.hasPathOrNull("conversion")) c.getConfig("conversion") - else com.typesafe.config.ConfigFactory.parseString("conversion{}") - ), - modules = BeamConfig.Matsim.Modules( - if (c.hasPathOrNull("modules")) c.getConfig("modules") - else com.typesafe.config.ConfigFactory.parseString("modules{}") - ) + conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), + modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam( - if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") - ), - matsim = BeamConfig.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ) + beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), + matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) ) } - private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - - private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - - private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { + private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ( - (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number] - ) throw $_expE(cv, "double") + if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - - private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { + private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException( - cv.origin.lineNumber + + new java.lang.RuntimeException(cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) - ) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) } - - private def $_str(cv: com.typesafe.config.ConfigValue) = + private def $_str(cv:com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } + From c83452e192acaee7e89188f4860aecf6b6640a80 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 3 Jun 2022 00:34:10 -0700 Subject: [PATCH 104/307] sample overnight charging --- .../agents/household/HouseholdActor.scala | 14 +- .../household/HouseholdFleetManager.scala | 15 +- .../scala/beam/sim/config/BeamConfig.scala | 5603 +++++++++++------ 3 files changed, 3639 insertions(+), 1993 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index 63191c35c31..5f665ecd652 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -54,6 +54,7 @@ import java.util.concurrent.atomic.AtomicReference import scala.collection.mutable import scala.concurrent.{ExecutionContext, Future} import scala.jdk.CollectionConverters.collectionAsScalaIterableConverter +import scala.util.Random object HouseholdActor { @@ -164,6 +165,8 @@ object HouseholdActor { implicit val executionContext: ExecutionContext = context.dispatcher implicit val debug: Debug = beamServices.beamConfig.beam.debug + private val rand = new Random(beamScenario.beamConfig.matsim.modules.global.randomSeed) + protected val generateEmergencyHousehold: Boolean = beamScenario.beamConfig.beam.agentsim.agents.vehicles.generateEmergencyHouseholdVehicleWhenPlansRequireIt @@ -585,14 +588,9 @@ object HouseholdActor { triggerId = triggerId, searchMode = ParkingSearchMode.Init ) - if ( - vehicle.isEV && - beamScenario.beamConfig.beam.agentsim.chargingNetworkManager.overnightChargingEnabled && - vehicle.isRefuelNeeded( - beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.home.refuelRequiredThresholdInMeters, - beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters - ) - ) + val probabilityOfOvernightCharging = + rand.nextDouble() <= beamServices.beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize + if (vehicle.isEV && probabilityOfOvernightCharging) chargingNetworkManager ? inquiry else parkingManager ? inquiry } diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 48cdf4aa5ae..41486e8c359 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -28,6 +28,7 @@ import org.matsim.api.core.v01.{Coord, Id} import java.util.concurrent.TimeUnit import scala.collection.mutable import scala.concurrent.{ExecutionContext, Future} +import scala.util.Random class HouseholdFleetManager( parkingManager: ActorRef, @@ -52,6 +53,8 @@ class HouseholdFleetManager( private val trackingVehicleAssignmentAtInitialization = mutable.HashMap.empty[Id[BeamVehicle], Id[Person]] + private val rand = new Random(beamConfig.matsim.modules.global.randomSeed) + override def loggedReceive: Receive = { case ResolvedParkingResponses(triggerId, xs) => logger.debug(s"ResolvedParkingResponses ($triggerId, $xs)") @@ -100,14 +103,10 @@ class HouseholdFleetManager( triggerId = triggerId, searchMode = ParkingSearchMode.Init ) - if ( - vehicle.isEV && - beamConfig.beam.agentsim.chargingNetworkManager.overnightChargingEnabled && - vehicle.isRefuelNeeded( - beamConfig.beam.agentsim.agents.vehicles.destination.home.refuelRequiredThresholdInMeters, - beamConfig.beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters - ) - ) (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) + val probabilityOfOvernightCharging = + rand.nextDouble() <= beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize + if (vehicle.isEV && probabilityOfOvernightCharging) + (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) else (parkingManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) } } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index a8a50bf5665..da0e790459d 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,3574 +3,5223 @@ package beam.sim.config case class BeamConfig( - beam : BeamConfig.Beam, - matsim : BeamConfig.Matsim + beam: BeamConfig.Beam, + matsim: BeamConfig.Matsim ) + object BeamConfig { + case class Beam( - actorSystemName : java.lang.String, - agentsim : BeamConfig.Beam.Agentsim, - calibration : BeamConfig.Beam.Calibration, - cluster : BeamConfig.Beam.Cluster, - debug : BeamConfig.Beam.Debug, - exchange : BeamConfig.Beam.Exchange, - experimental : BeamConfig.Beam.Experimental, - input : BeamConfig.Beam.Input, - inputDirectory : java.lang.String, - logger : BeamConfig.Beam.Logger, - metrics : BeamConfig.Beam.Metrics, - output : BeamConfig.Beam.Output, - outputs : BeamConfig.Beam.Outputs, - physsim : BeamConfig.Beam.Physsim, - replanning : BeamConfig.Beam.Replanning, - router : BeamConfig.Beam.Router, - routing : BeamConfig.Beam.Routing, - sim : BeamConfig.Beam.Sim, - spatial : BeamConfig.Beam.Spatial, - urbansim : BeamConfig.Beam.Urbansim, - useLocalWorker : scala.Boolean, - warmStart : BeamConfig.Beam.WarmStart + actorSystemName: java.lang.String, + agentsim: BeamConfig.Beam.Agentsim, + calibration: BeamConfig.Beam.Calibration, + cluster: BeamConfig.Beam.Cluster, + debug: BeamConfig.Beam.Debug, + exchange: BeamConfig.Beam.Exchange, + experimental: BeamConfig.Beam.Experimental, + input: BeamConfig.Beam.Input, + inputDirectory: java.lang.String, + logger: BeamConfig.Beam.Logger, + metrics: BeamConfig.Beam.Metrics, + output: BeamConfig.Beam.Output, + outputs: BeamConfig.Beam.Outputs, + physsim: BeamConfig.Beam.Physsim, + replanning: BeamConfig.Beam.Replanning, + router: BeamConfig.Beam.Router, + routing: BeamConfig.Beam.Routing, + sim: BeamConfig.Beam.Sim, + spatial: BeamConfig.Beam.Spatial, + urbansim: BeamConfig.Beam.Urbansim, + useLocalWorker: scala.Boolean, + warmStart: BeamConfig.Beam.WarmStart ) + object Beam { + case class Agentsim( - agentSampleSizeAsFractionOfPopulation : scala.Double, - agents : BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime : java.lang.String, - firstIteration : scala.Int, - fractionOfPlansWithSingleActivity : scala.Double, - h3taz : BeamConfig.Beam.Agentsim.H3taz, - lastIteration : scala.Int, - populationAdjustment : java.lang.String, - randomSeedForPopulationSampling : scala.Option[scala.Int], - scenarios : BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow : scala.Int, - simulationName : java.lang.String, - snapLocationAndRemoveInvalidInputs : scala.Boolean, - taz : BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters : scala.Int, - thresholdForWalkingInMeters : scala.Int, - timeBinSize : scala.Int, - toll : BeamConfig.Beam.Agentsim.Toll, - tuning : BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation: scala.Double, + agents: BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime: java.lang.String, + firstIteration: scala.Int, + fractionOfPlansWithSingleActivity: scala.Double, + h3taz: BeamConfig.Beam.Agentsim.H3taz, + lastIteration: scala.Int, + populationAdjustment: java.lang.String, + randomSeedForPopulationSampling: scala.Option[scala.Int], + scenarios: BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow: scala.Int, + simulationName: java.lang.String, + snapLocationAndRemoveInvalidInputs: scala.Boolean, + taz: BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters: scala.Int, + thresholdForWalkingInMeters: scala.Int, + timeBinSize: scala.Int, + toll: BeamConfig.Beam.Agentsim.Toll, + tuning: BeamConfig.Beam.Agentsim.Tuning ) + object Agentsim { + case class Agents( - activities : BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType : java.lang.String, - freight : BeamConfig.Beam.Agentsim.Agents.Freight, - households : BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking : BeamConfig.Beam.Agentsim.Agents.Parking, - plans : BeamConfig.Beam.Agentsim.Agents.Plans, - population : BeamConfig.Beam.Agentsim.Agents.Population, - ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles + activities: BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType: java.lang.String, + freight: BeamConfig.Beam.Agentsim.Agents.Freight, + households: BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking: BeamConfig.Beam.Agentsim.Agents.Parking, + plans: BeamConfig.Beam.Agentsim.Agents.Plans, + population: BeamConfig.Beam.Agentsim.Agents.Population, + ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles ) + object Agents { + case class Activities( - activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] ) + object Activities { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None + activityTypeToFixedDurationMap = + if (c.hasPathOrNull("activityTypeToFixedDurationMap")) + scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) + else None ) } } - + case class Freight( - carrierParkingFilePath : scala.Option[java.lang.String], - carriersFilePath : java.lang.String, - convertWgs2Utm : scala.Boolean, - enabled : scala.Boolean, - generateFixedActivitiesDurations : scala.Boolean, - name : java.lang.String, - plansFilePath : java.lang.String, - reader : java.lang.String, - replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath : java.lang.String + carrierParkingFilePath: scala.Option[java.lang.String], + carriersFilePath: java.lang.String, + convertWgs2Utm: scala.Boolean, + enabled: scala.Boolean, + generateFixedActivitiesDurations: scala.Boolean, + name: java.lang.String, + plansFilePath: java.lang.String, + reader: java.lang.String, + replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath: java.lang.String ) + object Freight { + case class Replanning( - departureTime : scala.Int, - disableAfterIteration : scala.Int, - strategy : java.lang.String + departureTime: scala.Int, + disableAfterIteration: scala.Int, + strategy: java.lang.String ) + object Replanning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", - reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = + if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = + if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") + else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = + c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = + if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") + else "/test/input/beamville/freight/payload-plans.csv", + reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + toursFilePath = + if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") + else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath : java.lang.String, - inputHouseholdAttributesFilePath : java.lang.String + inputFilePath: java.lang.String, + inputHouseholdAttributesFilePath: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = + if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") + else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = + if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") + else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime : scala.Double, - highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts : scala.Int, - minimumValueOfTime : scala.Double, - modeChoiceClass : java.lang.String, - modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT : scala.Boolean, - overrideAutomationLevel : scala.Int, - poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] + defaultValueOfTime: scala.Double, + highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts: scala.Int, + minimumValueOfTime: scala.Double, + modeChoiceClass: java.lang.String, + modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT: scala.Boolean, + overrideAutomationLevel: scala.Int, + poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] ) + object ModalBehaviors { + case class HighTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) + object HighTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class Lccm( - filePath : java.lang.String + filePath: java.lang.String ) + object Lccm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) + object LowTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class ModeVotMultiplier( - CAV : scala.Double, - bike : scala.Double, - drive : scala.Double, - rideHail : scala.Double, - rideHailPooled : scala.Double, - rideHailTransit : scala.Double, - transit : scala.Double, - waiting : scala.Double, - walk : scala.Double + CAV: scala.Double, + bike: scala.Double, + drive: scala.Double, + rideHail: scala.Double, + rideHailPooled: scala.Double, + rideHailTransit: scala.Double, + transit: scala.Double, + waiting: scala.Double, + walk: scala.Double ) + object ModeVotMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor : scala.Double + params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor: scala.Double ) + object MulitnomialLogit { + case class Params( - bike_intercept : scala.Double, - bike_transit_intercept : scala.Double, - car_intercept : scala.Double, - cav_intercept : scala.Double, - drive_transit_intercept : scala.Double, - ride_hail_intercept : scala.Double, - ride_hail_pooled_intercept : scala.Double, - ride_hail_transit_intercept : scala.Double, - transfer : scala.Double, - transit_crowding : scala.Double, - transit_crowding_VOT_multiplier : scala.Double, - transit_crowding_VOT_threshold : scala.Double, - transit_crowding_percentile : scala.Double, - walk_intercept : scala.Double, - walk_transit_intercept : scala.Double + bike_intercept: scala.Double, + bike_transit_intercept: scala.Double, + car_intercept: scala.Double, + cav_intercept: scala.Double, + drive_transit_intercept: scala.Double, + ride_hail_intercept: scala.Double, + ride_hail_pooled_intercept: scala.Double, + ride_hail_transit_intercept: scala.Double, + transfer: scala.Double, + transit_crowding: scala.Double, + transit_crowding_VOT_multiplier: scala.Double, + transit_crowding_VOT_threshold: scala.Double, + transit_crowding_percentile: scala.Double, + walk_intercept: scala.Double, + walk_transit_intercept: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, - ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, - transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, - transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, - transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, - walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = + if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = + if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = + if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = + if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") + else 0.0, + ride_hail_transit_intercept = + if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") + else 0.0, + transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = + if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) + c.getDouble("transit_crowding_VOT_multiplier") + else 0.0, + transit_crowding_VOT_threshold = + if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") + else 0.5, + transit_crowding_percentile = + if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") + else 90.0, + walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = + if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), - utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ), + utility_scale_factor = + if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object PoolingMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), - maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, - minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), - transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None - ) - } - } - + defaultValueOfTime = + if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( + if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") + ), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( + if (c.hasPathOrNull("lccm")) c.getConfig("lccm") + else com.typesafe.config.ConfigFactory.parseString("lccm{}") + ), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( + if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") + ), + maximumNumberOfReplanningAttempts = + if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") + else 3, + minimumValueOfTime = + if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = + if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") + else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( + if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") + else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + overrideAutomationForVOTT = + c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = + if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( + if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") + else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") + ), + transitVehicleTypeVOTMultipliers = + if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) + scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) + else None + ) + } + } + case class ModeIncentive( - filePath : java.lang.String + filePath: java.lang.String ) + object ModeIncentive { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - estimatedMinParkingDurationInSeconds : scala.Double, - fractionOfSameTypeZones : scala.Double, - maxSearchRadius : scala.Double, - minNumberOfSameTypeZones : scala.Int, - minSearchRadius : scala.Double, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - overnightChargingSampleSize : scala.Double, - rangeAnxietyBuffer : scala.Double, - searchMaxDistanceRelativeToEllipseFoci : scala.Double + estimatedMinParkingDurationInSeconds: scala.Double, + fractionOfSameTypeZones: scala.Double, + maxSearchRadius: scala.Double, + minNumberOfSameTypeZones: scala.Int, + minSearchRadius: scala.Double, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + overnightChargingSampleSize: scala.Double, + rangeAnxietyBuffer: scala.Double, + searchMaxDistanceRelativeToEllipseFoci: scala.Double ) + object Parking { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - distanceMultiplier : scala.Double, - enrouteDetourMultiplier : scala.Double, - homeActivityPrefersResidentialParkingMultiplier : scala.Double, - overnightParkingPrefersChargingMultiplier : scala.Double, - parkingPriceMultiplier : scala.Double, - rangeAnxietyMultiplier : scala.Double + distanceMultiplier: scala.Double, + enrouteDetourMultiplier: scala.Double, + homeActivityPrefersResidentialParkingMultiplier: scala.Double, + overnightParkingPrefersChargingMultiplier: scala.Double, + parkingPriceMultiplier: scala.Double, + rangeAnxietyMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, - overnightParkingPrefersChargingMultiplier = if(c.hasPathOrNull("overnightParkingPrefersChargingMultiplier")) c.getDouble("overnightParkingPrefersChargingMultiplier") else 1.0, - parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = + if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = + if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = + if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) + c.getDouble("homeActivityPrefersResidentialParkingMultiplier") + else 1.0, + overnightParkingPrefersChargingMultiplier = + if (c.hasPathOrNull("overnightParkingPrefersChargingMultiplier")) + c.getDouble("overnightParkingPrefersChargingMultiplier") + else 1.0, + parkingPriceMultiplier = + if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = + if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - estimatedMinParkingDurationInSeconds = if(c.hasPathOrNull("estimatedMinParkingDurationInSeconds")) c.getDouble("estimatedMinParkingDurationInSeconds") else 60.0, - fractionOfSameTypeZones = if(c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, - maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minNumberOfSameTypeZones = if(c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, - minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - overnightChargingSampleSize = if(c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0.5, - rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 + estimatedMinParkingDurationInSeconds = + if (c.hasPathOrNull("estimatedMinParkingDurationInSeconds")) + c.getDouble("estimatedMinParkingDurationInSeconds") + else 60.0, + fractionOfSameTypeZones = + if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, + maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minNumberOfSameTypeZones = + if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, + minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + overnightChargingSampleSize = + if (c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0.5, + rangeAnxietyBuffer = + if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = + if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) + c.getDouble("searchMaxDistanceRelativeToEllipseFoci") + else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath : java.lang.String, - inputPlansFilePath : java.lang.String, - merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath: java.lang.String, + inputPlansFilePath: java.lang.String, + merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) + object Plans { + case class Merge( - fraction : scala.Double + fraction: scala.Double ) + object Merge { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) + inputPersonAttributesFilePath = + if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") + else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = + if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") + else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( + if (c.hasPathOrNull("merge")) c.getConfig("merge") + else com.typesafe.config.ConfigFactory.parseString("merge{}") + ) ) } } - + case class Population( - industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling : scala.Boolean + industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling: scala.Boolean ) + object Population { + case class IndustryRemovalProbabilty( - enabled : scala.Boolean, - inputFilePath : java.lang.String, - removalStrategy : java.lang.String + enabled: scala.Boolean, + inputFilePath: java.lang.String, + removalStrategy: java.lang.String ) + object IndustryRemovalProbabilty { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = + if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( + if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") + else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") + ), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath : java.lang.String + filePath: java.lang.String ) + object PtFare { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost : scala.Double, - defaultCostPerMile : scala.Double, - defaultCostPerMinute : scala.Double, - human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations : scala.Boolean, - name : java.lang.String, - pooledBaseCost : scala.Double, - pooledCostPerMile : scala.Double, - pooledCostPerMinute : scala.Double, - rangeBufferForDispatchInMeters : scala.Int, - repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost: scala.Double, + defaultCostPerMile: scala.Double, + defaultCostPerMinute: scala.Double, + human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations: scala.Boolean, + name: java.lang.String, + pooledBaseCost: scala.Double, + pooledCostPerMile: scala.Double, + pooledCostPerMinute: scala.Double, + rangeBufferForDispatchInMeters: scala.Int, + repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) + object RideHail { + case class AllocationManager( - alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm : java.lang.String, - maxExcessRideTime : scala.Double, - maxWaitingTimeInSec : scala.Int, - name : java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, - repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds : scala.Int + alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm: java.lang.String, + maxExcessRideTime: scala.Double, + maxWaitingTimeInSec: scala.Int, + name: java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, + repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds: scala.Int ) + object AllocationManager { + case class AlonsoMora( - maxRequestsPerVehicle : scala.Int + maxRequestsPerVehicle: scala.Int ) + object AlonsoMora { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = + if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, - demandWeight : scala.Double, - distanceWeight : scala.Double, - keepMaxTopNScores : scala.Int, - minDemandPercentageInRadius : scala.Double, - minScoreThresholdForRepositioning : scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, - percentageOfVehiclesToReposition : scala.Double, - produceDebugImages : scala.Boolean, - repositionCircleRadiusInMeters : scala.Double, - repositioningMethod : java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, - waitingTimeWeight : scala.Double + allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, + demandWeight: scala.Double, + distanceWeight: scala.Double, + keepMaxTopNScores: scala.Int, + minDemandPercentageInRadius: scala.Double, + minScoreThresholdForRepositioning: scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, + percentageOfVehiclesToReposition: scala.Double, + produceDebugImages: scala.Boolean, + repositionCircleRadiusInMeters: scala.Double, + repositioningMethod: java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, + waitingTimeWeight: scala.Double ) + object RepositionLowWaitingTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, - minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, - percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, - repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, - waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( + "allowIncreasingRadiusIfDemandInRadiusLow" + ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = + if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") + else 0.1, + minScoreThresholdForRepositioning = + if (c.hasPathOrNull("minScoreThresholdForRepositioning")) + c.getDouble("minScoreThresholdForRepositioning") + else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = + if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) + c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") + else 1, + percentageOfVehiclesToReposition = + if (c.hasPathOrNull("percentageOfVehiclesToReposition")) + c.getDouble("percentageOfVehiclesToReposition") + else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = + if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") + else 3000, + repositioningMethod = + if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = + if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) + c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") + else 1200, + waitingTimeWeight = + if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), - matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, - repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), - requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( + if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") + else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") + ), + matchingAlgorithm = + if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") + else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = + if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = + if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) + c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") + else 1, + repositionLowWaitingTimes = + BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( + if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") + else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") + ), + requestBufferTimeoutInSeconds = + if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Int ) + object Cav { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 16090, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) + object Charging { + case class VehicleChargingManager( - defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager ) + object VehicleChargingManager { + case class DefaultVehicleChargingManager( - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit ) + object DefaultVehicleChargingManager { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - chargingTimeMultiplier : scala.Double, - drivingTimeMultiplier : scala.Double, - insufficientRangeMultiplier : scala.Double, - queueingTimeMultiplier : scala.Double + chargingTimeMultiplier: scala.Double, + drivingTimeMultiplier: scala.Double, + insufficientRangeMultiplier: scala.Double, + queueingTimeMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( - chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, - drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, - insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, - queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + chargingTimeMultiplier = + if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") + else -0.01666667, + drivingTimeMultiplier = + if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") + else -0.01666667, + insufficientRangeMultiplier = + if (c.hasPathOrNull("insufficientRangeMultiplier")) + c.getDouble("insufficientRangeMultiplier") + else -60.0, + queueingTimeMultiplier = + if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") + else -0.01666667 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + params = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + mulitnomialLogit = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")) + defaultVehicleChargingManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + if (c.hasPathOrNull("defaultVehicleChargingManager")) + c.getConfig("defaultVehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( + if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") + ) ) } } - + case class Human( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int ) + object Human { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180 ) } } - + case class Initialization( - filePath : java.lang.String, - initType : java.lang.String, - parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath: java.lang.String, + initType: java.lang.String, + parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) + object Initialization { + case class Parking( - filePath : java.lang.String + filePath: java.lang.String ) + object Parking { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet : scala.Double, - initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId : java.lang.String, - vehicleTypePrefix : java.lang.String + fractionOfInitialVehicleFleet: scala.Double, + initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId: java.lang.String, + vehicleTypePrefix: java.lang.String ) + object Procedural { + case class InitialLocation( - home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name : java.lang.String + home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name: java.lang.String ) + object InitialLocation { + case class Home( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object Home { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( + if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") + else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") + ), + vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = + if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( + if (c.hasPathOrNull("procedural")) c.getConfig("procedural") + else com.typesafe.config.ConfigFactory.parseString("procedural{}") + ) ) } } - + case class IterationStats( - timeBinSizeInSec : scala.Double + timeBinSizeInSec: scala.Double ) + object IterationStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name : java.lang.String, - timeout : scala.Int + demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name: java.lang.String, + timeout: scala.Int ) + object RepositioningManager { + case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider : scala.Double, - horizon : scala.Int, - numberOfClustersForDemand : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDemandForCAVs : scala.Double + fractionOfClosestClustersToConsider: scala.Double, + horizon: scala.Int, + numberOfClustersForDemand: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDemandForCAVs: scala.Double ) + object DemandFollowingRepositioningManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, - horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, - sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 + fractionOfClosestClustersToConsider = + if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) + c.getDouble("fractionOfClosestClustersToConsider") + else 0.2, + horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = + if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 1, + sensitivityOfRepositioningToDemandForCAVs = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) + c.getDouble("sensitivityOfRepositioningToDemandForCAVs") + else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDistance : scala.Double + predictionHorizon: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDistance: scala.Double ) + object InverseSquareDistanceRepositioningFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, - sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 + predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 0.4, + sensitivityOfRepositioningToDistance = + if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) + c.getDouble("sensitivityOfRepositioningToDistance") + else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( + if (c.hasPathOrNull("demandFollowingRepositioningManager")) + c.getConfig("demandFollowingRepositioningManager") + else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") + ), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager + .InverseSquareDistanceRepositioningFactor( + if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) + c.getConfig("inverseSquareDistanceRepositioningFactor") + else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object RideHailManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel : scala.Double, - numberOfCategories : scala.Int, - priceAdjustmentStrategy : java.lang.String, - surgeLevelAdaptionStep : scala.Double + minimumSurgeLevel: scala.Double, + numberOfCategories: scala.Int, + priceAdjustmentStrategy: java.lang.String, + surgeLevelAdaptionStep: scala.Double ) + object SurgePricing { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = + if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") + else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = + if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), - defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), - linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( + if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") + else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") + ), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( + if (c.hasPathOrNull("cav")) c.getConfig("cav") + else com.typesafe.config.ConfigFactory.parseString("cav{}") + ), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( + if (c.hasPathOrNull("charging")) c.getConfig("charging") + else com.typesafe.config.ConfigFactory.parseString("charging{}") + ), + defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = + if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = + if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( + if (c.hasPathOrNull("human")) c.getConfig("human") + else com.typesafe.config.ConfigFactory.parseString("human{}") + ), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( + if (c.hasPathOrNull("initialization")) c.getConfig("initialization") + else com.typesafe.config.ConfigFactory.parseString("initialization{}") + ), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( + if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") + else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") + ), + linkFleetStateAcrossIterations = + c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = + if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + rangeBufferForDispatchInMeters = + if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") + else 10000, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( + if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") + else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") + ), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( + if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") + else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") + ), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( + if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") + else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") + ) + ) + } + } + case class RideHailTransit( - modesToConsider : java.lang.String + modesToConsider: java.lang.String ) + object RideHailTransit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) + object TripBehaviors { + case class CarUsage( - minDistanceToTrainStop : scala.Double + minDistanceToTrainStop: scala.Double ) + object CarUsage { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = + if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path : java.lang.String, - additional_trip_utility : scala.Double, - destination_nest_scale_factor : scala.Double, - generate_secondary_activities : scala.Boolean, - intercept_file_path : java.lang.String, - max_destination_choice_set_size : scala.Int, - max_destination_distance_meters : scala.Double, - mode_nest_scale_factor : scala.Double, - trip_nest_scale_factor : scala.Double + activity_file_path: java.lang.String, + additional_trip_utility: scala.Double, + destination_nest_scale_factor: scala.Double, + generate_secondary_activities: scala.Boolean, + intercept_file_path: java.lang.String, + max_destination_choice_set_size: scala.Int, + max_destination_distance_meters: scala.Double, + mode_nest_scale_factor: scala.Double, + trip_nest_scale_factor: scala.Double ) + object MulitnomialLogit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, - generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, - max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, - mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = + if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = + if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = + if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") + else 1.0, + generate_secondary_activities = + c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = + if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = + if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") + else 20, + max_destination_distance_meters = + if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") + else 32000, + mode_nest_scale_factor = + if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = + if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( + if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") + else com.typesafe.config.ConfigFactory.parseString("carUsage{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ) ) } } - + case class Vehicles( - destination : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination, - downsamplingMethod : java.lang.String, - dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet : scala.Double, - fractionOfPeopleWithBicycle : scala.Double, - fuelTypesFilePath : java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, - linkSocAcrossIterations : scala.Boolean, - linkToGradePercentFilePath : java.lang.String, - meanPrivateVehicleStartingSOC : scala.Double, - meanRidehailVehicleStartingSOC : scala.Double, - sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile : java.lang.String, - vehicleAdjustmentMethod : java.lang.String, - vehicleTypesFilePath : java.lang.String, - vehiclesFilePath : java.lang.String + destination: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination, + downsamplingMethod: java.lang.String, + dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet: scala.Double, + fractionOfPeopleWithBicycle: scala.Double, + fuelTypesFilePath: java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, + linkSocAcrossIterations: scala.Boolean, + linkToGradePercentFilePath: java.lang.String, + meanPrivateVehicleStartingSOC: scala.Double, + meanRidehailVehicleStartingSOC: scala.Double, + sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile: java.lang.String, + vehicleAdjustmentMethod: java.lang.String, + vehicleTypesFilePath: java.lang.String, + vehiclesFilePath: java.lang.String ) + object Vehicles { + case class Destination( - home : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home, - noRefuelThresholdInMeters : scala.Int, - secondary : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary, - work : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work + home: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home, + noRefuelThresholdInMeters: scala.Int, + secondary: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary, + work: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work ) + object Destination { + case class Home( - refuelRequiredThresholdInMeters : scala.Double + refuelRequiredThresholdInMeters: scala.Double ) + object Home { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getDouble("refuelRequiredThresholdInMeters") else 128747.6 + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) + c.getDouble("refuelRequiredThresholdInMeters") + else 128747.6 ) } } - + case class Secondary( - refuelRequiredThresholdInMeters : scala.Int + refuelRequiredThresholdInMeters: scala.Int ) + object Secondary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary( - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180 ) } } - + case class Work( - refuelRequiredThresholdInMeters : scala.Double + refuelRequiredThresholdInMeters: scala.Double ) + object Work { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work( - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getDouble("refuelRequiredThresholdInMeters") else 64373.8 + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) + c.getDouble("refuelRequiredThresholdInMeters") + else 64373.8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( - home = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - secondary = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), - work = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work(if(c.hasPathOrNull("work")) c.getConfig("work") else com.typesafe.config.ConfigFactory.parseString("work{}")) + home = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + secondary = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary( + if (c.hasPathOrNull("secondary")) c.getConfig("secondary") + else com.typesafe.config.ConfigFactory.parseString("secondary{}") + ), + work = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work( + if (c.hasPathOrNull("work")) c.getConfig("work") + else com.typesafe.config.ConfigFactory.parseString("work{}") + ) ) } } - + case class DummySharedBike( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedBike { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedCar { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond : scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, - noRefuelThresholdOffsetInMeters : scala.Double, - refuelRequiredThresholdOffsetInMeters : scala.Int, - remainingDistanceWrtBatteryCapacityThreshold : scala.Int + estimateOfMeanChargingDurationInSecond: scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, + noRefuelThresholdOffsetInMeters: scala.Double, + refuelRequiredThresholdOffsetInMeters: scala.Int, + remainingDistanceWrtBatteryCapacityThreshold: scala.Int ) + object Enroute { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, - noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, - refuelRequiredThresholdOffsetInMeters = if(c.hasPathOrNull("refuelRequiredThresholdOffsetInMeters")) c.getInt("refuelRequiredThresholdOffsetInMeters") else 0, - remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 + estimateOfMeanChargingDurationInSecond = + if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) + c.getInt("estimateOfMeanChargingDurationInSecond") + else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = + if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) + c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") + else 500, + noRefuelThresholdOffsetInMeters = + if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") + else 32186.9, + refuelRequiredThresholdOffsetInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdOffsetInMeters")) + c.getInt("refuelRequiredThresholdOffsetInMeters") + else 0, + remainingDistanceWrtBatteryCapacityThreshold = + if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) + c.getInt("remainingDistanceWrtBatteryCapacityThreshold") + else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], - fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], - inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], - managerType : java.lang.String, - name : java.lang.String, - parkingFilePath : java.lang.String, - reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving + ], + fixed_non_reserving_fleet_by_taz: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz + ], + inexhaustible_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving + ], + managerType: java.lang.String, + name: java.lang.String, + parkingFilePath: java.lang.String, + reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) + object SharedFleets$Elm { + case class FixedNonReserving( - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String ) + object FixedNonReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize : scala.Int, - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String, - vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] + fleetSize: scala.Int, + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String, + vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] ) + object FixedNonReservingFleetByTaz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None + fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = + if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) + else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object InexhaustibleReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], - name : java.lang.String, - repositionTimeBin : scala.Int, - statTimeBin : scala.Int + min_availability_undersupply_algorithm: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm + ], + name: java.lang.String, + repositionTimeBin: scala.Int, + statTimeBin: scala.Int ) + object Reposition { + case class MinAvailabilityUndersupplyAlgorithm( - matchLimit : scala.Int + matchLimit: scala.Int ) + object MinAvailabilityUndersupplyAlgorithm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( - matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm( + matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = + if (c.hasPathOrNull("min-availability-undersupply-algorithm")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) + ) + else None, + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, - fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, - inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, - managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None + fixed_non_reserving = + if (c.hasPathOrNull("fixed-non-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReserving(c.getConfig("fixed-non-reserving")) + ) + else None, + fixed_non_reserving_fleet_by_taz = + if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) + ) + else None, + inexhaustible_reserving = + if (c.hasPathOrNull("inexhaustible-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) + ) + else None, + managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = + if (c.hasPathOrNull("reposition")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) + ) + else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - destination = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination(if(c.hasPathOrNull("destination")) c.getConfig("destination") else com.typesafe.config.ConfigFactory.parseString("destination{}")), - downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, - fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, - meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", - vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" - ) - } - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + destination = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( + if (c.hasPathOrNull("destination")) c.getConfig("destination") + else com.typesafe.config.ConfigFactory.parseString("destination{}") + ), + downsamplingMethod = + if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") + else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( + if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") + else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") + ), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( + if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") + else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") + ), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( + if (c.hasPathOrNull("enroute")) c.getConfig("enroute") + else com.typesafe.config.ConfigFactory.parseString("enroute{}") + ), + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 1.0, + fractionOfPeopleWithBicycle = + if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = + if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") + else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( + "generateEmergencyHouseholdVehicleWhenPlansRequireIt" + ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = + c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = + if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = + if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") + else 1.0, + meanRidehailVehicleStartingSOC = + if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") + else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = + if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") + else "", + vehicleAdjustmentMethod = + if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = + if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") + else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = + if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") + else "/test/input/beamville/vehicles.csv" + ) + } + + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Agentsim.Agents.Vehicles + .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), - bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), - households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), - parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities( + if (c.hasPathOrNull("activities")) c.getConfig("activities") + else com.typesafe.config.ConfigFactory.parseString("activities{}") + ), + bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight( + if (c.hasPathOrNull("freight")) c.getConfig("freight") + else com.typesafe.config.ConfigFactory.parseString("freight{}") + ), + households = BeamConfig.Beam.Agentsim.Agents.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( + if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") + else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") + ), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( + if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") + else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") + ), + parking = BeamConfig.Beam.Agentsim.Agents.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + plans = BeamConfig.Beam.Agentsim.Agents.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + population = BeamConfig.Beam.Agentsim.Agents.Population( + if (c.hasPathOrNull("population")) c.getConfig("population") + else com.typesafe.config.ConfigFactory.parseString("population{}") + ), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( + if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") + else com.typesafe.config.ConfigFactory.parseString("ptFare{}") + ), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( + if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") + else com.typesafe.config.ConfigFactory.parseString("rideHail{}") + ), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( + if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") + else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") + ), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( + if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") + else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") + ), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor : scala.Double, - chargingPointCountScalingFactor : scala.Double, - chargingPointFilePath : java.lang.String, - helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - maxChargingSessionsInSeconds : scala.Int, - overnightChargingEnabled : scala.Boolean, - scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds : scala.Int + chargingPointCostScalingFactor: scala.Double, + chargingPointCountScalingFactor: scala.Double, + chargingPointFilePath: java.lang.String, + helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + maxChargingSessionsInSeconds: scala.Int, + overnightChargingEnabled: scala.Boolean, + scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds: scala.Int ) + object ChargingNetworkManager { + case class Helics( - bufferSize : scala.Int, - connectionEnabled : scala.Boolean, - coreInitString : java.lang.String, - coreType : java.lang.String, - dataInStreamPoint : java.lang.String, - dataOutStreamPoint : java.lang.String, - federateName : java.lang.String, - feedbackEnabled : scala.Boolean, - intLogLevel : scala.Int, - timeDeltaProperty : scala.Double + bufferSize: scala.Int, + connectionEnabled: scala.Boolean, + coreInitString: java.lang.String, + coreType: java.lang.String, + dataInStreamPoint: java.lang.String, + dataOutStreamPoint: java.lang.String, + federateName: java.lang.String, + feedbackEnabled: scala.Boolean, + intLogLevel: scala.Int, + timeDeltaProperty: scala.Double ) + object Helics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", - dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = + if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") + else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = + if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") + else "GridFed/PhysicalBounds", + dataOutStreamPoint = + if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled : scala.Boolean, - expansionFactor_charge_activity : scala.Double, - expansionFactor_home_activity : scala.Double, - expansionFactor_init_activity : scala.Double, - expansionFactor_wherever_activity : scala.Double, - expansionFactor_work_activity : scala.Double + enabled: scala.Boolean, + expansionFactor_charge_activity: scala.Double, + expansionFactor_home_activity: scala.Double, + expansionFactor_init_activity: scala.Double, + expansionFactor_wherever_activity: scala.Double, + expansionFactor_work_activity: scala.Double ) + object ScaleUp { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, - expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, - expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, - expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, - expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = + if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") + else 1.0, + expansionFactor_home_activity = + if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") + else 1.0, + expansionFactor_init_activity = + if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") + else 1.0, + expansionFactor_wherever_activity = + if (c.hasPathOrNull("expansionFactor_wherever_activity")) + c.getDouble("expansionFactor_wherever_activity") + else 1.0, + expansionFactor_work_activity = + if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") + else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, - chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, - chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), - maxChargingSessionsInSeconds = if(c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, - overnightChargingEnabled = c.hasPathOrNull("overnightChargingEnabled") && c.getBoolean("overnightChargingEnabled"), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), - timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = + if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") + else 1.0, + chargingPointCountScalingFactor = + if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") + else 1.0, + chargingPointFilePath = + if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( + if (c.hasPathOrNull("helics")) c.getConfig("helics") + else com.typesafe.config.ConfigFactory.parseString("helics{}") + ), + maxChargingSessionsInSeconds = + if (c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, + overnightChargingEnabled = + c.hasPathOrNull("overnightChargingEnabled") && c.getBoolean("overnightChargingEnabled"), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( + if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") + else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") + ), + timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution : scala.Int, - upperBoundResolution : scala.Int + lowerBoundResolution: scala.Int, + upperBoundResolution: scala.Int ) + object H3taz { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile : java.lang.String + frequencyAdjustmentFile: java.lang.String ) + object Scenarios { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = + if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") + else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay : scala.Int, - interval : scala.Int + initialDelay: scala.Int, + interval: scala.Int ) + object ScheduleMonitorTask { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath : java.lang.String, - parkingCostScalingFactor : scala.Double, - parkingFilePath : java.lang.String, - parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor : scala.Double + filePath: java.lang.String, + parkingCostScalingFactor: scala.Double, + parkingFilePath: java.lang.String, + parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor: scala.Double ) + object Taz { + case class ParkingManager( - displayPerformanceTimings : scala.Boolean, - method : java.lang.String, - parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings: scala.Boolean, + method: java.lang.String, + parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) + object ParkingManager { + case class Parallel( - numberOfClusters : scala.Int + numberOfClusters: scala.Int ) + object Parallel { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( + if (c.hasPathOrNull("parallel")) c.getConfig("parallel") + else com.typesafe.config.ConfigFactory.parseString("parallel{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), - parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = + if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( + if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") + else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") + ), + parkingStallCountScalingFactor = + if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") + else 1.0 ) } } - + case class Toll( - filePath : java.lang.String + filePath: java.lang.String ) + object Toll { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules : scala.Double, - rideHailPrice : scala.Double, - tollPrice : scala.Double, - transitCapacity : scala.Option[scala.Double], - transitPrice : scala.Double + fuelCapacityInJoules: scala.Double, + rideHailPrice: scala.Double, + tollPrice: scala.Double, + transitCapacity: scala.Option[scala.Double], + transitPrice: scala.Double ) + object Tuning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = + if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - randomSeedForPopulationSampling = if(c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) else None, - scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), - schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - snapLocationAndRemoveInvalidInputs = c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), - taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), - thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, - thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), - tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) + agentSampleSizeAsFractionOfPopulation = + if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) + c.getDouble("agentSampleSizeAsFractionOfPopulation") + else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents( + if (c.hasPathOrNull("agents")) c.getConfig("agents") + else com.typesafe.config.ConfigFactory.parseString("agents{}") + ), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( + if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") + else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") + ), + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = + if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") + else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz( + if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") + else com.typesafe.config.ConfigFactory.parseString("h3taz{}") + ), + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = + if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + randomSeedForPopulationSampling = + if (c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) + else None, + scenarios = BeamConfig.Beam.Agentsim.Scenarios( + if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") + else com.typesafe.config.ConfigFactory.parseString("scenarios{}") + ), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( + if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") + else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") + ), + schedulerParallelismWindow = + if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + snapLocationAndRemoveInvalidInputs = + c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), + taz = BeamConfig.Beam.Agentsim.Taz( + if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") + ), + thresholdForMakingParkingChoiceInMeters = + if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) + c.getInt("thresholdForMakingParkingChoiceInMeters") + else 100, + thresholdForWalkingInMeters = + if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll( + if (c.hasPathOrNull("toll")) c.getConfig("toll") + else com.typesafe.config.ConfigFactory.parseString("toll{}") + ), + tuning = BeamConfig.Beam.Agentsim.Tuning( + if (c.hasPathOrNull("tuning")) c.getConfig("tuning") + else com.typesafe.config.ConfigFactory.parseString("tuning{}") + ) ) } } - + case class Calibration( - counts : BeamConfig.Beam.Calibration.Counts, - google : BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio : scala.Double, - mode : BeamConfig.Beam.Calibration.Mode, - objectiveFunction : java.lang.String, - roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, - studyArea : BeamConfig.Beam.Calibration.StudyArea + counts: BeamConfig.Beam.Calibration.Counts, + google: BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio: scala.Double, + mode: BeamConfig.Beam.Calibration.Mode, + objectiveFunction: java.lang.String, + roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, + studyArea: BeamConfig.Beam.Calibration.StudyArea ) + object Calibration { + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Int, - inputCountsFile : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Int, + inputCountsFile: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes ) + object Google { + case class TravelTimes( - enable : scala.Boolean, - iterationInterval : scala.Int, - minDistanceInMeters : scala.Double, - numDataPointsOver24Hours : scala.Int, - offPeakEnabled : scala.Boolean, - queryDate : java.lang.String, - tolls : scala.Boolean + enable: scala.Boolean, + iterationInterval: scala.Int, + minDistanceInMeters: scala.Double, + numDataPointsOver24Hours: scala.Int, + offPeakEnabled: scala.Boolean, + queryDate: java.lang.String, + tolls: scala.Boolean ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = + if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = + if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class Mode( - benchmarkFilePath : java.lang.String + benchmarkFilePath: java.lang.String ) + object Mode { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) + object RoadNetwork { + case class TravelTimes( - zoneBoundariesFilePath : java.lang.String, - zoneODTravelTimesFilePath : java.lang.String + zoneBoundariesFilePath: java.lang.String, + zoneODTravelTimesFilePath: java.lang.String ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = + if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = + if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class StudyArea( - enabled : scala.Boolean, - lat : scala.Double, - lon : scala.Double, - radius : scala.Double + enabled: scala.Boolean, + lat: scala.Double, + lon: scala.Double, + radius: scala.Double ) + object StudyArea { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), - meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), - objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), - studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) + counts = BeamConfig.Beam.Calibration.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + google = BeamConfig.Beam.Calibration.Google( + if (c.hasPathOrNull("google")) c.getConfig("google") + else com.typesafe.config.ConfigFactory.parseString("google{}") + ), + meanToCountsWeightRatio = + if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode( + if (c.hasPathOrNull("mode")) c.getConfig("mode") + else com.typesafe.config.ConfigFactory.parseString("mode{}") + ), + objectiveFunction = + if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") + else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( + if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") + else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") + ), + studyArea = BeamConfig.Beam.Calibration.StudyArea( + if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") + else com.typesafe.config.ConfigFactory.parseString("studyArea{}") + ) ) } } - + case class Cluster( - clusterType : scala.Option[java.lang.String], - enabled : scala.Boolean + clusterType: scala.Option[java.lang.String], + enabled: scala.Boolean ) + object Cluster { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor : BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval : scala.Int, - clearRoutedOutstandingWorkEnabled : scala.Boolean, - debugActorTimerIntervalInSec : scala.Int, - debugEnabled : scala.Boolean, - memoryConsumptionDisplayTimeoutInSec : scala.Int, - messageLogging : scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork : scala.Int, - stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation : BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives : scala.Boolean, - writeRealizedModeChoiceFile : scala.Boolean + actor: BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval: scala.Int, + clearRoutedOutstandingWorkEnabled: scala.Boolean, + debugActorTimerIntervalInSec: scala.Int, + debugEnabled: scala.Boolean, + memoryConsumptionDisplayTimeoutInSec: scala.Int, + messageLogging: scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork: scala.Int, + stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation: BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives: scala.Boolean, + writeRealizedModeChoiceFile: scala.Boolean ) + object Debug { + case class Actor( - logDepth : scala.Int + logDepth: scala.Int ) + object Actor { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs : scala.Long, - checkMaxNumberOfMessagesEnabled : scala.Boolean, - defaultTimeoutMs : scala.Long, - enabled : scala.Boolean, - overallSimulationTimeoutMs : scala.Long, - thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs: scala.Long, + checkMaxNumberOfMessagesEnabled: scala.Boolean, + defaultTimeoutMs: scala.Long, + enabled: scala.Boolean, + overallSimulationTimeoutMs: scala.Long, + thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) + object StuckAgentDetection { + case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs : scala.Long, - triggerType : java.lang.String + actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs: scala.Long, + triggerType: java.lang.String ) + object Thresholds$Elm { + case class ActorTypeToMaxNumberOfMessages( - population : scala.Option[scala.Int], - rideHailAgent : scala.Option[scala.Int], - rideHailManager : scala.Option[scala.Int], - transitDriverAgent : scala.Option[scala.Int] + population: scala.Option[scala.Int], + rideHailAgent: scala.Option[scala.Int], + rideHailManager: scala.Option[scala.Int], + transitDriverAgent: scala.Option[scala.Int] ) + object ActorTypeToMaxNumberOfMessages { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = + if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), - markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, - triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = + BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( + if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") + else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") + ), + markAsStuckAfterMs = + if (c.hasPathOrNull("markAsStuckAfterMs")) + c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 20000, + triggerType = + if (c.hasPathOrNull("triggerType")) c.getString("triggerType") + else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, - checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = + if (c.hasPathOrNull("checkIntervalMs")) + c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 200, + checkMaxNumberOfMessagesEnabled = + !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = + if (c.hasPathOrNull("defaultTimeoutMs")) + c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = + if (c.hasPathOrNull("overallSimulationTimeoutMs")) + c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Debug.StuckAgentDetection + .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class TriggerMeasurer( - enabled : scala.Boolean, - writeStuckAgentDetectionConfig : scala.Boolean + enabled: scala.Boolean, + writeStuckAgentDetectionConfig: scala.Boolean ) + object TriggerMeasurer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = + !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram : scala.Boolean + createGCClassHistogram: scala.Boolean ) + object VmInformation { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), - agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), - vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), - writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor( + if (c.hasPathOrNull("actor")) c.getConfig("actor") + else com.typesafe.config.ConfigFactory.parseString("actor{}") + ), + agentTripScoresInterval = + if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = + c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = + if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = + if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) + c.getInt("memoryConsumptionDisplayTimeoutInSec") + else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = + if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) + c.getInt("secondsToWaitToClearRoutedOutstandingWork") + else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( + if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") + else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") + ), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( + if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") + else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") + ), + vmInformation = BeamConfig.Beam.Debug.VmInformation( + if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") + else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") + ), + writeModeChoiceAlternatives = + c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = + c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output : BeamConfig.Beam.Exchange.Output, - scenario : BeamConfig.Beam.Exchange.Scenario + output: BeamConfig.Beam.Exchange.Output, + scenario: BeamConfig.Beam.Exchange.Scenario ) + object Exchange { + case class Output( - activitySimSkimsEnabled : scala.Boolean, - geo : BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled: scala.Boolean, + geo: BeamConfig.Beam.Exchange.Output.Geo ) + object Output { + case class Geo( - filePath : scala.Option[java.lang.String] + filePath: scala.Option[java.lang.String] ) + object Geo { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) + activitySimSkimsEnabled = + c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo( + if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") + ) ) } } - + case class Scenario( - convertWgs2Utm : scala.Boolean, - fileFormat : java.lang.String, - folder : java.lang.String, - modeMap : scala.Option[scala.List[java.lang.String]], - source : java.lang.String, - urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm: scala.Boolean, + fileFormat: java.lang.String, + folder: java.lang.String, + modeMap: scala.Option[scala.List[java.lang.String]], + source: java.lang.String, + urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim ) + object Scenario { + case class Urbansim( - activitySimEnabled : scala.Boolean + activitySimEnabled: scala.Boolean ) + object Urbansim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) + fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) + output = BeamConfig.Beam.Exchange.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + scenario = BeamConfig.Beam.Exchange.Scenario( + if (c.hasPathOrNull("scenario")) c.getConfig("scenario") + else com.typesafe.config.ConfigFactory.parseString("scenario{}") + ) ) } } - + case class Experimental( - optimizer : BeamConfig.Beam.Experimental.Optimizer + optimizer: BeamConfig.Beam.Experimental.Optimizer ) + object Experimental { + case class Optimizer( - enabled : scala.Boolean + enabled: scala.Boolean ) + object Optimizer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) + optimizer = BeamConfig.Beam.Experimental.Optimizer( + if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") + else com.typesafe.config.ConfigFactory.parseString("optimizer{}") + ) ) } } - + case class Input( - lastBaseOutputDir : java.lang.String, - simulationPrefix : java.lang.String + lastBaseOutputDir: java.lang.String, + simulationPrefix: java.lang.String ) + object Input { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn : scala.Boolean + keepConsoleAppenderOn: scala.Boolean ) + object Logger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level : java.lang.String + level: java.lang.String ) + object Metrics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation : scala.Boolean + writePlansAndStopSimulation: scala.Boolean ) + object Output { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = + c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory : scala.Boolean, - baseOutputDirectory : java.lang.String, - collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, - defaultWriteInterval : scala.Int, - displayPerformanceTimings : scala.Boolean, - events : BeamConfig.Beam.Outputs.Events, - generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval : scala.Int, - matsim : BeamConfig.Beam.Outputs.Matsim, - stats : BeamConfig.Beam.Outputs.Stats, - writeAnalysis : scala.Boolean, - writeEventsInterval : scala.Int, - writeGraphs : scala.Boolean, - writePlansInterval : scala.Int, - writeR5RoutesInterval : scala.Int + addTimestampToOutputDirectory: scala.Boolean, + baseOutputDirectory: java.lang.String, + collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, + defaultWriteInterval: scala.Int, + displayPerformanceTimings: scala.Boolean, + events: BeamConfig.Beam.Outputs.Events, + generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval: scala.Int, + matsim: BeamConfig.Beam.Outputs.Matsim, + stats: BeamConfig.Beam.Outputs.Stats, + writeAnalysis: scala.Boolean, + writeEventsInterval: scala.Int, + writeGraphs: scala.Boolean, + writePlansInterval: scala.Int, + writeR5RoutesInterval: scala.Int ) + object Outputs { + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime : scala.Int, - startTime : scala.Int + endTime: scala.Int, + startTime: scala.Int ) + object GeneralizedLinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles : java.lang.String, - deleteRootFolderFiles : java.lang.String + deleteITERSFolderFiles: java.lang.String, + deleteRootFolderFiles: java.lang.String ) + object Matsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = + if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = + if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize : scala.Int + binSize: scala.Int ) + object Stats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), - defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), - generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), - stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = + !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = + if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = + !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( + "collectAndCreateBeamAnalysisAndGraphs" + ), + defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( + if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") + else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") + ), + generalizedLinkStatsInterval = + if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ), + stats = BeamConfig.Beam.Outputs.Stats( + if (c.hasPathOrNull("stats")) c.getConfig("stats") + else com.typesafe.config.ConfigFactory.parseString("stats{}") + ), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim : BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager : BeamConfig.Beam.Physsim.EventManager, - events : BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia : scala.Boolean, - eventsSampling : scala.Double, - flowCapacityFactor : scala.Double, - initializeRouterWithFreeFlowTimes : scala.Boolean, - inputNetworkFilePath : java.lang.String, - jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize : scala.Int, - linkStatsWriteInterval : scala.Int, - maxLinkLengthToApplySpeedScalingFactor : scala.Double, - name : java.lang.String, - network : BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath : java.lang.String, - parbprsim : BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize : scala.Double, - quick_fix_minCarSpeedInMetersPerSecond : scala.Double, - relaxation : BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim : scala.Boolean, - speedScalingFactor : scala.Double, - storageCapacityFactor : scala.Double, - writeEventsInterval : scala.Int, - writePlansInterval : scala.Int, - writeRouteHistoryInterval : scala.Int + bprsim: BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager: BeamConfig.Beam.Physsim.EventManager, + events: BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia: scala.Boolean, + eventsSampling: scala.Double, + flowCapacityFactor: scala.Double, + initializeRouterWithFreeFlowTimes: scala.Boolean, + inputNetworkFilePath: java.lang.String, + jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize: scala.Int, + linkStatsWriteInterval: scala.Int, + maxLinkLengthToApplySpeedScalingFactor: scala.Double, + name: java.lang.String, + network: BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath: java.lang.String, + parbprsim: BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize: scala.Double, + quick_fix_minCarSpeedInMetersPerSecond: scala.Double, + relaxation: BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim: scala.Boolean, + speedScalingFactor: scala.Double, + storageCapacityFactor: scala.Double, + writeEventsInterval: scala.Int, + writePlansInterval: scala.Int, + writeRouteHistoryInterval: scala.Int ) + object Physsim { + case class Bprsim( - inFlowAggregationTimeWindowInSeconds : scala.Int, - minFlowToUseBPRFunction : scala.Int, - travelTimeFunction : java.lang.String + inFlowAggregationTimeWindowInSeconds: scala.Int, + minFlowToUseBPRFunction: scala.Int, + travelTimeFunction: java.lang.String ) + object Bprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, - minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = + if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) + c.getInt("inFlowAggregationTimeWindowInSeconds") + else 900, + minFlowToUseBPRFunction = + if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor : scala.Double + congestionFactor: scala.Double ) + object CchRoutingAssignment { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax : scala.Int, - departureTimeShiftMin : scala.Int, - fractionOfEventsToDuplicate : scala.Double + departureTimeShiftMax: scala.Int, + departureTimeShiftMin: scala.Int, + fractionOfEventsToDuplicate: scala.Double ) + object DuplicatePTE { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = + if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = + if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = + if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads : scala.Int, - `type` : java.lang.String + numberOfThreads: scala.Int, + `type`: java.lang.String ) + object EventManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) + object Jdeqsim { + case class AgentSimPhysSimInterfaceDebugger( - enabled : scala.Boolean + enabled: scala.Boolean ) + object AgentSimPhysSimInterfaceDebugger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, - capacityPlansWriteInterval : scala.Int, - enabled : scala.Boolean, - minRoadCapacity : scala.Int, - minSpeedMetersPerSec : scala.Int, - speedAdjustmentFactor : scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, + capacityPlansWriteInterval: scala.Int, + enabled: scala.Boolean, + minRoadCapacity: scala.Int, + minSpeedMetersPerSec: scala.Int, + speedAdjustmentFactor: scala.Double ) + object Cacc { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, - capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = + if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) + c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") + else 1.3, + capacityPlansWriteInterval = + if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = + if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = + if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( + if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") + else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") + ), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( + if (c.hasPathOrNull("cacc")) c.getConfig("cacc") + else com.typesafe.config.ConfigFactory.parseString("cacc{}") + ) ) } } - + case class Network( - maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) + object Network { + case class MaxSpeedInference( - enabled : scala.Boolean, - `type` : java.lang.String + enabled: scala.Boolean, + `type`: java.lang.String ) + object MaxSpeedInference { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled : scala.Boolean, - livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled: scala.Boolean, + livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) + object OverwriteRoadTypeProperties { + case class LivingStreet( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object LivingStreet { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Minor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Motorway { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object MotorwayLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Primary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object PrimaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Residential { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Secondary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object SecondaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Tertiary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TertiaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Trunk { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TrunkLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Unclassified { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( + if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") + else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") + ), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( + if (c.hasPathOrNull("minor")) c.getConfig("minor") + else com.typesafe.config.ConfigFactory.parseString("minor{}") + ), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( + if (c.hasPathOrNull("motorway")) c.getConfig("motorway") + else com.typesafe.config.ConfigFactory.parseString("motorway{}") + ), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( + if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") + else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") + ), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( + if (c.hasPathOrNull("primary")) c.getConfig("primary") + else com.typesafe.config.ConfigFactory.parseString("primary{}") + ), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( + if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") + else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") + ), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( + if (c.hasPathOrNull("residential")) c.getConfig("residential") + else com.typesafe.config.ConfigFactory.parseString("residential{}") + ), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( + if (c.hasPathOrNull("secondary")) c.getConfig("secondary") + else com.typesafe.config.ConfigFactory.parseString("secondary{}") + ), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( + if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") + else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") + ), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( + if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") + else com.typesafe.config.ConfigFactory.parseString("tertiary{}") + ), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( + if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") + else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") + ), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( + if (c.hasPathOrNull("trunk")) c.getConfig("trunk") + else com.typesafe.config.ConfigFactory.parseString("trunk{}") + ), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( + if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") + else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") + ), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( + if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") + else com.typesafe.config.ConfigFactory.parseString("unclassified{}") + ) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( + if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") + else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") + ), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( + if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") + else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") + ) ) } } - + case class Parbprsim( - numberOfClusters : scala.Int, - syncInterval : scala.Int + numberOfClusters: scala.Int, + syncInterval: scala.Int ) + object Parbprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier : scala.Double, - enabled : scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime : scala.Int + additionalTravelTimeMultiplier: scala.Double, + enabled: scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime: scala.Int ) + object PickUpDropOffAnalysis { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 + additionalTravelTimeMultiplier = + if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") + else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = + if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) + c.getInt("secondsFromPickUpPropOffToAffectTravelTime") + else 600 ) } } - + case class Relaxation( - experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type` : java.lang.String + experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type`: java.lang.String ) + object Relaxation { + case class Experiment20( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment20 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment21 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment30 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment40 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment50 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment51 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment52 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( + if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") + else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") + ), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( + if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") + else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") + ), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( + if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") + else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") + ), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( + if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") + else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") + ), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( + if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") + else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") + ), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( + if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") + else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") + ), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( + if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") + else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") + ), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), - eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), - events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), - linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, - name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), - ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim( + if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") + else com.typesafe.config.ConfigFactory.parseString("bprsim{}") + ), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( + if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") + else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") + ), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( + if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") + else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") + ), + eventManager = BeamConfig.Beam.Physsim.EventManager( + if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") + else com.typesafe.config.ConfigFactory.parseString("eventManager{}") + ), + events = BeamConfig.Beam.Physsim.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + eventsForFullVersionOfVia = + !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = + !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = + if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") + else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( + if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") + else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") + ), + linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = + if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = + if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) + c.getDouble("maxLinkLengthToApplySpeedScalingFactor") + else 50.0, + name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + overwriteLinkParamPath = + if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim( + if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") + else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") + ), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( + if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") + else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") + ), + ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = + if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) + c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") + else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation( + if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") + else com.typesafe.config.ConfigFactory.parseString("relaxation{}") + ), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = + if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = + if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1 : scala.Double, - ModuleProbability_2 : scala.Double, - ModuleProbability_3 : scala.Double, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - clearModes : BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation : scala.Double, - maxAgentPlanMemorySize : scala.Int + ModuleProbability_1: scala.Double, + ModuleProbability_2: scala.Double, + ModuleProbability_3: scala.Double, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + clearModes: BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation: scala.Double, + maxAgentPlanMemorySize: scala.Int ) + object Replanning { + case class ClearModes( - iteration : scala.Int, - modes : scala.Option[scala.List[java.lang.String]], - strategy : java.lang.String + iteration: scala.Int, + modes: scala.Option[scala.List[java.lang.String]], + strategy: java.lang.String ) + object ClearModes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes( + if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") + else com.typesafe.config.ConfigFactory.parseString("clearModes{}") + ), + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getDouble("fractionOfIterationsToDisableInnovation") + else Double.PositiveInfinity, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim : BeamConfig.Beam.Router.Skim + skim: BeamConfig.Beam.Router.Skim ) + object Router { + case class Skim( - activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims : scala.Int, - origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval : scala.Int, - writeSkimsInterval : scala.Int + activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims: scala.Int, + origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval: scala.Int, + writeSkimsInterval: scala.Int ) + object Skim { + case class ActivitySimSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object ActivitySimSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object DriveTimeSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", - name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") + else "skimsTravelTimeObservedVsSimulated", + name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String, - poolingTravelTimeOveheadFactor : scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, - writeFullSkimsInterval : scala.Int + fileBaseName: java.lang.String, + name: java.lang.String, + poolingTravelTimeOveheadFactor: scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, + writeFullSkimsInterval: scala.Int ) + object OriginDestinationSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, - writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = + if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") + else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = + if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) + c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") + else 0, + writeFullSkimsInterval = + if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName : java.lang.String, - geoHierarchy : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + geoHierarchy: java.lang.String, + name: java.lang.String ) + object TazSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object TransitCrowdingSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), - keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), - writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( + if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") + else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") + ), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( + if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") + else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") + ), + keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( + if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") + else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") + ), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( + if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") + else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") + ), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( + if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") + else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") + ), + writeAggregatedSkimsInterval = + if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) + skim = BeamConfig.Beam.Router.Skim( + if (c.hasPathOrNull("skim")) c.getConfig("skim") + else com.typesafe.config.ConfigFactory.parseString("skim{}") + ) ) } } - + case class Routing( - baseDate : java.lang.String, - carRouter : java.lang.String, - gh : BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS : scala.Int, - overrideNetworkTravelTimesUsingSkims : scala.Boolean, - r5 : BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor : scala.Double, - startingIterationForTravelTimesMSA : scala.Int, - transitOnStreetNetwork : scala.Boolean, - writeRoutingStatistic : scala.Boolean + baseDate: java.lang.String, + carRouter: java.lang.String, + gh: BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS: scala.Int, + overrideNetworkTravelTimesUsingSkims: scala.Boolean, + r5: BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor: scala.Double, + startingIterationForTravelTimesMSA: scala.Int, + transitOnStreetNetwork: scala.Boolean, + writeRoutingStatistic: scala.Boolean ) + object Routing { + case class Gh( - useAlternativeRoutes : scala.Boolean + useAlternativeRoutes: scala.Boolean ) + object Gh { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath : java.lang.String, - bikeLaneScaleFactor : scala.Double, - departureWindow : scala.Double, - directory : java.lang.String, - directory2 : scala.Option[java.lang.String], - linkRadiusMeters : scala.Double, - mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples : scala.Int, - osmMapdbFile : java.lang.String, - travelTimeNoiseFraction : scala.Double + bikeLaneLinkIdsFilePath: java.lang.String, + bikeLaneScaleFactor: scala.Double, + departureWindow: scala.Double, + directory: java.lang.String, + directory2: scala.Option[java.lang.String], + linkRadiusMeters: scala.Double, + mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples: scala.Int, + osmMapdbFile: java.lang.String, + travelTimeNoiseFraction: scala.Double ) + object R5 { + case class MNetBuilder( - fromCRS : java.lang.String, - toCRS : java.lang.String + fromCRS: java.lang.String, + toCRS: java.lang.String ) + object MNetBuilder { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike : scala.Int + bike: scala.Int ) + object MaxDistanceLimitByModeInMeters { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), - numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = + if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = + if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( + if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") + else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") + ), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( + if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") + ), + numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmMapdbFile = + if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") + else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = + if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), - minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, - overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), - r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), - skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh( + if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") + ), + minimumPossibleSkimBasedTravelTimeInS = + if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) + c.getInt("minimumPossibleSkimBasedTravelTimeInS") + else 60, + overrideNetworkTravelTimesUsingSkims = + c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( + "overrideNetworkTravelTimesUsingSkims" + ), + r5 = BeamConfig.Beam.Routing.R5( + if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") + ), + skimTravelTimesScalingFactor = + if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = + if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") + else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric : BeamConfig.Beam.Sim.Metric, - termination : BeamConfig.Beam.Sim.Termination + metric: BeamConfig.Beam.Sim.Metric, + termination: BeamConfig.Beam.Sim.Termination ) + object Sim { + case class Metric( - collector : BeamConfig.Beam.Sim.Metric.Collector + collector: BeamConfig.Beam.Sim.Metric.Collector ) + object Metric { + case class Collector( - influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics : java.lang.String + influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics: java.lang.String ) + object Collector { + case class InfluxDbSimulationMetricCollector( - connectionString : java.lang.String, - database : java.lang.String + connectionString: java.lang.String, + database: java.lang.String ) + object InfluxDbSimulationMetricCollector { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = + if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), - metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = + BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( + if (c.hasPathOrNull("influxDbSimulationMetricCollector")) + c.getConfig("influxDbSimulationMetricCollector") + else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") + ), + metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) + collector = BeamConfig.Beam.Sim.Metric.Collector( + if (c.hasPathOrNull("collector")) c.getConfig("collector") + else com.typesafe.config.ConfigFactory.parseString("collector{}") + ) ) } } - + case class Termination( - criterionName : java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName: java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) + object Termination { + case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration : scala.Int, - minLastIteration : scala.Int, - relativeTolerance : scala.Double + maxLastIteration: scala.Int, + minLastIteration: scala.Int, + relativeTolerance: scala.Double ) + object TerminateAtRideHailFleetStoredElectricityConvergence { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) + criterionName = + if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = + BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( + if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) + c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") + else + com.typesafe.config.ConfigFactory + .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), - termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) + metric = BeamConfig.Beam.Sim.Metric( + if (c.hasPathOrNull("metric")) c.getConfig("metric") + else com.typesafe.config.ConfigFactory.parseString("metric{}") + ), + termination = BeamConfig.Beam.Sim.Termination( + if (c.hasPathOrNull("termination")) c.getConfig("termination") + else com.typesafe.config.ConfigFactory.parseString("termination{}") + ) ) } } - + case class Spatial( - boundingBoxBuffer : scala.Int, - localCRS : java.lang.String + boundingBoxBuffer: scala.Int, + localCRS: java.lang.String ) + object Spatial { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear ) + object Urbansim { + case class BackgroundODSkimsCreator( - calculationTimeoutHours : scala.Int, - enabled : scala.Boolean, - maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes : scala.Int, - peakHours : scala.Option[scala.List[scala.Double]], - routerType : java.lang.String, - skimsGeoType : java.lang.String, - skimsKind : java.lang.String + calculationTimeoutHours: scala.Int, + enabled: scala.Boolean, + maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes: scala.Int, + peakHours: scala.Option[scala.List[scala.Double]], + routerType: java.lang.String, + skimsGeoType: java.lang.String, + skimsKind: java.lang.String ) + object BackgroundODSkimsCreator { + case class MaxTravelDistanceInMeters( - bike : scala.Int, - walk : scala.Int + bike: scala.Int, + walk: scala.Int ) + object MaxTravelDistanceInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive : scala.Boolean, - transit : scala.Boolean, - walk : scala.Boolean + drive: scala.Boolean, + transit: scala.Boolean, + walk: scala.Boolean ) + object ModesToBuild { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), - numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = + if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( + if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") + ), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( + if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") + else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") + ), + numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes : scala.Double, - bike : scala.Double, - car : scala.Double, - drive_transit : scala.Double, - walk : scala.Double, - walk_transit : scala.Double + allModes: scala.Double, + bike: scala.Double, + car: scala.Double, + drive_transit: scala.Double, + walk: scala.Double, + walk_transit: scala.Double ) + object FractionOfModesToClear { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( + if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") + else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") + ), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( + if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") + else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") + ) ) } } - + case class WarmStart( - path : java.lang.String, - prepareData : scala.Boolean, - samplePopulationIntegerFlag : scala.Int, - skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type` : java.lang.String + path: java.lang.String, + prepareData: scala.Boolean, + samplePopulationIntegerFlag: scala.Int, + skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type`: java.lang.String ) + object WarmStart { + case class SkimsFilePaths$Elm( - skimType : java.lang.String, - skimsFilePath : java.lang.String + skimType: java.lang.String, + skimsFilePath: java.lang.String ) + object SkimsFilePaths$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if(c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if (c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = + if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = + if (c.hasPathOrNull("skimsFilePaths")) + scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) + else None, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), - calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), - cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), - debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), - exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), - experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), - input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), - inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), - metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), - output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), - physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), - replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), - routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), - sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), - spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), - urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) + actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim( + if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") + else com.typesafe.config.ConfigFactory.parseString("agentsim{}") + ), + calibration = BeamConfig.Beam.Calibration( + if (c.hasPathOrNull("calibration")) c.getConfig("calibration") + else com.typesafe.config.ConfigFactory.parseString("calibration{}") + ), + cluster = BeamConfig.Beam.Cluster( + if (c.hasPathOrNull("cluster")) c.getConfig("cluster") + else com.typesafe.config.ConfigFactory.parseString("cluster{}") + ), + debug = BeamConfig.Beam.Debug( + if (c.hasPathOrNull("debug")) c.getConfig("debug") + else com.typesafe.config.ConfigFactory.parseString("debug{}") + ), + exchange = BeamConfig.Beam.Exchange( + if (c.hasPathOrNull("exchange")) c.getConfig("exchange") + else com.typesafe.config.ConfigFactory.parseString("exchange{}") + ), + experimental = BeamConfig.Beam.Experimental( + if (c.hasPathOrNull("experimental")) c.getConfig("experimental") + else com.typesafe.config.ConfigFactory.parseString("experimental{}") + ), + input = BeamConfig.Beam.Input( + if (c.hasPathOrNull("input")) c.getConfig("input") + else com.typesafe.config.ConfigFactory.parseString("input{}") + ), + inputDirectory = + if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger( + if (c.hasPathOrNull("logger")) c.getConfig("logger") + else com.typesafe.config.ConfigFactory.parseString("logger{}") + ), + metrics = BeamConfig.Beam.Metrics( + if (c.hasPathOrNull("metrics")) c.getConfig("metrics") + else com.typesafe.config.ConfigFactory.parseString("metrics{}") + ), + output = BeamConfig.Beam.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + outputs = BeamConfig.Beam.Outputs( + if (c.hasPathOrNull("outputs")) c.getConfig("outputs") + else com.typesafe.config.ConfigFactory.parseString("outputs{}") + ), + physsim = BeamConfig.Beam.Physsim( + if (c.hasPathOrNull("physsim")) c.getConfig("physsim") + else com.typesafe.config.ConfigFactory.parseString("physsim{}") + ), + replanning = BeamConfig.Beam.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + router = BeamConfig.Beam.Router( + if (c.hasPathOrNull("router")) c.getConfig("router") + else com.typesafe.config.ConfigFactory.parseString("router{}") + ), + routing = BeamConfig.Beam.Routing( + if (c.hasPathOrNull("routing")) c.getConfig("routing") + else com.typesafe.config.ConfigFactory.parseString("routing{}") + ), + sim = BeamConfig.Beam.Sim( + if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") + ), + spatial = BeamConfig.Beam.Spatial( + if (c.hasPathOrNull("spatial")) c.getConfig("spatial") + else com.typesafe.config.ConfigFactory.parseString("spatial{}") + ), + urbansim = BeamConfig.Beam.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart( + if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") + else com.typesafe.config.ConfigFactory.parseString("warmStart{}") + ) ) } } - + case class Matsim( - conversion : BeamConfig.Matsim.Conversion, - modules : BeamConfig.Matsim.Modules + conversion: BeamConfig.Matsim.Conversion, + modules: BeamConfig.Matsim.Modules ) + object Matsim { + case class Conversion( - defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles : scala.Boolean, - matsimNetworkFile : java.lang.String, - osmFile : java.lang.String, - populationFile : java.lang.String, - scenarioDirectory : java.lang.String, - shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile : java.lang.String + defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles: scala.Boolean, + matsimNetworkFile: java.lang.String, + osmFile: java.lang.String, + populationFile: java.lang.String, + scenarioDirectory: java.lang.String, + shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile: java.lang.String ) + object Conversion { + case class DefaultHouseholdIncome( - currency : java.lang.String, - period : java.lang.String, - value : scala.Int + currency: java.lang.String, + period: java.lang.String, + value: scala.Int ) + object DefaultHouseholdIncome { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if(c.hasPathOrNull("period")) c.getString("period") else "year", - value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if (c.hasPathOrNull("period")) c.getString("period") else "year", + value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile : java.lang.String, - tazIdFieldName : java.lang.String + shapeFile: java.lang.String, + tazIdFieldName: java.lang.String ) + object ShapeConfig { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( + if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") + else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") + ), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = + if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = + if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = + if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") + else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( + if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") + else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") + ), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode : BeamConfig.Matsim.Modules.ChangeMode, - controler : BeamConfig.Matsim.Modules.Controler, - counts : BeamConfig.Matsim.Modules.Counts, - global : BeamConfig.Matsim.Modules.Global, - households : BeamConfig.Matsim.Modules.Households, - linkStats : BeamConfig.Matsim.Modules.LinkStats, - network : BeamConfig.Matsim.Modules.Network, - parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, - plans : BeamConfig.Matsim.Modules.Plans, - qsim : BeamConfig.Matsim.Modules.Qsim, - strategy : BeamConfig.Matsim.Modules.Strategy, - transit : BeamConfig.Matsim.Modules.Transit, - vehicles : BeamConfig.Matsim.Modules.Vehicles + changeMode: BeamConfig.Matsim.Modules.ChangeMode, + controler: BeamConfig.Matsim.Modules.Controler, + counts: BeamConfig.Matsim.Modules.Counts, + global: BeamConfig.Matsim.Modules.Global, + households: BeamConfig.Matsim.Modules.Households, + linkStats: BeamConfig.Matsim.Modules.LinkStats, + network: BeamConfig.Matsim.Modules.Network, + parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, + plans: BeamConfig.Matsim.Modules.Plans, + qsim: BeamConfig.Matsim.Modules.Qsim, + strategy: BeamConfig.Matsim.Modules.Strategy, + transit: BeamConfig.Matsim.Modules.Transit, + vehicles: BeamConfig.Matsim.Modules.Vehicles ) + object Modules { + case class ChangeMode( - modes : java.lang.String + modes: java.lang.String ) + object ChangeMode { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat : java.lang.String, - firstIteration : scala.Int, - lastIteration : scala.Int, - mobsim : java.lang.String, - outputDirectory : java.lang.String, - overwriteFiles : java.lang.String + eventsFileFormat: java.lang.String, + firstIteration: scala.Int, + lastIteration: scala.Int, + mobsim: java.lang.String, + outputDirectory: java.lang.String, + overwriteFiles: java.lang.String ) + object Controler { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = + if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Double, - inputCountsFile : java.lang.String, - outputformat : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Double, + inputCountsFile: java.lang.String, + outputformat: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem : java.lang.String, - randomSeed : scala.Int + coordinateSystem: java.lang.String, + randomSeed: scala.Int ) + object Global { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile : java.lang.String, - inputHouseholdAttributesFile : java.lang.String + inputFile: java.lang.String, + inputHouseholdAttributesFile: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" + inputFile = + if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = + if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") + else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations : scala.Int, - writeLinkStatsInterval : scala.Int + averageLinkStatsOverIterations: scala.Int, + writeLinkStatsInterval: scala.Int ) + object LinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = + if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = + if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile : java.lang.String + inputNetworkFile: java.lang.String ) + object Network { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = + if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") + else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents : scala.Int, - numberOfThreads : scala.Int, - oneThreadPerHandler : scala.Boolean, - synchronizeOnSimSteps : scala.Boolean + estimatedNumberOfEvents: scala.Int, + numberOfThreads: scala.Int, + oneThreadPerHandler: scala.Boolean, + synchronizeOnSimSteps: scala.Boolean ) + object ParallelEventHandling { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = + if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta : scala.Long, - earlyDeparture : scala.Long, - lateArrival : scala.Long, - learningRate : scala.Long, - parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing : scala.Long, - traveling : scala.Long, - waiting : scala.Long, - writeExperiencedPlans : scala.Boolean + BrainExpBeta: scala.Long, + earlyDeparture: scala.Long, + lateArrival: scala.Long, + learningRate: scala.Long, + parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing: scala.Long, + traveling: scala.Long, + waiting: scala.Long, + writeExperiencedPlans: scala.Boolean ) + object PlanCalcScore { + case class Parameterset$Elm( - activityType : java.lang.String, - priority : scala.Int, - scoringThisActivityAtAll : scala.Boolean, - `type` : java.lang.String, - typicalDuration : java.lang.String, - typicalDurationScoreComputation : java.lang.String + activityType: java.lang.String, + priority: scala.Int, + scoringThisActivityAtAll: scala.Boolean, + `type`: java.lang.String, + typicalDuration: java.lang.String, + typicalDurationScoreComputation: java.lang.String ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" + activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = + !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = + if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") + else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, - earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, - lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, - learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, - traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, - waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + BrainExpBeta = + if (c.hasPathOrNull("BrainExpBeta")) + c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) + else 2, + earlyDeparture = + if (c.hasPathOrNull("earlyDeparture")) + c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, + lateArrival = + if (c.hasPathOrNull("lateArrival")) + c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) + else -18, + learningRate = + if (c.hasPathOrNull("learningRate")) + c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) + else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = + if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) + else 6, + traveling = + if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) + else -6, + waiting = + if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.PlanCalcScore + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Plans( - inputPersonAttributesFile : java.lang.String, - inputPlansFile : java.lang.String + inputPersonAttributesFile: java.lang.String, + inputPlansFile: java.lang.String ) + object Plans { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" + inputPersonAttributesFile = + if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") + else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = + if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") + else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime : java.lang.String, - snapshotperiod : java.lang.String, - startTime : java.lang.String + endTime: java.lang.String, + snapshotperiod: java.lang.String, + startTime: java.lang.String ) + object Qsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1 : scala.Int, - ModuleProbability_2 : scala.Int, - ModuleProbability_3 : scala.Int, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - fractionOfIterationsToDisableInnovation : scala.Int, - maxAgentPlanMemorySize : scala.Int, - parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval : java.lang.String + ModuleProbability_1: scala.Int, + ModuleProbability_2: scala.Int, + ModuleProbability_3: scala.Int, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + fractionOfIterationsToDisableInnovation: scala.Int, + maxAgentPlanMemorySize: scala.Int, + parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval: java.lang.String ) + object Strategy { + case class Parameterset$Elm( - disableAfterIteration : scala.Int, - strategyName : java.lang.String, - `type` : java.lang.String, - weight : scala.Int + disableAfterIteration: scala.Int, + strategyName: java.lang.String, + `type`: java.lang.String, + weight: scala.Int ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" - ) - } - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getInt("fractionOfIterationsToDisableInnovation") + else 999999, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = + if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") + else "WorstPlanForRemovalSelector" + ) + } + + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.Strategy + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Transit( - transitModes : java.lang.String, - useTransit : scala.Boolean, - vehiclesFile : java.lang.String + transitModes: java.lang.String, + useTransit: scala.Boolean, + vehiclesFile: java.lang.String ) + object Transit { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile : java.lang.String + vehiclesFile: java.lang.String ) + object Vehicles { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), - controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), - counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), - households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), - network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), - plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), - strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), - transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), - vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + changeMode = BeamConfig.Matsim.Modules.ChangeMode( + if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") + else com.typesafe.config.ConfigFactory.parseString("changeMode{}") + ), + controler = BeamConfig.Matsim.Modules.Controler( + if (c.hasPathOrNull("controler")) c.getConfig("controler") + else com.typesafe.config.ConfigFactory.parseString("controler{}") + ), + counts = BeamConfig.Matsim.Modules.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + global = BeamConfig.Matsim.Modules.Global( + if (c.hasPathOrNull("global")) c.getConfig("global") + else com.typesafe.config.ConfigFactory.parseString("global{}") + ), + households = BeamConfig.Matsim.Modules.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + linkStats = BeamConfig.Matsim.Modules.LinkStats( + if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") + else com.typesafe.config.ConfigFactory.parseString("linkStats{}") + ), + network = BeamConfig.Matsim.Modules.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( + if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") + else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") + ), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( + if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") + else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") + ), + plans = BeamConfig.Matsim.Modules.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + qsim = BeamConfig.Matsim.Modules.Qsim( + if (c.hasPathOrNull("qsim")) c.getConfig("qsim") + else com.typesafe.config.ConfigFactory.parseString("qsim{}") + ), + strategy = BeamConfig.Matsim.Modules.Strategy( + if (c.hasPathOrNull("strategy")) c.getConfig("strategy") + else com.typesafe.config.ConfigFactory.parseString("strategy{}") + ), + transit = BeamConfig.Matsim.Modules.Transit( + if (c.hasPathOrNull("transit")) c.getConfig("transit") + else com.typesafe.config.ConfigFactory.parseString("transit{}") + ), + vehicles = BeamConfig.Matsim.Modules.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), - modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) + conversion = BeamConfig.Matsim.Conversion( + if (c.hasPathOrNull("conversion")) c.getConfig("conversion") + else com.typesafe.config.ConfigFactory.parseString("conversion{}") + ), + modules = BeamConfig.Matsim.Modules( + if (c.hasPathOrNull("modules")) c.getConfig("modules") + else com.typesafe.config.ConfigFactory.parseString("modules{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), - matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) + beam = BeamConfig.Beam( + if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") + ), + matsim = BeamConfig.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ) ) } - private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + + private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { + + private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") + if ( + (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number] + ) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { + + private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException(cv.origin.lineNumber + + new java.lang.RuntimeException( + cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) + ) } - private def $_str(cv:com.typesafe.config.ConfigValue) = + + private def $_str(cv: com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } - From ef2367436c27d4dd3d937ed54014be9fe2d4ba3b Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sat, 4 Jun 2022 21:44:19 -0700 Subject: [PATCH 105/307] fix compilation problem --- .../infrastructure/ChargingNetworkManager.scala | 2 +- .../infrastructure/ChargingNetworkManagerHelper.scala | 10 ++++++---- .../infrastructure/parking/ParkingZoneFileUtils.scala | 5 +---- .../infrastructure/ChargingNetworkManagerSpec.scala | 1 - .../agentsim/infrastructure/ChargingNetworkSpec.scala | 7 +++++-- .../infrastructure/ZonalParkingManagerSpec.scala | 6 +++--- .../infrastructure/parking/PricingModelSpec.scala | 7 +++---- .../scala/beam/integration/EnrouteChargingSpec.scala | 4 ++-- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index a0337b7c7ab..db7f4c38736 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -103,7 +103,7 @@ class ChargingNetworkManager( .map(_.numAvailableChargers) .getOrElse(0) if (numAvailableChargers <= 0) { - logger.error(s"returning a stall with 0 availability. Something is broken. ${parkingResponse.stall}") + log.error(s"returning a stall with 0 availability. Something is broken. ${parkingResponse.stall}") } sender() ! parkingResponse } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index ad0860d9050..519a44b01fe 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -76,10 +76,12 @@ trait ChargingNetworkManagerHelper extends { ): Option[ScheduleTrigger] = { assume(endTime - startTime >= 0, s"timeInterval should not be negative! startTime $startTime endTime $endTime") // Calculate the energy to charge each vehicle connected to the a charging station - val endOfMaxSessionTime = chargingEndTimeInSeconds.get(chargingVehicle.personId).getOrElse { - log.error(s"Something is broken. The person ${chargingVehicle.personId} is not tracked by CHM") - endTime - } + val endOfMaxSessionTime = chargingEndTimeInSeconds.getOrElse( + chargingVehicle.personId, { + log.error(s"Something is broken. The person ${chargingVehicle.personId} is not tracked by CHM") + endTime + } + ) val endOfShiftTime = chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow).getOrElse(endTime) val updatedEndTime = Math.min(endOfMaxSessionTime, endOfShiftTime) val duration = Math.max(0, updatedEndTime - startTime) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala index a962d8d8a2b..1a3c770ca7d 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala @@ -506,10 +506,7 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { ): Int = { reservedFor.managerType match { case VehicleManager.TypeEnum.Household => - if (rand.nextDouble() <= scalingFactor) - initialNumStalls.toInt - else - 0 + initialNumStalls.toInt case _ => val expectedNumberOfStalls = initialNumStalls * scalingFactor MathUtils.roundUniformly(expectedNumberOfStalls, rand).toInt diff --git a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala index a02a2180065..6ccd78d1d34 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala @@ -460,7 +460,6 @@ class ChargingNetworkManagerSpec beamServices, chargingNetworkMap, rideHailNetwork, - parkingManager.ref, scheduler ) ) diff --git a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkSpec.scala index 29d3c32ab64..2a57c732506 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkSpec.scala @@ -95,7 +95,7 @@ class ChargingNetworkSpec val xfcChargingPoint = CustomChargingPoint("ultrafast", 250.0, ElectricCurrentType.DC) // first request is handled with the only stall in the system val firstInquiry = - ParkingInquiry.init(centerSpaceTime, "work", beamVehicle = Some(vehicle1), triggerId = 73737) + ParkingInquiry.init(centerSpaceTime, "charge", beamVehicle = Some(vehicle1), triggerId = 73737) val expectedFirstStall = ParkingStall( Id.create(1, classOf[TAZ]), @@ -125,7 +125,10 @@ class ChargingNetworkSpec ParkingInquiry.init(centerSpaceTime, "work", beamVehicle = Some(vehicle2), triggerId = 49238) val response2 = chargingNetwork.processParkingInquiry(secondInquiry) chargingNetwork.processParkingInquiry(secondInquiry) - assert(response2.isEmpty, "it should not get an Ultra Fast charging point stall") + assert( + !response2.exists(_.stall.chargingPointType.isDefined), + "it should not get an Ultra Fast charging point stall" + ) } } } diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index cfe2b3defdf..b7e4608c2e3 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -445,9 +445,9 @@ class ZonalParkingManagerSpec zonesMap, SpaceTime(new Coord(170308.0, 2964.0), 0), "4", - ParkingZone.createId("105"), + ParkingZone.createId("17"), Block(1.99, 3600), - ParkingType.Residential, + ParkingType.Public, "beamVilleCar" ) @@ -508,7 +508,7 @@ class ZonalParkingManagerSpec val inquiry = ParkingInquiry.init(spaceTime, "init", reservedFor, Some(vehicle), triggerId = 3737) val response = zpm.processParkingInquiry(inquiry) val tazId1 = Id.create(tazId, classOf[TAZ]) - val costInDollars = if (pricingModel.isInstanceOf[FlatFee]) pricingModel.costInDollars else 0.0 + val costInDollars = PricingModel.evaluateParkingTicket(pricingModel, 60) val expectedStall = ParkingStall( tazId1, diff --git a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala index c820b489620..077802adb18 100644 --- a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala @@ -18,7 +18,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { PricingModel("flatfee", inputCost.toString) match { case Some(PricingModel.FlatFee(cost)) => cost should equal(inputCost) - PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration, 0.0) should equal( + PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration) should equal( inputCost ) case _ => fail() @@ -31,7 +31,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { case Some(PricingModel.Block(cost, intervalInSeconds)) => cost should equal(100) intervalInSeconds should equal(PricingModel.DefaultPricingInterval) - PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration, 0.0) should equal( + PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration) should equal( inputCost * 2 ) case _ => fail() @@ -54,8 +54,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { inputCost.toDouble * (parkingDuration.toDouble / blockIntervalInSeconds.toDouble) PricingModel.evaluateParkingTicket( PricingModel.Block(cost, intervalInSeconds), - parkingDuration, - 0.0 + parkingDuration ) should equal( expectedTicketPrice ) diff --git a/src/test/scala/beam/integration/EnrouteChargingSpec.scala b/src/test/scala/beam/integration/EnrouteChargingSpec.scala index a5714ae1e3c..d836ed474a7 100644 --- a/src/test/scala/beam/integration/EnrouteChargingSpec.scala +++ b/src/test/scala/beam/integration/EnrouteChargingSpec.scala @@ -127,9 +127,9 @@ class EnrouteChargingSpec extends AnyWordSpecLike with Matchers with BeamHelper `vehicleId`, _, _, - "EnRoute", + enroute, _ - ) => + ) if enroute.startsWith("EnRoute") => refuelEvents += RefuelEventData( energyInJoules, ChargingPointType.getChargingPointInstalledPowerInKw(stall.chargingPointType.get) From b383855316932069944566cd10d350e75ff61fd0 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 5 Jun 2022 15:44:46 -0700 Subject: [PATCH 106/307] more logs --- .../beam/agentsim/infrastructure/ChargingNetwork.scala | 6 ++++++ .../agentsim/infrastructure/ChargingNetworkManager.scala | 8 -------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 3e1c83ac169..513f896bc5e 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -293,6 +293,12 @@ object ChargingNetwork extends LazyLogging { chargingVehiclesInternal.put(vehicle.id, chargingVehicle) chargingVehicle.updateStatus(Connected, tick) } else { + logger.warn( + s"Person $personId heading to activity $activityType with vehicle ${chargingVehicle.vehicle.id} " + + s"has been added to the queue at stall $stall." + + s"maxStall ${zone.maxStalls}, howManyVehiclesAreCharging $howManyVehiclesAreCharging, " + + s"howManyVehiclesAreInGracePeriodAfterCharging $howManyVehiclesAreInGracePeriodAfterCharging" + ) waitingLineInternal.enqueue(chargingVehicle) chargingVehicle.updateStatus(WaitingAtStation, tick) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index db7f4c38736..f3a6e61bd98 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -97,14 +97,6 @@ class ChargingNetworkManager( parkingResponse => if (parkingResponse.stall.chargingPointType.isDefined) inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) - val numAvailableChargers: Int = chargingNetworkHelper - .get(parkingResponse.stall.reservedFor.managerId) - .lookupStation(parkingResponse.stall.parkingZoneId) - .map(_.numAvailableChargers) - .getOrElse(0) - if (numAvailableChargers <= 0) { - log.error(s"returning a stall with 0 availability. Something is broken. ${parkingResponse.stall}") - } sender() ! parkingResponse } From b78bc75ad314525e0453f85468b3e14ebf2e4845 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 5 Jun 2022 19:56:04 -0700 Subject: [PATCH 107/307] more logging --- .../agentsim/infrastructure/parking/ParkingNetwork.scala | 3 +++ .../agentsim/infrastructure/parking/ParkingZoneSearch.scala | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala index 732cb4515ff..0118c7ac5a6 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala @@ -35,6 +35,9 @@ abstract class ParkingNetwork(parkingZones: Map[Id[ParkingZoneId], ParkingZone]) ) // update the parking stall data val claimed: Boolean = searchFunctions.get.claimStall(parkingZone) + logger.warn( + s"The parking zone ${parkingZone.parkingZoneId} after claim has now availability ${parkingZone.stallsAvailable}" + ) if (claimed) { totalStallsInUse += 1 totalStallsAvailable -= 1 diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 365653437ac..b3ca94bd0a3 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -9,6 +9,7 @@ import beam.agentsim.infrastructure.charging._ import beam.agentsim.infrastructure.taz.TAZ import beam.router.BeamRouter.Location import beam.utils.MathUtils +import com.typesafe.scalalogging.LazyLogging import com.vividsolutions.jts.geom.Envelope import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.collections.QuadTree @@ -18,7 +19,7 @@ import scala.collection.JavaConverters._ import scala.collection.mutable import scala.util.Random -object ParkingZoneSearch { +object ParkingZoneSearch extends LazyLogging { /** * a nested structure to support a search over available parking attributes, @@ -169,6 +170,9 @@ object ParkingZoneSearch { ) if parkingZoneFilterFunction(parkingZone) } yield { + if (parkingZone.stallsAvailable <= 0) { + logger.warn(s"Selected parking zone ${parkingZone.parkingZoneId} with 0 availability") + } // wrap ParkingZone in a ParkingAlternative val stallLocation: Coord = parkingZoneLocSamplingFunction(parkingZone) // end-of-day parking durations are set to zero, which will be mis-interpreted here From 2eda6c87c62dc9999900ce5ec7c94ea52f88cd56 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 5 Jun 2022 21:28:30 -0700 Subject: [PATCH 108/307] test fix --- src/main/R/gemini/gemini-processing.R | 27 +++++++++++-------- .../parking/ParkingZoneFileUtils.scala | 12 ++++----- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index fb9ed2102af..34d219bc115 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -53,17 +53,7 @@ write.csv( quote=FALSE) ### -test1 <- readCsv(pp(workDir, "/test/0.events.test1.csv.gz")) -test1H <- readCsv(pp(workDir, "/test/0.events.test1H.csv.gz")) -test2 <- readCsv(pp(workDir, "/test/0.events.test2.csv.gz")) -test <- readCsv(pp(workDir, "/test/0.events.csv.gz")) -householdVehicles <- readCsv(pp(workDir, "/test/householdVehicles.csv")) -refuelEvents <- test[type=="RefuelSessionEvent"] -parkEvents <- test[type=="ParkingEvent"] -householdVehicles$vehicleId <- as.character(householdVehicles$vehicleId) -res <- parkEvents[householdVehicles, on=c(vehicle="vehicleId")] -res2 <- rbind(res[startsWith(i.vehicleType,"ev-")], res[startsWith(i.vehicleType,"phev-")]) - +#eventsraw <- readCsv(pp(workDir, "/0.events.csv.gz")) events1 <- readCsv(pp(workDir, "/2022-04-27-Calibration/events/filtered.0.events.5b4.csv.gz")) events2 <- readCsv(pp(workDir, "/2022-04-28/events/filtered.0.events.5bBase.csv.gz")) test <- events2[type=="RefuelSessionEvent"][time-duration == 0] @@ -940,4 +930,19 @@ mnl_param[,.(.N,mean(costInDollars)),by=.(chargingPointType)] events7[type=="RefuelSessionEvent"][,.(sumFuel=sum(fuel)),by=.(actType)] +## TEST + + +events.test <- readCsv(pp(workDir, "/test/0.events.csv.gz")) +ref.test <- events.test[type=="RefuelSessionEvent"] +charging_share <- ref.test[,.(fuel=sum(fuel)),by=.(chargingPointType)][,fuel_share:=fuel/sum(fuel)] +vehicle.test <- readCsv(pp(workDir, "/test/householdVehicles.csv")) +park.test <- events.test[type=="ParkingEvent"] +vehicle.test$vehicleId <- as.character(vehicle.test$vehicleId) +park.test.2 <- park.test[vehicle.test, on=c(vehicle="vehicleId")] + +ev <- park.test.2[startsWith(i.vehicleType,"ev-")] +phev <- park.test.2[startsWith(i.vehicleType,"phev-")] +allev <- rbind(ev,phev) + diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala index 1a3c770ca7d..989d0dda764 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala @@ -290,10 +290,10 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { parkingStallCountScalingFactor, parkingCostScalingFactor ) match { - case None => - accumulator.countFailedRow - case Some(row: ParkingLoadingDataRow) => + case Some(row: ParkingLoadingDataRow) if row.parkingZone.stallsAvailable > 0 => addStallToSearch(row, accumulator) + case _ => + accumulator.countFailedRow } _read(updatedAccumulator) } else { @@ -342,10 +342,10 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { parkingStallCountScalingFactor, parkingCostScalingFactor ) match { - case None => - accumulator.countFailedRow - case Some(row: ParkingLoadingDataRow) => + case Some(row: ParkingLoadingDataRow) if row.parkingZone.stallsAvailable > 0 => addStallToSearch(row, accumulator) + case _ => + accumulator.countFailedRow } } match { case Success(updatedAccumulator) => From 12fbea2a59895a7057e75d8ac17c10af95db4a9e Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 5 Jun 2022 23:39:54 -0700 Subject: [PATCH 109/307] rollback overnight to only begining of the day --- src/main/R/gemini/gemini-main.R | 16 ++++++++-------- .../infrastructure/ChargingFunctions.scala | 4 ++-- .../infrastructure/parking/ParkingNetwork.scala | 6 +++--- .../parking/ParkingZoneSearch.scala | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index aba14419388..c185cb8a5b7 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -27,7 +27,7 @@ expFactor <- (6.015/0.6015) severity_order <- c("Public <1MW", "Public 1-5MW", "Public >5MW", "Ridehail Depot <1MW", "Ridehail Depot 1-5MW", "Ridehail Depot >5MW") extreme_lab_order <- c("<1MW", "1-5MW", ">5MW") -dataDir <- normalizePath("~/Data/GEMINI/2022-04-28") +dataDir <- normalizePath("~/Data/GEMINI/2022-04-27-Calibration") #events <- readCsv(pp(dataDir, "/events/0.events.BASE.csv.gz")) #eventsDir <- paste(dataDir, "/events",sep="") resultsDir <- paste(dataDir, "/results",sep="") @@ -65,18 +65,18 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') -# scenarioNames <- c('5b1', '5b2', '5b3', '5b4') +scenarioNames <- c('5b1', '5b2', '5b3', '5b4') -scenarioNames <- c('BaseXFC', 'HighEV') -scenarioBaselineLabel <- 'BaseXFC' -#scenarioBaselineLabel <- '5b3' +#scenarioNames <- c('BaseXFC', 'HighEV') +#scenarioBaselineLabel <- 'BaseXFC' +scenarioBaselineLabel <- '5b1' #all.loads <- all.loads[!is.na(loadType)] ########################################## # LOADS & ENERGY ########################################## ## Baseline XFC hours per site per day -scenarioBaselineLabel <- 'BaseXFC' +#scenarioBaselineLabel <- 'BaseXFC' toplot <- all.loads[name==scenarioBaselineLabel] toplot[,panel:=revalue(factor(site),c('public'='Public','depot'='Ridehail CAV Depot'))] p <- toplot[,.(kw=sum(kw)),by=c('severity','hour.bin2', 'panel')] %>% @@ -90,7 +90,7 @@ p <- toplot[,.(kw=sum(kw)),by=c('severity','hour.bin2', 'panel')] %>% ggsave(pp(plotsDir,'/baseline-xfc-hours-per-site-per-day.png'),p,width=6,height=4,units='in') ## Baseline public charging -scenarioBaselineLabel <- 'HighEV' +#scenarioBaselineLabel <- 'HighEV' title_label <- paste("Public Charging - ", scenarioBaselineLabel, sep="") file_name <- paste('/baseline-public-charging-', scenarioBaselineLabel, ".png", sep="") toplot <- all.loads[name==scenarioBaselineLabel] @@ -106,7 +106,7 @@ ggsave(pp(plotsDir,file_name),p,width=6,height=4,units='in') ## Baseline ev charging loads by space time -scenarioBaselineLabel <- 'BaseXFC' +#scenarioBaselineLabel <- 'BaseXFC' toplot <- all.loads[name==scenarioBaselineLabel&hour.bin2%in%c(0, 6, 12, 18)] toplot$mw <- toplot$kw/1000 toplot$hour.bin2.label <- "12am" diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 86093bac04f..d33a8d9dcc3 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -202,8 +202,8 @@ class ChargingFunctions( .map(_.rangeAnxiety(withAddedFuelInJoules = addedEnergy)) .getOrElse(0.0) // default no anxiety if no remaining trip data provided - // overnight charging is either at the beginning of the simulated day or end of the simulated day - val overnightParkingCheck = inquiry.remainingTripData.forall(_.remainingTourDistance == 0) + // overnight charging is at the beginning of the simulated day, when inquiries are submitted at time t=0 + val overnightParkingCheck = inquiry.destinationUtm.time == 0 val overnightParkingPrefersChargingFactor: Double = if (overnightParkingCheck) 1 - math.min(1.0, math.max(0.0, stateOfCharge)) else 0.0 diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala index 0118c7ac5a6..d72b2141ba9 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala @@ -35,9 +35,9 @@ abstract class ParkingNetwork(parkingZones: Map[Id[ParkingZoneId], ParkingZone]) ) // update the parking stall data val claimed: Boolean = searchFunctions.get.claimStall(parkingZone) - logger.warn( - s"The parking zone ${parkingZone.parkingZoneId} after claim has now availability ${parkingZone.stallsAvailable}" - ) +// logger.warn( +// s"The parking zone ${parkingZone.parkingZoneId} after claim has now availability ${parkingZone.stallsAvailable}" +// ) if (claimed) { totalStallsInUse += 1 totalStallsAvailable -= 1 diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index b3ca94bd0a3..9e14c0ab0f2 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -171,7 +171,7 @@ object ParkingZoneSearch extends LazyLogging { if parkingZoneFilterFunction(parkingZone) } yield { if (parkingZone.stallsAvailable <= 0) { - logger.warn(s"Selected parking zone ${parkingZone.parkingZoneId} with 0 availability") + //logger.warn(s"Selected parking zone ${parkingZone.parkingZoneId} with 0 availability") } // wrap ParkingZone in a ParkingAlternative val stallLocation: Coord = parkingZoneLocSamplingFunction(parkingZone) From fce13cdbd191fc48235a94cf4d07f4328583f7dd Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Sun, 5 Jun 2022 23:42:32 -0700 Subject: [PATCH 110/307] removing debug code --- .../beam/agentsim/infrastructure/ChargingNetwork.scala | 6 ------ .../agentsim/infrastructure/parking/ParkingNetwork.scala | 3 --- .../infrastructure/parking/ParkingZoneFileUtils.scala | 2 ++ .../agentsim/infrastructure/parking/ParkingZoneSearch.scala | 6 +----- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 513f896bc5e..3e1c83ac169 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -293,12 +293,6 @@ object ChargingNetwork extends LazyLogging { chargingVehiclesInternal.put(vehicle.id, chargingVehicle) chargingVehicle.updateStatus(Connected, tick) } else { - logger.warn( - s"Person $personId heading to activity $activityType with vehicle ${chargingVehicle.vehicle.id} " + - s"has been added to the queue at stall $stall." + - s"maxStall ${zone.maxStalls}, howManyVehiclesAreCharging $howManyVehiclesAreCharging, " + - s"howManyVehiclesAreInGracePeriodAfterCharging $howManyVehiclesAreInGracePeriodAfterCharging" - ) waitingLineInternal.enqueue(chargingVehicle) chargingVehicle.updateStatus(WaitingAtStation, tick) } diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala index d72b2141ba9..732cb4515ff 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala @@ -35,9 +35,6 @@ abstract class ParkingNetwork(parkingZones: Map[Id[ParkingZoneId], ParkingZone]) ) // update the parking stall data val claimed: Boolean = searchFunctions.get.claimStall(parkingZone) -// logger.warn( -// s"The parking zone ${parkingZone.parkingZoneId} after claim has now availability ${parkingZone.stallsAvailable}" -// ) if (claimed) { totalStallsInUse += 1 totalStallsAvailable -= 1 diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala index 989d0dda764..2c744b36a6b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala @@ -291,6 +291,7 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { parkingCostScalingFactor ) match { case Some(row: ParkingLoadingDataRow) if row.parkingZone.stallsAvailable > 0 => + // After sampling down parking certain parking zone became unavailable. We keep only available ones. addStallToSearch(row, accumulator) case _ => accumulator.countFailedRow @@ -343,6 +344,7 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { parkingCostScalingFactor ) match { case Some(row: ParkingLoadingDataRow) if row.parkingZone.stallsAvailable > 0 => + // After sampling down parking certain parking zone became unavailable. We keep only available ones. addStallToSearch(row, accumulator) case _ => accumulator.countFailedRow diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 9e14c0ab0f2..365653437ac 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -9,7 +9,6 @@ import beam.agentsim.infrastructure.charging._ import beam.agentsim.infrastructure.taz.TAZ import beam.router.BeamRouter.Location import beam.utils.MathUtils -import com.typesafe.scalalogging.LazyLogging import com.vividsolutions.jts.geom.Envelope import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.collections.QuadTree @@ -19,7 +18,7 @@ import scala.collection.JavaConverters._ import scala.collection.mutable import scala.util.Random -object ParkingZoneSearch extends LazyLogging { +object ParkingZoneSearch { /** * a nested structure to support a search over available parking attributes, @@ -170,9 +169,6 @@ object ParkingZoneSearch extends LazyLogging { ) if parkingZoneFilterFunction(parkingZone) } yield { - if (parkingZone.stallsAvailable <= 0) { - //logger.warn(s"Selected parking zone ${parkingZone.parkingZoneId} with 0 availability") - } // wrap ParkingZone in a ParkingAlternative val stallLocation: Coord = parkingZoneLocSamplingFunction(parkingZone) // end-of-day parking durations are set to zero, which will be mis-interpreted here From cf866642e307d11acf13ccbb1f11bbec00d66f44 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 6 Jun 2022 21:31:17 +0600 Subject: [PATCH 111/307] Moving all utilities that extends `App` or defines `main(args: String[])` to `scripts` package --- docs/messages.rst | 2 +- .../beam/physsim/jdeqsim/JDEQSimRunner.scala | 1 - src/main/scala/beam/sim/BeamSim.scala | 3 +- .../beam/utils/{scripts => }/FailFast.scala | 2 +- src/main/scala/beam/utils/map/GpxPoint.scala | 5 +++ src/main/scala/beam/utils/map/PointInfo.scala | 5 +++ .../utils/mapsapi/bingapi/BingAdapter.scala | 2 +- .../mapsapi/googleapi/GoogleAdapter.scala | 2 +- .../BackgroundSkimsCreatorApp.scala | 25 +++++++-------- .../BeamScenarioDataExtractor.scala | 2 +- .../utils => scripts}/ConfigAnalysis.scala | 4 ++- .../ConfigValuesComparator.scala | 5 +-- .../utils => scripts}/CoordInBoundsUtil.scala | 6 ++-- .../DeadHeadingAnalysisExample.scala | 3 +- .../utils => scripts}/EventReplayer.scala | 3 +- .../GpxCompareSimulationVsReference.scala | 3 +- .../GraphHopperOsmUsageExample.scala | 3 +- .../utils => scripts}/Network2ShapeFile.scala | 2 +- .../NetworkEdgeOutputGenerator.scala | 4 +-- .../ParkingManagerBenchmark.scala | 5 +-- .../utils/plan => scripts}/PlansBuilder.scala | 3 +- .../PlansSamplerApp.scala | 2 +- .../scripts/PopulationWriterCSV.scala | 6 ++-- .../utils => }/scripts/R5GraphGenerator.scala | 2 +- .../RespositioingValidation.scala | 3 +- .../TravelTimeAndDistanceCalculatorApp.scala | 21 +++++++------ .../TravelTimeGoogleApp.scala | 5 +-- .../UberOSMSpeedMapper.scala | 2 +- .../UrbansimConverter.scala | 4 ++- .../analysis/BlockGroupToTazMapper.scala | 10 +++--- .../analysis/GenerateTripTable.scala | 2 +- .../analysis/NewYorkBeamVsLodes.scala | 4 +-- .../NewYorkBeamVsLodesWithinTAZ.scala | 4 +-- .../NewYorkHomeWorkLocationAnalysis.scala | 10 +++--- .../NewYorkTrafficSpeedAnalysis.scala | 8 ++--- .../beam_to_matsim/EventsByVehicleMode.scala | 0 .../beam_to_matsim/events/BeamActivity.scala | 0 .../beam_to_matsim/events/BeamEvent.scala | 0 .../events/BeamModeChoice.scala | 0 .../events/BeamPathTraversal.scala | 0 .../events/BeamPersonEntersVehicle.scala | 0 .../events/BeamPersonLeavesVehicle.scala | 0 .../MutablePopulationEventsFilter.scala | 0 .../MutablePopulationFilter.scala | 0 .../events_filter/MutableSamplingFilter.scala | 0 .../events_filter/MutableVehiclesFilter.scala | 0 .../events_filter/PersonEvents.scala | 0 .../events_filter/PersonTrip.scala | 0 .../events_filter/PopulationSample.scala | 0 .../events_filter/VehicleSample.scala | 0 .../events_filter/VehicleTrip.scala | 0 .../beam_to_matsim/io/BeamEventsReader.scala | 0 .../beam_to_matsim/io/ConsoleProgress.scala | 0 .../beam_to_matsim/io/HashSetReader.scala | 0 .../beam_to_matsim/io/Reader.scala | 0 .../beam_to_matsim/io/Writer.scala | 0 .../beam_to_matsim/utils/CollectIds.scala | 0 .../utils/FindIdsInCircles.scala | 0 .../utils/FindPersonsUsesVehicles.scala | 0 .../beam_to_matsim/utils/LinkCoordinate.scala | 0 .../utils/ZipViaEventsFiles.scala | 0 .../via_event/ViaActivity.scala | 0 .../beam_to_matsim/via_event/ViaEvent.scala | 0 .../via_event/ViaEventsCollection.scala | 0 .../via_event/ViaPersonArrivalEvent.scala | 0 .../via_event/ViaPersonDepartureEvent.scala | 0 .../via_event/ViaTraverseLinkEvent.scala | 0 .../visualization/via/visualization_11.scala | 0 .../visualization/via/visualization_12.scala | 0 .../via/visualization_20_24.scala | 0 .../via/visualization_33_34.scala | 0 .../visualization/via/visualization_35.scala | 0 ...isualization_35_person1_alternatives.scala | 0 .../via/visualization_3_4_5.scala | 0 .../visualization/via/visualization_6.scala | 0 .../visualization/via/visualization_9.scala | 0 .../calibration/BeamSigoptTuner.scala | 10 +++--- .../calibration/Bounded.scala | 2 +- .../calibration/CalibrationArguments.scala | 2 +- .../calibration/ExperimentRunner.scala | 8 ++--- .../calibration/RunCalibration.scala | 8 ++--- .../calibration/SigoptExperimentData.scala | 9 +++--- .../calibration/utils/CreateExperiment.scala | 9 +++--- .../calibration/utils/DeleteSuggestion.scala | 4 +-- .../calibration/utils/ListExperiments.scala | 2 +- .../calibration/utils/ListSuggestions.scala | 2 +- .../calibration/utils/SigOptApiToken.scala | 2 +- .../HouseholdsXml2CsvConverter.scala | 2 +- .../csv/conversion/NetworkXmlToCSV.scala | 2 +- .../conversion/PhyssimEventsXmlToCSV.scala | 2 +- .../conversion/PlansXml2CsvConverter.scala | 2 +- .../PopulationXml2CsvConverter.scala | 2 +- .../csv/conversion/Xml2CsvFileConverter.scala | 2 +- .../csv/conversion/XmlConverter.scala | 2 +- .../data => scripts}/ctpp/CTPPParser.scala | 5 +-- .../ctpp/JointDistribution.scala | 4 +-- .../utils/data => scripts}/ctpp/Models.scala | 2 +- .../ctpp/models/AgeRange.scala | 2 +- .../ctpp/models/FlowGeoParser.scala | 2 +- .../data => scripts}/ctpp/models/Gender.scala | 2 +- .../ctpp/models/HouseholdIncome.scala | 2 +- .../ctpp/models/HouseholdSize.scala | 2 +- .../ctpp/models/MeansOfTransportation.scala | 2 +- .../data => scripts}/ctpp/models/OD.scala | 2 +- .../ctpp/models/ResidenceGeoParser.scala | 2 +- .../ctpp/models/ResidenceGeography.scala | 2 +- .../ResidenceToWorkplaceFlowGeography.scala | 2 +- .../ctpp/models/ResidentialGeoParser.scala | 2 +- .../ctpp/models/Vehicles.scala | 2 +- .../ctpp/models/WorkedHours.scala | 2 +- .../ctpp/models/flow/Industry.scala | 2 +- .../ctpp/models/residence/Industry.scala | 2 +- .../ctpp/readers/BaseTableReader.scala | 9 +++--- .../ctpp/readers/MetadataReader.scala | 4 +-- .../readers/flow/AgeOfWorkerTableReader.scala | 9 +++--- .../flow/HouseholdIncomeTableReader.scala | 14 +++++---- .../readers/flow/IndustryTableReader.scala | 11 ++++--- .../MeansOfTransportationTableReader.scala | 13 +++++--- .../flow/TimeLeavingHomeTableReader.scala | 14 ++++----- .../readers/flow/TravelTimeTableReader.scala | 17 +++++----- .../readers/residence/AgeTableReader.scala | 8 ++--- ...oldSizeByUnitsInStructureTableReader.scala | 14 +++++---- .../residence/IndustryTableReader.scala | 13 ++++---- .../MeanHouseholdIncomeTableReader.scala | 10 +++--- .../MedianHouseholdIncomeTableReader.scala | 10 +++--- .../readers/residence/SexTableReader.scala | 11 ++++--- .../TotalHouseholdsTableReader.scala | 10 +++--- .../TotalPopulationTableReader.scala | 10 +++--- .../UsualHoursWorkedPerWeekTableReader.scala | 8 ++--- .../VehiclesAvailableTableReader.scala | 8 ++--- .../ctpp/scenario/ScenarioGenerator.scala | 2 +- .../scenario/SimpleScenarioGenerator.scala | 27 +++++----------- .../docs/GenerateDocumentationTask.scala | 2 +- .../docs/ReflectionUtil.scala | 2 +- .../experiment/ExperimentApp.scala | 4 +-- .../experiment/ExperimentDef.scala | 2 +- .../experiment/ExperimentGenerator.scala | 4 +-- .../experiment/ExperimentRunSandbox.scala | 2 +- .../{beam => scripts}/experiment/Factor.scala | 2 +- .../experiment/RunExperiments.scala | 2 +- .../map/ActivitiesClustering.scala | 4 +-- .../utils => scripts}/map/EnvelopeToGpx.scala | 16 +++++----- .../map/GeoFenceVerifier.scala | 12 +++----- .../map/GeoJsonToGpxConvertor.scala | 11 ++++--- .../utils => scripts}/map/GpxWriter.scala | 10 +++--- .../utils => scripts}/map/LinkIdsToGpx.scala | 6 ++-- .../map/NewYorkAnalysis.scala | 6 ++-- .../map/NewYorkReplanningAnalysis.scala | 7 ++--- .../map/NewYorkRouteDebugging.scala | 2 +- .../map/NewYorkSubwayAnalysis.scala | 2 +- .../NewYorkTrafficVolumeVisualization.scala | 4 +-- .../map/OsmosisPolygonFilterGenerator.scala | 10 +++--- .../map/R5MapStatsCalculator.scala | 2 +- .../map/R5NetworkPlayground.scala | 6 ++-- .../map/RepositioningAnalyzer.scala | 10 +++--- .../map/TazTravelTimeAnalyzer.scala | 8 ++--- .../map/TazTreeMapToGpx.scala | 6 ++-- .../mapsapi}/BingExampleOfUsage.scala | 10 +++--- .../mapsapi}/GoogleApiExampleUsage.scala | 12 ++++---- .../mapsapi}/HereExampleUsage.scala | 9 +++--- .../protocolvis/ActorAsState.scala | 6 ++-- .../protocolvis/AgentStateDiagram.scala | 8 ++--- .../protocolvis/Extractors.scala | 4 +-- .../protocolvis/MessageReader.scala | 2 +- .../protocolvis/PumlWriter.scala | 2 +- .../protocolvis/SequenceDiagram.scala | 4 +-- .../protocolvis/VisualizingApp.scala | 6 ++-- .../shape/FilterPointsInShapeFile.scala | 2 +- .../shape/GenericFeatureBuilder.scala | 2 +- .../shape/NoAttributeShapeWriter.scala | 4 +-- .../utils => scripts}/shape/ShapeWriter.scala | 6 ++-- .../shapefiles/WriteShapeFile.scala | 0 .../synthpop/CongestionLevelData.scala | 2 +- .../data => scripts}/synthpop/FipsCodes.scala | 5 ++- .../synthpop/FlowStatsForParking.scala | 10 +++--- .../synthpop/HouseholdReader.scala | 2 +- .../synthpop/IndustryAssigner.scala | 17 +++++----- .../synthpop/NewYorkScenarioFilter.scala | 5 ++- .../data => scripts}/synthpop/ODSampler.scala | 4 +-- .../synthpop/PolygonShapeToCsvConverter.scala | 5 +-- .../synthpop/PopulationCorrection.scala | 2 +- .../synthpop/PopulationReader.scala | 2 +- .../synthpop/PumaLevelScenarioGenerator.scala | 11 ++++--- .../synthpop/ScenarioGenerator.scala | 29 ++++++++---------- .../SimpleScenarioGeneratorArgParser.scala | 7 ++--- .../synthpop/SynthpopOutputJoiner.scala} | 7 ++--- .../synthpop/SynthpopReader.scala} | 14 ++++----- .../synthpop/WorkForceSampler.scala | 10 +++--- .../data => scripts}/synthpop/doc/README.md | 4 +-- .../synthpop/doc/data_sources.svg | 0 .../synthpop/doc/flowchart.svg | 0 .../doc/hierarchy_of_cencus_geo_entities.jpg | Bin .../generators/BenchmarkGenerator.scala | 8 ++--- .../generators/TimeLeavingHomeGenerator.scala | 8 ++--- .../generators/WorkDestinationGenerator.scala | 10 +++--- .../generators/WorkedDurationGenerator.scala | 5 ++- .../synthpop/tools/ScenarioDownsampler.scala | 2 +- .../traveltime/FeatureEventHandler.scala | 2 +- .../traveltime/FeatureExtractor.scala | 2 +- .../traveltime/LinkInOutFeature.scala | 4 +-- .../traveltime/NetworkFeaturesExtractor.scala | 2 +- .../traveltime/NetworkUtil.scala | 2 +- .../BackgroundSkimsCreatorAppSpec.scala | 4 +-- .../Network2ShapeFileTest.scala | 4 +-- .../NetworkXmlToCsvSpec.scala | 4 +-- ...avelTimeAndDistanceCalculatorAppSpec.scala | 3 +- .../beam_to_matsim/LinkCoordinateTest.scala | 0 .../beam_to_matsim/io/WriterTest.scala | 0 .../calibration/BeamSigoptTunerSpec.scala | 7 +++-- .../ctpp}/JointDistributionTest.scala | 7 ++--- .../protocolvis/SequenceDiagramTest.scala | 4 +-- .../shape/NoAttributeShapeWriterTest.scala | 4 +-- .../shape/ShapeWriterTest.scala | 4 +-- 213 files changed, 482 insertions(+), 467 deletions(-) rename src/main/scala/beam/utils/{scripts => }/FailFast.scala (99%) create mode 100644 src/main/scala/beam/utils/map/GpxPoint.scala create mode 100644 src/main/scala/beam/utils/map/PointInfo.scala rename src/main/scala/{beam/router/skim/urbansim => scripts}/BackgroundSkimsCreatorApp.scala (97%) rename src/main/scala/{beam/utils/data/synthpop => scripts}/BeamScenarioDataExtractor.scala (98%) rename src/main/scala/{beam/utils => scripts}/ConfigAnalysis.scala (98%) rename src/main/scala/{beam/utils => scripts}/ConfigValuesComparator.scala (96%) rename src/main/scala/{beam/utils => scripts}/CoordInBoundsUtil.scala (98%) rename src/main/scala/{beam/utils => scripts}/DeadHeadingAnalysisExample.scala (95%) rename src/main/scala/{beam/utils => scripts}/EventReplayer.scala (97%) rename src/main/scala/{beam/utils => scripts}/GpxCompareSimulationVsReference.scala (97%) rename src/main/scala/{beam/router/graphhopper => scripts}/GraphHopperOsmUsageExample.scala (93%) rename src/main/scala/{beam/utils => scripts}/Network2ShapeFile.scala (99%) rename src/main/scala/{beam/utils => scripts}/NetworkEdgeOutputGenerator.scala (97%) rename src/main/scala/{beam/agentsim/infrastructure => scripts}/ParkingManagerBenchmark.scala (99%) rename src/main/scala/{beam/utils/plan => scripts}/PlansBuilder.scala (99%) rename src/main/scala/{beam/utils/plan/sampling => scripts}/PlansSamplerApp.scala (99%) rename src/main/scala/{beam/utils => }/scripts/PopulationWriterCSV.scala (99%) rename src/main/scala/{beam/utils => }/scripts/R5GraphGenerator.scala (98%) rename src/main/scala/{beam/utils => scripts}/RespositioingValidation.scala (98%) rename src/main/scala/{beam/router => scripts}/TravelTimeAndDistanceCalculatorApp.scala (95%) rename src/main/scala/{beam/utils => scripts}/TravelTimeGoogleApp.scala (98%) rename src/main/scala/{beam/utils => scripts}/UberOSMSpeedMapper.scala (99%) rename src/main/scala/{beam/utils/scenario/urbansim/censusblock => scripts}/UrbansimConverter.scala (97%) rename src/main/scala/{beam/utils => scripts}/analysis/BlockGroupToTazMapper.scala (89%) rename src/main/scala/{beam/utils => scripts}/analysis/GenerateTripTable.scala (99%) rename src/main/scala/{beam/utils => scripts}/analysis/NewYorkBeamVsLodes.scala (99%) rename src/main/scala/{beam/utils => scripts}/analysis/NewYorkBeamVsLodesWithinTAZ.scala (98%) rename src/main/scala/{beam/utils => scripts}/analysis/NewYorkHomeWorkLocationAnalysis.scala (97%) rename src/main/scala/{beam/utils => scripts}/analysis/NewYorkTrafficSpeedAnalysis.scala (98%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/EventsByVehicleMode.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events/BeamActivity.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events/BeamEvent.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events/BeamModeChoice.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events/BeamPathTraversal.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events/BeamPersonEntersVehicle.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events/BeamPersonLeavesVehicle.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events_filter/MutablePopulationFilter.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events_filter/MutableSamplingFilter.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events_filter/MutableVehiclesFilter.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events_filter/PersonEvents.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events_filter/PersonTrip.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events_filter/PopulationSample.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events_filter/VehicleSample.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/events_filter/VehicleTrip.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/io/BeamEventsReader.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/io/ConsoleProgress.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/io/HashSetReader.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/io/Reader.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/io/Writer.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/utils/CollectIds.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/utils/FindIdsInCircles.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/utils/FindPersonsUsesVehicles.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/utils/LinkCoordinate.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/utils/ZipViaEventsFiles.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/via_event/ViaActivity.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/via_event/ViaEvent.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/via_event/ViaEventsCollection.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/visualization/via/visualization_11.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/visualization/via/visualization_12.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/visualization/via/visualization_20_24.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/visualization/via/visualization_33_34.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/visualization/via/visualization_35.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/visualization/via/visualization_3_4_5.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/visualization/via/visualization_6.scala (100%) rename src/main/scala/{beam/utils => scripts}/beam_to_matsim/visualization/via/visualization_9.scala (100%) rename src/main/scala/{beam => scripts}/calibration/BeamSigoptTuner.scala (92%) mode change 100755 => 100644 rename src/main/scala/{beam => scripts}/calibration/Bounded.scala (95%) rename src/main/scala/{beam => scripts}/calibration/CalibrationArguments.scala (93%) rename src/main/scala/{beam => scripts}/calibration/ExperimentRunner.scala (98%) rename src/main/scala/{beam => scripts}/calibration/RunCalibration.scala (97%) mode change 100755 => 100644 rename src/main/scala/{beam => scripts}/calibration/SigoptExperimentData.scala (90%) rename src/main/scala/{beam => scripts}/calibration/utils/CreateExperiment.scala (63%) rename src/main/scala/{beam => scripts}/calibration/utils/DeleteSuggestion.scala (97%) rename src/main/scala/{beam => scripts}/calibration/utils/ListExperiments.scala (95%) rename src/main/scala/{beam => scripts}/calibration/utils/ListSuggestions.scala (94%) rename src/main/scala/{beam => scripts}/calibration/utils/SigOptApiToken.scala (90%) rename src/main/scala/{beam/utils => scripts}/csv/conversion/HouseholdsXml2CsvConverter.scala (99%) rename src/main/scala/{beam/utils => scripts}/csv/conversion/NetworkXmlToCSV.scala (99%) rename src/main/scala/{beam/utils => scripts}/csv/conversion/PhyssimEventsXmlToCSV.scala (96%) rename src/main/scala/{beam/utils => scripts}/csv/conversion/PlansXml2CsvConverter.scala (98%) rename src/main/scala/{beam/utils => scripts}/csv/conversion/PopulationXml2CsvConverter.scala (99%) rename src/main/scala/{beam/utils => scripts}/csv/conversion/Xml2CsvFileConverter.scala (94%) rename src/main/scala/{beam/utils => scripts}/csv/conversion/XmlConverter.scala (99%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/CTPPParser.scala (94%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/JointDistribution.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/Models.scala (81%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/AgeRange.scala (58%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/FlowGeoParser.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/Gender.scala (93%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/HouseholdIncome.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/HouseholdSize.scala (95%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/MeansOfTransportation.scala (99%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/OD.scala (70%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/ResidenceGeoParser.scala (94%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/ResidenceGeography.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/ResidenceToWorkplaceFlowGeography.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/ResidentialGeoParser.scala (97%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/Vehicles.scala (97%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/WorkedHours.scala (97%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/flow/Industry.scala (97%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/models/residence/Industry.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/BaseTableReader.scala (95%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/MetadataReader.scala (97%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/flow/AgeOfWorkerTableReader.scala (86%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/flow/HouseholdIncomeTableReader.scala (75%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/flow/IndustryTableReader.scala (65%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/flow/MeansOfTransportationTableReader.scala (80%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/flow/TimeLeavingHomeTableReader.scala (91%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/flow/TravelTimeTableReader.scala (86%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/AgeTableReader.scala (89%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/HouseholdSizeByUnitsInStructureTableReader.scala (81%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/IndustryTableReader.scala (80%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/MeanHouseholdIncomeTableReader.scala (74%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/MedianHouseholdIncomeTableReader.scala (74%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/SexTableReader.scala (69%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/TotalHouseholdsTableReader.scala (78%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/TotalPopulationTableReader.scala (80%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/UsualHoursWorkedPerWeekTableReader.scala (91%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/readers/residence/VehiclesAvailableTableReader.scala (78%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/scenario/ScenarioGenerator.scala (84%) rename src/main/scala/{beam/utils/data => scripts}/ctpp/scenario/SimpleScenarioGenerator.scala (90%) rename src/main/scala/{beam => scripts}/docs/GenerateDocumentationTask.scala (99%) rename src/main/scala/{beam => scripts}/docs/ReflectionUtil.scala (96%) rename src/main/scala/{beam => scripts}/experiment/ExperimentApp.scala (97%) rename src/main/scala/{beam => scripts}/experiment/ExperimentDef.scala (99%) rename src/main/scala/{beam => scripts}/experiment/ExperimentGenerator.scala (98%) rename src/main/scala/{beam => scripts}/experiment/ExperimentRunSandbox.scala (99%) rename src/main/scala/{beam => scripts}/experiment/Factor.scala (95%) rename src/main/scala/{beam => scripts}/experiment/RunExperiments.scala (96%) rename src/main/scala/{beam/utils => scripts}/map/ActivitiesClustering.scala (98%) rename src/main/scala/{beam/utils => scripts}/map/EnvelopeToGpx.scala (79%) rename src/main/scala/{beam/utils => scripts}/map/GeoFenceVerifier.scala (93%) rename src/main/scala/{beam/utils => scripts}/map/GeoJsonToGpxConvertor.scala (93%) rename src/main/scala/{beam/utils => scripts}/map/GpxWriter.scala (96%) rename src/main/scala/{beam/utils => scripts}/map/LinkIdsToGpx.scala (94%) rename src/main/scala/{beam/utils => scripts}/map/NewYorkAnalysis.scala (95%) rename src/main/scala/{beam/utils => scripts}/map/NewYorkReplanningAnalysis.scala (97%) rename src/main/scala/{beam/utils => scripts}/map/NewYorkRouteDebugging.scala (99%) rename src/main/scala/{beam/utils => scripts}/map/NewYorkSubwayAnalysis.scala (99%) rename src/main/scala/{beam/utils => scripts}/map/NewYorkTrafficVolumeVisualization.scala (97%) rename src/main/scala/{beam/utils => scripts}/map/OsmosisPolygonFilterGenerator.scala (98%) rename src/main/scala/{beam/utils => scripts}/map/R5MapStatsCalculator.scala (99%) rename src/main/scala/{beam/utils => scripts}/map/R5NetworkPlayground.scala (94%) rename src/main/scala/{beam/utils => scripts}/map/RepositioningAnalyzer.scala (99%) rename src/main/scala/{beam/utils => scripts}/map/TazTravelTimeAnalyzer.scala (98%) rename src/main/scala/{beam/utils => scripts}/map/TazTreeMapToGpx.scala (89%) rename src/main/scala/{beam/utils/mapsapi/bingapi => scripts/mapsapi}/BingExampleOfUsage.scala (93%) rename src/main/scala/{beam/utils/mapsapi/googleapi => scripts/mapsapi}/GoogleApiExampleUsage.scala (94%) rename src/main/scala/{beam/utils/mapsapi/hereapi => scripts/mapsapi}/HereExampleUsage.scala (94%) rename src/main/scala/{beam/utils => scripts}/protocolvis/ActorAsState.scala (95%) rename src/main/scala/{beam/utils => scripts}/protocolvis/AgentStateDiagram.scala (82%) rename src/main/scala/{beam/utils => scripts}/protocolvis/Extractors.scala (93%) rename src/main/scala/{beam/utils => scripts}/protocolvis/MessageReader.scala (99%) rename src/main/scala/{beam/utils => scripts}/protocolvis/PumlWriter.scala (92%) rename src/main/scala/{beam/utils => scripts}/protocolvis/SequenceDiagram.scala (99%) rename src/main/scala/{beam/utils => scripts}/protocolvis/VisualizingApp.scala (97%) rename src/main/scala/{beam/utils => scripts}/shape/FilterPointsInShapeFile.scala (99%) rename src/main/scala/{beam/utils => scripts}/shape/GenericFeatureBuilder.scala (99%) rename src/main/scala/{beam/utils => scripts}/shape/NoAttributeShapeWriter.scala (91%) rename src/main/scala/{beam/utils => scripts}/shape/ShapeWriter.scala (96%) rename src/main/scala/{beam/utils => scripts}/shapefiles/WriteShapeFile.scala (100%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/CongestionLevelData.scala (96%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/FipsCodes.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/FlowStatsForParking.scala (88%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/HouseholdReader.scala (99%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/IndustryAssigner.scala (92%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/NewYorkScenarioFilter.scala (99%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/ODSampler.scala (90%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/PolygonShapeToCsvConverter.scala (99%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/PopulationCorrection.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/PopulationReader.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/PumaLevelScenarioGenerator.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/ScenarioGenerator.scala (98%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/SimpleScenarioGeneratorArgParser.scala (98%) rename src/main/scala/{beam/utils/data/synthpop/SythpopOutputJoiner.scala => scripts/synthpop/SynthpopOutputJoiner.scala} (98%) rename src/main/scala/{beam/utils/data/synthpop/SythpopReader.scala => scripts/synthpop/SynthpopReader.scala} (91%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/WorkForceSampler.scala (91%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/doc/README.md (91%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/doc/data_sources.svg (100%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/doc/flowchart.svg (100%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/doc/hierarchy_of_cencus_geo_entities.jpg (100%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/generators/BenchmarkGenerator.scala (94%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/generators/TimeLeavingHomeGenerator.scala (82%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/generators/WorkDestinationGenerator.scala (82%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/generators/WorkedDurationGenerator.scala (96%) rename src/main/scala/{beam/utils/data => scripts}/synthpop/tools/ScenarioDownsampler.scala (98%) rename src/main/scala/{beam/utils => scripts}/traveltime/FeatureEventHandler.scala (99%) rename src/main/scala/{beam/utils => scripts}/traveltime/FeatureExtractor.scala (93%) rename src/main/scala/{beam/utils => scripts}/traveltime/LinkInOutFeature.scala (98%) rename src/main/scala/{beam/utils => scripts}/traveltime/NetworkFeaturesExtractor.scala (97%) rename src/main/scala/{beam/utils => scripts}/traveltime/NetworkUtil.scala (98%) rename src/test/scala/{beam/router/skim/urbansim => scripts}/BackgroundSkimsCreatorAppSpec.scala (96%) rename src/test/scala/{beam/utils => scripts}/Network2ShapeFileTest.scala (96%) rename src/test/scala/{beam/utils => scripts}/NetworkXmlToCsvSpec.scala (88%) rename src/test/scala/{beam/router => scripts}/TravelTimeAndDistanceCalculatorAppSpec.scala (91%) rename src/test/scala/{beam/utils => scripts}/beam_to_matsim/LinkCoordinateTest.scala (100%) rename src/test/scala/{beam/utils => scripts}/beam_to_matsim/io/WriterTest.scala (100%) rename src/test/scala/{beam => scripts}/calibration/BeamSigoptTunerSpec.scala (95%) rename src/test/scala/{beam/utils => scripts/ctpp}/JointDistributionTest.scala (94%) rename src/test/scala/{beam/utils => scripts}/protocolvis/SequenceDiagramTest.scala (97%) rename src/test/scala/{beam/utils => scripts}/shape/NoAttributeShapeWriterTest.scala (96%) rename src/test/scala/{beam/utils => scripts}/shape/ShapeWriterTest.scala (97%) diff --git a/docs/messages.rst b/docs/messages.rst index 87eaf384339..e70b8ac3f0f 100755 --- a/docs/messages.rst +++ b/docs/messages.rst @@ -34,7 +34,7 @@ How to visualize them VisualizingApp can convert these files to different diagrams. It creates `PlantUML`_ files that can be easily converted to pictures. You can run it with gradle with the following command:: -$ ./gradlew :execute -PmainClass=beam.utils.protocolvis.VisualizingApp -PappArgs=["'--input', 'output/sf-light/sf-light_2021-05-03_10-50-55_cxc/ITERS/it.0', '--output', 'docs/uml/sequence1.puml', '--diagram-type', 'Sequence', '--force', '--person-id', '010900-2012001379980-0-560057'"] +$ ./gradlew :execute -PmainClass=scripts.protocolvis.VisualizingApp -PappArgs=["'--input', 'output/sf-light/sf-light_2021-05-03_10-50-55_cxc/ITERS/it.0', '--output', 'docs/uml/sequence1.puml', '--diagram-type', 'Sequence', '--force', '--person-id', '010900-2012001379980-0-560057'"] Parameters ---------- diff --git a/src/main/scala/beam/physsim/jdeqsim/JDEQSimRunner.scala b/src/main/scala/beam/physsim/jdeqsim/JDEQSimRunner.scala index 8a8db0352eb..c40647452dd 100644 --- a/src/main/scala/beam/physsim/jdeqsim/JDEQSimRunner.scala +++ b/src/main/scala/beam/physsim/jdeqsim/JDEQSimRunner.scala @@ -13,7 +13,6 @@ import beam.physsim.{PickUpDropOffCollector, PickUpDropOffHolder} import beam.sim.config.BeamConfig import beam.sim.{BeamConfigChangesObservable, BeamServices} import beam.utils.ConcurrentUtils.parallelExecution -import beam.utils.NetworkEdgeOutputGenerator.beamConfig import beam.utils.{DebugLib, ProfilingUtils} import com.typesafe.scalalogging.StrictLogging import org.matsim.analysis.LegHistogram diff --git a/src/main/scala/beam/sim/BeamSim.scala b/src/main/scala/beam/sim/BeamSim.scala index 345b464969a..3990f223632 100755 --- a/src/main/scala/beam/sim/BeamSim.scala +++ b/src/main/scala/beam/sim/BeamSim.scala @@ -29,9 +29,8 @@ import beam.sim.config.{BeamConfig, BeamConfigHolder} import beam.sim.metrics.{BeamStaticMetricsWriter, MetricsSupport} import beam.utils.csv.writers._ import beam.utils.logging.ExponentialLazyLogging -import beam.utils.scripts.FailFast import beam.utils.watcher.MethodWatcher -import beam.utils.{DebugLib, NetworkHelper, ProfilingUtils, SummaryVehicleStatsParser} +import beam.utils.{DebugLib, FailFast, NetworkHelper, ProfilingUtils, SummaryVehicleStatsParser} import com.conveyal.r5.transit.TransportNetwork import com.google.inject.Inject import com.typesafe.scalalogging.LazyLogging diff --git a/src/main/scala/beam/utils/scripts/FailFast.scala b/src/main/scala/beam/utils/FailFast.scala similarity index 99% rename from src/main/scala/beam/utils/scripts/FailFast.scala rename to src/main/scala/beam/utils/FailFast.scala index df242c11906..68158dae79b 100644 --- a/src/main/scala/beam/utils/scripts/FailFast.scala +++ b/src/main/scala/beam/utils/FailFast.scala @@ -1,4 +1,4 @@ -package beam.utils.scripts +package beam.utils import beam.agentsim.agents.vehicles.FuelType.Electricity import beam.sim.BeamServices diff --git a/src/main/scala/beam/utils/map/GpxPoint.scala b/src/main/scala/beam/utils/map/GpxPoint.scala new file mode 100644 index 00000000000..04bdc225f27 --- /dev/null +++ b/src/main/scala/beam/utils/map/GpxPoint.scala @@ -0,0 +1,5 @@ +package beam.utils.map + +import org.matsim.api.core.v01.Coord + +case class GpxPoint(name: String, wgsCoord: Coord) diff --git a/src/main/scala/beam/utils/map/PointInfo.scala b/src/main/scala/beam/utils/map/PointInfo.scala new file mode 100644 index 00000000000..8dd25154960 --- /dev/null +++ b/src/main/scala/beam/utils/map/PointInfo.scala @@ -0,0 +1,5 @@ +package beam.utils.map + +case class PointInfo(offset: Double, geofenceRadius: Double) { + val ratio: Double = if (geofenceRadius.equals(0d)) Double.NaN else offset / geofenceRadius +} diff --git a/src/main/scala/beam/utils/mapsapi/bingapi/BingAdapter.scala b/src/main/scala/beam/utils/mapsapi/bingapi/BingAdapter.scala index df40a8aae68..6204dcbc579 100644 --- a/src/main/scala/beam/utils/mapsapi/bingapi/BingAdapter.scala +++ b/src/main/scala/beam/utils/mapsapi/bingapi/BingAdapter.scala @@ -19,7 +19,7 @@ class BingAdapter(apiKey: String, actorSystem: Option[ActorSystem] = None) exten private implicit val system: ActorSystem = actorSystem.getOrElse(ActorSystem()) private val timeout: FiniteDuration = new FiniteDuration(5L, TimeUnit.SECONDS) - private[bingapi] def findPath(points: Seq[WgsCoordinate]): Future[Seq[SnappedPoint]] = { + def findPath(points: Seq[WgsCoordinate]): Future[Seq[SnappedPoint]] = { val pointsStr = points .map { p => s"${p.latitude},${p.longitude}" diff --git a/src/main/scala/beam/utils/mapsapi/googleapi/GoogleAdapter.scala b/src/main/scala/beam/utils/mapsapi/googleapi/GoogleAdapter.scala index 054d8e96949..647176d4c7d 100644 --- a/src/main/scala/beam/utils/mapsapi/googleapi/GoogleAdapter.scala +++ b/src/main/scala/beam/utils/mapsapi/googleapi/GoogleAdapter.scala @@ -178,7 +178,7 @@ object GoogleAdapter { constraints: Set[TravelConstraints.TravelConstraint] = Set.empty ) - private[googleapi] def buildUrl( + def buildUrl( apiKey: String, origin: WgsCoordinate, destination: WgsCoordinate, diff --git a/src/main/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorApp.scala b/src/main/scala/scripts/BackgroundSkimsCreatorApp.scala similarity index 97% rename from src/main/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorApp.scala rename to src/main/scala/scripts/BackgroundSkimsCreatorApp.scala index 90bd6bafe72..3c429462128 100644 --- a/src/main/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorApp.scala +++ b/src/main/scala/scripts/BackgroundSkimsCreatorApp.scala @@ -1,4 +1,4 @@ -package beam.router.skim.urbansim +package scripts import akka.actor.{ActorSystem, Terminated} import beam.agentsim.infrastructure.geozone.{GeoIndex, TAZIndex} @@ -7,6 +7,7 @@ import beam.router.Modes.BeamMode import beam.router.skim.ActivitySimSkimmer.ExcerptData import beam.router.skim._ import beam.router.skim.core.{AbstractSkimmer, ODSkimmer} +import beam.router.skim.urbansim.BackgroundSkimsCreator import beam.router.{FreeFlowTravelTime, LinkTravelTimeContainer} import beam.sim.config.BeamExecutionConfig import beam.sim.{BeamHelper, BeamServices} @@ -21,17 +22,6 @@ import java.nio.file.Path import scala.concurrent.{ExecutionContext, Future} import scala.util.control.NonFatal -case class InputParameters( - configPath: Path = null, - input: Option[Path] = None, - output: Path = null, - linkstatsPath: Option[Path] = None, - ODSkimsPath: Option[Path] = None, - parallelism: Int = 1 -) - -case class ODRow(origin: GeoUnit.TAZ, destination: GeoUnit.TAZ) - /* Example of parameters usage: --configPath test/input/beamville/beam.conf @@ -49,6 +39,17 @@ for example "--input test/input/beamville/input.csv.gz" */ object BackgroundSkimsCreatorApp extends App with BeamHelper { + case class InputParameters( + configPath: Path = null, + input: Option[Path] = None, + output: Path = null, + linkstatsPath: Option[Path] = None, + ODSkimsPath: Option[Path] = None, + parallelism: Int = 1 + ) + + case class ODRow(origin: GeoUnit.TAZ, destination: GeoUnit.TAZ) + private val parser = { val builder = OParser.builder[InputParameters] import builder._ diff --git a/src/main/scala/beam/utils/data/synthpop/BeamScenarioDataExtractor.scala b/src/main/scala/scripts/BeamScenarioDataExtractor.scala similarity index 98% rename from src/main/scala/beam/utils/data/synthpop/BeamScenarioDataExtractor.scala rename to src/main/scala/scripts/BeamScenarioDataExtractor.scala index 6b6ac82ff2f..177d965a3d0 100644 --- a/src/main/scala/beam/utils/data/synthpop/BeamScenarioDataExtractor.scala +++ b/src/main/scala/scripts/BeamScenarioDataExtractor.scala @@ -1,4 +1,4 @@ -package beam.utils.data.synthpop +package scripts import beam.sim.BeamHelper import beam.sim.config.BeamExecutionConfig diff --git a/src/main/scala/beam/utils/ConfigAnalysis.scala b/src/main/scala/scripts/ConfigAnalysis.scala similarity index 98% rename from src/main/scala/beam/utils/ConfigAnalysis.scala rename to src/main/scala/scripts/ConfigAnalysis.scala index 6de2192f598..0f8c4a41bf1 100644 --- a/src/main/scala/beam/utils/ConfigAnalysis.scala +++ b/src/main/scala/scripts/ConfigAnalysis.scala @@ -1,4 +1,6 @@ -package beam.utils +package scripts + +import beam.utils.BeamConfigUtils import java.io.File diff --git a/src/main/scala/beam/utils/ConfigValuesComparator.scala b/src/main/scala/scripts/ConfigValuesComparator.scala similarity index 96% rename from src/main/scala/beam/utils/ConfigValuesComparator.scala rename to src/main/scala/scripts/ConfigValuesComparator.scala index 3451578c982..ddc659e5e48 100644 --- a/src/main/scala/beam/utils/ConfigValuesComparator.scala +++ b/src/main/scala/scripts/ConfigValuesComparator.scala @@ -1,9 +1,10 @@ -package beam.utils +package scripts +import beam.utils.BeamConfigUtils import com.typesafe.config.ConfigRenderOptions import com.typesafe.scalalogging.LazyLogging -import scala.collection.JavaConverters._ +import scala.jdk.CollectionConverters._ /* Application expects to get two config files as input diff --git a/src/main/scala/beam/utils/CoordInBoundsUtil.scala b/src/main/scala/scripts/CoordInBoundsUtil.scala similarity index 98% rename from src/main/scala/beam/utils/CoordInBoundsUtil.scala rename to src/main/scala/scripts/CoordInBoundsUtil.scala index 2192f040001..c585c771117 100644 --- a/src/main/scala/beam/utils/CoordInBoundsUtil.scala +++ b/src/main/scala/scripts/CoordInBoundsUtil.scala @@ -1,13 +1,13 @@ -package beam.utils - -import java.util.Random +package scripts +import beam.utils.FileUtils import beam.utils.matsim_conversion.ShapeUtils.QuadTreeBounds import org.matsim.api.core.v01.Coord import org.matsim.core.utils.geometry.transformations.GeotoolsTransformation import org.supercsv.io.CsvMapReader import org.supercsv.prefs.CsvPreference +import java.util.Random import scala.collection.mutable.ListBuffer object CoordInBoundsUtil extends App { diff --git a/src/main/scala/beam/utils/DeadHeadingAnalysisExample.scala b/src/main/scala/scripts/DeadHeadingAnalysisExample.scala similarity index 95% rename from src/main/scala/beam/utils/DeadHeadingAnalysisExample.scala rename to src/main/scala/scripts/DeadHeadingAnalysisExample.scala index af08f7abefc..4618d65c6b3 100644 --- a/src/main/scala/beam/utils/DeadHeadingAnalysisExample.scala +++ b/src/main/scala/scripts/DeadHeadingAnalysisExample.scala @@ -1,8 +1,9 @@ -package beam.utils +package scripts import beam.agentsim.events.PathTraversalEvent import beam.analysis.plots.DeadHeadingAnalysis import beam.sim.metrics.NoOpSimulationMetricCollector +import beam.utils.{EventReader, ProfilingUtils} import org.matsim.core.controler.OutputDirectoryHierarchy import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting import org.matsim.core.controler.events.IterationEndsEvent diff --git a/src/main/scala/beam/utils/EventReplayer.scala b/src/main/scala/scripts/EventReplayer.scala similarity index 97% rename from src/main/scala/beam/utils/EventReplayer.scala rename to src/main/scala/scripts/EventReplayer.scala index 637727e3486..766925df8a1 100644 --- a/src/main/scala/beam/utils/EventReplayer.scala +++ b/src/main/scala/scripts/EventReplayer.scala @@ -1,9 +1,10 @@ -package beam.utils +package scripts import beam.analysis.DelayMetricAnalysis import beam.router.r5.DefaultNetworkCoordinator import beam.sim.BeamHelper import beam.sim.config.BeamConfig +import beam.utils.NetworkHelperImpl import org.matsim.api.core.v01.events.Event import org.matsim.core.events.handler.BasicEventHandler import org.matsim.core.events.{EventsUtils, MatsimEventsReader} diff --git a/src/main/scala/beam/utils/GpxCompareSimulationVsReference.scala b/src/main/scala/scripts/GpxCompareSimulationVsReference.scala similarity index 97% rename from src/main/scala/beam/utils/GpxCompareSimulationVsReference.scala rename to src/main/scala/scripts/GpxCompareSimulationVsReference.scala index f59c4feb746..48e644e781a 100644 --- a/src/main/scala/beam/utils/GpxCompareSimulationVsReference.scala +++ b/src/main/scala/scripts/GpxCompareSimulationVsReference.scala @@ -1,9 +1,10 @@ -package beam.utils +package scripts import beam.agentsim.infrastructure.taz import beam.agentsim.infrastructure.taz.TAZTreeMap import beam.sim.common.GeoUtilsImpl import beam.sim.config.BeamConfig +import beam.utils.{BeamConfigUtils, FileUtils} import org.matsim.core.utils.io.IOUtils import org.supercsv.io.{CsvMapReader, ICsvMapReader} import org.supercsv.prefs.CsvPreference diff --git a/src/main/scala/beam/router/graphhopper/GraphHopperOsmUsageExample.scala b/src/main/scala/scripts/GraphHopperOsmUsageExample.scala similarity index 93% rename from src/main/scala/beam/router/graphhopper/GraphHopperOsmUsageExample.scala rename to src/main/scala/scripts/GraphHopperOsmUsageExample.scala index abd6a558a25..603ca72d687 100644 --- a/src/main/scala/beam/router/graphhopper/GraphHopperOsmUsageExample.scala +++ b/src/main/scala/scripts/GraphHopperOsmUsageExample.scala @@ -1,5 +1,6 @@ -package beam.router.graphhopper +package scripts +import beam.router.graphhopper.{EdgeIdToWayIdConvertor, GraphHopperWrapper, WayIdParser} import com.graphhopper.GHRequest import com.graphhopper.routing.util.AllEdgesIterator import com.graphhopper.routing.util.parsers.{DefaultTagParserFactory, TagParser, TagParserFactory} diff --git a/src/main/scala/beam/utils/Network2ShapeFile.scala b/src/main/scala/scripts/Network2ShapeFile.scala similarity index 99% rename from src/main/scala/beam/utils/Network2ShapeFile.scala rename to src/main/scala/scripts/Network2ShapeFile.scala index 8f4b26c143f..970d80d9fa5 100644 --- a/src/main/scala/beam/utils/Network2ShapeFile.scala +++ b/src/main/scala/scripts/Network2ShapeFile.scala @@ -1,4 +1,4 @@ -package beam.utils +package scripts import beam.sim.common.GeoUtils import com.typesafe.scalalogging.LazyLogging diff --git a/src/main/scala/beam/utils/NetworkEdgeOutputGenerator.scala b/src/main/scala/scripts/NetworkEdgeOutputGenerator.scala similarity index 97% rename from src/main/scala/beam/utils/NetworkEdgeOutputGenerator.scala rename to src/main/scala/scripts/NetworkEdgeOutputGenerator.scala index 539314e4dc0..e473b0e2b71 100644 --- a/src/main/scala/beam/utils/NetworkEdgeOutputGenerator.scala +++ b/src/main/scala/scripts/NetworkEdgeOutputGenerator.scala @@ -1,12 +1,12 @@ -package beam.utils +package scripts import beam.router.r5.DefaultNetworkCoordinator import beam.sim.config.BeamConfig +import beam.utils.{BeamConfigUtils, FileUtils} import com.conveyal.r5.streets.EdgeStore import com.typesafe.config.Config import scala.collection.mutable -import scala.language.postfixOps /** * @author Bhavya Latha Bandaru. diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala b/src/main/scala/scripts/ParkingManagerBenchmark.scala similarity index 99% rename from src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala rename to src/main/scala/scripts/ParkingManagerBenchmark.scala index 763b8e7429c..def22836da0 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala +++ b/src/main/scala/scripts/ParkingManagerBenchmark.scala @@ -1,10 +1,11 @@ -package beam.agentsim.infrastructure +package scripts import akka.actor.ActorSystem import akka.util.Timeout import beam.agentsim.events.SpaceTime import beam.agentsim.infrastructure.parking._ import beam.agentsim.infrastructure.taz.{TAZ, TAZTreeMap} +import beam.agentsim.infrastructure._ import beam.sim.common.GeoUtils import beam.sim.config.BeamConfig import beam.utils.csv.CsvWriter @@ -12,7 +13,7 @@ import beam.utils.{BeamConfigUtils, FileUtils, ProfilingUtils} import com.typesafe.config.{Config, ConfigFactory} import com.typesafe.scalalogging.StrictLogging import com.vividsolutions.jts.geom.Envelope -import org.matsim.api.core.v01.network.{Link, Network} +import org.matsim.api.core.v01.network.Network import org.matsim.api.core.v01.population.Activity import org.matsim.api.core.v01.{Coord, Id, Scenario} import org.matsim.core.config.ConfigUtils diff --git a/src/main/scala/beam/utils/plan/PlansBuilder.scala b/src/main/scala/scripts/PlansBuilder.scala similarity index 99% rename from src/main/scala/beam/utils/plan/PlansBuilder.scala rename to src/main/scala/scripts/PlansBuilder.scala index 638e42c8a48..1bcf66bafb6 100644 --- a/src/main/scala/beam/utils/plan/PlansBuilder.scala +++ b/src/main/scala/scripts/PlansBuilder.scala @@ -1,10 +1,9 @@ -package beam.utils.plan +package scripts import beam.utils.plan.sampling.AvailableModeUtils.AllowAllModes import beam.utils.plan.sampling.HouseholdAttrib.{HomeCoordX, HomeCoordY, HousingType} import beam.utils.plan.sampling.PopulationAttrib.Rank import beam.utils.plan.sampling._ -import beam.utils.scripts.PopulationWriterCSV import org.matsim.api.core.v01.network.Node import org.matsim.api.core.v01.population.{Activity, Person, Plan, Population} import org.matsim.api.core.v01.{Coord, Id} diff --git a/src/main/scala/beam/utils/plan/sampling/PlansSamplerApp.scala b/src/main/scala/scripts/PlansSamplerApp.scala similarity index 99% rename from src/main/scala/beam/utils/plan/sampling/PlansSamplerApp.scala rename to src/main/scala/scripts/PlansSamplerApp.scala index 67ab393207d..805c7b65091 100644 --- a/src/main/scala/beam/utils/plan/sampling/PlansSamplerApp.scala +++ b/src/main/scala/scripts/PlansSamplerApp.scala @@ -6,7 +6,6 @@ import java.util import beam.utils.matsim_conversion.{MatsimConversionTool, ShapeUtils} import beam.utils.plan.sampling.HouseholdAttrib.{HomeCoordX, HomeCoordY, HousingType} import beam.utils.plan.sampling.PopulationAttrib.Rank -import beam.utils.scripts.PopulationWriterCSV import com.vividsolutions.jts.geom.{Envelope, Geometry, GeometryCollection, GeometryFactory, Point} import enumeratum.EnumEntry._ import enumeratum._ @@ -36,6 +35,7 @@ import org.matsim.utils.objectattributes.{ObjectAttributes, ObjectAttributesXmlW import org.matsim.vehicles.{Vehicle, VehicleUtils, VehicleWriterV1, Vehicles} import org.opengis.feature.simple.SimpleFeature import org.opengis.referencing.crs.CoordinateReferenceSystem +import scripts.PopulationWriterCSV import scala.collection.JavaConverters._ import scala.collection.{immutable, mutable, JavaConverters} diff --git a/src/main/scala/beam/utils/scripts/PopulationWriterCSV.scala b/src/main/scala/scripts/PopulationWriterCSV.scala similarity index 99% rename from src/main/scala/beam/utils/scripts/PopulationWriterCSV.scala rename to src/main/scala/scripts/PopulationWriterCSV.scala index bbe3254737a..5c9f4abb05b 100755 --- a/src/main/scala/beam/utils/scripts/PopulationWriterCSV.scala +++ b/src/main/scala/scripts/PopulationWriterCSV.scala @@ -1,6 +1,4 @@ -package beam.utils.scripts - -import java.io.{BufferedWriter, IOException} +package scripts import beam.sim.MapStringDouble import org.matsim.api.core.v01.network.Network @@ -10,6 +8,8 @@ import org.matsim.core.population.io.PopulationWriterHandler import org.matsim.core.utils.geometry.CoordinateTransformation import org.matsim.core.utils.io.{AbstractMatsimWriter, UncheckedIOException} +import java.io.{BufferedWriter, IOException} + /** * BEAM */ diff --git a/src/main/scala/beam/utils/scripts/R5GraphGenerator.scala b/src/main/scala/scripts/R5GraphGenerator.scala similarity index 98% rename from src/main/scala/beam/utils/scripts/R5GraphGenerator.scala rename to src/main/scala/scripts/R5GraphGenerator.scala index 557f152a38c..c80547c2e46 100644 --- a/src/main/scala/beam/utils/scripts/R5GraphGenerator.scala +++ b/src/main/scala/scripts/R5GraphGenerator.scala @@ -1,4 +1,4 @@ -package beam.utils.scripts +package scripts import java.util.concurrent.TimeUnit diff --git a/src/main/scala/beam/utils/RespositioingValidation.scala b/src/main/scala/scripts/RespositioingValidation.scala similarity index 98% rename from src/main/scala/beam/utils/RespositioingValidation.scala rename to src/main/scala/scripts/RespositioingValidation.scala index 8974cb88eb7..3a1ba5410af 100644 --- a/src/main/scala/beam/utils/RespositioingValidation.scala +++ b/src/main/scala/scripts/RespositioingValidation.scala @@ -1,7 +1,8 @@ -package beam.utils +package scripts import beam.agentsim.events.PathTraversalEvent import beam.router.Modes.BeamMode +import beam.utils.EventReader import org.matsim.api.core.v01.events.Event import org.matsim.core.events.handler.BasicEventHandler import org.matsim.core.events.{EventsUtils, MatsimEventsReader} diff --git a/src/main/scala/beam/router/TravelTimeAndDistanceCalculatorApp.scala b/src/main/scala/scripts/TravelTimeAndDistanceCalculatorApp.scala similarity index 95% rename from src/main/scala/beam/router/TravelTimeAndDistanceCalculatorApp.scala rename to src/main/scala/scripts/TravelTimeAndDistanceCalculatorApp.scala index 62f044699e1..e7bd74b0175 100644 --- a/src/main/scala/beam/router/TravelTimeAndDistanceCalculatorApp.scala +++ b/src/main/scala/scripts/TravelTimeAndDistanceCalculatorApp.scala @@ -1,9 +1,10 @@ -package beam.router +package scripts import beam.agentsim.agents.vehicles.VehicleCategory import beam.agentsim.agents.vehicles.VehicleProtocol.StreetVehicle import beam.agentsim.events.SpaceTime import beam.router.BeamRouter.{Location, RoutingRequest} +import beam.router.LinkTravelTimeContainer import beam.router.Modes.BeamMode.CAR import beam.router.graphhopper.{CarGraphHopperWrapper, GraphHopperWrapper} import beam.router.r5.{R5Parameters, R5Wrapper} @@ -14,18 +15,11 @@ import beam.utils.csv.{CsvWriter, GenericCsvReader} import com.conveyal.osmlib.OSM import org.matsim.api.core.v01.Id import scopt.OParser +import scripts.TravelTimeAndDistanceCalculatorApp.InputParameters import java.io.{Closeable, File} import java.nio.file.{Path, Paths} -case class InputParameters( - departureTime: Int = 0, - configPath: Path = null, - linkstatsPath: Path = null, - router: String = "", - input: Path = null, - output: Path = null -) case class CsvInputRow(id: Int, originUTM: Location, destinationUTM: Location) case class CsvOutputRow(id: Int, originUTM: Location, destinationUTM: Location, travelTime: Int, distance: Double) @@ -40,6 +34,15 @@ Example of parameters usage: */ object TravelTimeAndDistanceCalculatorApp extends App with BeamHelper { + case class InputParameters( + departureTime: Int = 0, + configPath: Path = null, + linkstatsPath: Path = null, + router: String = "", + input: Path = null, + output: Path = null + ) + private val parser = { val builder = OParser.builder[InputParameters] import builder._ diff --git a/src/main/scala/beam/utils/TravelTimeGoogleApp.scala b/src/main/scala/scripts/TravelTimeGoogleApp.scala similarity index 98% rename from src/main/scala/beam/utils/TravelTimeGoogleApp.scala rename to src/main/scala/scripts/TravelTimeGoogleApp.scala index 99796d6b67e..119c18a95f1 100644 --- a/src/main/scala/beam/utils/TravelTimeGoogleApp.scala +++ b/src/main/scala/scripts/TravelTimeGoogleApp.scala @@ -1,4 +1,4 @@ -package beam.utils +package scripts import akka.actor.ActorSystem import beam.agentsim.events.PathTraversalEvent @@ -7,6 +7,7 @@ import beam.router.Modes.BeamMode import beam.sim.BeamHelper import beam.sim.common.SimpleGeoUtils import beam.sim.config.BeamExecutionConfig +import beam.utils.EventReader import beam.utils.FileUtils.using import com.google.inject.{Injector, Provider} import com.typesafe.scalalogging.StrictLogging @@ -19,9 +20,9 @@ import org.matsim.core.controler.events.IterationEndsEvent import org.matsim.core.controler.listener.ControlerListener import org.matsim.core.controler.{MatsimServices, OutputDirectoryHierarchy} import org.matsim.core.replanning.StrategyManager +import org.matsim.core.router.TripRouter import org.matsim.core.router.costcalculators.TravelDisutilityFactory import org.matsim.core.router.util.{LeastCostPathCalculatorFactory, TravelDisutility, TravelTime} -import org.matsim.core.router.TripRouter import org.matsim.core.scoring.ScoringFunctionFactory /** diff --git a/src/main/scala/beam/utils/UberOSMSpeedMapper.scala b/src/main/scala/scripts/UberOSMSpeedMapper.scala similarity index 99% rename from src/main/scala/beam/utils/UberOSMSpeedMapper.scala rename to src/main/scala/scripts/UberOSMSpeedMapper.scala index 2936ae886bb..da13804b39d 100644 --- a/src/main/scala/beam/utils/UberOSMSpeedMapper.scala +++ b/src/main/scala/scripts/UberOSMSpeedMapper.scala @@ -1,4 +1,4 @@ -package beam.utils +package scripts import beam.analysis.via.CSVWriter import beam.utils.csv.GenericCsvReader diff --git a/src/main/scala/beam/utils/scenario/urbansim/censusblock/UrbansimConverter.scala b/src/main/scala/scripts/UrbansimConverter.scala similarity index 97% rename from src/main/scala/beam/utils/scenario/urbansim/censusblock/UrbansimConverter.scala rename to src/main/scala/scripts/UrbansimConverter.scala index bcd8ad797e1..66bf077812f 100644 --- a/src/main/scala/beam/utils/scenario/urbansim/censusblock/UrbansimConverter.scala +++ b/src/main/scala/scripts/UrbansimConverter.scala @@ -1,4 +1,4 @@ -package beam.utils.scenario.urbansim.censusblock +package scripts import java.io.{BufferedWriter, Closeable, FileWriter} @@ -12,6 +12,8 @@ import org.supercsv.io.CsvMapWriter import org.supercsv.prefs.CsvPreference import scala.collection.JavaConverters._ +import java.io.{BufferedWriter, Closeable, FileWriter} + object UrbansimConverter { private val logger = LoggerFactory.getLogger(getClass) diff --git a/src/main/scala/beam/utils/analysis/BlockGroupToTazMapper.scala b/src/main/scala/scripts/analysis/BlockGroupToTazMapper.scala similarity index 89% rename from src/main/scala/beam/utils/analysis/BlockGroupToTazMapper.scala rename to src/main/scala/scripts/analysis/BlockGroupToTazMapper.scala index 3d9d22c1be0..aca2433f0ab 100644 --- a/src/main/scala/beam/utils/analysis/BlockGroupToTazMapper.scala +++ b/src/main/scala/scripts/analysis/BlockGroupToTazMapper.scala @@ -1,12 +1,12 @@ -package beam.utils.analysis +package scripts.analysis import beam.sim.common.GeoUtils import beam.utils.ProfilingUtils import beam.utils.csv.CsvWriter -import beam.utils.data.ctpp.models.ResidenceToWorkplaceFlowGeography -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.flow.HouseholdIncomeTableReader -import beam.utils.data.synthpop.SimpleScenarioGenerator.getBlockGroupToTazs +import scripts.ctpp.models.ResidenceToWorkplaceFlowGeography +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} +import scripts.ctpp.readers.flow.HouseholdIncomeTableReader +import scripts.synthpop.SimpleScenarioGenerator.getBlockGroupToTazs import beam.utils.data.synthpop.models.Models.{BlockGroupGeoId, TazGeoId} import beam.utils.data.synthpop.{GeoService, GeoServiceInputParam} diff --git a/src/main/scala/beam/utils/analysis/GenerateTripTable.scala b/src/main/scala/scripts/analysis/GenerateTripTable.scala similarity index 99% rename from src/main/scala/beam/utils/analysis/GenerateTripTable.scala rename to src/main/scala/scripts/analysis/GenerateTripTable.scala index 6daad63ff93..ade73a975a0 100644 --- a/src/main/scala/beam/utils/analysis/GenerateTripTable.scala +++ b/src/main/scala/scripts/analysis/GenerateTripTable.scala @@ -1,4 +1,4 @@ -package beam.utils.analysis +package scripts.analysis import java.io.Closeable diff --git a/src/main/scala/beam/utils/analysis/NewYorkBeamVsLodes.scala b/src/main/scala/scripts/analysis/NewYorkBeamVsLodes.scala similarity index 99% rename from src/main/scala/beam/utils/analysis/NewYorkBeamVsLodes.scala rename to src/main/scala/scripts/analysis/NewYorkBeamVsLodes.scala index ad02b456e7c..a5c7717b944 100644 --- a/src/main/scala/beam/utils/analysis/NewYorkBeamVsLodes.scala +++ b/src/main/scala/scripts/analysis/NewYorkBeamVsLodes.scala @@ -1,4 +1,4 @@ -package beam.utils.analysis +package scripts.analysis import java.io.Closeable import java.util @@ -9,7 +9,7 @@ import beam.utils.csv.{CsvWriter, GenericCsvReader} import beam.utils.geospatial.PolygonUtil import beam.utils.scenario.PlanElement import beam.utils.scenario.generic.readers.CsvPlanElementReader -import beam.utils.shape.Attributes +import scripts.shape.Attributes import com.vividsolutions.jts.geom.MultiPolygon import org.locationtech.jts.geom.Envelope import org.matsim.api.core.v01.Coord diff --git a/src/main/scala/beam/utils/analysis/NewYorkBeamVsLodesWithinTAZ.scala b/src/main/scala/scripts/analysis/NewYorkBeamVsLodesWithinTAZ.scala similarity index 98% rename from src/main/scala/beam/utils/analysis/NewYorkBeamVsLodesWithinTAZ.scala rename to src/main/scala/scripts/analysis/NewYorkBeamVsLodesWithinTAZ.scala index c4390cca43b..c18cad999ba 100644 --- a/src/main/scala/beam/utils/analysis/NewYorkBeamVsLodesWithinTAZ.scala +++ b/src/main/scala/scripts/analysis/NewYorkBeamVsLodesWithinTAZ.scala @@ -1,4 +1,4 @@ -package beam.utils.analysis +package scripts.analysis import java.io.Closeable import java.util @@ -6,7 +6,7 @@ import java.util import beam.agentsim.infrastructure.taz.{TAZ, TAZTreeMap} import beam.sim.common.GeoUtils import beam.utils.GeoJsonReader -import beam.utils.analysis.NewYorkBeamVsLodes.GeoAttribute +import scripts.analysis.NewYorkBeamVsLodes.GeoAttribute import beam.utils.csv.{CsvWriter, GenericCsvReader} import org.matsim.api.core.v01.{Coord, Id} diff --git a/src/main/scala/beam/utils/analysis/NewYorkHomeWorkLocationAnalysis.scala b/src/main/scala/scripts/analysis/NewYorkHomeWorkLocationAnalysis.scala similarity index 97% rename from src/main/scala/beam/utils/analysis/NewYorkHomeWorkLocationAnalysis.scala rename to src/main/scala/scripts/analysis/NewYorkHomeWorkLocationAnalysis.scala index fe8799d6ab5..bc5234ddce1 100644 --- a/src/main/scala/beam/utils/analysis/NewYorkHomeWorkLocationAnalysis.scala +++ b/src/main/scala/scripts/analysis/NewYorkHomeWorkLocationAnalysis.scala @@ -1,15 +1,15 @@ -package beam.utils.analysis +package scripts.analysis import beam.sim.common.GeoUtils import beam.utils.ProfilingUtils import beam.utils.csv.CsvWriter -import beam.utils.data.ctpp.models.ResidenceToWorkplaceFlowGeography -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.flow.HouseholdIncomeTableReader +import scripts.ctpp.models.ResidenceToWorkplaceFlowGeography +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} +import scripts.ctpp.readers.flow.HouseholdIncomeTableReader import beam.utils.map.ShapefileReader import beam.utils.scenario.PlanElement import beam.utils.scenario.generic.readers.CsvPlanElementReader -import beam.utils.shape.Attributes +import scripts.shape.Attributes import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory import com.vividsolutions.jts.geom.{Geometry, MultiPolygon} import org.geotools.geometry.jts.JTS diff --git a/src/main/scala/beam/utils/analysis/NewYorkTrafficSpeedAnalysis.scala b/src/main/scala/scripts/analysis/NewYorkTrafficSpeedAnalysis.scala similarity index 98% rename from src/main/scala/beam/utils/analysis/NewYorkTrafficSpeedAnalysis.scala rename to src/main/scala/scripts/analysis/NewYorkTrafficSpeedAnalysis.scala index 29b73b98997..346ccddf7c4 100644 --- a/src/main/scala/beam/utils/analysis/NewYorkTrafficSpeedAnalysis.scala +++ b/src/main/scala/scripts/analysis/NewYorkTrafficSpeedAnalysis.scala @@ -1,4 +1,4 @@ -package beam.utils.analysis +package scripts.analysis import java.io.File import java.time.LocalDateTime @@ -6,9 +6,9 @@ import java.time.format.DateTimeFormatter import beam.sim.common.GeoUtils import beam.utils.csv.{CsvWriter, GenericCsvReader} -import beam.utils.shape.{Attributes, NoAttributeShapeWriter, ShapeWriter} -import beam.utils.traveltime.NetworkUtil -import beam.utils.traveltime.NetworkUtil.Direction +import scripts.shape.{Attributes, NoAttributeShapeWriter, ShapeWriter} +import scripts.traveltime.NetworkUtil +import scripts.traveltime.NetworkUtil.Direction import beam.utils.{ProfilingUtils, Statistics} import com.conveyal.r5.kryo.KryoNetworkSerializer import com.vividsolutions.jts.densify.Densifier diff --git a/src/main/scala/beam/utils/beam_to_matsim/EventsByVehicleMode.scala b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/EventsByVehicleMode.scala rename to src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events/BeamActivity.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events/BeamActivity.scala rename to src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events/BeamEvent.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events/BeamEvent.scala rename to src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events/BeamModeChoice.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events/BeamModeChoice.scala rename to src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events/BeamPathTraversal.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events/BeamPathTraversal.scala rename to src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events/BeamPersonEntersVehicle.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events/BeamPersonEntersVehicle.scala rename to src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events/BeamPersonLeavesVehicle.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events/BeamPersonLeavesVehicle.scala rename to src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala rename to src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events_filter/MutablePopulationFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events_filter/MutablePopulationFilter.scala rename to src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events_filter/MutableSamplingFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events_filter/MutableSamplingFilter.scala rename to src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events_filter/MutableVehiclesFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events_filter/MutableVehiclesFilter.scala rename to src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events_filter/PersonEvents.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events_filter/PersonEvents.scala rename to src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events_filter/PersonTrip.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events_filter/PersonTrip.scala rename to src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events_filter/PopulationSample.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events_filter/PopulationSample.scala rename to src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events_filter/VehicleSample.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events_filter/VehicleSample.scala rename to src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/events_filter/VehicleTrip.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/events_filter/VehicleTrip.scala rename to src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/io/BeamEventsReader.scala b/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/io/BeamEventsReader.scala rename to src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/io/ConsoleProgress.scala b/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/io/ConsoleProgress.scala rename to src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/io/HashSetReader.scala b/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/io/HashSetReader.scala rename to src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/io/Reader.scala b/src/main/scala/scripts/beam_to_matsim/io/Reader.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/io/Reader.scala rename to src/main/scala/scripts/beam_to_matsim/io/Reader.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/io/Writer.scala b/src/main/scala/scripts/beam_to_matsim/io/Writer.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/io/Writer.scala rename to src/main/scala/scripts/beam_to_matsim/io/Writer.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/utils/CollectIds.scala b/src/main/scala/scripts/beam_to_matsim/utils/CollectIds.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/utils/CollectIds.scala rename to src/main/scala/scripts/beam_to_matsim/utils/CollectIds.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/utils/FindIdsInCircles.scala b/src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/utils/FindIdsInCircles.scala rename to src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/utils/FindPersonsUsesVehicles.scala b/src/main/scala/scripts/beam_to_matsim/utils/FindPersonsUsesVehicles.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/utils/FindPersonsUsesVehicles.scala rename to src/main/scala/scripts/beam_to_matsim/utils/FindPersonsUsesVehicles.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/utils/LinkCoordinate.scala b/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/utils/LinkCoordinate.scala rename to src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/utils/ZipViaEventsFiles.scala b/src/main/scala/scripts/beam_to_matsim/utils/ZipViaEventsFiles.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/utils/ZipViaEventsFiles.scala rename to src/main/scala/scripts/beam_to_matsim/utils/ZipViaEventsFiles.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/via_event/ViaActivity.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/via_event/ViaActivity.scala rename to src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/via_event/ViaEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/via_event/ViaEvent.scala rename to src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/via_event/ViaEventsCollection.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/via_event/ViaEventsCollection.scala rename to src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala rename to src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala rename to src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala rename to src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_11.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_11.scala rename to src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_12.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_12.scala rename to src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_20_24.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_20_24.scala rename to src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_33_34.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_33_34.scala rename to src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_35.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_35.scala rename to src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala rename to src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_3_4_5.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_3_4_5.scala rename to src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_6.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_6.scala rename to src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala diff --git a/src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_9.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala similarity index 100% rename from src/main/scala/beam/utils/beam_to_matsim/visualization/via/visualization_9.scala rename to src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala diff --git a/src/main/scala/beam/calibration/BeamSigoptTuner.scala b/src/main/scala/scripts/calibration/BeamSigoptTuner.scala old mode 100755 new mode 100644 similarity index 92% rename from src/main/scala/beam/calibration/BeamSigoptTuner.scala rename to src/main/scala/scripts/calibration/BeamSigoptTuner.scala index c4fdbcff852..89a8aa0098a --- a/src/main/scala/beam/calibration/BeamSigoptTuner.scala +++ b/src/main/scala/scripts/calibration/BeamSigoptTuner.scala @@ -1,12 +1,12 @@ -package beam.calibration +package scripts.calibration -import beam.calibration.Bounded._ -import beam.experiment._ -import beam.utils.OptionalUtils.JavaOptionals._ +import scripts.experiment.{ExperimentDef, Factor, Level} +import beam.utils.OptionalUtils.JavaOptionals.toRichOptional import com.google.common.collect.Lists import com.sigopt.Sigopt import com.sigopt.exception.SigoptException -import com.sigopt.model._ +import com.sigopt.model.{Client, Experiment, Parameter} +import scripts.calibration.Bounded.getBounds import scala.collection.JavaConverters diff --git a/src/main/scala/beam/calibration/Bounded.scala b/src/main/scala/scripts/calibration/Bounded.scala similarity index 95% rename from src/main/scala/beam/calibration/Bounded.scala rename to src/main/scala/scripts/calibration/Bounded.scala index 83b73f1e241..69794aad694 100755 --- a/src/main/scala/beam/calibration/Bounded.scala +++ b/src/main/scala/scripts/calibration/Bounded.scala @@ -1,4 +1,4 @@ -package beam.calibration +package scripts.calibration import com.sigopt.model.Bounds diff --git a/src/main/scala/beam/calibration/CalibrationArguments.scala b/src/main/scala/scripts/calibration/CalibrationArguments.scala similarity index 93% rename from src/main/scala/beam/calibration/CalibrationArguments.scala rename to src/main/scala/scripts/calibration/CalibrationArguments.scala index 46ea8d33f04..9c69efff208 100644 --- a/src/main/scala/beam/calibration/CalibrationArguments.scala +++ b/src/main/scala/scripts/calibration/CalibrationArguments.scala @@ -1,4 +1,4 @@ -package beam.calibration +package scripts.calibration object CalibrationArguments { val BENCHMARK_EXPERIMENTS_TAG: String = "benchmark" diff --git a/src/main/scala/beam/calibration/ExperimentRunner.scala b/src/main/scala/scripts/calibration/ExperimentRunner.scala similarity index 98% rename from src/main/scala/beam/calibration/ExperimentRunner.scala rename to src/main/scala/scripts/calibration/ExperimentRunner.scala index e3ba20e0ad5..ea9e5b49cef 100755 --- a/src/main/scala/beam/calibration/ExperimentRunner.scala +++ b/src/main/scala/scripts/calibration/ExperimentRunner.scala @@ -1,9 +1,5 @@ -package beam.calibration +package scripts.calibration -import java.io.File -import java.nio.file.{Files, Path, Paths} - -import beam.analysis.plots.GraphsStatsAgentSimEventsListener import beam.calibration.impl.example.{ CountsObjectiveFunction, ErrorComparisonType, @@ -17,6 +13,8 @@ import com.typesafe.config.{Config, ConfigValueFactory} import org.matsim.core.config.{Config => MatsimConfig} import org.matsim.core.controler.OutputDirectoryHierarchy +import java.io.File +import java.nio.file.{Files, Path, Paths} import scala.collection.{mutable, JavaConverters} object ObjectiveFunctionClassBuilder extends ReflectionUtils { diff --git a/src/main/scala/beam/calibration/RunCalibration.scala b/src/main/scala/scripts/calibration/RunCalibration.scala old mode 100755 new mode 100644 similarity index 97% rename from src/main/scala/beam/calibration/RunCalibration.scala rename to src/main/scala/scripts/calibration/RunCalibration.scala index 2d1e73ef3f2..cc69f2a87f1 --- a/src/main/scala/beam/calibration/RunCalibration.scala +++ b/src/main/scala/scripts/calibration/RunCalibration.scala @@ -1,12 +1,12 @@ -package beam.calibration +package scripts.calibration -import beam.calibration.utils.SigOptApiToken -import beam.calibration.CalibrationArguments._ -import beam.experiment.ExperimentApp +import scripts.calibration.utils.SigOptApiToken +import scripts.experiment.ExperimentApp import com.sigopt.Sigopt import com.sigopt.exception.APIConnectionError import com.typesafe.scalalogging.LazyLogging import org.apache.commons.lang.SystemUtils +import scripts.calibration.CalibrationArguments._ /** * To run on t2.large w/ 16g (Max) RAM on AWS via Gradle build script, do the following: diff --git a/src/main/scala/beam/calibration/SigoptExperimentData.scala b/src/main/scala/scripts/calibration/SigoptExperimentData.scala similarity index 90% rename from src/main/scala/beam/calibration/SigoptExperimentData.scala rename to src/main/scala/scripts/calibration/SigoptExperimentData.scala index 77fbf7261a4..40ce96e32dc 100644 --- a/src/main/scala/beam/calibration/SigoptExperimentData.scala +++ b/src/main/scala/scripts/calibration/SigoptExperimentData.scala @@ -1,13 +1,12 @@ -package beam.calibration +package scripts.calibration -import java.nio.file.Paths - -import beam.calibration.BeamSigoptTuner.{createExperiment, fetchExperiment} -import beam.experiment.ExperimentDef +import scripts.experiment.ExperimentDef import com.sigopt.model.Experiment import com.typesafe.config.{Config, ConfigFactory} import com.typesafe.scalalogging.LazyLogging +import scripts.calibration.BeamSigoptTuner.{createExperiment, fetchExperiment} +import java.nio.file.Paths import scala.util.Try case class SigoptExperimentData( diff --git a/src/main/scala/beam/calibration/utils/CreateExperiment.scala b/src/main/scala/scripts/calibration/utils/CreateExperiment.scala similarity index 63% rename from src/main/scala/beam/calibration/utils/CreateExperiment.scala rename to src/main/scala/scripts/calibration/utils/CreateExperiment.scala index 5583b8f91a5..1210a996a78 100644 --- a/src/main/scala/beam/calibration/utils/CreateExperiment.scala +++ b/src/main/scala/scripts/calibration/utils/CreateExperiment.scala @@ -1,8 +1,9 @@ -package beam.calibration.utils +package scripts.calibration.utils -import beam.calibration.SigoptExperimentData -import beam.experiment.ExperimentApp +import scripts.experiment.ExperimentApp import com.sigopt.Sigopt +import scripts.calibration +import scripts.calibration.SigoptExperimentData object CreateExperiment extends ExperimentApp { private val NEW_EXPERIMENT_FLAG = "00000" @@ -13,7 +14,7 @@ object CreateExperiment extends ExperimentApp { override def lastThingDoneInMain(): Unit = { Sigopt.clientToken = SigOptApiToken.getClientAPIToken val benchmarkLoc: String = "production/application-sfbay/calibration/benchmark.csv" - SigoptExperimentData(experimentDef, benchmarkLoc, NEW_EXPERIMENT_FLAG) + calibration.SigoptExperimentData(experimentDef, benchmarkLoc, NEW_EXPERIMENT_FLAG) } } diff --git a/src/main/scala/beam/calibration/utils/DeleteSuggestion.scala b/src/main/scala/scripts/calibration/utils/DeleteSuggestion.scala similarity index 97% rename from src/main/scala/beam/calibration/utils/DeleteSuggestion.scala rename to src/main/scala/scripts/calibration/utils/DeleteSuggestion.scala index db20b0ccfe7..16aee8feea0 100644 --- a/src/main/scala/beam/calibration/utils/DeleteSuggestion.scala +++ b/src/main/scala/scripts/calibration/utils/DeleteSuggestion.scala @@ -1,9 +1,9 @@ -package beam.calibration.utils +package scripts.calibration.utils -import beam.calibration.BeamSigoptTuner import com.sigopt.Sigopt import com.sigopt.model.{Experiment, Pagination, Suggestion} import com.typesafe.scalalogging.LazyLogging +import scripts.calibration.BeamSigoptTuner import scala.collection.JavaConverters._ diff --git a/src/main/scala/beam/calibration/utils/ListExperiments.scala b/src/main/scala/scripts/calibration/utils/ListExperiments.scala similarity index 95% rename from src/main/scala/beam/calibration/utils/ListExperiments.scala rename to src/main/scala/scripts/calibration/utils/ListExperiments.scala index d733d067635..e058bf67827 100644 --- a/src/main/scala/beam/calibration/utils/ListExperiments.scala +++ b/src/main/scala/scripts/calibration/utils/ListExperiments.scala @@ -1,4 +1,4 @@ -package beam.calibration.utils +package scripts.calibration.utils import com.sigopt.Sigopt import com.sigopt.model.{Experiment, Pagination, Suggestion} diff --git a/src/main/scala/beam/calibration/utils/ListSuggestions.scala b/src/main/scala/scripts/calibration/utils/ListSuggestions.scala similarity index 94% rename from src/main/scala/beam/calibration/utils/ListSuggestions.scala rename to src/main/scala/scripts/calibration/utils/ListSuggestions.scala index 7baaf84939e..440a6961855 100644 --- a/src/main/scala/beam/calibration/utils/ListSuggestions.scala +++ b/src/main/scala/scripts/calibration/utils/ListSuggestions.scala @@ -1,4 +1,4 @@ -package beam.calibration.utils +package scripts.calibration.utils import beam.utils.DebugLib import com.sigopt.Sigopt diff --git a/src/main/scala/beam/calibration/utils/SigOptApiToken.scala b/src/main/scala/scripts/calibration/utils/SigOptApiToken.scala similarity index 90% rename from src/main/scala/beam/calibration/utils/SigOptApiToken.scala rename to src/main/scala/scripts/calibration/utils/SigOptApiToken.scala index aec5712091b..07a2565d0f4 100644 --- a/src/main/scala/beam/calibration/utils/SigOptApiToken.scala +++ b/src/main/scala/scripts/calibration/utils/SigOptApiToken.scala @@ -1,4 +1,4 @@ -package beam.calibration.utils +package scripts.calibration.utils import com.sigopt.exception.APIConnectionError diff --git a/src/main/scala/beam/utils/csv/conversion/HouseholdsXml2CsvConverter.scala b/src/main/scala/scripts/csv/conversion/HouseholdsXml2CsvConverter.scala similarity index 99% rename from src/main/scala/beam/utils/csv/conversion/HouseholdsXml2CsvConverter.scala rename to src/main/scala/scripts/csv/conversion/HouseholdsXml2CsvConverter.scala index c357c1062f2..8d06168e4e8 100644 --- a/src/main/scala/beam/utils/csv/conversion/HouseholdsXml2CsvConverter.scala +++ b/src/main/scala/scripts/csv/conversion/HouseholdsXml2CsvConverter.scala @@ -1,4 +1,4 @@ -package beam.utils.csv.conversion +package scripts.csv.conversion import java.io.File diff --git a/src/main/scala/beam/utils/csv/conversion/NetworkXmlToCSV.scala b/src/main/scala/scripts/csv/conversion/NetworkXmlToCSV.scala similarity index 99% rename from src/main/scala/beam/utils/csv/conversion/NetworkXmlToCSV.scala rename to src/main/scala/scripts/csv/conversion/NetworkXmlToCSV.scala index d4d4dabd850..ddb6be50c3a 100644 --- a/src/main/scala/beam/utils/csv/conversion/NetworkXmlToCSV.scala +++ b/src/main/scala/scripts/csv/conversion/NetworkXmlToCSV.scala @@ -1,4 +1,4 @@ -package beam.utils.csv.conversion +package scripts.csv.conversion import java.io.{BufferedReader, File, PrintWriter} diff --git a/src/main/scala/beam/utils/csv/conversion/PhyssimEventsXmlToCSV.scala b/src/main/scala/scripts/csv/conversion/PhyssimEventsXmlToCSV.scala similarity index 96% rename from src/main/scala/beam/utils/csv/conversion/PhyssimEventsXmlToCSV.scala rename to src/main/scala/scripts/csv/conversion/PhyssimEventsXmlToCSV.scala index 1a79e69a97c..e129fa90c39 100644 --- a/src/main/scala/beam/utils/csv/conversion/PhyssimEventsXmlToCSV.scala +++ b/src/main/scala/scripts/csv/conversion/PhyssimEventsXmlToCSV.scala @@ -1,4 +1,4 @@ -package beam.utils.csv.conversion +package scripts.csv.conversion import java.io.{File, PrintWriter} diff --git a/src/main/scala/beam/utils/csv/conversion/PlansXml2CsvConverter.scala b/src/main/scala/scripts/csv/conversion/PlansXml2CsvConverter.scala similarity index 98% rename from src/main/scala/beam/utils/csv/conversion/PlansXml2CsvConverter.scala rename to src/main/scala/scripts/csv/conversion/PlansXml2CsvConverter.scala index e215c436cca..530efb807ea 100644 --- a/src/main/scala/beam/utils/csv/conversion/PlansXml2CsvConverter.scala +++ b/src/main/scala/scripts/csv/conversion/PlansXml2CsvConverter.scala @@ -1,4 +1,4 @@ -package beam.utils.csv.conversion +package scripts.csv.conversion import java.io.File diff --git a/src/main/scala/beam/utils/csv/conversion/PopulationXml2CsvConverter.scala b/src/main/scala/scripts/csv/conversion/PopulationXml2CsvConverter.scala similarity index 99% rename from src/main/scala/beam/utils/csv/conversion/PopulationXml2CsvConverter.scala rename to src/main/scala/scripts/csv/conversion/PopulationXml2CsvConverter.scala index 0f72c03232a..db3ab86dd9f 100644 --- a/src/main/scala/beam/utils/csv/conversion/PopulationXml2CsvConverter.scala +++ b/src/main/scala/scripts/csv/conversion/PopulationXml2CsvConverter.scala @@ -1,4 +1,4 @@ -package beam.utils.csv.conversion +package scripts.csv.conversion import java.io.File diff --git a/src/main/scala/beam/utils/csv/conversion/Xml2CsvFileConverter.scala b/src/main/scala/scripts/csv/conversion/Xml2CsvFileConverter.scala similarity index 94% rename from src/main/scala/beam/utils/csv/conversion/Xml2CsvFileConverter.scala rename to src/main/scala/scripts/csv/conversion/Xml2CsvFileConverter.scala index 9b0308b9946..6d17389a6c9 100644 --- a/src/main/scala/beam/utils/csv/conversion/Xml2CsvFileConverter.scala +++ b/src/main/scala/scripts/csv/conversion/Xml2CsvFileConverter.scala @@ -1,4 +1,4 @@ -package beam.utils.csv.conversion +package scripts.csv.conversion import java.io.File diff --git a/src/main/scala/beam/utils/csv/conversion/XmlConverter.scala b/src/main/scala/scripts/csv/conversion/XmlConverter.scala similarity index 99% rename from src/main/scala/beam/utils/csv/conversion/XmlConverter.scala rename to src/main/scala/scripts/csv/conversion/XmlConverter.scala index 559f1aa4ed2..0942f1c75a0 100644 --- a/src/main/scala/beam/utils/csv/conversion/XmlConverter.scala +++ b/src/main/scala/scripts/csv/conversion/XmlConverter.scala @@ -1,4 +1,4 @@ -package beam.utils.csv.conversion +package scripts.csv.conversion import java.io.{File, FileInputStream, FileOutputStream} import java.nio.file.Files diff --git a/src/main/scala/beam/utils/data/ctpp/CTPPParser.scala b/src/main/scala/scripts/ctpp/CTPPParser.scala similarity index 94% rename from src/main/scala/beam/utils/data/ctpp/CTPPParser.scala rename to src/main/scala/scripts/ctpp/CTPPParser.scala index e5040ff1fdb..d835ce7ce7d 100644 --- a/src/main/scala/beam/utils/data/ctpp/CTPPParser.scala +++ b/src/main/scala/scripts/ctpp/CTPPParser.scala @@ -1,8 +1,9 @@ -package beam.utils.data.ctpp +package scripts.ctpp import beam.utils.csv.GenericCsvReader -import beam.utils.data.ctpp.Models.CTPPEntry +import Models.CTPPEntry import com.typesafe.scalalogging.LazyLogging +import scripts.ctpp.Models.CTPPEntry import scala.util.Try import scala.util.control.NonFatal diff --git a/src/main/scala/beam/utils/data/ctpp/JointDistribution.scala b/src/main/scala/scripts/ctpp/JointDistribution.scala similarity index 98% rename from src/main/scala/beam/utils/data/ctpp/JointDistribution.scala rename to src/main/scala/scripts/ctpp/JointDistribution.scala index ac8a1f3339e..d3ebc66c3a0 100644 --- a/src/main/scala/beam/utils/data/ctpp/JointDistribution.scala +++ b/src/main/scala/scripts/ctpp/JointDistribution.scala @@ -1,7 +1,7 @@ -package beam.utils.data.ctpp +package scripts.ctpp import beam.utils.csv.GenericCsvReader -import beam.utils.data.ctpp.JointDistribution.{CustomRange, RETURN_COLUMN} +import JointDistribution.{CustomRange, RETURN_COLUMN} import org.apache.commons.math3.distribution.EnumeratedDistribution import org.apache.commons.math3.random.RandomGenerator import org.apache.commons.math3.util.{Pair => CPair} diff --git a/src/main/scala/beam/utils/data/ctpp/Models.scala b/src/main/scala/scripts/ctpp/Models.scala similarity index 81% rename from src/main/scala/beam/utils/data/ctpp/Models.scala rename to src/main/scala/scripts/ctpp/Models.scala index 03d7fe300f2..098f9ee1800 100644 --- a/src/main/scala/beam/utils/data/ctpp/Models.scala +++ b/src/main/scala/scripts/ctpp/Models.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp +package scripts.ctpp object Models { case class CTPPEntry(geoId: String, tblId: String, lineNumber: Int, estimate: Double, marginOfError: String) diff --git a/src/main/scala/beam/utils/data/ctpp/models/AgeRange.scala b/src/main/scala/scripts/ctpp/models/AgeRange.scala similarity index 58% rename from src/main/scala/beam/utils/data/ctpp/models/AgeRange.scala rename to src/main/scala/scripts/ctpp/models/AgeRange.scala index fcc7e0a01e3..d5e60096a03 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/AgeRange.scala +++ b/src/main/scala/scripts/ctpp/models/AgeRange.scala @@ -1,3 +1,3 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models case class AgeRange(range: Range) extends AnyVal diff --git a/src/main/scala/beam/utils/data/ctpp/models/FlowGeoParser.scala b/src/main/scala/scripts/ctpp/models/FlowGeoParser.scala similarity index 98% rename from src/main/scala/beam/utils/data/ctpp/models/FlowGeoParser.scala rename to src/main/scala/scripts/ctpp/models/FlowGeoParser.scala index 5d7b0ed1341..1360dad0ead 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/FlowGeoParser.scala +++ b/src/main/scala/scripts/ctpp/models/FlowGeoParser.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models object FlowGeoParser { val markerLength: Int = "C5600US".length diff --git a/src/main/scala/beam/utils/data/ctpp/models/Gender.scala b/src/main/scala/scripts/ctpp/models/Gender.scala similarity index 93% rename from src/main/scala/beam/utils/data/ctpp/models/Gender.scala rename to src/main/scala/scripts/ctpp/models/Gender.scala index cbd44ea6635..89b61601dad 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/Gender.scala +++ b/src/main/scala/scripts/ctpp/models/Gender.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models import scala.util.{Failure, Success, Try} diff --git a/src/main/scala/beam/utils/data/ctpp/models/HouseholdIncome.scala b/src/main/scala/scripts/ctpp/models/HouseholdIncome.scala similarity index 98% rename from src/main/scala/beam/utils/data/ctpp/models/HouseholdIncome.scala rename to src/main/scala/scripts/ctpp/models/HouseholdIncome.scala index 624d8d56457..5af34313e0b 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/HouseholdIncome.scala +++ b/src/main/scala/scripts/ctpp/models/HouseholdIncome.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models sealed trait HouseholdIncome { def contains(income: Int): Boolean = range.contains(income) diff --git a/src/main/scala/beam/utils/data/ctpp/models/HouseholdSize.scala b/src/main/scala/scripts/ctpp/models/HouseholdSize.scala similarity index 95% rename from src/main/scala/beam/utils/data/ctpp/models/HouseholdSize.scala rename to src/main/scala/scripts/ctpp/models/HouseholdSize.scala index 46d1e0d8695..71d94342c6f 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/HouseholdSize.scala +++ b/src/main/scala/scripts/ctpp/models/HouseholdSize.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models sealed trait HouseholdSize { def count: Int diff --git a/src/main/scala/beam/utils/data/ctpp/models/MeansOfTransportation.scala b/src/main/scala/scripts/ctpp/models/MeansOfTransportation.scala similarity index 99% rename from src/main/scala/beam/utils/data/ctpp/models/MeansOfTransportation.scala rename to src/main/scala/scripts/ctpp/models/MeansOfTransportation.scala index d403df263a9..f0b38d61662 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/MeansOfTransportation.scala +++ b/src/main/scala/scripts/ctpp/models/MeansOfTransportation.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models import beam.router.Modes.BeamMode diff --git a/src/main/scala/beam/utils/data/ctpp/models/OD.scala b/src/main/scala/scripts/ctpp/models/OD.scala similarity index 70% rename from src/main/scala/beam/utils/data/ctpp/models/OD.scala rename to src/main/scala/scripts/ctpp/models/OD.scala index c6f8084907e..2b2abcfba14 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/OD.scala +++ b/src/main/scala/scripts/ctpp/models/OD.scala @@ -1,3 +1,3 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models case class OD[+T](source: String, destination: String, attribute: T, value: Double) diff --git a/src/main/scala/beam/utils/data/ctpp/models/ResidenceGeoParser.scala b/src/main/scala/scripts/ctpp/models/ResidenceGeoParser.scala similarity index 94% rename from src/main/scala/beam/utils/data/ctpp/models/ResidenceGeoParser.scala rename to src/main/scala/scripts/ctpp/models/ResidenceGeoParser.scala index af64f2fddba..7a7be6502f7 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/ResidenceGeoParser.scala +++ b/src/main/scala/scripts/ctpp/models/ResidenceGeoParser.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models import scala.util.{Failure, Success, Try} diff --git a/src/main/scala/beam/utils/data/ctpp/models/ResidenceGeography.scala b/src/main/scala/scripts/ctpp/models/ResidenceGeography.scala similarity index 98% rename from src/main/scala/beam/utils/data/ctpp/models/ResidenceGeography.scala rename to src/main/scala/scripts/ctpp/models/ResidenceGeography.scala index 47f31774a8c..1ade325214b 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/ResidenceGeography.scala +++ b/src/main/scala/scripts/ctpp/models/ResidenceGeography.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models sealed trait ResidenceGeography { def name: String diff --git a/src/main/scala/beam/utils/data/ctpp/models/ResidenceToWorkplaceFlowGeography.scala b/src/main/scala/scripts/ctpp/models/ResidenceToWorkplaceFlowGeography.scala similarity index 98% rename from src/main/scala/beam/utils/data/ctpp/models/ResidenceToWorkplaceFlowGeography.scala rename to src/main/scala/scripts/ctpp/models/ResidenceToWorkplaceFlowGeography.scala index f7dbbbad9fc..8b0f56c7cfa 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/ResidenceToWorkplaceFlowGeography.scala +++ b/src/main/scala/scripts/ctpp/models/ResidenceToWorkplaceFlowGeography.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models sealed trait ResidenceToWorkplaceFlowGeography { diff --git a/src/main/scala/beam/utils/data/ctpp/models/ResidentialGeoParser.scala b/src/main/scala/scripts/ctpp/models/ResidentialGeoParser.scala similarity index 97% rename from src/main/scala/beam/utils/data/ctpp/models/ResidentialGeoParser.scala rename to src/main/scala/scripts/ctpp/models/ResidentialGeoParser.scala index 8efc6af3b7b..c2206e51d85 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/ResidentialGeoParser.scala +++ b/src/main/scala/scripts/ctpp/models/ResidentialGeoParser.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models import scala.util.{Failure, Success, Try} diff --git a/src/main/scala/beam/utils/data/ctpp/models/Vehicles.scala b/src/main/scala/scripts/ctpp/models/Vehicles.scala similarity index 97% rename from src/main/scala/beam/utils/data/ctpp/models/Vehicles.scala rename to src/main/scala/scripts/ctpp/models/Vehicles.scala index 324c9494588..53bd06fe903 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/Vehicles.scala +++ b/src/main/scala/scripts/ctpp/models/Vehicles.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models import scala.util.{Failure, Success, Try} diff --git a/src/main/scala/beam/utils/data/ctpp/models/WorkedHours.scala b/src/main/scala/scripts/ctpp/models/WorkedHours.scala similarity index 97% rename from src/main/scala/beam/utils/data/ctpp/models/WorkedHours.scala rename to src/main/scala/scripts/ctpp/models/WorkedHours.scala index d9f2e53acef..70725310de7 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/WorkedHours.scala +++ b/src/main/scala/scripts/ctpp/models/WorkedHours.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models +package scripts.ctpp.models sealed trait WorkedHours { def range: Range diff --git a/src/main/scala/beam/utils/data/ctpp/models/flow/Industry.scala b/src/main/scala/scripts/ctpp/models/flow/Industry.scala similarity index 97% rename from src/main/scala/beam/utils/data/ctpp/models/flow/Industry.scala rename to src/main/scala/scripts/ctpp/models/flow/Industry.scala index 9a65aa1903f..53ccfa0aa9f 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/flow/Industry.scala +++ b/src/main/scala/scripts/ctpp/models/flow/Industry.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models.flow +package scripts.ctpp.models.flow import scala.util.{Failure, Success, Try} diff --git a/src/main/scala/beam/utils/data/ctpp/models/residence/Industry.scala b/src/main/scala/scripts/ctpp/models/residence/Industry.scala similarity index 98% rename from src/main/scala/beam/utils/data/ctpp/models/residence/Industry.scala rename to src/main/scala/scripts/ctpp/models/residence/Industry.scala index 3a2c760d341..aa9c68881e2 100644 --- a/src/main/scala/beam/utils/data/ctpp/models/residence/Industry.scala +++ b/src/main/scala/scripts/ctpp/models/residence/Industry.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.models.residence +package scripts.ctpp.models.residence import scala.util.{Failure, Success, Try} diff --git a/src/main/scala/beam/utils/data/ctpp/readers/BaseTableReader.scala b/src/main/scala/scripts/ctpp/readers/BaseTableReader.scala similarity index 95% rename from src/main/scala/beam/utils/data/ctpp/readers/BaseTableReader.scala rename to src/main/scala/scripts/ctpp/readers/BaseTableReader.scala index 48d1ed5a801..506c4beb3ec 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/BaseTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/BaseTableReader.scala @@ -1,11 +1,10 @@ -package beam.utils.data.ctpp.readers +package scripts.ctpp.readers import java.io.{File, FileFilter} - -import beam.utils.data.ctpp.CTPPParser -import beam.utils.data.ctpp.Models.CTPPEntry -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import BaseTableReader.{CTPPDatabaseInfo, Table} import com.typesafe.scalalogging.StrictLogging +import scripts.ctpp.CTPPParser +import scripts.ctpp.Models.CTPPEntry abstract class BaseTableReader( protected val dbInfo: CTPPDatabaseInfo, diff --git a/src/main/scala/beam/utils/data/ctpp/readers/MetadataReader.scala b/src/main/scala/scripts/ctpp/readers/MetadataReader.scala similarity index 97% rename from src/main/scala/beam/utils/data/ctpp/readers/MetadataReader.scala rename to src/main/scala/scripts/ctpp/readers/MetadataReader.scala index b4f2f4abfea..b365202ceee 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/MetadataReader.scala +++ b/src/main/scala/scripts/ctpp/readers/MetadataReader.scala @@ -1,7 +1,7 @@ -package beam.utils.data.ctpp.readers +package scripts.ctpp.readers import beam.utils.csv.GenericCsvReader -import beam.utils.data.ctpp.readers.MetadataReader.{TableInfo, TableShell} +import MetadataReader.{TableInfo, TableShell} import com.typesafe.scalalogging.StrictLogging import de.vandermeer.asciitable.AsciiTable import org.supercsv.prefs.CsvPreference diff --git a/src/main/scala/beam/utils/data/ctpp/readers/flow/AgeOfWorkerTableReader.scala b/src/main/scala/scripts/ctpp/readers/flow/AgeOfWorkerTableReader.scala similarity index 86% rename from src/main/scala/beam/utils/data/ctpp/readers/flow/AgeOfWorkerTableReader.scala rename to src/main/scala/scripts/ctpp/readers/flow/AgeOfWorkerTableReader.scala index f7d6a55b336..68922a4941f 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/flow/AgeOfWorkerTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/flow/AgeOfWorkerTableReader.scala @@ -1,8 +1,9 @@ -package beam.utils.data.ctpp.readers.flow +package scripts.ctpp.readers.flow -import beam.utils.data.ctpp.models.{AgeRange, FlowGeoParser, OD, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import scripts.ctpp.models.ResidenceToWorkplaceFlowGeography +import scripts.ctpp.models.{AgeRange, FlowGeoParser, OD, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import scripts.ctpp.readers.BaseTableReader class AgeOfWorkerTableReader( dbInfo: CTPPDatabaseInfo, diff --git a/src/main/scala/beam/utils/data/ctpp/readers/flow/HouseholdIncomeTableReader.scala b/src/main/scala/scripts/ctpp/readers/flow/HouseholdIncomeTableReader.scala similarity index 75% rename from src/main/scala/beam/utils/data/ctpp/readers/flow/HouseholdIncomeTableReader.scala rename to src/main/scala/scripts/ctpp/readers/flow/HouseholdIncomeTableReader.scala index 6807be72db0..d7200d01fb0 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/flow/HouseholdIncomeTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/flow/HouseholdIncomeTableReader.scala @@ -1,16 +1,18 @@ -package beam.utils.data.ctpp.readers.flow +package scripts.ctpp.readers.flow import beam.utils.csv.CsvWriter -import beam.utils.data.ctpp.models.{FlowGeoParser, HouseholdIncome, OD, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import scripts.ctpp.models.ResidenceToWorkplaceFlowGeography.`TAZ To TAZ` +import scripts.ctpp.models.{FlowGeoParser, HouseholdIncome, OD, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.BaseTableReader +import scripts.ctpp.readers.BaseTableReader.Table.Flow.HouseholdIncomeInThePast12Months +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} class HouseholdIncomeTableReader( dbInfo: CTPPDatabaseInfo, val residenceToWorkplaceFlowGeography: ResidenceToWorkplaceFlowGeography ) extends BaseTableReader( dbInfo, - Table.Flow.HouseholdIncomeInThePast12Months, + HouseholdIncomeInThePast12Months, Some(residenceToWorkplaceFlowGeography.level) ) { @@ -34,7 +36,7 @@ object HouseholdIncomeTableReader { // 36 - New York val databaseInfo = CTPPDatabaseInfo(pathToData, Set("34", "36")) val readData = - new HouseholdIncomeTableReader(databaseInfo, ResidenceToWorkplaceFlowGeography.`TAZ To TAZ`) + new HouseholdIncomeTableReader(databaseInfo, `TAZ To TAZ`) .read() .toVector val nonZeros = readData.filterNot(x => x.value.equals(0d)) diff --git a/src/main/scala/beam/utils/data/ctpp/readers/flow/IndustryTableReader.scala b/src/main/scala/scripts/ctpp/readers/flow/IndustryTableReader.scala similarity index 65% rename from src/main/scala/beam/utils/data/ctpp/readers/flow/IndustryTableReader.scala rename to src/main/scala/scripts/ctpp/readers/flow/IndustryTableReader.scala index 2397fdc19b8..7783de27347 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/flow/IndustryTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/flow/IndustryTableReader.scala @@ -1,9 +1,10 @@ -package beam.utils.data.ctpp.readers.flow +package scripts.ctpp.readers.flow -import beam.utils.data.ctpp.models.flow.Industry -import beam.utils.data.ctpp.models.{FlowGeoParser, OD, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import scripts.ctpp.models.flow.Industry +import scripts.ctpp.models.{FlowGeoParser, OD, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.BaseTableReader +import scripts.ctpp.readers.BaseTableReader.CTPPDatabaseInfo +import scripts.ctpp.readers.BaseTableReader.Table class IndustryTableReader( dbInfo: CTPPDatabaseInfo, diff --git a/src/main/scala/beam/utils/data/ctpp/readers/flow/MeansOfTransportationTableReader.scala b/src/main/scala/scripts/ctpp/readers/flow/MeansOfTransportationTableReader.scala similarity index 80% rename from src/main/scala/beam/utils/data/ctpp/readers/flow/MeansOfTransportationTableReader.scala rename to src/main/scala/scripts/ctpp/readers/flow/MeansOfTransportationTableReader.scala index 531ebebcf21..6231f64bde7 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/flow/MeansOfTransportationTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/flow/MeansOfTransportationTableReader.scala @@ -1,13 +1,16 @@ -package beam.utils.data.ctpp.readers.flow +package scripts.ctpp.readers.flow -import beam.utils.data.ctpp.models.{FlowGeoParser, MeansOfTransportation, OD, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import scripts.ctpp.models.ResidenceToWorkplaceFlowGeography +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import scripts.ctpp.models.{FlowGeoParser, MeansOfTransportation, OD, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.BaseTableReader +import scripts.ctpp.readers.BaseTableReader.CTPPDatabaseInfo +import scripts.ctpp.readers.BaseTableReader.Table.Flow.MeanOfTransportation class MeansOfTransportationTableReader( dbInfo: CTPPDatabaseInfo, val residenceToWorkplaceFlowGeography: ResidenceToWorkplaceFlowGeography -) extends BaseTableReader(dbInfo, Table.Flow.MeanOfTransportation, Some(residenceToWorkplaceFlowGeography.level)) { +) extends BaseTableReader(dbInfo, MeanOfTransportation, Some(residenceToWorkplaceFlowGeography.level)) { private val interestedLineNumber: Set[Int] = MeansOfTransportation.all.map(_.lineNumber).toSet def read(): Iterable[OD[MeansOfTransportation]] = { diff --git a/src/main/scala/beam/utils/data/ctpp/readers/flow/TimeLeavingHomeTableReader.scala b/src/main/scala/scripts/ctpp/readers/flow/TimeLeavingHomeTableReader.scala similarity index 91% rename from src/main/scala/beam/utils/data/ctpp/readers/flow/TimeLeavingHomeTableReader.scala rename to src/main/scala/scripts/ctpp/readers/flow/TimeLeavingHomeTableReader.scala index 3c492ee75d0..d8d30ff1f61 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/flow/TimeLeavingHomeTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/flow/TimeLeavingHomeTableReader.scala @@ -1,16 +1,16 @@ -package beam.utils.data.ctpp.readers.flow +package scripts.ctpp.readers.flow -import java.util.concurrent.TimeUnit +import scripts.ctpp.models.{FlowGeoParser, OD, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.BaseTableReader +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} +import scripts.ctpp.readers.BaseTableReader.Table.Flow.TimeLeavingHome -import beam.utils.data.ctpp.CTPPParser -import beam.utils.data.ctpp.models.{FlowGeoParser, OD, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import java.util.concurrent.TimeUnit class TimeLeavingHomeTableReader( dbInfo: CTPPDatabaseInfo, val residenceToWorkplaceFlowGeography: ResidenceToWorkplaceFlowGeography -) extends BaseTableReader(dbInfo, Table.Flow.TimeLeavingHome, Some(residenceToWorkplaceFlowGeography.level)) { +) extends BaseTableReader(dbInfo, TimeLeavingHome, Some(residenceToWorkplaceFlowGeography.level)) { /* TableShell(B302104,1,0,Total) TableShell(B302104,2,1,Did not work at home:) diff --git a/src/main/scala/beam/utils/data/ctpp/readers/flow/TravelTimeTableReader.scala b/src/main/scala/scripts/ctpp/readers/flow/TravelTimeTableReader.scala similarity index 86% rename from src/main/scala/beam/utils/data/ctpp/readers/flow/TravelTimeTableReader.scala rename to src/main/scala/scripts/ctpp/readers/flow/TravelTimeTableReader.scala index f335e1f8355..b9b39471ee0 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/flow/TravelTimeTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/flow/TravelTimeTableReader.scala @@ -1,16 +1,17 @@ -package beam.utils.data.ctpp.readers.flow +package scripts.ctpp.readers.flow -import java.util.concurrent.TimeUnit +import scripts.ctpp.models.ResidenceToWorkplaceFlowGeography.`PUMA5 To POWPUMA` +import scripts.ctpp.models.{FlowGeoParser, OD, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.BaseTableReader +import scripts.ctpp.readers.BaseTableReader.Table.Flow.TravelTime +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.CTPPParser -import beam.utils.data.ctpp.models.{FlowGeoParser, OD, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import java.util.concurrent.TimeUnit class TravelTimeTableReader( dbInfo: CTPPDatabaseInfo, val residenceToWorkplaceFlowGeography: ResidenceToWorkplaceFlowGeography -) extends BaseTableReader(dbInfo, Table.Flow.TravelTime, Some(residenceToWorkplaceFlowGeography.level)) { +) extends BaseTableReader(dbInfo, TravelTime, Some(residenceToWorkplaceFlowGeography.level)) { /* TableShell(B302106,3,2,Less than 5 minutes) TableShell(B302106,4,2,5 to 14 minutes) @@ -89,7 +90,7 @@ object TravelTimeTableReader { def main(args: Array[String]): Unit = { val databaseInfo = CTPPDatabaseInfo(PathToData("d:/Work/beam/Austin/input/CTPP/"), Set("48")) - val rdr = new TravelTimeTableReader(databaseInfo, ResidenceToWorkplaceFlowGeography.`PUMA5 To POWPUMA`) + val rdr = new TravelTimeTableReader(databaseInfo, `PUMA5 To POWPUMA`) val readData = rdr.read().toVector val nonZeros = readData.filterNot(x => x.value.equals(0d)) diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/AgeTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/AgeTableReader.scala similarity index 89% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/AgeTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/AgeTableReader.scala index 3128896d6b5..0dded3d0907 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/AgeTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/AgeTableReader.scala @@ -1,8 +1,8 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.{AgeRange, ResidenceGeoParser, ResidenceGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import scripts.ctpp.models.{AgeRange, ResidenceGeoParser, ResidenceGeography} +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import scripts.ctpp.readers.BaseTableReader class AgeTableReader(dbInfo: CTPPDatabaseInfo, val residenceGeography: ResidenceGeography) extends BaseTableReader(dbInfo, Table.Residence.Age, Some(residenceGeography.level)) { diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/HouseholdSizeByUnitsInStructureTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/HouseholdSizeByUnitsInStructureTableReader.scala similarity index 81% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/HouseholdSizeByUnitsInStructureTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/HouseholdSizeByUnitsInStructureTableReader.scala index bab99285c86..28c835fbae9 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/HouseholdSizeByUnitsInStructureTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/HouseholdSizeByUnitsInStructureTableReader.scala @@ -1,11 +1,13 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.{HouseholdSize, ResidenceGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import scripts.ctpp.models.ResidenceGeography.State +import scripts.ctpp.models.{HouseholdSize, ResidenceGeography} +import scripts.ctpp.readers.BaseTableReader +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} +import scripts.ctpp.readers.BaseTableReader.Table.Residence.HouseholdSizeByUnitsInStructure class HouseholdSizeByUnitsInStructureTableReader(dbInfo: CTPPDatabaseInfo, val residenceGeography: ResidenceGeography) - extends BaseTableReader(dbInfo, Table.Residence.HouseholdSizeByUnitsInStructure, Some(residenceGeography.level)) { + extends BaseTableReader(dbInfo, HouseholdSizeByUnitsInStructure, Some(residenceGeography.level)) { private val `1-person household-lineNumber`: Int = 10 private val `2-person household-lineNumber`: Int = 19 private val `3-person household-lineNumber`: Int = 28 @@ -41,7 +43,7 @@ object HouseholdSizeByUnitsInStructureTableReader { def main(args: Array[String]): Unit = { val databaseInfo = CTPPDatabaseInfo(PathToData("d:/Work/beam/Austin/input/CTPP/"), Set("48")) val rdr = - new HouseholdSizeByUnitsInStructureTableReader(databaseInfo, ResidenceGeography.State) + new HouseholdSizeByUnitsInStructureTableReader(databaseInfo, State) val readData = rdr.read() readData.foreach { case (geoId, map) => println(s"geoId: $geoId") diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/IndustryTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/IndustryTableReader.scala similarity index 80% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/IndustryTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/IndustryTableReader.scala index b4eacd71357..adb495f0eb9 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/IndustryTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/IndustryTableReader.scala @@ -1,9 +1,10 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.residence.Industry -import beam.utils.data.ctpp.models.{ResidenceGeography, ResidentialGeoParser} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import scripts.ctpp.models.residence.Industry +import scripts.ctpp.models.{ResidenceGeography, ResidentialGeoParser} +import scripts.ctpp.readers.BaseTableReader +import scripts.ctpp.readers.BaseTableReader.CTPPDatabaseInfo +import scripts.ctpp.readers.BaseTableReader.Table.Residence.OccupationByIndustry /* TableShell(A102214,2,2,Agriculture, forestry, fishing and hunting, and mining) @@ -28,7 +29,7 @@ class IndustryTableReader( val geo: ResidenceGeography ) extends BaseTableReader( dbInfo, - Table.Residence.OccupationByIndustry, + OccupationByIndustry, Some(geo.level) ) { diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/MeanHouseholdIncomeTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/MeanHouseholdIncomeTableReader.scala similarity index 74% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/MeanHouseholdIncomeTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/MeanHouseholdIncomeTableReader.scala index 8181aa037c8..5e13b3eda70 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/MeanHouseholdIncomeTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/MeanHouseholdIncomeTableReader.scala @@ -1,9 +1,9 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.ResidenceGeography -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} -import beam.utils.data.ctpp.readers.residence.MeanHouseholdIncomeTableReader.MeanHouseholdIncome +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import MeanHouseholdIncomeTableReader.MeanHouseholdIncome +import scripts.ctpp.models.ResidenceGeography +import scripts.ctpp.readers.BaseTableReader class MeanHouseholdIncomeTableReader(dbInfo: CTPPDatabaseInfo, val residenceGeography: ResidenceGeography) extends BaseTableReader(dbInfo, Table.Residence.MeanHouseholdIncome, Some(residenceGeography.level)) { diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/MedianHouseholdIncomeTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/MedianHouseholdIncomeTableReader.scala similarity index 74% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/MedianHouseholdIncomeTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/MedianHouseholdIncomeTableReader.scala index 82e54efbbe5..7b379eb31a9 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/MedianHouseholdIncomeTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/MedianHouseholdIncomeTableReader.scala @@ -1,9 +1,9 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.ResidenceGeography -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} -import beam.utils.data.ctpp.readers.residence.MedianHouseholdIncomeTableReader.MedianHouseholdIncome +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import MedianHouseholdIncomeTableReader.MedianHouseholdIncome +import scripts.ctpp.models.ResidenceGeography +import scripts.ctpp.readers.BaseTableReader class MedianHouseholdIncomeTableReader(dbInfo: CTPPDatabaseInfo, val residenceGeography: ResidenceGeography) extends BaseTableReader(dbInfo, Table.Residence.MedianHouseholdIncome, Some(residenceGeography.level)) { diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/SexTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/SexTableReader.scala similarity index 69% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/SexTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/SexTableReader.scala index 53e8ee5ca17..948517361ad 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/SexTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/SexTableReader.scala @@ -1,13 +1,14 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.{Gender, ResidenceGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import scripts.ctpp.models.{Gender, ResidenceGeography} +import scripts.ctpp.readers.BaseTableReader +import scripts.ctpp.readers.BaseTableReader.CTPPDatabaseInfo +import scripts.ctpp.readers.BaseTableReader.Table.Residence.Sex import scala.util.{Failure, Success} class SexTableReader(dbInfo: CTPPDatabaseInfo, val residenceGeography: ResidenceGeography) - extends BaseTableReader(dbInfo, Table.Residence.Sex, Some(residenceGeography.level)) { + extends BaseTableReader(dbInfo, Sex, Some(residenceGeography.level)) { def read(): Map[String, Map[Gender, Double]] = { val map = readRaw() diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/TotalHouseholdsTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/TotalHouseholdsTableReader.scala similarity index 78% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/TotalHouseholdsTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/TotalHouseholdsTableReader.scala index a3781eedee7..527849e413e 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/TotalHouseholdsTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/TotalHouseholdsTableReader.scala @@ -1,9 +1,9 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.ResidenceGeography -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} -import beam.utils.data.ctpp.readers.residence.TotalHouseholdsTableReader.TotalHouseholds +import scripts.ctpp.models.ResidenceGeography +import scripts.ctpp.readers.BaseTableReader +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import scripts.ctpp.readers.residence.TotalHouseholdsTableReader.TotalHouseholds class TotalHouseholdsTableReader(dbInfo: CTPPDatabaseInfo, val residenceGeography: ResidenceGeography) extends BaseTableReader(dbInfo, Table.Residence.TotalHouseholds, Some(residenceGeography.level)) { diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/TotalPopulationTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/TotalPopulationTableReader.scala similarity index 80% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/TotalPopulationTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/TotalPopulationTableReader.scala index 4c7fe2c2462..5136734db97 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/TotalPopulationTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/TotalPopulationTableReader.scala @@ -1,9 +1,9 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.{ResidenceGeoParser, ResidenceGeography} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} -import beam.utils.data.ctpp.readers.residence.TotalPopulationTableReader.TotalPopulation +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData, Table} +import TotalPopulationTableReader.TotalPopulation +import scripts.ctpp.models.{ResidenceGeoParser, ResidenceGeography} +import scripts.ctpp.readers.BaseTableReader class TotalPopulationTableReader(dbInfo: CTPPDatabaseInfo, val residenceGeography: ResidenceGeography) extends BaseTableReader(dbInfo, Table.Residence.PopulationInHouseholds, Some(residenceGeography.level)) { diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/UsualHoursWorkedPerWeekTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/UsualHoursWorkedPerWeekTableReader.scala similarity index 91% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/UsualHoursWorkedPerWeekTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/UsualHoursWorkedPerWeekTableReader.scala index e5adbe106c4..dc87cdd0dd0 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/UsualHoursWorkedPerWeekTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/UsualHoursWorkedPerWeekTableReader.scala @@ -1,8 +1,8 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.{ResidenceGeography, WorkedHours} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import scripts.ctpp.models.{ResidenceGeography, WorkedHours} +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import scripts.ctpp.readers.BaseTableReader class UsualHoursWorkedPerWeekTableReader(dbInfo: CTPPDatabaseInfo, val residenceGeography: ResidenceGeography) extends BaseTableReader(dbInfo, Table.Residence.UsualHoursWorkedPerWeek, Some(residenceGeography.level)) { diff --git a/src/main/scala/beam/utils/data/ctpp/readers/residence/VehiclesAvailableTableReader.scala b/src/main/scala/scripts/ctpp/readers/residence/VehiclesAvailableTableReader.scala similarity index 78% rename from src/main/scala/beam/utils/data/ctpp/readers/residence/VehiclesAvailableTableReader.scala rename to src/main/scala/scripts/ctpp/readers/residence/VehiclesAvailableTableReader.scala index 65b895726b9..29acc7ede9d 100644 --- a/src/main/scala/beam/utils/data/ctpp/readers/residence/VehiclesAvailableTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/residence/VehiclesAvailableTableReader.scala @@ -1,8 +1,8 @@ -package beam.utils.data.ctpp.readers.residence +package scripts.ctpp.readers.residence -import beam.utils.data.ctpp.models.{ResidenceGeography, Vehicles} -import beam.utils.data.ctpp.readers.BaseTableReader -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import scripts.ctpp.models.{ResidenceGeography, Vehicles} +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, Table} +import scripts.ctpp.readers.BaseTableReader import scala.util.{Failure, Success} diff --git a/src/main/scala/beam/utils/data/ctpp/scenario/ScenarioGenerator.scala b/src/main/scala/scripts/ctpp/scenario/ScenarioGenerator.scala similarity index 84% rename from src/main/scala/beam/utils/data/ctpp/scenario/ScenarioGenerator.scala rename to src/main/scala/scripts/ctpp/scenario/ScenarioGenerator.scala index 1e619975657..c6b3ac41e23 100644 --- a/src/main/scala/beam/utils/data/ctpp/scenario/ScenarioGenerator.scala +++ b/src/main/scala/scripts/ctpp/scenario/ScenarioGenerator.scala @@ -1,4 +1,4 @@ -package beam.utils.data.ctpp.scenario +package scripts.ctpp.scenario import org.matsim.api.core.v01.population.Population import org.matsim.households.Households diff --git a/src/main/scala/beam/utils/data/ctpp/scenario/SimpleScenarioGenerator.scala b/src/main/scala/scripts/ctpp/scenario/SimpleScenarioGenerator.scala similarity index 90% rename from src/main/scala/beam/utils/data/ctpp/scenario/SimpleScenarioGenerator.scala rename to src/main/scala/scripts/ctpp/scenario/SimpleScenarioGenerator.scala index 553f77df359..8dee1b3acb1 100644 --- a/src/main/scala/beam/utils/data/ctpp/scenario/SimpleScenarioGenerator.scala +++ b/src/main/scala/scripts/ctpp/scenario/SimpleScenarioGenerator.scala @@ -1,27 +1,16 @@ -package beam.utils.data.ctpp.scenario +package scripts.ctpp.scenario -import java.util.Random - -import beam.utils.data.ctpp.models._ -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.residence.MeanHouseholdIncomeTableReader.MeanHouseholdIncome -import beam.utils.data.ctpp.readers.residence.MedianHouseholdIncomeTableReader.MedianHouseholdIncome -import beam.utils.data.ctpp.readers.residence.TotalPopulationTableReader.TotalPopulation -import beam.utils.data.ctpp.readers.residence.{ - AgeTableReader, - HouseholdSizeByUnitsInStructureTableReader, - MeanHouseholdIncomeTableReader, - MedianHouseholdIncomeTableReader, - SexTableReader, - TotalHouseholdsTableReader, - TotalPopulationTableReader, - UsualHoursWorkedPerWeekTableReader, - VehiclesAvailableTableReader -} import com.typesafe.scalalogging.StrictLogging import org.matsim.api.core.v01.population.Population import org.matsim.households.Households +import scripts.ctpp.models._ +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} +import scripts.ctpp.readers.residence.MeanHouseholdIncomeTableReader.MeanHouseholdIncome +import scripts.ctpp.readers.residence.MedianHouseholdIncomeTableReader.MedianHouseholdIncome +import scripts.ctpp.readers.residence.TotalPopulationTableReader.TotalPopulation +import scripts.ctpp.readers.residence._ +import java.util.Random import scala.concurrent.duration._ import scala.concurrent.{Await, ExecutionContext, Future} diff --git a/src/main/scala/beam/docs/GenerateDocumentationTask.scala b/src/main/scala/scripts/docs/GenerateDocumentationTask.scala similarity index 99% rename from src/main/scala/beam/docs/GenerateDocumentationTask.scala rename to src/main/scala/scripts/docs/GenerateDocumentationTask.scala index 4fc0837a7b4..358916a740f 100644 --- a/src/main/scala/beam/docs/GenerateDocumentationTask.scala +++ b/src/main/scala/scripts/docs/GenerateDocumentationTask.scala @@ -1,4 +1,4 @@ -package beam.docs +package scripts.docs import java.io.{FileOutputStream, PrintWriter} import java.nio.file.{FileSystems, Path, Paths} diff --git a/src/main/scala/beam/docs/ReflectionUtil.scala b/src/main/scala/scripts/docs/ReflectionUtil.scala similarity index 96% rename from src/main/scala/beam/docs/ReflectionUtil.scala rename to src/main/scala/scripts/docs/ReflectionUtil.scala index c5062d2164c..78a8565235f 100644 --- a/src/main/scala/beam/docs/ReflectionUtil.scala +++ b/src/main/scala/scripts/docs/ReflectionUtil.scala @@ -1,4 +1,4 @@ -package beam.docs +package scripts.docs object ReflectionUtil { diff --git a/src/main/scala/beam/experiment/ExperimentApp.scala b/src/main/scala/scripts/experiment/ExperimentApp.scala similarity index 97% rename from src/main/scala/beam/experiment/ExperimentApp.scala rename to src/main/scala/scripts/experiment/ExperimentApp.scala index ac48e1f2ead..eee54eb5515 100644 --- a/src/main/scala/beam/experiment/ExperimentApp.scala +++ b/src/main/scala/scripts/experiment/ExperimentApp.scala @@ -1,9 +1,9 @@ -package beam.experiment +package scripts.experiment import java.io.{File, FileInputStream} import java.nio.file.{Files, Path, Paths} -import beam.experiment.ExperimentApp.loadExperimentDefs +import scripts.experiment.ExperimentApp.loadExperimentDefs import org.yaml.snakeyaml.constructor.Constructor /** diff --git a/src/main/scala/beam/experiment/ExperimentDef.scala b/src/main/scala/scripts/experiment/ExperimentDef.scala similarity index 99% rename from src/main/scala/beam/experiment/ExperimentDef.scala rename to src/main/scala/scripts/experiment/ExperimentDef.scala index 4b4c9a17592..13dd2c36268 100755 --- a/src/main/scala/beam/experiment/ExperimentDef.scala +++ b/src/main/scala/scripts/experiment/ExperimentDef.scala @@ -1,4 +1,4 @@ -package beam.experiment +package scripts.experiment import java.nio.file.{Files, Path, Paths} import java.util.{Collections, List => JavaList, Map => JavaMap} diff --git a/src/main/scala/beam/experiment/ExperimentGenerator.scala b/src/main/scala/scripts/experiment/ExperimentGenerator.scala similarity index 98% rename from src/main/scala/beam/experiment/ExperimentGenerator.scala rename to src/main/scala/scripts/experiment/ExperimentGenerator.scala index f55001fe8dd..eca28a0bb59 100755 --- a/src/main/scala/beam/experiment/ExperimentGenerator.scala +++ b/src/main/scala/scripts/experiment/ExperimentGenerator.scala @@ -1,4 +1,4 @@ -package beam.experiment +package scripts.experiment import java.io._ import java.nio.file.{Files, Path, Paths} @@ -22,7 +22,7 @@ import scala.collection.immutable * This generator will create sub-directories relatively to experiments.yml */ object ExperimentGenerator extends ExperimentApp { - import beam.experiment.ExperimentApp + import scripts.experiment.ExperimentApp override def validateExperimentConfig(experiment: ExperimentDef): Unit = { if (!Files.exists(Paths.get(experiment.header.beamTemplateConfPath))) { diff --git a/src/main/scala/beam/experiment/ExperimentRunSandbox.scala b/src/main/scala/scripts/experiment/ExperimentRunSandbox.scala similarity index 99% rename from src/main/scala/beam/experiment/ExperimentRunSandbox.scala rename to src/main/scala/scripts/experiment/ExperimentRunSandbox.scala index f0067bb35c5..4aa3736d57c 100755 --- a/src/main/scala/beam/experiment/ExperimentRunSandbox.scala +++ b/src/main/scala/scripts/experiment/ExperimentRunSandbox.scala @@ -1,4 +1,4 @@ -package beam.experiment +package scripts.experiment import java.nio.file.{Files, Path, Paths} diff --git a/src/main/scala/beam/experiment/Factor.scala b/src/main/scala/scripts/experiment/Factor.scala similarity index 95% rename from src/main/scala/beam/experiment/Factor.scala rename to src/main/scala/scripts/experiment/Factor.scala index d14575cb160..b04a552244d 100755 --- a/src/main/scala/beam/experiment/Factor.scala +++ b/src/main/scala/scripts/experiment/Factor.scala @@ -1,4 +1,4 @@ -package beam.experiment +package scripts.experiment import scala.beans.BeanProperty diff --git a/src/main/scala/beam/experiment/RunExperiments.scala b/src/main/scala/scripts/experiment/RunExperiments.scala similarity index 96% rename from src/main/scala/beam/experiment/RunExperiments.scala rename to src/main/scala/scripts/experiment/RunExperiments.scala index 1236d5143cd..d858846e7e5 100755 --- a/src/main/scala/beam/experiment/RunExperiments.scala +++ b/src/main/scala/scripts/experiment/RunExperiments.scala @@ -1,4 +1,4 @@ -package beam.experiment +package scripts.experiment import java.io.IOException import java.nio.file.{Files, Path, Paths} diff --git a/src/main/scala/beam/utils/map/ActivitiesClustering.scala b/src/main/scala/scripts/map/ActivitiesClustering.scala similarity index 98% rename from src/main/scala/beam/utils/map/ActivitiesClustering.scala rename to src/main/scala/scripts/map/ActivitiesClustering.scala index 3892742f461..98be7b8639e 100644 --- a/src/main/scala/beam/utils/map/ActivitiesClustering.scala +++ b/src/main/scala/scripts/map/ActivitiesClustering.scala @@ -1,9 +1,9 @@ -package beam.utils.map +package scripts.map import beam.sim.common.GeoUtils import beam.utils.csv.readers.BeamCsvScenarioReader import beam.utils.scenario.PlanElement -import beam.utils.shape.{Attributes, ShapeWriter} +import scripts.shape.{Attributes, ShapeWriter} import com.typesafe.scalalogging.StrictLogging import com.vividsolutions.jts.algorithm.ConvexHull import com.vividsolutions.jts.geom.{Coordinate, GeometryFactory, Polygon} diff --git a/src/main/scala/beam/utils/map/EnvelopeToGpx.scala b/src/main/scala/scripts/map/EnvelopeToGpx.scala similarity index 79% rename from src/main/scala/beam/utils/map/EnvelopeToGpx.scala rename to src/main/scala/scripts/map/EnvelopeToGpx.scala index 005d8e1a4bb..3fbc7e65c43 100644 --- a/src/main/scala/beam/utils/map/EnvelopeToGpx.scala +++ b/src/main/scala/scripts/map/EnvelopeToGpx.scala @@ -1,6 +1,8 @@ -package beam.utils.map +package scripts.map import beam.sim.common.GeoUtils +import beam.utils.map +import beam.utils.map.GpxPoint import com.typesafe.scalalogging.LazyLogging import com.vividsolutions.jts.geom.Envelope import org.matsim.api.core.v01.Coord @@ -27,22 +29,22 @@ x0,y0 .___________. x1, y0 */ val envelopePoints = Array[GpxPoint]( - GpxPoint("x0,y0", new Coord(envelope.getMinX, envelope.getMinY)), - GpxPoint("x0,y1", new Coord(envelope.getMinX, envelope.getMaxY)), - GpxPoint("x1,y1", new Coord(envelope.getMaxX, envelope.getMaxY)), - GpxPoint("x1,y0", new Coord(envelope.getMaxX, envelope.getMinY)) + map.GpxPoint("x0,y0", new Coord(envelope.getMinX, envelope.getMinY)), + map.GpxPoint("x0,y1", new Coord(envelope.getMinX, envelope.getMaxY)), + map.GpxPoint("x1,y1", new Coord(envelope.getMaxX, envelope.getMaxY)), + map.GpxPoint("x1,y0", new Coord(envelope.getMaxX, envelope.getMinY)) ) val gpxWriter = new GpxWriter(outputPath, geoUtils) try { wgsCoordOpt.foreach { wgsCoord => - val middle = GpxPoint( + val middle = map.GpxPoint( "Middle", new Coord((envelope.getMinX + envelope.getMaxX) / 2, (envelope.getMinY + envelope.getMaxY) / 2) ) gpxWriter.drawMarker(middle) - val searchPoint = GpxPoint("Search", wgsCoord) + val searchPoint = map.GpxPoint("Search", wgsCoord) gpxWriter.drawMarker(searchPoint) gpxWriter.drawSourceToDest(middle, searchPoint) } diff --git a/src/main/scala/beam/utils/map/GeoFenceVerifier.scala b/src/main/scala/scripts/map/GeoFenceVerifier.scala similarity index 93% rename from src/main/scala/beam/utils/map/GeoFenceVerifier.scala rename to src/main/scala/scripts/map/GeoFenceVerifier.scala index ca4cbed6a56..64fd6f0bd46 100644 --- a/src/main/scala/beam/utils/map/GeoFenceVerifier.scala +++ b/src/main/scala/scripts/map/GeoFenceVerifier.scala @@ -1,21 +1,17 @@ -package beam.utils.map - -import java.io.Closeable +package scripts.map import beam.agentsim.events.PathTraversalEvent import beam.sim.common.GeoUtils -import beam.sim.{CircularGeofence, Geofence, RideHailFleetInitializer} +import beam.sim.{CircularGeofence, RideHailFleetInitializer} +import beam.utils.map.PointInfo import beam.utils.{EventReader, ProfilingUtils, Statistics} import com.typesafe.scalalogging.LazyLogging import org.matsim.api.core.v01.Coord import org.matsim.api.core.v01.events.Event +import java.io.Closeable import scala.util.Try -case class PointInfo(offset: Double, geofenceRadius: Double) { - val ratio: Double = if (geofenceRadius.equals(0d)) Double.NaN else offset / geofenceRadius -} - object GeoFenceVerifier extends LazyLogging { val geoUtils: GeoUtils = new beam.sim.common.GeoUtils { diff --git a/src/main/scala/beam/utils/map/GeoJsonToGpxConvertor.scala b/src/main/scala/scripts/map/GeoJsonToGpxConvertor.scala similarity index 93% rename from src/main/scala/beam/utils/map/GeoJsonToGpxConvertor.scala rename to src/main/scala/scripts/map/GeoJsonToGpxConvertor.scala index ce6f598a9c3..b70bf28e55d 100644 --- a/src/main/scala/beam/utils/map/GeoJsonToGpxConvertor.scala +++ b/src/main/scala/scripts/map/GeoJsonToGpxConvertor.scala @@ -1,8 +1,7 @@ -package beam.utils.map +package scripts.map -import java.io.File - -import beam.utils.GeoJsonReader +import beam.utils.{map, GeoJsonReader} +import beam.utils.map.GpxPoint import com.typesafe.scalalogging.LazyLogging import com.vividsolutions.jts.geom.{Coordinate, Envelope, Geometry} import org.apache.commons.io.FilenameUtils @@ -10,6 +9,8 @@ import org.matsim.api.core.v01.Coord import org.opengis.feature.Feature import org.opengis.feature.simple.SimpleFeature +import java.io.File + object GeoJsonToGpxConvertor extends LazyLogging { def renderEnvelope(points: Array[GpxPoint], outputPath: String): Unit = { @@ -25,7 +26,7 @@ object GeoJsonToGpxConvertor extends LazyLogging { val movementId = feature.getProperty("MOVEMENT_ID").getValue.toString val centroid = feature.asInstanceOf[SimpleFeature].getDefaultGeometry.asInstanceOf[Geometry].getCentroid val wgsCoord = new Coord(centroid.getX, centroid.getY) - GpxPoint(movementId, wgsCoord) + map.GpxPoint(movementId, wgsCoord) } GeoJsonReader.read(inputPath, mapper) } diff --git a/src/main/scala/beam/utils/map/GpxWriter.scala b/src/main/scala/scripts/map/GpxWriter.scala similarity index 96% rename from src/main/scala/beam/utils/map/GpxWriter.scala rename to src/main/scala/scripts/map/GpxWriter.scala index 8a4775a14a3..78bd5d5f6f2 100644 --- a/src/main/scala/beam/utils/map/GpxWriter.scala +++ b/src/main/scala/scripts/map/GpxWriter.scala @@ -1,16 +1,14 @@ -package beam.utils.map - -import java.io.BufferedWriter +package scripts.map import beam.sim.common.GeoUtils -import beam.utils.map.EnvelopeToGpx.{latitude, longitude} +import beam.utils.map.GpxPoint import org.matsim.api.core.v01.Coord import org.matsim.core.utils.io.IOUtils +import scripts.map.EnvelopeToGpx.{latitude, longitude} +import java.io.BufferedWriter import scala.util.Try -case class GpxPoint(name: String, wgsCoord: Coord) - class GpxWriter(filePath: String, geoUtils: GeoUtils) extends AutoCloseable { import GpxWriter._ diff --git a/src/main/scala/beam/utils/map/LinkIdsToGpx.scala b/src/main/scala/scripts/map/LinkIdsToGpx.scala similarity index 94% rename from src/main/scala/beam/utils/map/LinkIdsToGpx.scala rename to src/main/scala/scripts/map/LinkIdsToGpx.scala index d3c445f433b..af8415b8b8a 100644 --- a/src/main/scala/beam/utils/map/LinkIdsToGpx.scala +++ b/src/main/scala/scripts/map/LinkIdsToGpx.scala @@ -1,7 +1,7 @@ -package beam.utils.map +package scripts.map -import org.matsim.api.core.v01.network.Link -import org.matsim.api.core.v01.{BasicLocation, Id} +import beam.utils.map.GpxPoint +import org.matsim.api.core.v01.Id import org.matsim.core.network.NetworkUtils import org.matsim.core.network.io.MatsimNetworkReader diff --git a/src/main/scala/beam/utils/map/NewYorkAnalysis.scala b/src/main/scala/scripts/map/NewYorkAnalysis.scala similarity index 95% rename from src/main/scala/beam/utils/map/NewYorkAnalysis.scala rename to src/main/scala/scripts/map/NewYorkAnalysis.scala index 4d8cc396cee..f06374c9be6 100644 --- a/src/main/scala/beam/utils/map/NewYorkAnalysis.scala +++ b/src/main/scala/scripts/map/NewYorkAnalysis.scala @@ -1,13 +1,13 @@ -package beam.utils.map +package scripts.map import beam.sim.common.GeoUtils import beam.utils.csv.CsvWriter import beam.utils.scenario.PlanElement import beam.utils.scenario.generic.readers.CsvPlanElementReader -import beam.utils.shape.{NoAttributeShapeWriter, ShapeWriter} +import scripts.shape.{NoAttributeShapeWriter, ShapeWriter} import com.conveyal.osmlib.OSM import com.vividsolutions.jts.algorithm.ConvexHull -import com.vividsolutions.jts.geom.{Coordinate, Envelope, GeometryFactory, Point, Polygon} +import com.vividsolutions.jts.geom._ import org.matsim.api.core.v01.Coord import scala.collection.mutable.ArrayBuffer diff --git a/src/main/scala/beam/utils/map/NewYorkReplanningAnalysis.scala b/src/main/scala/scripts/map/NewYorkReplanningAnalysis.scala similarity index 97% rename from src/main/scala/beam/utils/map/NewYorkReplanningAnalysis.scala rename to src/main/scala/scripts/map/NewYorkReplanningAnalysis.scala index 85d494cb244..70d17b5405a 100644 --- a/src/main/scala/beam/utils/map/NewYorkReplanningAnalysis.scala +++ b/src/main/scala/scripts/map/NewYorkReplanningAnalysis.scala @@ -1,17 +1,16 @@ -package beam.utils.map - -import java.util.UUID +package scripts.map import beam.agentsim.events.{ModeChoiceEvent, ReplanningEvent} import beam.sim.common.GeoUtils import beam.utils.EventReader -import beam.utils.shape.{Attributes, ShapeWriter} +import scripts.shape.{Attributes, ShapeWriter} import com.vividsolutions.jts.geom._ import org.matsim.api.core.v01.Id import org.matsim.api.core.v01.network.Network import org.matsim.core.network.NetworkUtils import org.matsim.core.network.io.MatsimNetworkReader +import java.util.UUID import scala.collection.mutable private case class Attribute(count: Int) extends Attributes diff --git a/src/main/scala/beam/utils/map/NewYorkRouteDebugging.scala b/src/main/scala/scripts/map/NewYorkRouteDebugging.scala similarity index 99% rename from src/main/scala/beam/utils/map/NewYorkRouteDebugging.scala rename to src/main/scala/scripts/map/NewYorkRouteDebugging.scala index b88196c9a18..008935d58aa 100644 --- a/src/main/scala/beam/utils/map/NewYorkRouteDebugging.scala +++ b/src/main/scala/scripts/map/NewYorkRouteDebugging.scala @@ -1,4 +1,4 @@ -package beam.utils.map +package scripts.map import java.nio.charset.StandardCharsets import java.time.LocalDate diff --git a/src/main/scala/beam/utils/map/NewYorkSubwayAnalysis.scala b/src/main/scala/scripts/map/NewYorkSubwayAnalysis.scala similarity index 99% rename from src/main/scala/beam/utils/map/NewYorkSubwayAnalysis.scala rename to src/main/scala/scripts/map/NewYorkSubwayAnalysis.scala index 66b93f70e63..246457d988f 100644 --- a/src/main/scala/beam/utils/map/NewYorkSubwayAnalysis.scala +++ b/src/main/scala/scripts/map/NewYorkSubwayAnalysis.scala @@ -1,4 +1,4 @@ -package beam.utils.map +package scripts.map import beam.utils.csv.CsvWriter import beam.utils.{DebugLib, ParquetReader, Statistics} diff --git a/src/main/scala/beam/utils/map/NewYorkTrafficVolumeVisualization.scala b/src/main/scala/scripts/map/NewYorkTrafficVolumeVisualization.scala similarity index 97% rename from src/main/scala/beam/utils/map/NewYorkTrafficVolumeVisualization.scala rename to src/main/scala/scripts/map/NewYorkTrafficVolumeVisualization.scala index 7599ff268e2..ddc1788c67d 100644 --- a/src/main/scala/beam/utils/map/NewYorkTrafficVolumeVisualization.scala +++ b/src/main/scala/scripts/map/NewYorkTrafficVolumeVisualization.scala @@ -1,7 +1,7 @@ -package beam.utils.map +package scripts.map import beam.utils.csv.GenericCsvReader -import beam.utils.shape.{Attributes, ShapeWriter} +import scripts.shape.{Attributes, ShapeWriter} import beam.utils.{FileUtils, GeoJsonReader} import com.vividsolutions.jts.geom.{Geometry, MultiLineString} import org.opengis.feature.Feature diff --git a/src/main/scala/beam/utils/map/OsmosisPolygonFilterGenerator.scala b/src/main/scala/scripts/map/OsmosisPolygonFilterGenerator.scala similarity index 98% rename from src/main/scala/beam/utils/map/OsmosisPolygonFilterGenerator.scala rename to src/main/scala/scripts/map/OsmosisPolygonFilterGenerator.scala index a9d7d7699bb..58a0c3f6eec 100644 --- a/src/main/scala/beam/utils/map/OsmosisPolygonFilterGenerator.scala +++ b/src/main/scala/scripts/map/OsmosisPolygonFilterGenerator.scala @@ -1,10 +1,7 @@ -package beam.utils.map - -import java.io.File -import java.nio.charset.StandardCharsets -import java.nio.file.{Files, StandardOpenOption} +package scripts.map import beam.utils.csv.CsvWriter +import beam.utils.map.ShapefileReader import com.typesafe.scalalogging.StrictLogging import com.vividsolutions.jts.geom.Geometry import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory @@ -12,6 +9,9 @@ import org.geotools.geometry.jts.JTS import org.opengis.feature.simple.SimpleFeature import org.opengis.referencing.operation.MathTransform +import java.io.File +import java.nio.charset.StandardCharsets +import java.nio.file.{Files, StandardOpenOption} import scala.util.Try object OsmosisPolygonFilterGenerator extends StrictLogging { diff --git a/src/main/scala/beam/utils/map/R5MapStatsCalculator.scala b/src/main/scala/scripts/map/R5MapStatsCalculator.scala similarity index 99% rename from src/main/scala/beam/utils/map/R5MapStatsCalculator.scala rename to src/main/scala/scripts/map/R5MapStatsCalculator.scala index 43002f1b644..663e87af601 100644 --- a/src/main/scala/beam/utils/map/R5MapStatsCalculator.scala +++ b/src/main/scala/scripts/map/R5MapStatsCalculator.scala @@ -1,4 +1,4 @@ -package beam.utils.map +package scripts.map import com.conveyal.osmlib.{OSM, Way} import com.conveyal.r5.point_to_point.builder.TNBuilderConfig diff --git a/src/main/scala/beam/utils/map/R5NetworkPlayground.scala b/src/main/scala/scripts/map/R5NetworkPlayground.scala similarity index 94% rename from src/main/scala/beam/utils/map/R5NetworkPlayground.scala rename to src/main/scala/scripts/map/R5NetworkPlayground.scala index a244e92b1ff..0596d3ffdfd 100644 --- a/src/main/scala/beam/utils/map/R5NetworkPlayground.scala +++ b/src/main/scala/scripts/map/R5NetworkPlayground.scala @@ -1,9 +1,11 @@ -package beam.utils.map +package scripts.map import beam.router.r5.DefaultNetworkCoordinator import beam.sim.BeamHelper import beam.sim.common.EdgeWithCoord import beam.sim.config.BeamConfig +import beam.utils.map +import beam.utils.map.GpxPoint import org.matsim.api.core.v01.Coord object R5NetworkPlayground extends BeamHelper { @@ -37,7 +39,7 @@ object R5NetworkPlayground extends BeamHelper { gpxWriter.drawRectangle(corners.take(4)) r.foreach { case (edgeWithCoord, cornerPoint) => - val point = GpxPoint( + val point = map.GpxPoint( s"${edgeWithCoord.edgeIndex}_${cornerPoint.name}", new Coord(edgeWithCoord.wgsCoord.x, edgeWithCoord.wgsCoord.y) ) diff --git a/src/main/scala/beam/utils/map/RepositioningAnalyzer.scala b/src/main/scala/scripts/map/RepositioningAnalyzer.scala similarity index 99% rename from src/main/scala/beam/utils/map/RepositioningAnalyzer.scala rename to src/main/scala/scripts/map/RepositioningAnalyzer.scala index 0d5fe3829ad..d3fab5a99dc 100644 --- a/src/main/scala/beam/utils/map/RepositioningAnalyzer.scala +++ b/src/main/scala/scripts/map/RepositioningAnalyzer.scala @@ -1,19 +1,19 @@ -package beam.utils.map - -import java.io.{BufferedWriter, Closeable, Writer} -import java.util.concurrent.TimeUnit +package scripts.map import beam.agentsim.agents.vehicles.BeamVehicle import beam.agentsim.events.PathTraversalEvent import beam.utils.scenario.PlanElement import beam.utils.{EventReader, FileUtils, ProfilingUtils} import com.typesafe.scalalogging.LazyLogging -import org.matsim.api.core.v01.{Coord, Id} import org.matsim.api.core.v01.events.Event +import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.io.IOUtils import org.supercsv.io.CsvMapReader import org.supercsv.prefs.CsvPreference +import java.io.{BufferedWriter, Closeable, Writer} +import java.util.concurrent.TimeUnit + case class VehicleLocation(vehicleId: Id[BeamVehicle], x: Double, y: Double, time: Int, numOfPassangers: Int) object RepositioningAnalyzer extends LazyLogging { diff --git a/src/main/scala/beam/utils/map/TazTravelTimeAnalyzer.scala b/src/main/scala/scripts/map/TazTravelTimeAnalyzer.scala similarity index 98% rename from src/main/scala/beam/utils/map/TazTravelTimeAnalyzer.scala rename to src/main/scala/scripts/map/TazTravelTimeAnalyzer.scala index e906a8f0aef..aea4fcb8923 100644 --- a/src/main/scala/beam/utils/map/TazTravelTimeAnalyzer.scala +++ b/src/main/scala/scripts/map/TazTravelTimeAnalyzer.scala @@ -1,18 +1,18 @@ -package beam.utils.map - -import java.io.{BufferedWriter, Closeable} +package scripts.map import beam.agentsim.events.PathTraversalEvent import beam.agentsim.infrastructure.taz._ import beam.router.skim.SkimsUtils import beam.sim.common.GeoUtils import beam.sim.config.BeamConfig -import beam.utils.map.R5NetworkPlayground.prepareConfig import beam.utils.{EventReader, ProfilingUtils} import com.typesafe.scalalogging.LazyLogging import org.matsim.api.core.v01.events.Event import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.io.IOUtils +import scripts.map.R5NetworkPlayground.prepareConfig + +import java.io.{BufferedWriter, Closeable} case class Taz2TazWithTrip( startTazId: Id[TAZ], diff --git a/src/main/scala/beam/utils/map/TazTreeMapToGpx.scala b/src/main/scala/scripts/map/TazTreeMapToGpx.scala similarity index 89% rename from src/main/scala/beam/utils/map/TazTreeMapToGpx.scala rename to src/main/scala/scripts/map/TazTreeMapToGpx.scala index 267c0fa662a..0169f8e537f 100644 --- a/src/main/scala/beam/utils/map/TazTreeMapToGpx.scala +++ b/src/main/scala/scripts/map/TazTreeMapToGpx.scala @@ -1,9 +1,9 @@ -package beam.utils.map +package scripts.map import beam.agentsim.infrastructure.taz.TAZTreeMap -import beam.sim.BeamServices import beam.sim.config.BeamConfig -import beam.utils.map.R5NetworkPlayground.prepareConfig +import R5NetworkPlayground.prepareConfig +import beam.utils.map.GpxPoint import com.google.common.io.Files import com.typesafe.scalalogging.LazyLogging diff --git a/src/main/scala/beam/utils/mapsapi/bingapi/BingExampleOfUsage.scala b/src/main/scala/scripts/mapsapi/BingExampleOfUsage.scala similarity index 93% rename from src/main/scala/beam/utils/mapsapi/bingapi/BingExampleOfUsage.scala rename to src/main/scala/scripts/mapsapi/BingExampleOfUsage.scala index 2615b84b94a..d475673b546 100644 --- a/src/main/scala/beam/utils/mapsapi/bingapi/BingExampleOfUsage.scala +++ b/src/main/scala/scripts/mapsapi/BingExampleOfUsage.scala @@ -1,14 +1,14 @@ -package beam.utils.mapsapi.bingapi +package scripts.mapsapi -import java.util.concurrent.TimeUnit +import beam.agentsim.infrastructure.geozone.WgsCoordinate +import beam.utils.FileUtils +import beam.utils.mapsapi.bingapi.BingAdapter +import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration.FiniteDuration import scala.util.Try -import beam.agentsim.infrastructure.geozone.WgsCoordinate -import beam.utils.FileUtils - object BingExampleOfUsage extends App { if (args.length != 2) { println("Expected arguments: [API-KEY] [lat1,long1;lat2,long2;lat3,long3]") diff --git a/src/main/scala/beam/utils/mapsapi/googleapi/GoogleApiExampleUsage.scala b/src/main/scala/scripts/mapsapi/GoogleApiExampleUsage.scala similarity index 94% rename from src/main/scala/beam/utils/mapsapi/googleapi/GoogleApiExampleUsage.scala rename to src/main/scala/scripts/mapsapi/GoogleApiExampleUsage.scala index 8cfd10c1d29..d12af1ac576 100644 --- a/src/main/scala/beam/utils/mapsapi/googleapi/GoogleApiExampleUsage.scala +++ b/src/main/scala/scripts/mapsapi/GoogleApiExampleUsage.scala @@ -1,15 +1,15 @@ -package beam.utils.mapsapi.googleapi +package scripts.mapsapi + +import beam.agentsim.infrastructure.geozone.WgsCoordinate +import beam.utils.FileUtils +import beam.utils.mapsapi.googleapi.{GoogleAdapter, Route, TrafficModels, TravelModes} +import beam.utils.mapsapi.RichSegments._ import java.nio.file.{Path, Paths} import java.time.LocalDateTime - import scala.concurrent.Await import scala.concurrent.duration.Duration -import beam.utils.mapsapi.RichSegments._ -import beam.agentsim.infrastructure.geozone.WgsCoordinate -import beam.utils.FileUtils - object GoogleApiExampleUsage extends App { if (args.length != 3) { println("Expected arguments: [API-KEY] [ORIGIN] [DESTINATION]") diff --git a/src/main/scala/beam/utils/mapsapi/hereapi/HereExampleUsage.scala b/src/main/scala/scripts/mapsapi/HereExampleUsage.scala similarity index 94% rename from src/main/scala/beam/utils/mapsapi/hereapi/HereExampleUsage.scala rename to src/main/scala/scripts/mapsapi/HereExampleUsage.scala index 6033745e5fd..e784a67b10e 100644 --- a/src/main/scala/beam/utils/mapsapi/hereapi/HereExampleUsage.scala +++ b/src/main/scala/scripts/mapsapi/HereExampleUsage.scala @@ -1,10 +1,11 @@ -package beam.utils.mapsapi.hereapi - -import java.nio.file.{Path, Paths} +package scripts.mapsapi import beam.agentsim.infrastructure.geozone.WgsCoordinate -import beam.utils.mapsapi.RichSegments._ +import beam.utils.mapsapi.hereapi.HereService import beam.utils.mapsapi.{Segment, SegmentSerializer} +import beam.utils.mapsapi.RichSegments._ + +import java.nio.file.{Path, Paths} object HereExampleUsage extends App { if (args.length != 3) { diff --git a/src/main/scala/beam/utils/protocolvis/ActorAsState.scala b/src/main/scala/scripts/protocolvis/ActorAsState.scala similarity index 95% rename from src/main/scala/beam/utils/protocolvis/ActorAsState.scala rename to src/main/scala/scripts/protocolvis/ActorAsState.scala index c88a6fab6d6..dabf3844896 100644 --- a/src/main/scala/beam/utils/protocolvis/ActorAsState.scala +++ b/src/main/scala/scripts/protocolvis/ActorAsState.scala @@ -1,7 +1,7 @@ -package beam.utils.protocolvis +package scripts.protocolvis -import beam.utils.protocolvis.MessageReader._ -import beam.utils.protocolvis.SequenceDiagram.{userFriendlyActorName, userFriendlyPayloadSimplified} +import scripts.protocolvis.MessageReader._ +import scripts.protocolvis.SequenceDiagram.{userFriendlyActorName, userFriendlyPayloadSimplified} import java.nio.file.Path import scala.collection.immutable diff --git a/src/main/scala/beam/utils/protocolvis/AgentStateDiagram.scala b/src/main/scala/scripts/protocolvis/AgentStateDiagram.scala similarity index 82% rename from src/main/scala/beam/utils/protocolvis/AgentStateDiagram.scala rename to src/main/scala/scripts/protocolvis/AgentStateDiagram.scala index 2ea06cadea3..a73d255ecd9 100644 --- a/src/main/scala/beam/utils/protocolvis/AgentStateDiagram.scala +++ b/src/main/scala/scripts/protocolvis/AgentStateDiagram.scala @@ -1,8 +1,8 @@ -package beam.utils.protocolvis +package scripts.protocolvis -import beam.utils.protocolvis.ActorAsState.{toPumlEntries, toShortName, writeToDir, StateTransition} -import beam.utils.protocolvis.MessageReader.{RowData, Transition} -import beam.utils.protocolvis.SequenceDiagram.userFriendlyActorName +import scripts.protocolvis.ActorAsState.{toPumlEntries, toShortName, writeToDir, StateTransition} +import scripts.protocolvis.MessageReader.{RowData, Transition} +import scripts.protocolvis.SequenceDiagram.userFriendlyActorName import java.nio.file.Path diff --git a/src/main/scala/beam/utils/protocolvis/Extractors.scala b/src/main/scala/scripts/protocolvis/Extractors.scala similarity index 93% rename from src/main/scala/beam/utils/protocolvis/Extractors.scala rename to src/main/scala/scripts/protocolvis/Extractors.scala index fa9ae559ed1..85e1584c415 100644 --- a/src/main/scala/beam/utils/protocolvis/Extractors.scala +++ b/src/main/scala/scripts/protocolvis/Extractors.scala @@ -1,6 +1,6 @@ -package beam.utils.protocolvis +package scripts.protocolvis -import beam.utils.protocolvis.MessageReader.RowData +import scripts.protocolvis.MessageReader.RowData /** * @author Dmitry Openkov diff --git a/src/main/scala/beam/utils/protocolvis/MessageReader.scala b/src/main/scala/scripts/protocolvis/MessageReader.scala similarity index 99% rename from src/main/scala/beam/utils/protocolvis/MessageReader.scala rename to src/main/scala/scripts/protocolvis/MessageReader.scala index de2d0f93e4a..6dc9cfe9a33 100644 --- a/src/main/scala/beam/utils/protocolvis/MessageReader.scala +++ b/src/main/scala/scripts/protocolvis/MessageReader.scala @@ -1,4 +1,4 @@ -package beam.utils.protocolvis +package scripts.protocolvis import beam.utils.csv.GenericCsvReader import com.typesafe.scalalogging.LazyLogging diff --git a/src/main/scala/beam/utils/protocolvis/PumlWriter.scala b/src/main/scala/scripts/protocolvis/PumlWriter.scala similarity index 92% rename from src/main/scala/beam/utils/protocolvis/PumlWriter.scala rename to src/main/scala/scripts/protocolvis/PumlWriter.scala index a17cb8595e8..395e2996895 100644 --- a/src/main/scala/beam/utils/protocolvis/PumlWriter.scala +++ b/src/main/scala/scripts/protocolvis/PumlWriter.scala @@ -1,4 +1,4 @@ -package beam.utils.protocolvis +package scripts.protocolvis import beam.utils.FileUtils diff --git a/src/main/scala/beam/utils/protocolvis/SequenceDiagram.scala b/src/main/scala/scripts/protocolvis/SequenceDiagram.scala similarity index 99% rename from src/main/scala/beam/utils/protocolvis/SequenceDiagram.scala rename to src/main/scala/scripts/protocolvis/SequenceDiagram.scala index 69fc5c968db..e8c739d359d 100644 --- a/src/main/scala/beam/utils/protocolvis/SequenceDiagram.scala +++ b/src/main/scala/scripts/protocolvis/SequenceDiagram.scala @@ -1,7 +1,7 @@ -package beam.utils.protocolvis +package scripts.protocolvis import beam.utils.logging.MessageLogger -import beam.utils.protocolvis.MessageReader._ +import scripts.protocolvis.MessageReader._ import org.apache.commons.lang3.StringUtils import java.nio.file.Path diff --git a/src/main/scala/beam/utils/protocolvis/VisualizingApp.scala b/src/main/scala/scripts/protocolvis/VisualizingApp.scala similarity index 97% rename from src/main/scala/beam/utils/protocolvis/VisualizingApp.scala rename to src/main/scala/scripts/protocolvis/VisualizingApp.scala index bf543df2dfa..bba8509b87f 100644 --- a/src/main/scala/beam/utils/protocolvis/VisualizingApp.scala +++ b/src/main/scala/scripts/protocolvis/VisualizingApp.scala @@ -1,7 +1,7 @@ -package beam.utils.protocolvis +package scripts.protocolvis -import beam.utils.protocolvis.Extractors.{AllMessages, ByPerson, ByTrigger, ExtractorType} -import beam.utils.protocolvis.MessageReader.RowData +import scripts.protocolvis.Extractors.{AllMessages, ByPerson, ByTrigger, ExtractorType} +import scripts.protocolvis.MessageReader.RowData import com.typesafe.scalalogging.StrictLogging import enumeratum.{Enum, EnumEntry} diff --git a/src/main/scala/beam/utils/shape/FilterPointsInShapeFile.scala b/src/main/scala/scripts/shape/FilterPointsInShapeFile.scala similarity index 99% rename from src/main/scala/beam/utils/shape/FilterPointsInShapeFile.scala rename to src/main/scala/scripts/shape/FilterPointsInShapeFile.scala index d17e62424b0..c86e9bd223c 100644 --- a/src/main/scala/beam/utils/shape/FilterPointsInShapeFile.scala +++ b/src/main/scala/scripts/shape/FilterPointsInShapeFile.scala @@ -1,4 +1,4 @@ -package beam.utils.shape +package scripts.shape import beam.utils.csv.CsvWriter import beam.utils.data.synthpop.GeoService.findShapeFile diff --git a/src/main/scala/beam/utils/shape/GenericFeatureBuilder.scala b/src/main/scala/scripts/shape/GenericFeatureBuilder.scala similarity index 99% rename from src/main/scala/beam/utils/shape/GenericFeatureBuilder.scala rename to src/main/scala/scripts/shape/GenericFeatureBuilder.scala index ecbcf2b8bd8..3bb8df0cfce 100644 --- a/src/main/scala/beam/utils/shape/GenericFeatureBuilder.scala +++ b/src/main/scala/scripts/shape/GenericFeatureBuilder.scala @@ -1,4 +1,4 @@ -package beam.utils.shape +package scripts.shape import java.lang.reflect.Method import org.geotools.feature.simple.{SimpleFeatureBuilder, SimpleFeatureTypeBuilder} diff --git a/src/main/scala/beam/utils/shape/NoAttributeShapeWriter.scala b/src/main/scala/scripts/shape/NoAttributeShapeWriter.scala similarity index 91% rename from src/main/scala/beam/utils/shape/NoAttributeShapeWriter.scala rename to src/main/scala/scripts/shape/NoAttributeShapeWriter.scala index c76ad97f8bd..5ff74dcafc5 100644 --- a/src/main/scala/beam/utils/shape/NoAttributeShapeWriter.scala +++ b/src/main/scala/scripts/shape/NoAttributeShapeWriter.scala @@ -1,6 +1,6 @@ -package beam.utils.shape +package scripts.shape -import beam.utils.shape.ShapeWriter.OriginalToPersistedFeatureIdMap +import scripts.shape.ShapeWriter.OriginalToPersistedFeatureIdMap import com.vividsolutions.jts.geom.{Geometry => JtsGeometry} import org.geotools.referencing.crs.DefaultGeographicCRS import org.opengis.referencing.crs.CoordinateReferenceSystem diff --git a/src/main/scala/beam/utils/shape/ShapeWriter.scala b/src/main/scala/scripts/shape/ShapeWriter.scala similarity index 96% rename from src/main/scala/beam/utils/shape/ShapeWriter.scala rename to src/main/scala/scripts/shape/ShapeWriter.scala index 7a06deaa610..22c5342ceb8 100644 --- a/src/main/scala/beam/utils/shape/ShapeWriter.scala +++ b/src/main/scala/scripts/shape/ShapeWriter.scala @@ -1,10 +1,10 @@ -package beam.utils.shape +package scripts.shape import java.io.File import java.util -import beam.utils.shape.Attributes.EmptyAttributes -import beam.utils.shape.ShapeWriter.OriginalToPersistedFeatureIdMap +import scripts.shape.Attributes.EmptyAttributes +import scripts.shape.ShapeWriter.OriginalToPersistedFeatureIdMap import com.typesafe.scalalogging.StrictLogging import com.vividsolutions.jts.geom.{Geometry => JtsGeometry} import org.geotools.data.DataUtilities diff --git a/src/main/scala/beam/utils/shapefiles/WriteShapeFile.scala b/src/main/scala/scripts/shapefiles/WriteShapeFile.scala similarity index 100% rename from src/main/scala/beam/utils/shapefiles/WriteShapeFile.scala rename to src/main/scala/scripts/shapefiles/WriteShapeFile.scala diff --git a/src/main/scala/beam/utils/data/synthpop/CongestionLevelData.scala b/src/main/scala/scripts/synthpop/CongestionLevelData.scala similarity index 96% rename from src/main/scala/beam/utils/data/synthpop/CongestionLevelData.scala rename to src/main/scala/scripts/synthpop/CongestionLevelData.scala index a1e3be9feb0..dbceb4e7287 100644 --- a/src/main/scala/beam/utils/data/synthpop/CongestionLevelData.scala +++ b/src/main/scala/scripts/synthpop/CongestionLevelData.scala @@ -1,4 +1,4 @@ -package beam.utils.data.synthpop +package scripts.synthpop import beam.utils.csv.GenericCsvReader diff --git a/src/main/scala/beam/utils/data/synthpop/FipsCodes.scala b/src/main/scala/scripts/synthpop/FipsCodes.scala similarity index 98% rename from src/main/scala/beam/utils/data/synthpop/FipsCodes.scala rename to src/main/scala/scripts/synthpop/FipsCodes.scala index 0e668900b78..fac44377e95 100644 --- a/src/main/scala/beam/utils/data/synthpop/FipsCodes.scala +++ b/src/main/scala/scripts/synthpop/FipsCodes.scala @@ -1,10 +1,9 @@ -package beam.utils.data.synthpop - -import java.io.Closeable +package scripts.synthpop import beam.utils.csv.GenericCsvReader import com.typesafe.scalalogging.LazyLogging +import java.io.Closeable import scala.collection.JavaConverters._ import scala.collection.mutable diff --git a/src/main/scala/beam/utils/data/synthpop/FlowStatsForParking.scala b/src/main/scala/scripts/synthpop/FlowStatsForParking.scala similarity index 88% rename from src/main/scala/beam/utils/data/synthpop/FlowStatsForParking.scala rename to src/main/scala/scripts/synthpop/FlowStatsForParking.scala index 9a887ea00b6..9f32a468f93 100644 --- a/src/main/scala/beam/utils/data/synthpop/FlowStatsForParking.scala +++ b/src/main/scala/scripts/synthpop/FlowStatsForParking.scala @@ -1,15 +1,15 @@ -package beam.utils.data.synthpop +package scripts.synthpop -import beam.utils.data.ctpp.models.{OD, ResidenceGeography, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.flow.TravelTimeTableReader -import beam.utils.data.ctpp.readers.residence.TotalPopulationTableReader +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} import beam.utils.data.synthpop.GeoService.{defaultTazMapper, getTazMap} import beam.utils.data.synthpop.models.Models.TazGeoId import com.typesafe.scalalogging.StrictLogging import com.vividsolutions.jts.geom.Geometry import org.opengis.feature.simple.SimpleFeature import org.opengis.referencing.operation.MathTransform +import scripts.ctpp.models.{OD, ResidenceGeography, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.flow.TravelTimeTableReader +import scripts.ctpp.readers.residence.TotalPopulationTableReader class FlowStatsForParking(val dbInfo: CTPPDatabaseInfo, val tazGeoIdToGeomAndLandArea: Map[TazGeoId, (Geometry, Long)]) extends StrictLogging { diff --git a/src/main/scala/beam/utils/data/synthpop/HouseholdReader.scala b/src/main/scala/scripts/synthpop/HouseholdReader.scala similarity index 99% rename from src/main/scala/beam/utils/data/synthpop/HouseholdReader.scala rename to src/main/scala/scripts/synthpop/HouseholdReader.scala index df36d68e6c2..bcc55cc53d0 100644 --- a/src/main/scala/beam/utils/data/synthpop/HouseholdReader.scala +++ b/src/main/scala/scripts/synthpop/HouseholdReader.scala @@ -1,4 +1,4 @@ -package beam.utils.data.synthpop +package scripts.synthpop import beam.utils.csv.GenericCsvReader import beam.utils.data.synthpop.models.Models.{BlockGroupGeoId, County, Household, State} diff --git a/src/main/scala/beam/utils/data/synthpop/IndustryAssigner.scala b/src/main/scala/scripts/synthpop/IndustryAssigner.scala similarity index 92% rename from src/main/scala/beam/utils/data/synthpop/IndustryAssigner.scala rename to src/main/scala/scripts/synthpop/IndustryAssigner.scala index c0800074da7..c0eecc57f3c 100644 --- a/src/main/scala/beam/utils/data/synthpop/IndustryAssigner.scala +++ b/src/main/scala/scripts/synthpop/IndustryAssigner.scala @@ -1,15 +1,16 @@ -package beam.utils.data.synthpop +package scripts.synthpop import beam.utils.ProfilingUtils import beam.utils.csv.{CsvWriter, GenericCsvReader} -import beam.utils.data.ctpp.models.residence.{Industry => ResidenceIndustry} -import beam.utils.data.ctpp.models.flow.{Industry => FlowIndustry} -import beam.utils.data.ctpp.models.{ResidenceGeography, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.flow.IndustryTableReader -import beam.utils.data.ctpp.readers.residence +import scripts.ctpp.models.flow.{Industry => FlowIndustry} +import scripts.ctpp.models.residence.{Industry => ResidenceIndustry} +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} import beam.utils.scenario.PlanElement import beam.utils.scenario.generic.readers.CsvPlanElementReader +import scripts.ctpp.models.{flow, ResidenceGeography, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.models.residence.Industry +import scripts.ctpp.readers.flow.IndustryTableReader +import scripts.ctpp.readers.residence class IndustryAssigner {} @@ -166,7 +167,7 @@ object IndustryAssigner { csvWriter.close() } - def toFlowIndustry(input: (ResidenceIndustry, Double)): (FlowIndustry, Double) = { + def toFlowIndustry(input: (Industry, Double)): (flow.Industry, Double) = { val (workIndustry, count) = input val flowIndustry = workIndustry match { case ResidenceIndustry.Agriculture | ResidenceIndustry.Construction | ResidenceIndustry.ArmedForces => diff --git a/src/main/scala/beam/utils/data/synthpop/NewYorkScenarioFilter.scala b/src/main/scala/scripts/synthpop/NewYorkScenarioFilter.scala similarity index 99% rename from src/main/scala/beam/utils/data/synthpop/NewYorkScenarioFilter.scala rename to src/main/scala/scripts/synthpop/NewYorkScenarioFilter.scala index 53296fdd0e3..26ad6cbc662 100644 --- a/src/main/scala/beam/utils/data/synthpop/NewYorkScenarioFilter.scala +++ b/src/main/scala/scripts/synthpop/NewYorkScenarioFilter.scala @@ -1,6 +1,4 @@ -package beam.utils.data.synthpop - -import java.io.{Closeable, File} +package scripts.synthpop import beam.utils.ProfilingUtils import beam.utils.scenario.generic.readers.{CsvHouseholdInfoReader, CsvPersonInfoReader, CsvPlanElementReader} @@ -8,6 +6,7 @@ import beam.utils.scenario.generic.writers.{CsvHouseholdInfoWriter, CsvPersonInf import beam.utils.scenario.{HouseholdId, PersonId, PersonInfo, PlanElement} import com.typesafe.scalalogging.LazyLogging +import java.io.{Closeable, File} import scala.collection.mutable import scala.util.Try diff --git a/src/main/scala/beam/utils/data/synthpop/ODSampler.scala b/src/main/scala/scripts/synthpop/ODSampler.scala similarity index 90% rename from src/main/scala/beam/utils/data/synthpop/ODSampler.scala rename to src/main/scala/scripts/synthpop/ODSampler.scala index 3047a7d6db3..b03a2d50f9b 100644 --- a/src/main/scala/beam/utils/data/synthpop/ODSampler.scala +++ b/src/main/scala/scripts/synthpop/ODSampler.scala @@ -1,9 +1,9 @@ -package beam.utils.data.synthpop +package scripts.synthpop -import beam.utils.data.ctpp.models.OD import org.apache.commons.math3.distribution.EnumeratedDistribution import org.apache.commons.math3.random.RandomGenerator import org.apache.commons.math3.util.{Pair => CPair} +import scripts.ctpp.models.OD import scala.collection.JavaConverters._ diff --git a/src/main/scala/beam/utils/data/synthpop/PolygonShapeToCsvConverter.scala b/src/main/scala/scripts/synthpop/PolygonShapeToCsvConverter.scala similarity index 99% rename from src/main/scala/beam/utils/data/synthpop/PolygonShapeToCsvConverter.scala rename to src/main/scala/scripts/synthpop/PolygonShapeToCsvConverter.scala index fcdc5afbb98..fd654eaa9ce 100644 --- a/src/main/scala/beam/utils/data/synthpop/PolygonShapeToCsvConverter.scala +++ b/src/main/scala/scripts/synthpop/PolygonShapeToCsvConverter.scala @@ -1,8 +1,7 @@ -package beam.utils.data.synthpop +package scripts.synthpop import beam.sim.common.{GeoUtils, SimpleGeoUtils} import beam.utils.csv.CsvWriter -import beam.utils.map.ShapefileReader import com.typesafe.scalalogging.StrictLogging import com.vividsolutions.jts.geom.Geometry import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory @@ -10,6 +9,7 @@ import org.geotools.geometry.jts.JTS import org.matsim.api.core.v01.Coord import org.opengis.feature.simple.SimpleFeature import org.opengis.referencing.operation.MathTransform +import beam.utils.map.ShapefileReader import java.io.File import java.nio.file.{Path, Paths} @@ -22,6 +22,7 @@ import scala.util.{Failure, Success, Try} * ./gradlew :execute -PmainClass=beam.utils.data.synthpop.PolygonShapeToCsvConverter \ * -PappArgs="['--input=./j5ouj.shp', '--output=./block_group-centers.csv.gz', '--crs=epsg:26910', '--id-attribute-name=blkgrpid']" * }}} + * * @author Dmitry Openkov */ object PolygonShapeToCsvConverter extends App with StrictLogging { diff --git a/src/main/scala/beam/utils/data/synthpop/PopulationCorrection.scala b/src/main/scala/scripts/synthpop/PopulationCorrection.scala similarity index 98% rename from src/main/scala/beam/utils/data/synthpop/PopulationCorrection.scala rename to src/main/scala/scripts/synthpop/PopulationCorrection.scala index 43022f87ab8..f146c942a62 100644 --- a/src/main/scala/beam/utils/data/synthpop/PopulationCorrection.scala +++ b/src/main/scala/scripts/synthpop/PopulationCorrection.scala @@ -1,4 +1,4 @@ -package beam.utils.data.synthpop +package scripts.synthpop import beam.utils.data.synthpop.models.Models import com.typesafe.scalalogging.StrictLogging diff --git a/src/main/scala/beam/utils/data/synthpop/PopulationReader.scala b/src/main/scala/scripts/synthpop/PopulationReader.scala similarity index 98% rename from src/main/scala/beam/utils/data/synthpop/PopulationReader.scala rename to src/main/scala/scripts/synthpop/PopulationReader.scala index efecc5909c2..ef825f360c6 100644 --- a/src/main/scala/beam/utils/data/synthpop/PopulationReader.scala +++ b/src/main/scala/scripts/synthpop/PopulationReader.scala @@ -1,4 +1,4 @@ -package beam.utils.data.synthpop +package scripts.synthpop import beam.utils.csv.GenericCsvReader import beam.utils.data.synthpop.models.Models.{Gender, Person} diff --git a/src/main/scala/beam/utils/data/synthpop/PumaLevelScenarioGenerator.scala b/src/main/scala/scripts/synthpop/PumaLevelScenarioGenerator.scala similarity index 98% rename from src/main/scala/beam/utils/data/synthpop/PumaLevelScenarioGenerator.scala rename to src/main/scala/scripts/synthpop/PumaLevelScenarioGenerator.scala index 48c73f80702..948461a58ab 100644 --- a/src/main/scala/beam/utils/data/synthpop/PumaLevelScenarioGenerator.scala +++ b/src/main/scala/scripts/synthpop/PumaLevelScenarioGenerator.scala @@ -1,13 +1,12 @@ -package beam.utils.data.synthpop +package scripts.synthpop import beam.sim.common.GeoUtils import beam.sim.population.PopulationAdjustment import beam.taz.{PointGenerator, RandomPointsInGridGenerator} import beam.utils.ProfilingUtils -import beam.utils.data.ctpp.models.ResidenceToWorkplaceFlowGeography -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.flow.TimeLeavingHomeTableReader -import beam.utils.data.synthpop.generators.{RandomWorkDestinationGenerator, WorkedDurationGeneratorImpl} +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} +import beam.utils.data.synthpop._ +import scripts.synthpop.generators.{RandomWorkDestinationGenerator, WorkedDurationGeneratorImpl} import beam.utils.data.synthpop.models.Models import beam.utils.data.synthpop.models.Models.{BlockGroupGeoId, Gender, PowPumaGeoId, PumaGeoId} import beam.utils.scenario._ @@ -16,6 +15,8 @@ import com.typesafe.scalalogging.StrictLogging import com.vividsolutions.jts.geom.{Envelope, Geometry} import org.apache.commons.math3.random.MersenneTwister import org.matsim.api.core.v01.Coord +import scripts.ctpp.models.ResidenceToWorkplaceFlowGeography +import scripts.ctpp.readers.flow.TimeLeavingHomeTableReader import scala.collection.mutable import scala.util.Try diff --git a/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala b/src/main/scala/scripts/synthpop/ScenarioGenerator.scala similarity index 98% rename from src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala rename to src/main/scala/scripts/synthpop/ScenarioGenerator.scala index 23a621605d0..4bf93c26620 100644 --- a/src/main/scala/beam/utils/data/synthpop/ScenarioGenerator.scala +++ b/src/main/scala/scripts/synthpop/ScenarioGenerator.scala @@ -1,39 +1,34 @@ -package beam.utils.data.synthpop +package scripts.synthpop -import java.io.File -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter -import java.util.concurrent.atomic.AtomicInteger import beam.agentsim.infrastructure.geozone._ import beam.sim.common.GeoUtils import beam.sim.population.PopulationAdjustment import beam.taz.{PointGenerator, RandomPointsInGridGenerator} import beam.utils.ProfilingUtils import beam.utils.csv.CsvWriter -import beam.utils.data.ctpp.models.ResidenceToWorkplaceFlowGeography -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} import beam.utils.data.synthpop.GeoService.CheckResult -import beam.utils.data.synthpop.generators.{ +import beam.utils.data.synthpop._ +import scripts.synthpop.generators.{ RandomWorkDestinationGenerator, TimeLeavingHomeGenerator, TimeLeavingHomeGeneratorImpl, WorkedDurationGeneratorImpl } import beam.utils.data.synthpop.models.Models -import beam.utils.data.synthpop.models.Models.{BlockGroupGeoId, County, Gender, GenericGeoId, State, TazGeoId} +import beam.utils.data.synthpop.models.Models._ import beam.utils.scenario._ -import beam.utils.scenario.generic.writers.{ - CsvBlocksInfoWriter, - CsvHouseholdInfoWriter, - CsvParkingInfoWriter, - CsvPersonInfoWriter, - CsvPlanElementWriter -} +import beam.utils.scenario.generic.writers._ import com.typesafe.scalalogging.StrictLogging import com.vividsolutions.jts.geom.Geometry import org.apache.commons.math3.random.{MersenneTwister, RandomGenerator} import org.matsim.api.core.v01.Coord +import scripts.ctpp.models.ResidenceToWorkplaceFlowGeography +import java.io.File +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter +import java.util.concurrent.atomic.AtomicInteger import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.util.{Random, Try} @@ -131,7 +126,7 @@ class SimpleScenarioGenerator( private val householdWithPersons: Map[Models.Household, Seq[Models.Person]] = { // Read households and people - val temp: Seq[(Models.Household, Seq[Models.Person])] = SythpopReader.apply(pathToSythpopDataFolder).read().toSeq + val temp: Seq[(Models.Household, Seq[Models.Person])] = SynthpopReader.apply(pathToSythpopDataFolder).read().toSeq // Adjust population PopulationCorrection.adjust(temp, stateCodeToWorkForceSampler, shouldRemoveNonWorkers) } diff --git a/src/main/scala/beam/utils/data/synthpop/SimpleScenarioGeneratorArgParser.scala b/src/main/scala/scripts/synthpop/SimpleScenarioGeneratorArgParser.scala similarity index 98% rename from src/main/scala/beam/utils/data/synthpop/SimpleScenarioGeneratorArgParser.scala rename to src/main/scala/scripts/synthpop/SimpleScenarioGeneratorArgParser.scala index e1f91eb69ab..6780b2e4885 100644 --- a/src/main/scala/beam/utils/data/synthpop/SimpleScenarioGeneratorArgParser.scala +++ b/src/main/scala/scripts/synthpop/SimpleScenarioGeneratorArgParser.scala @@ -1,10 +1,9 @@ -package beam.utils.data.synthpop +package scripts.synthpop -import java.io.File - -import beam.utils.data.synthpop.SimpleScenarioGenerator.Arguments import scopt.OptionParser +import scripts.synthpop.SimpleScenarioGenerator.Arguments +import java.io.File import scala.util.Try object SimpleScenarioGeneratorArgParser { diff --git a/src/main/scala/beam/utils/data/synthpop/SythpopOutputJoiner.scala b/src/main/scala/scripts/synthpop/SynthpopOutputJoiner.scala similarity index 98% rename from src/main/scala/beam/utils/data/synthpop/SythpopOutputJoiner.scala rename to src/main/scala/scripts/synthpop/SynthpopOutputJoiner.scala index 6e80363e0b5..a817dadf649 100644 --- a/src/main/scala/beam/utils/data/synthpop/SythpopOutputJoiner.scala +++ b/src/main/scala/scripts/synthpop/SynthpopOutputJoiner.scala @@ -1,13 +1,12 @@ -package beam.utils.data.synthpop - -import java.io.{File, FileFilter} +package scripts.synthpop import beam.utils.csv.CsvWriter import beam.utils.data.synthpop.models.Models.Gender +import java.io.{File, FileFilter} import scala.util.Try -object SythpopOutputUnion { +object SynthpopOutputUnion { def main(args: Array[String]): Unit = { require(args.length == 2) diff --git a/src/main/scala/beam/utils/data/synthpop/SythpopReader.scala b/src/main/scala/scripts/synthpop/SynthpopReader.scala similarity index 91% rename from src/main/scala/beam/utils/data/synthpop/SythpopReader.scala rename to src/main/scala/scripts/synthpop/SynthpopReader.scala index 233c20932cf..11c776497f9 100644 --- a/src/main/scala/beam/utils/data/synthpop/SythpopReader.scala +++ b/src/main/scala/scripts/synthpop/SynthpopReader.scala @@ -1,11 +1,11 @@ -package beam.utils.data.synthpop - -import java.io.{File, FileFilter} +package scripts.synthpop import beam.utils.data.synthpop.models.Models.{Household, Person} import com.typesafe.scalalogging.StrictLogging -class SythpopReader(val houseHoldsWithPeople: Seq[(File, File)]) { +import java.io.{File, FileFilter} + +class SynthpopReader(val houseHoldsWithPeople: Seq[(File, File)]) { def read(): Map[Household, Seq[Person]] = { val (_, allHouseholdsWithPeople) = houseHoldsWithPeople.foldLeft((0, Map[Household, Seq[Person]]())) { @@ -38,9 +38,9 @@ class SythpopReader(val houseHoldsWithPeople: Seq[(File, File)]) { } } -object SythpopReader extends StrictLogging { +object SynthpopReader extends StrictLogging { - def apply(folderToScan: String): SythpopReader = { + def apply(folderToScan: String): SynthpopReader = { val householdFiles = new File(folderToScan) .listFiles(new FileFilter { override def accept(pathname: File): Boolean = { @@ -71,6 +71,6 @@ object SythpopReader extends StrictLogging { logger.info(s"Household: $hh") logger.info(s"People : $people") } - new SythpopReader(hhWithPeople) + new SynthpopReader(hhWithPeople) } } diff --git a/src/main/scala/beam/utils/data/synthpop/WorkForceSampler.scala b/src/main/scala/scripts/synthpop/WorkForceSampler.scala similarity index 91% rename from src/main/scala/beam/utils/data/synthpop/WorkForceSampler.scala rename to src/main/scala/scripts/synthpop/WorkForceSampler.scala index 70c8dc98980..3e18a8c7615 100644 --- a/src/main/scala/beam/utils/data/synthpop/WorkForceSampler.scala +++ b/src/main/scala/scripts/synthpop/WorkForceSampler.scala @@ -1,11 +1,11 @@ -package beam.utils.data.synthpop +package scripts.synthpop -import beam.utils.data.ctpp.models.{AgeRange, OD, ResidenceGeography, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.flow.AgeOfWorkerTableReader -import beam.utils.data.ctpp.readers.residence.AgeTableReader +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} import com.typesafe.scalalogging.StrictLogging import org.apache.commons.math3.random.{MersenneTwister, RandomGenerator} +import scripts.ctpp.models.{AgeRange, OD, ResidenceGeography, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.flow.AgeOfWorkerTableReader +import scripts.ctpp.readers.residence.AgeTableReader private case class PeopleAndWorkers(totalPeople: Int, totalWorkers: Int) diff --git a/src/main/scala/beam/utils/data/synthpop/doc/README.md b/src/main/scala/scripts/synthpop/doc/README.md similarity index 91% rename from src/main/scala/beam/utils/data/synthpop/doc/README.md rename to src/main/scala/scripts/synthpop/doc/README.md index 71c5c05a9ad..4e318a3d25e 100644 --- a/src/main/scala/beam/utils/data/synthpop/doc/README.md +++ b/src/main/scala/scripts/synthpop/doc/README.md @@ -1,6 +1,6 @@ #Beam scenario generator ## Data sources -To generate a new scenario for Beam by [beam.utils.data.synthpop.SimpleScenarioGenerator](../ScenarioGenerator.scala) we need to provide the following information: +To generate a new scenario for Beam by [scripts.synthpop.SimpleScenarioGenerator](../ScenarioGenerator.scala) we need to provide the following information: 1. For every county, two files: household_STATE_COUNTY.csv and people_STATE_COUNTY.csv as an output of SynthPop. How to run it: https://github.com/LBNL-UCB-STI/synthpop#how-to-run-it 2. Census Transportation Planning Products Program data ([CTPP](https://ctpp.transportation.org/2012-2016-5-year-ctpp/)) for the state, link to FTP: ftp://data5.ctpp.transportation.org/. Mirrored data on our S3: https://s3.us-east-2.amazonaws.com/beam-outputs/index.html#new_city/ctpp/ 3. List of state codes for CTPP @@ -14,7 +14,7 @@ To generate a new scenario for Beam by [beam.utils.data.synthpop.SimpleScenarioG Example of run: ```bash -./gradlew :execute -PmaxRAM=20 -PmainClass=beam.utils.data.synthpop.SimpleScenarioGenerator -PappArgs=[" +./gradlew :execute -PmaxRAM=20 -PmainClass=scripts.synthpop.SimpleScenarioGenerator -PappArgs=[" '--sythpopDataFolder', 'D:/Work/beam/NewYork/input/syntpop', '--ctppFolder', 'D:/Work/beam/CTPP/', '--stateCodes', '34,36', diff --git a/src/main/scala/beam/utils/data/synthpop/doc/data_sources.svg b/src/main/scala/scripts/synthpop/doc/data_sources.svg similarity index 100% rename from src/main/scala/beam/utils/data/synthpop/doc/data_sources.svg rename to src/main/scala/scripts/synthpop/doc/data_sources.svg diff --git a/src/main/scala/beam/utils/data/synthpop/doc/flowchart.svg b/src/main/scala/scripts/synthpop/doc/flowchart.svg similarity index 100% rename from src/main/scala/beam/utils/data/synthpop/doc/flowchart.svg rename to src/main/scala/scripts/synthpop/doc/flowchart.svg diff --git a/src/main/scala/beam/utils/data/synthpop/doc/hierarchy_of_cencus_geo_entities.jpg b/src/main/scala/scripts/synthpop/doc/hierarchy_of_cencus_geo_entities.jpg similarity index 100% rename from src/main/scala/beam/utils/data/synthpop/doc/hierarchy_of_cencus_geo_entities.jpg rename to src/main/scala/scripts/synthpop/doc/hierarchy_of_cencus_geo_entities.jpg diff --git a/src/main/scala/beam/utils/data/synthpop/generators/BenchmarkGenerator.scala b/src/main/scala/scripts/synthpop/generators/BenchmarkGenerator.scala similarity index 94% rename from src/main/scala/beam/utils/data/synthpop/generators/BenchmarkGenerator.scala rename to src/main/scala/scripts/synthpop/generators/BenchmarkGenerator.scala index b89376baa8e..692cf8abe12 100644 --- a/src/main/scala/beam/utils/data/synthpop/generators/BenchmarkGenerator.scala +++ b/src/main/scala/scripts/synthpop/generators/BenchmarkGenerator.scala @@ -1,13 +1,13 @@ -package beam.utils.data.synthpop.generators +package scripts.synthpop.generators import beam.router.Modes.BeamMode import beam.utils.csv.CsvWriter -import beam.utils.data.ctpp.models.{MeansOfTransportation, OD, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.flow.MeansOfTransportationTableReader +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} import beam.utils.data.synthpop.GeoService import beam.utils.data.synthpop.models.Models.TazGeoId import com.vividsolutions.jts.geom.{Envelope, Geometry} +import scripts.ctpp.models.{MeansOfTransportation, OD, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.flow.MeansOfTransportationTableReader class BenchmarkGenerator( val odList: Iterable[OD[MeansOfTransportation]], diff --git a/src/main/scala/beam/utils/data/synthpop/generators/TimeLeavingHomeGenerator.scala b/src/main/scala/scripts/synthpop/generators/TimeLeavingHomeGenerator.scala similarity index 82% rename from src/main/scala/beam/utils/data/synthpop/generators/TimeLeavingHomeGenerator.scala rename to src/main/scala/scripts/synthpop/generators/TimeLeavingHomeGenerator.scala index 9ea3fd0b3ee..9d275215ee1 100644 --- a/src/main/scala/beam/utils/data/synthpop/generators/TimeLeavingHomeGenerator.scala +++ b/src/main/scala/scripts/synthpop/generators/TimeLeavingHomeGenerator.scala @@ -1,10 +1,10 @@ -package beam.utils.data.synthpop.generators +package scripts.synthpop.generators import beam.utils.ProfilingUtils -import beam.utils.data.ctpp.models.{OD, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.flow.TimeLeavingHomeTableReader +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} import com.typesafe.scalalogging.StrictLogging +import scripts.ctpp.models.{OD, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.flow.TimeLeavingHomeTableReader trait TimeLeavingHomeGenerator { def find(source: String, destination: String): Seq[OD[Range]] diff --git a/src/main/scala/beam/utils/data/synthpop/generators/WorkDestinationGenerator.scala b/src/main/scala/scripts/synthpop/generators/WorkDestinationGenerator.scala similarity index 82% rename from src/main/scala/beam/utils/data/synthpop/generators/WorkDestinationGenerator.scala rename to src/main/scala/scripts/synthpop/generators/WorkDestinationGenerator.scala index 4a344dd228a..c2cd0ec7a7d 100644 --- a/src/main/scala/beam/utils/data/synthpop/generators/WorkDestinationGenerator.scala +++ b/src/main/scala/scripts/synthpop/generators/WorkDestinationGenerator.scala @@ -1,11 +1,11 @@ -package beam.utils.data.synthpop.generators +package scripts.synthpop.generators -import beam.utils.data.ctpp.models.{HouseholdIncome, OD, ResidenceToWorkplaceFlowGeography} -import beam.utils.data.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} -import beam.utils.data.ctpp.readers.flow.HouseholdIncomeTableReader -import beam.utils.data.synthpop.ODSampler +import scripts.ctpp.readers.BaseTableReader.{CTPPDatabaseInfo, PathToData} import com.typesafe.scalalogging.StrictLogging import org.apache.commons.math3.random.RandomGenerator +import scripts.ctpp.models.{HouseholdIncome, OD, ResidenceToWorkplaceFlowGeography} +import scripts.ctpp.readers.flow.HouseholdIncomeTableReader +import scripts.synthpop.ODSampler trait WorkDestinationGenerator { def next(homeLocation: String, income: Double, rndGen: RandomGenerator): Option[String] diff --git a/src/main/scala/beam/utils/data/synthpop/generators/WorkedDurationGenerator.scala b/src/main/scala/scripts/synthpop/generators/WorkedDurationGenerator.scala similarity index 96% rename from src/main/scala/beam/utils/data/synthpop/generators/WorkedDurationGenerator.scala rename to src/main/scala/scripts/synthpop/generators/WorkedDurationGenerator.scala index acb48d50f58..0c1e55da19f 100644 --- a/src/main/scala/beam/utils/data/synthpop/generators/WorkedDurationGenerator.scala +++ b/src/main/scala/scripts/synthpop/generators/WorkedDurationGenerator.scala @@ -1,11 +1,10 @@ -package beam.utils.data.synthpop.generators +package scripts.synthpop.generators import java.util.concurrent.TimeUnit - import beam.utils.{MathUtils, ProfilingUtils, Statistics} -import beam.utils.data.ctpp.JointDistribution import com.typesafe.scalalogging.LazyLogging import org.apache.commons.math3.random.{MersenneTwister, RandomGenerator} +import scripts.ctpp.JointDistribution import scala.util.control.NonFatal diff --git a/src/main/scala/beam/utils/data/synthpop/tools/ScenarioDownsampler.scala b/src/main/scala/scripts/synthpop/tools/ScenarioDownsampler.scala similarity index 98% rename from src/main/scala/beam/utils/data/synthpop/tools/ScenarioDownsampler.scala rename to src/main/scala/scripts/synthpop/tools/ScenarioDownsampler.scala index 9f57e52125f..864ecbac17f 100644 --- a/src/main/scala/beam/utils/data/synthpop/tools/ScenarioDownsampler.scala +++ b/src/main/scala/scripts/synthpop/tools/ScenarioDownsampler.scala @@ -1,4 +1,4 @@ -package beam.utils.data.synthpop.tools +package scripts.synthpop.tools import beam.utils.ProfilingUtils import beam.utils.scenario.generic.readers.{CsvHouseholdInfoReader, CsvPersonInfoReader, CsvPlanElementReader} diff --git a/src/main/scala/beam/utils/traveltime/FeatureEventHandler.scala b/src/main/scala/scripts/traveltime/FeatureEventHandler.scala similarity index 99% rename from src/main/scala/beam/utils/traveltime/FeatureEventHandler.scala rename to src/main/scala/scripts/traveltime/FeatureEventHandler.scala index ecb0c0f1649..fa6005006b9 100644 --- a/src/main/scala/beam/utils/traveltime/FeatureEventHandler.scala +++ b/src/main/scala/scripts/traveltime/FeatureEventHandler.scala @@ -1,4 +1,4 @@ -package beam.utils.traveltime +package scripts.traveltime import java.io.{File, PrintWriter} import java.util diff --git a/src/main/scala/beam/utils/traveltime/FeatureExtractor.scala b/src/main/scala/scripts/traveltime/FeatureExtractor.scala similarity index 93% rename from src/main/scala/beam/utils/traveltime/FeatureExtractor.scala rename to src/main/scala/scripts/traveltime/FeatureExtractor.scala index f93d10e3bc9..37f6018a47c 100644 --- a/src/main/scala/beam/utils/traveltime/FeatureExtractor.scala +++ b/src/main/scala/scripts/traveltime/FeatureExtractor.scala @@ -1,4 +1,4 @@ -package beam.utils.traveltime +package scripts.traveltime import java.io.Writer diff --git a/src/main/scala/beam/utils/traveltime/LinkInOutFeature.scala b/src/main/scala/scripts/traveltime/LinkInOutFeature.scala similarity index 98% rename from src/main/scala/beam/utils/traveltime/LinkInOutFeature.scala rename to src/main/scala/scripts/traveltime/LinkInOutFeature.scala index c8eb53fc1dd..eca4125a419 100644 --- a/src/main/scala/beam/utils/traveltime/LinkInOutFeature.scala +++ b/src/main/scala/scripts/traveltime/LinkInOutFeature.scala @@ -1,10 +1,10 @@ -package beam.utils.traveltime +package scripts.traveltime import java.io.{File, PrintWriter, Writer} import java.util import beam.utils.ProfilingUtils -import beam.utils.traveltime.LinkInOutFeature.MappingWriter +import scripts.traveltime.LinkInOutFeature.MappingWriter import com.typesafe.scalalogging.LazyLogging import org.matsim.api.core.v01.Id import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/beam/utils/traveltime/NetworkFeaturesExtractor.scala b/src/main/scala/scripts/traveltime/NetworkFeaturesExtractor.scala similarity index 97% rename from src/main/scala/beam/utils/traveltime/NetworkFeaturesExtractor.scala rename to src/main/scala/scripts/traveltime/NetworkFeaturesExtractor.scala index 67f33da72c5..12133b1c4df 100644 --- a/src/main/scala/beam/utils/traveltime/NetworkFeaturesExtractor.scala +++ b/src/main/scala/scripts/traveltime/NetworkFeaturesExtractor.scala @@ -1,4 +1,4 @@ -package beam.utils.traveltime +package scripts.traveltime import java.util diff --git a/src/main/scala/beam/utils/traveltime/NetworkUtil.scala b/src/main/scala/scripts/traveltime/NetworkUtil.scala similarity index 98% rename from src/main/scala/beam/utils/traveltime/NetworkUtil.scala rename to src/main/scala/scripts/traveltime/NetworkUtil.scala index 8334758a121..4bd02cbcc93 100644 --- a/src/main/scala/beam/utils/traveltime/NetworkUtil.scala +++ b/src/main/scala/scripts/traveltime/NetworkUtil.scala @@ -1,4 +1,4 @@ -package beam.utils.traveltime +package scripts.traveltime import org.matsim.api.core.v01.network.Link diff --git a/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorAppSpec.scala b/src/test/scala/scripts/BackgroundSkimsCreatorAppSpec.scala similarity index 96% rename from src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorAppSpec.scala rename to src/test/scala/scripts/BackgroundSkimsCreatorAppSpec.scala index 6850ac570d3..4683c7356cc 100644 --- a/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorAppSpec.scala +++ b/src/test/scala/scripts/BackgroundSkimsCreatorAppSpec.scala @@ -1,8 +1,7 @@ -package beam.router.skim.urbansim +package scripts import akka.actor.ActorSystem import beam.router.skim.ActivitySimSkimmer.ExcerptData -import beam.router.skim.urbansim.BackgroundSkimsCreatorApp.toCsvSkimRow import beam.sim.config.{BeamConfig, MatSimBeamConfigBuilder} import beam.sim.{BeamHelper, BeamServices} import beam.utils.FileUtils @@ -16,6 +15,7 @@ import org.scalatest.concurrent.ScalaFutures import org.scalatest.matchers.should.Matchers import org.scalatest.time.{Seconds, Span} import org.scalatest.wordspec.AnyWordSpecLike +import scripts.BackgroundSkimsCreatorApp.{toCsvSkimRow, InputParameters} import java.nio.file.Paths diff --git a/src/test/scala/beam/utils/Network2ShapeFileTest.scala b/src/test/scala/scripts/Network2ShapeFileTest.scala similarity index 96% rename from src/test/scala/beam/utils/Network2ShapeFileTest.scala rename to src/test/scala/scripts/Network2ShapeFileTest.scala index 64773e76271..d522576455d 100644 --- a/src/test/scala/beam/utils/Network2ShapeFileTest.scala +++ b/src/test/scala/scripts/Network2ShapeFileTest.scala @@ -1,6 +1,5 @@ -package beam.utils +package scripts -import beam.utils.Network2ShapeFile.networkToShapeFile import beam.utils.map.ShapefileReader import org.matsim.core.network.NetworkUtils import org.matsim.core.network.io.NetworkReaderMatsimV2 @@ -9,6 +8,7 @@ import org.opengis.feature.simple.SimpleFeature import org.opengis.referencing.operation.MathTransform import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike +import scripts.Network2ShapeFile.networkToShapeFile import scala.jdk.CollectionConverters.collectionAsScalaIterableConverter diff --git a/src/test/scala/beam/utils/NetworkXmlToCsvSpec.scala b/src/test/scala/scripts/NetworkXmlToCsvSpec.scala similarity index 88% rename from src/test/scala/beam/utils/NetworkXmlToCsvSpec.scala rename to src/test/scala/scripts/NetworkXmlToCsvSpec.scala index baee6dbd740..5714bd828ff 100644 --- a/src/test/scala/beam/utils/NetworkXmlToCsvSpec.scala +++ b/src/test/scala/scripts/NetworkXmlToCsvSpec.scala @@ -1,7 +1,7 @@ -package beam.utils +package scripts -import beam.utils.csv.conversion.NetworkXmlToCSV import org.scalatest.wordspec.AnyWordSpecLike +import scripts.csv.conversion.NetworkXmlToCSV class NetworkXmlToCsvSpec extends AnyWordSpecLike { diff --git a/src/test/scala/beam/router/TravelTimeAndDistanceCalculatorAppSpec.scala b/src/test/scala/scripts/TravelTimeAndDistanceCalculatorAppSpec.scala similarity index 91% rename from src/test/scala/beam/router/TravelTimeAndDistanceCalculatorAppSpec.scala rename to src/test/scala/scripts/TravelTimeAndDistanceCalculatorAppSpec.scala index d14bb96504e..8982fb090e4 100644 --- a/src/test/scala/beam/router/TravelTimeAndDistanceCalculatorAppSpec.scala +++ b/src/test/scala/scripts/TravelTimeAndDistanceCalculatorAppSpec.scala @@ -1,7 +1,8 @@ -package beam.router +package scripts import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike +import scripts.TravelTimeAndDistanceCalculatorApp.InputParameters import java.nio.file.Paths diff --git a/src/test/scala/beam/utils/beam_to_matsim/LinkCoordinateTest.scala b/src/test/scala/scripts/beam_to_matsim/LinkCoordinateTest.scala similarity index 100% rename from src/test/scala/beam/utils/beam_to_matsim/LinkCoordinateTest.scala rename to src/test/scala/scripts/beam_to_matsim/LinkCoordinateTest.scala diff --git a/src/test/scala/beam/utils/beam_to_matsim/io/WriterTest.scala b/src/test/scala/scripts/beam_to_matsim/io/WriterTest.scala similarity index 100% rename from src/test/scala/beam/utils/beam_to_matsim/io/WriterTest.scala rename to src/test/scala/scripts/beam_to_matsim/io/WriterTest.scala diff --git a/src/test/scala/beam/calibration/BeamSigoptTunerSpec.scala b/src/test/scala/scripts/calibration/BeamSigoptTunerSpec.scala similarity index 95% rename from src/test/scala/beam/calibration/BeamSigoptTunerSpec.scala rename to src/test/scala/scripts/calibration/BeamSigoptTunerSpec.scala index dcf098b75e6..3105ec64617 100755 --- a/src/test/scala/beam/calibration/BeamSigoptTunerSpec.scala +++ b/src/test/scala/scripts/calibration/BeamSigoptTunerSpec.scala @@ -1,7 +1,7 @@ -package beam.calibration +package scripts.calibration import java.io.File -import beam.experiment.ExperimentApp +import scripts.experiment.ExperimentApp import beam.tags.Periodic import com.sigopt.Sigopt import com.sigopt.exception.APIConnectionError @@ -9,6 +9,7 @@ import com.typesafe.scalalogging.LazyLogging import org.scalatest.wordspec.AnyWordSpecLike import org.scalatest.BeforeAndAfterAll import org.scalatest.matchers.should.Matchers +import scripts.calibration import scala.util.{Failure, Success, Try} @@ -67,7 +68,7 @@ class BeamSigoptTunerSpec extends AnyWordSpecLike with Matchers with BeforeAndAf private def wrapWithTestExperiment(experimentDataFunc: SigoptExperimentData => Any): Unit = { Try { val file = new File(TEST_BEAM_BENCHMARK_DATA_LOC) - SigoptExperimentData( + calibration.SigoptExperimentData( ExperimentApp.loadExperimentDefs(file), TEST_BEAM_BENCHMARK_DATA_LOC, "None", diff --git a/src/test/scala/beam/utils/JointDistributionTest.scala b/src/test/scala/scripts/ctpp/JointDistributionTest.scala similarity index 94% rename from src/test/scala/beam/utils/JointDistributionTest.scala rename to src/test/scala/scripts/ctpp/JointDistributionTest.scala index 72a59a129c5..aba7dae34b0 100644 --- a/src/test/scala/beam/utils/JointDistributionTest.scala +++ b/src/test/scala/scripts/ctpp/JointDistributionTest.scala @@ -1,10 +1,9 @@ -package beam.utils +package scripts.ctpp -import beam.utils.data.ctpp.JointDistribution -import beam.utils.data.ctpp.JointDistribution.CustomRange import org.apache.commons.math3.random.MersenneTwister -import org.scalatest.wordspec.AnyWordSpecLike import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike +import scripts.ctpp.JointDistribution.CustomRange class JointDistributionTest extends AnyWordSpecLike with Matchers { diff --git a/src/test/scala/beam/utils/protocolvis/SequenceDiagramTest.scala b/src/test/scala/scripts/protocolvis/SequenceDiagramTest.scala similarity index 97% rename from src/test/scala/beam/utils/protocolvis/SequenceDiagramTest.scala rename to src/test/scala/scripts/protocolvis/SequenceDiagramTest.scala index 9f04457dad7..64786480247 100644 --- a/src/test/scala/beam/utils/protocolvis/SequenceDiagramTest.scala +++ b/src/test/scala/scripts/protocolvis/SequenceDiagramTest.scala @@ -1,6 +1,6 @@ -package beam.utils.protocolvis +package scripts.protocolvis -import beam.utils.protocolvis.MessageReader.Actor +import scripts.protocolvis.MessageReader.Actor import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec diff --git a/src/test/scala/beam/utils/shape/NoAttributeShapeWriterTest.scala b/src/test/scala/scripts/shape/NoAttributeShapeWriterTest.scala similarity index 96% rename from src/test/scala/beam/utils/shape/NoAttributeShapeWriterTest.scala rename to src/test/scala/scripts/shape/NoAttributeShapeWriterTest.scala index e962b783147..38ac1889b50 100644 --- a/src/test/scala/beam/utils/shape/NoAttributeShapeWriterTest.scala +++ b/src/test/scala/scripts/shape/NoAttributeShapeWriterTest.scala @@ -1,9 +1,9 @@ -package beam.utils.shape +package scripts.shape import java.io.File import beam.utils.FileUtils -import beam.utils.shape.ShapeWriter.OriginalToPersistedFeatureIdMap +import scripts.shape.ShapeWriter.OriginalToPersistedFeatureIdMap import com.vividsolutions.jts.geom.{Coordinate, GeometryFactory, Point} import org.matsim.core.utils.gis.ShapeFileReader import org.opengis.feature.simple.SimpleFeature diff --git a/src/test/scala/beam/utils/shape/ShapeWriterTest.scala b/src/test/scala/scripts/shape/ShapeWriterTest.scala similarity index 97% rename from src/test/scala/beam/utils/shape/ShapeWriterTest.scala rename to src/test/scala/scripts/shape/ShapeWriterTest.scala index 413e439348d..9afca951bae 100644 --- a/src/test/scala/beam/utils/shape/ShapeWriterTest.scala +++ b/src/test/scala/scripts/shape/ShapeWriterTest.scala @@ -1,9 +1,9 @@ -package beam.utils.shape +package scripts.shape import java.io.File import beam.utils.FileUtils -import beam.utils.shape.ShapeWriter.OriginalToPersistedFeatureIdMap +import scripts.shape.ShapeWriter.OriginalToPersistedFeatureIdMap import com.vividsolutions.jts.geom.{Coordinate, GeometryFactory, Point} import org.matsim.core.utils.gis.ShapeFileReader import org.opengis.feature.simple.SimpleFeature From b48beb049938e571a4eba580d9b56ce603c22940 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:10:16 -0700 Subject: [PATCH 112/307] rolling back some of overnight charging code --- src/main/resources/beam-template.conf | 1 - .../agentsim/agents/household/HouseholdActor.scala | 1 + .../agents/household/HouseholdFleetManager.scala | 1 + .../agentsim/infrastructure/ChargingFunctions.scala | 12 +++--------- .../agentsim/infrastructure/ParkingFunctions.scala | 6 +----- .../agentsim/infrastructure/parking/ParkingMNL.scala | 5 +---- src/main/scala/beam/sim/config/BeamConfig.scala | 5 ----- 7 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 4f77ffeb080..d78061bf3f7 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -164,7 +164,6 @@ beam.agentsim.agents.parking.mulitnomialLogit.params.rangeAnxietyMultiplier = "d beam.agentsim.agents.parking.mulitnomialLogit.params.distanceMultiplier = "double | -0.086" # based on 20m walk, VoT = $35/hr should be u=-1.0 beam.agentsim.agents.parking.mulitnomialLogit.params.parkingPriceMultiplier = "double | -0.005" # based on avg. parking prices up to $200! beam.agentsim.agents.parking.mulitnomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = "double | 1.0" # positive boost of 1.0 if true -beam.agentsim.agents.parking.mulitnomialLogit.params.overnightParkingPrefersChargingMultiplier = "double | 1.0" # positive boost of 1.0 if true beam.agentsim.agents.parking.mulitnomialLogit.params.enrouteDetourMultiplier = "double | 1.0" # based on skim travel time and the defined VoT for car trips beam.agentsim.agents.parking.rangeAnxietyBuffer = "double | 20000.0" # if our remaining range exceeds our remaining tour plus this many meters, then we feel no anxiety; default 20k beam.agentsim.agents.parking.minSearchRadius = "double | 250.00" # something small enough that, on average, we see 2 orders of magnitude of samples at most diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index 5f665ecd652..7af8d09c966 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -588,6 +588,7 @@ object HouseholdActor { triggerId = triggerId, searchMode = ParkingSearchMode.Init ) + // TODO Overnight charging is still a work in progress and might produce unexpected results val probabilityOfOvernightCharging = rand.nextDouble() <= beamServices.beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize if (vehicle.isEV && probabilityOfOvernightCharging) diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 41486e8c359..6292c809a83 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -103,6 +103,7 @@ class HouseholdFleetManager( triggerId = triggerId, searchMode = ParkingSearchMode.Init ) + // TODO Overnight charging is still a work in progress and might produce unexpected results val probabilityOfOvernightCharging = rand.nextDouble() <= beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize if (vehicle.isEV && probabilityOfOvernightCharging) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index d33a8d9dcc3..c6ef6ec61fa 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -176,7 +176,7 @@ class ChargingFunctions( Some(estimatedMinParkingDurationInSeconds.toInt) // at least a small duration of charging else Some(tempParkingDuration) - val (addedEnergy, stateOfCharge): (Double, Double) = + val (addedEnergy, _): (Double, Double) = inquiry.beamVehicle match { case Some(beamVehicle) => parkingAlternative.parkingZone.chargingPointType match { @@ -202,15 +202,9 @@ class ChargingFunctions( .map(_.rangeAnxiety(withAddedFuelInJoules = addedEnergy)) .getOrElse(0.0) // default no anxiety if no remaining trip data provided - // overnight charging is at the beginning of the simulated day, when inquiries are submitted at time t=0 - val overnightParkingCheck = inquiry.destinationUtm.time == 0 - val overnightParkingPrefersChargingFactor: Double = - if (overnightParkingCheck) 1 - math.min(1.0, math.max(0.0, stateOfCharge)) else 0.0 - super[ParkingFunctions].setupMNLParameters(parkingAlternative, inquiry) ++ Map( - ParkingMNL.Parameters.EnrouteDetourCost -> enrouteFactor, - ParkingMNL.Parameters.RangeAnxietyCost -> rangeAnxietyFactor, - ParkingMNL.Parameters.OvernightParkingPrefersCharging -> overnightParkingPrefersChargingFactor + ParkingMNL.Parameters.EnrouteDetourCost -> enrouteFactor, + ParkingMNL.Parameters.RangeAnxietyCost -> rangeAnxietyFactor ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index eb1fef7cdab..ab8d9ee5fc4 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -59,9 +59,6 @@ class ParkingFunctions( ), ParkingMNL.Parameters.EnrouteDetourCost -> UtilityFunctionOperation.Multiplier( mnlParkingConfig.params.enrouteDetourMultiplier - ), - ParkingMNL.Parameters.OvernightParkingPrefersCharging -> UtilityFunctionOperation.Multiplier( - mnlParkingConfig.params.overnightParkingPrefersChargingMultiplier ) ) @@ -93,8 +90,7 @@ class ParkingFunctions( ParkingMNL.Parameters.WalkingEgressCost -> distanceFactor, ParkingMNL.Parameters.ParkingTicketCost -> parkingCostsPriceFactor, ParkingMNL.Parameters.HomeActivityPrefersResidentialParking -> homeActivityPrefersResidentialFactor, - ParkingMNL.Parameters.EnrouteDetourCost -> 0.0, - ParkingMNL.Parameters.OvernightParkingPrefersCharging -> 0.0 + ParkingMNL.Parameters.EnrouteDetourCost -> 0.0 ) params diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingMNL.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingMNL.scala index 6d1e8eb7ee1..205cc19006f 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingMNL.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingMNL.scala @@ -11,8 +11,7 @@ object ParkingMNL { Parameters.RangeAnxietyCost -> UtilityFunctionOperation.Multiplier(-1.0), Parameters.WalkingEgressCost -> UtilityFunctionOperation.Multiplier(-1.0), Parameters.EnrouteDetourCost -> UtilityFunctionOperation.Multiplier(-1.0), - Parameters.HomeActivityPrefersResidentialParking -> UtilityFunctionOperation.Multiplier(1.0), - Parameters.OvernightParkingPrefersCharging -> UtilityFunctionOperation.Multiplier(1.0) + Parameters.HomeActivityPrefersResidentialParking -> UtilityFunctionOperation.Multiplier(1.0) ) /** @@ -73,7 +72,6 @@ object ParkingMNL { final case object QueueingTimeCost extends Parameters with Serializable final case object ChargingTimeCost extends Parameters with Serializable final case object HomeActivityPrefersResidentialParking extends Parameters with Serializable - final case object OvernightParkingPrefersCharging extends Parameters with Serializable final case object EnrouteDetourCost extends Parameters with Serializable def shortName(parameter: Parameters): String = parameter match { @@ -85,7 +83,6 @@ object ParkingMNL { case QueueingTimeCost => "queue" case ChargingTimeCost => "charge" case HomeActivityPrefersResidentialParking => "home" - case OvernightParkingPrefersCharging => "overnight" case EnrouteDetourCost => "enroute" } } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index da0e790459d..22547cff8fa 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -738,7 +738,6 @@ object BeamConfig { distanceMultiplier: scala.Double, enrouteDetourMultiplier: scala.Double, homeActivityPrefersResidentialParkingMultiplier: scala.Double, - overnightParkingPrefersChargingMultiplier: scala.Double, parkingPriceMultiplier: scala.Double, rangeAnxietyMultiplier: scala.Double ) @@ -757,10 +756,6 @@ object BeamConfig { if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, - overnightParkingPrefersChargingMultiplier = - if (c.hasPathOrNull("overnightParkingPrefersChargingMultiplier")) - c.getDouble("overnightParkingPrefersChargingMultiplier") - else 1.0, parkingPriceMultiplier = if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, rangeAnxietyMultiplier = From 53e46e5ee062484f02b60b0ec248c4762e90d372 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 6 Jun 2022 14:52:45 -0700 Subject: [PATCH 113/307] updating config file --- src/main/R/gemini/gemini-processing.R | 18 ++++++++++++++++++ src/main/resources/beam-template.conf | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 34d219bc115..f96f3d51faf 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -932,6 +932,24 @@ events7[type=="RefuelSessionEvent"][,.(sumFuel=sum(fuel)),by=.(actType)] ## TEST +events0 <- readCsv(pp(workDir, "/test/0.events.csv.gz")) +events1 <- readCsv(pp(workDir, "/test/1.events.csv.gz")) +ev0 <- events0[startsWith(vehicleType,"ev-")] +ev1 <- events1[startsWith(vehicleType,"ev-")] + +ref0 <- events0[type=="RefuelSessionEvent"][,iteration:="0"] +ref1 <- events1[type=="RefuelSessionEvent"][,iteration:="1"] + +rbind(ref0, ref1)[,.N,by=.(timeBin=as.POSIXct(cut(toDateTime(time),"15 min")), iteration)] %>% + ggplot(aes(timeBin, N, colour=iteration)) + + geom_line() + + +test <- ref1[time <= 3600] +nrow(ref0[time == 0]) +nrow(ref1[time == 0]) + + events.test <- readCsv(pp(workDir, "/test/0.events.csv.gz")) ref.test <- events.test[type=="RefuelSessionEvent"] diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index d78061bf3f7..893a1c2c182 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -164,7 +164,7 @@ beam.agentsim.agents.parking.mulitnomialLogit.params.rangeAnxietyMultiplier = "d beam.agentsim.agents.parking.mulitnomialLogit.params.distanceMultiplier = "double | -0.086" # based on 20m walk, VoT = $35/hr should be u=-1.0 beam.agentsim.agents.parking.mulitnomialLogit.params.parkingPriceMultiplier = "double | -0.005" # based on avg. parking prices up to $200! beam.agentsim.agents.parking.mulitnomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = "double | 1.0" # positive boost of 1.0 if true -beam.agentsim.agents.parking.mulitnomialLogit.params.enrouteDetourMultiplier = "double | 1.0" # based on skim travel time and the defined VoT for car trips +beam.agentsim.agents.parking.mulitnomialLogit.params.enrouteDetourMultiplier = "double | -0.05" # based on skim travel time and the defined VoT for car trips beam.agentsim.agents.parking.rangeAnxietyBuffer = "double | 20000.0" # if our remaining range exceeds our remaining tour plus this many meters, then we feel no anxiety; default 20k beam.agentsim.agents.parking.minSearchRadius = "double | 250.00" # something small enough that, on average, we see 2 orders of magnitude of samples at most beam.agentsim.agents.parking.maxSearchRadius = "double | 8046.72" # something large enough that we do not strand our drivers in an oasis From 64e26a7aab295dec3083a5f344b8387e064ac1d4 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 6 Jun 2022 15:45:16 -0700 Subject: [PATCH 114/307] update --- src/main/R/gemini/gemini-processing.R | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index f96f3d51faf..f0e7b377628 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -21,11 +21,14 @@ shpFile <- pp(workDir, "/shapefile/Oakland+Alameda+TAZ/Transportation_Analysis_Z oaklandCbg <- st_read(shpFile) infra5aBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/4a_output_2022_Apr_13_pubClust_withFees_aggregated.csv")) -infra5bBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/4b_output_2022_Apr_13_pubClust_withFees.csv.gz")) +infra5bBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/6_output_2022_Apr_13_pubClust_withFees.csv.gz")) infra5bBase[startsWith(reservedFor,"household")]$reservedFor <- "Any" +infra5bBase_NH <- infra5bBase[ + ,.(parkingZoneId=first(parkingZoneId),feeInCents=mean(feeInCents),numStalls=sum(numStalls)) + ,b=.(taz,parkingType,chargingPointType,X,Y,reservedFor,pricingModel)] write.csv( - infra5bBase, - file = pp(workDir, "/2022-04-28/_models/infrastructure/4b_output_2022_Apr_13_pubClust_withFees.csv"), + infra5bBase_NH, + file = pp(workDir, "/2022-04-28/_models/infrastructure/6_output_2022_Apr_13_pubClust_withFees_noHousehold.csv"), row.names=FALSE, quote=FALSE) From d574bd5507fd95a450f02cba0e5913a7ff62a398 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 6 Jun 2022 16:09:30 -0700 Subject: [PATCH 115/307] adding logs --- .../parking/ParkingZoneFileUtils.scala | 8 ++++++-- .../parking/ParkingZoneSearch.scala | 15 +++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala index 2c744b36a6b..2c808f100a1 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala @@ -521,8 +521,12 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { defaultReservedFor: Option[ReservedFor] = None ): ReservedFor = { VehicleManager.createOrGetReservedFor(reservedForString, beamConfigMaybe) match { - case Some(reservedFor) => reservedFor - case None if defaultReservedFor.nonEmpty => defaultReservedFor.get + case Some(reservedFor) => + logger.info(s"ParkingZoneFileUtils. reservedFor: ${reservedFor.toString}") + reservedFor + case None if defaultReservedFor.nonEmpty => + logger.info(s"ParkingZoneFileUtils. defaultReservedFor: ${reservedForString}") + defaultReservedFor.get case _ => logger.warn( s"The following reservedFor value $reservedForString in parking file " + diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 365653437ac..5690d3e2a2b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -2,6 +2,7 @@ package beam.agentsim.infrastructure.parking import beam.agentsim.agents.choice.logit.MultinomialLogit import beam.agentsim.agents.vehicles.VehicleCategory.VehicleCategory +import beam.agentsim.agents.vehicles.VehicleManager import beam.agentsim.agents.vehicles.VehicleManager.{ReservedFor, TypeEnum} import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode import beam.agentsim.infrastructure.ParkingStall @@ -9,6 +10,7 @@ import beam.agentsim.infrastructure.charging._ import beam.agentsim.infrastructure.taz.TAZ import beam.router.BeamRouter.Location import beam.utils.MathUtils +import com.typesafe.scalalogging.LazyLogging import com.vividsolutions.jts.geom.Envelope import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.collections.QuadTree @@ -293,7 +295,7 @@ object ParkingZoneSearch { } } - class ParkingZoneCollection(val parkingZones: Seq[ParkingZone]) { + class ParkingZoneCollection(val parkingZones: Seq[ParkingZone]) extends LazyLogging { private val publicFreeZones: Map[ParkingZoneInfo, mutable.Set[ParkingZone]] = parkingZones.view @@ -322,7 +324,16 @@ object ParkingZoneSearch { val numToTake = Math.max(MathUtils.doubleToInt(zones.size * fraction), min) MathUtils.selectRandomElements(zones, numToTake, rnd) } ++ - reservedFreeZones.getOrElse(reservedFor, Nil) + (reservedFor match { + case VehicleManager.AnyManager => Nil + case _ => + reservedFreeZones.getOrElse( + reservedFor, { + logger.error(s"ParkingZoneCollection. reservedFreeZones ${reservedFor.toString}") + Nil + } + ) + }) ).toIndexedSeq } From 2aab883871a83f5e754626f1dd0f64d6466a469e Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 6 Jun 2022 16:54:27 -0700 Subject: [PATCH 116/307] removing is refuel needed --- .../agents/parking/ChoosesParking.scala | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index deefb182c8b..41715c3f39b 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -221,7 +221,7 @@ trait ChoosesParking extends { ) } else { val searchModeChargeOrPark = - if (currentBeamVehicle.isEV && isRefuelAtDestinationNeeded(currentBeamVehicle, activityType)) + if (currentBeamVehicle.isEV /*&& isRefuelAtDestinationNeeded(currentBeamVehicle, activityType)*/ ) ParkingSearchMode.DestinationCharging else ParkingSearchMode.Parking @@ -242,17 +242,17 @@ trait ChoosesParking extends { } } - private def isRefuelAtDestinationNeeded(vehicle: BeamVehicle, activityType: String): Boolean = { - val conf = beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination - ParkingInquiry.activityTypeStringToEnum(activityType) match { - case ParkingActivityType.Home => - vehicle.isRefuelNeeded(conf.home.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) - case ParkingActivityType.Work => - vehicle.isRefuelNeeded(conf.work.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) - case _ => - vehicle.isRefuelNeeded(conf.secondary.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) - } - } +// private def isRefuelAtDestinationNeeded(vehicle: BeamVehicle, activityType: String): Boolean = { +// val conf = beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination +// ParkingInquiry.activityTypeStringToEnum(activityType) match { +// case ParkingActivityType.Home => +// vehicle.isRefuelNeeded(conf.home.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) +// case ParkingActivityType.Work => +// vehicle.isRefuelNeeded(conf.work.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) +// case _ => +// vehicle.isRefuelNeeded(conf.secondary.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) +// } +// } onTransition { case ReadyToChooseParking -> ChoosingParkingSpot => val personData = stateData.asInstanceOf[BasePersonData] From d308e78836ae6a7a2f49184209ff798b5481390d Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 6 Jun 2022 23:14:12 -0700 Subject: [PATCH 117/307] strict deactivation of overnight charging --- src/main/resources/beam-template.conf | 2 +- .../scala/beam/agentsim/agents/household/HouseholdActor.scala | 2 +- .../beam/agentsim/agents/household/HouseholdFleetManager.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 893a1c2c182..a517223aff7 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -172,7 +172,7 @@ beam.agentsim.agents.parking.searchMaxDistanceRelativeToEllipseFoci = "double | beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds = "double | 60.0" # in seconds, something small enough but has meaningful impact on pricing beam.agentsim.agents.parking.fractionOfSameTypeZones = "double | 0.5" beam.agentsim.agents.parking.minNumberOfSameTypeZones = "int | 10" -beam.agentsim.agents.parking.overnightChargingSampleSize = "double | 0.5" +beam.agentsim.agents.parking.overnightChargingSampleSize = "double | 0" #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index 7af8d09c966..593aadf6fd2 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -590,7 +590,7 @@ object HouseholdActor { ) // TODO Overnight charging is still a work in progress and might produce unexpected results val probabilityOfOvernightCharging = - rand.nextDouble() <= beamServices.beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize + rand.nextDouble() < beamServices.beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize if (vehicle.isEV && probabilityOfOvernightCharging) chargingNetworkManager ? inquiry else parkingManager ? inquiry diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 6292c809a83..ec4a20edf1b 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -105,7 +105,7 @@ class HouseholdFleetManager( ) // TODO Overnight charging is still a work in progress and might produce unexpected results val probabilityOfOvernightCharging = - rand.nextDouble() <= beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize + rand.nextDouble() < beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize if (vehicle.isEV && probabilityOfOvernightCharging) (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) else (parkingManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) From 87f555174f28dc51d3b7a7e7fc0cc2f1d668e533 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 6 Jun 2022 23:43:23 -0700 Subject: [PATCH 118/307] adding waiting in line logging --- .../agentsim/infrastructure/ChargingNetwork.scala | 4 ++++ .../parking/ParkingZoneSearch.scala | 15 ++------------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 3e1c83ac169..3781f7eb393 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -293,6 +293,10 @@ object ChargingNetwork extends LazyLogging { chargingVehiclesInternal.put(vehicle.id, chargingVehicle) chargingVehicle.updateStatus(Connected, tick) } else { + logger.error( + s"Dropping vehicle at waiting line time $tick: vehicle $vehicle - " + + s"activityType $activityType - stall $stall - personId $personId - chargingInfo $chargingVehicle" + ) waitingLineInternal.enqueue(chargingVehicle) chargingVehicle.updateStatus(WaitingAtStation, tick) } diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala index 5690d3e2a2b..365653437ac 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneSearch.scala @@ -2,7 +2,6 @@ package beam.agentsim.infrastructure.parking import beam.agentsim.agents.choice.logit.MultinomialLogit import beam.agentsim.agents.vehicles.VehicleCategory.VehicleCategory -import beam.agentsim.agents.vehicles.VehicleManager import beam.agentsim.agents.vehicles.VehicleManager.{ReservedFor, TypeEnum} import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode import beam.agentsim.infrastructure.ParkingStall @@ -10,7 +9,6 @@ import beam.agentsim.infrastructure.charging._ import beam.agentsim.infrastructure.taz.TAZ import beam.router.BeamRouter.Location import beam.utils.MathUtils -import com.typesafe.scalalogging.LazyLogging import com.vividsolutions.jts.geom.Envelope import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.collections.QuadTree @@ -295,7 +293,7 @@ object ParkingZoneSearch { } } - class ParkingZoneCollection(val parkingZones: Seq[ParkingZone]) extends LazyLogging { + class ParkingZoneCollection(val parkingZones: Seq[ParkingZone]) { private val publicFreeZones: Map[ParkingZoneInfo, mutable.Set[ParkingZone]] = parkingZones.view @@ -324,16 +322,7 @@ object ParkingZoneSearch { val numToTake = Math.max(MathUtils.doubleToInt(zones.size * fraction), min) MathUtils.selectRandomElements(zones, numToTake, rnd) } ++ - (reservedFor match { - case VehicleManager.AnyManager => Nil - case _ => - reservedFreeZones.getOrElse( - reservedFor, { - logger.error(s"ParkingZoneCollection. reservedFreeZones ${reservedFor.toString}") - Nil - } - ) - }) + reservedFreeZones.getOrElse(reservedFor, Nil) ).toIndexedSeq } From 0861abcb9878c688973ace6b708535e09c156b19 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 7 Jun 2022 01:37:31 -0700 Subject: [PATCH 119/307] if not virtual log error --- .../infrastructure/ChargingNetworkManagerHelper.scala | 3 ++- .../beam/agentsim/infrastructure/ScaleUpCharging.scala | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index 519a44b01fe..2352b70117e 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -78,7 +78,8 @@ trait ChargingNetworkManagerHelper extends { // Calculate the energy to charge each vehicle connected to the a charging station val endOfMaxSessionTime = chargingEndTimeInSeconds.getOrElse( chargingVehicle.personId, { - log.error(s"Something is broken. The person ${chargingVehicle.personId} is not tracked by CHM") + if (!isVirtualPerson(chargingVehicle.personId)) + log.error(s"Something is broken. The person ${chargingVehicle.personId} is not tracked by CHM") endTime } ) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 92fb10db4c2..0353bf3e514 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -305,7 +305,11 @@ trait ScaleUpCharging extends { * @param vehicleId vehicle Id * @return */ - protected def isVirtualCar(vehicleId: Id[BeamVehicle]): Boolean = vehicleId.toString.contains(VIRTUAL_CAR_ALIAS) + protected def isVirtualCar(vehicleId: Id[BeamVehicle]): Boolean = isVirtualEntity(vehicleId) + + protected def isVirtualPerson(personId: Id[Person]): Boolean = isVirtualEntity(personId) + + private def isVirtualEntity(entity: Id[_]): Boolean = entity.toString.startsWith(VIRTUAL_CAR_ALIAS) } object ScaleUpCharging { From 1dd683b5fe182a60311a1327cb7255410668d8f9 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 7 Jun 2022 01:47:55 -0700 Subject: [PATCH 120/307] if not virtual and ridehail thenlog error --- src/main/R/gemini/gemini-main.R | 2 +- .../agentsim/infrastructure/ChargingNetworkManagerHelper.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index c185cb8a5b7..3c3660e13c8 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -65,7 +65,7 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') -scenarioNames <- c('5b1', '5b2', '5b3', '5b4') +scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') #scenarioNames <- c('BaseXFC', 'HighEV') #scenarioBaselineLabel <- 'BaseXFC' diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index 2352b70117e..d4648eb2589 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -78,7 +78,7 @@ trait ChargingNetworkManagerHelper extends { // Calculate the energy to charge each vehicle connected to the a charging station val endOfMaxSessionTime = chargingEndTimeInSeconds.getOrElse( chargingVehicle.personId, { - if (!isVirtualPerson(chargingVehicle.personId)) + if (!isVirtualPerson(chargingVehicle.personId) && !chargingVehicle.personId.toString.startsWith("rideHail")) log.error(s"Something is broken. The person ${chargingVehicle.personId} is not tracked by CHM") endTime } From 661961e04e16cb60e6732ca3c1f4042a17540a6a Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 7 Jun 2022 01:48:53 -0700 Subject: [PATCH 121/307] remove tests --- .../infrastructure/ChargingNetworkManagerHelper.scala | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index d4648eb2589..e0b5504c084 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -76,13 +76,7 @@ trait ChargingNetworkManagerHelper extends { ): Option[ScheduleTrigger] = { assume(endTime - startTime >= 0, s"timeInterval should not be negative! startTime $startTime endTime $endTime") // Calculate the energy to charge each vehicle connected to the a charging station - val endOfMaxSessionTime = chargingEndTimeInSeconds.getOrElse( - chargingVehicle.personId, { - if (!isVirtualPerson(chargingVehicle.personId) && !chargingVehicle.personId.toString.startsWith("rideHail")) - log.error(s"Something is broken. The person ${chargingVehicle.personId} is not tracked by CHM") - endTime - } - ) + val endOfMaxSessionTime = chargingEndTimeInSeconds.getOrElse(chargingVehicle.personId, endTime) val endOfShiftTime = chargingVehicle.chargingShouldEndAt.map(_ - parallelismWindow).getOrElse(endTime) val updatedEndTime = Math.min(endOfMaxSessionTime, endOfShiftTime) val duration = Math.max(0, updatedEndTime - startTime) From bb75396e70544f17d90b1d78ab22d7ad510b584e Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 7 Jun 2022 02:07:14 -0700 Subject: [PATCH 122/307] back to isRefuel nedeed at destination --- .../agents/parking/ChoosesParking.scala | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 41715c3f39b..deefb182c8b 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -221,7 +221,7 @@ trait ChoosesParking extends { ) } else { val searchModeChargeOrPark = - if (currentBeamVehicle.isEV /*&& isRefuelAtDestinationNeeded(currentBeamVehicle, activityType)*/ ) + if (currentBeamVehicle.isEV && isRefuelAtDestinationNeeded(currentBeamVehicle, activityType)) ParkingSearchMode.DestinationCharging else ParkingSearchMode.Parking @@ -242,17 +242,17 @@ trait ChoosesParking extends { } } -// private def isRefuelAtDestinationNeeded(vehicle: BeamVehicle, activityType: String): Boolean = { -// val conf = beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination -// ParkingInquiry.activityTypeStringToEnum(activityType) match { -// case ParkingActivityType.Home => -// vehicle.isRefuelNeeded(conf.home.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) -// case ParkingActivityType.Work => -// vehicle.isRefuelNeeded(conf.work.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) -// case _ => -// vehicle.isRefuelNeeded(conf.secondary.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) -// } -// } + private def isRefuelAtDestinationNeeded(vehicle: BeamVehicle, activityType: String): Boolean = { + val conf = beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination + ParkingInquiry.activityTypeStringToEnum(activityType) match { + case ParkingActivityType.Home => + vehicle.isRefuelNeeded(conf.home.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) + case ParkingActivityType.Work => + vehicle.isRefuelNeeded(conf.work.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) + case _ => + vehicle.isRefuelNeeded(conf.secondary.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) + } + } onTransition { case ReadyToChooseParking -> ChoosingParkingSpot => val personData = stateData.asInstanceOf[BasePersonData] From 03f36f1e1c177c0ed91d482d04c04effc3f81b88 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 7 Jun 2022 02:17:44 -0700 Subject: [PATCH 123/307] relative range --- .../agents/parking/ChoosesParking.scala | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index deefb182c8b..29614def545 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -199,6 +199,7 @@ trait ChoosesParking extends { val lastLeg = vehicleTrip.last.beamLeg val activityType = nextActivity(data).get.getType val remainingTripData = calculateRemainingTripData(data) + val remainingTourDistance: Double = remainingTripData.map(_.remainingTourDistance).getOrElse(0.0) val parkingDuration = nextActivity(data).map(_.getEndTime - lastLeg.endTime).getOrElse(0.0) val destinationUtm = SpaceTime(beamServices.geo.wgs2Utm(lastLeg.travelPath.endPoint.loc), lastLeg.endTime) if (data.enrouteData.isInEnrouteState) { @@ -242,15 +243,28 @@ trait ChoosesParking extends { } } - private def isRefuelAtDestinationNeeded(vehicle: BeamVehicle, activityType: String): Boolean = { + private def isRefuelAtDestinationNeeded( + vehicle: BeamVehicle, + activityType: String, + remainingTourDistance: Double + ): Boolean = { val conf = beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination ParkingInquiry.activityTypeStringToEnum(activityType) match { case ParkingActivityType.Home => - vehicle.isRefuelNeeded(conf.home.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) + vehicle.isRefuelNeeded( + remainingTourDistance + conf.home.refuelRequiredThresholdInMeters, + conf.noRefuelThresholdInMeters + ) case ParkingActivityType.Work => - vehicle.isRefuelNeeded(conf.work.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) + vehicle.isRefuelNeeded( + remainingTourDistance + conf.work.refuelRequiredThresholdInMeters, + conf.noRefuelThresholdInMeters + ) case _ => - vehicle.isRefuelNeeded(conf.secondary.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters) + vehicle.isRefuelNeeded( + remainingTourDistance + conf.secondary.refuelRequiredThresholdInMeters, + conf.noRefuelThresholdInMeters + ) } } From 9a4442fd114c4c13df2224603375bd6f19264658 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 7 Jun 2022 02:26:06 -0700 Subject: [PATCH 124/307] constraining only home --- .../agents/parking/ChoosesParking.scala | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 29614def545..29c198fe3b4 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -199,7 +199,6 @@ trait ChoosesParking extends { val lastLeg = vehicleTrip.last.beamLeg val activityType = nextActivity(data).get.getType val remainingTripData = calculateRemainingTripData(data) - val remainingTourDistance: Double = remainingTripData.map(_.remainingTourDistance).getOrElse(0.0) val parkingDuration = nextActivity(data).map(_.getEndTime - lastLeg.endTime).getOrElse(0.0) val destinationUtm = SpaceTime(beamServices.geo.wgs2Utm(lastLeg.travelPath.endPoint.loc), lastLeg.endTime) if (data.enrouteData.isInEnrouteState) { @@ -222,7 +221,13 @@ trait ChoosesParking extends { ) } else { val searchModeChargeOrPark = - if (currentBeamVehicle.isEV && isRefuelAtDestinationNeeded(currentBeamVehicle, activityType)) + if ( + currentBeamVehicle.isEV && isRefuelAtDestinationNeeded( + currentBeamVehicle, + activityType, + remainingTripData.map(_.remainingTourDistance).getOrElse(0.0) + ) + ) ParkingSearchMode.DestinationCharging else ParkingSearchMode.Parking @@ -256,15 +261,17 @@ trait ChoosesParking extends { conf.noRefuelThresholdInMeters ) case ParkingActivityType.Work => - vehicle.isRefuelNeeded( - remainingTourDistance + conf.work.refuelRequiredThresholdInMeters, - conf.noRefuelThresholdInMeters - ) +// vehicle.isRefuelNeeded( +// remainingTourDistance + conf.work.refuelRequiredThresholdInMeters, +// conf.noRefuelThresholdInMeters +// ) + true case _ => - vehicle.isRefuelNeeded( - remainingTourDistance + conf.secondary.refuelRequiredThresholdInMeters, - conf.noRefuelThresholdInMeters - ) +// vehicle.isRefuelNeeded( +// remainingTourDistance + conf.secondary.refuelRequiredThresholdInMeters, +// conf.noRefuelThresholdInMeters +// ) + true } } From 3ad59516cbd922c0d2269c24347de64f2ee64314 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 7 Jun 2022 06:03:32 -0700 Subject: [PATCH 125/307] debug instead of warning for non observed load in ScaleUp --- .../scala/beam/agentsim/infrastructure/ScaleUpCharging.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 0353bf3e514..e6be2b71d4d 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -230,7 +230,7 @@ trait ScaleUpCharging extends { } } case _ => - log.warning("The observed load is null. Most likely due to vehicles not needing to charge!") + log.debug("The observed load is null. Most likely due to vehicles not needing to charge!") } partialTriggersAndInquiries.result() } From fe7735a032a4bbacffdea2e2eb3a7e66b675fe87 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 7 Jun 2022 13:02:57 -0700 Subject: [PATCH 126/307] update template --- src/main/R/gemini/gemini-processing.R | 3 +- src/main/resources/beam-template.conf | 3 +- .../agents/parking/ChoosesParking.scala | 14 +- .../scala/beam/sim/config/BeamConfig.scala | 5602 ++++++----------- 4 files changed, 1973 insertions(+), 3649 deletions(-) diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index f0e7b377628..b4ef83b8e1c 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -956,7 +956,8 @@ nrow(ref1[time == 0]) events.test <- readCsv(pp(workDir, "/test/0.events.csv.gz")) ref.test <- events.test[type=="RefuelSessionEvent"] -charging_share <- ref.test[,.(fuel=sum(fuel)),by=.(chargingPointType)][,fuel_share:=fuel/sum(fuel)] +charging_share <- ref.test[,.(fuel=sum(fuel)),by=.(chargingPointType)] +charging_share <- ref.test[,.(fuel=sum(fuel)),by=.(chargingPointType)][,fuel_share:=format(fuel/sum(fuel), digits=3, scientific = F)] vehicle.test <- readCsv(pp(workDir, "/test/householdVehicles.csv")) park.test <- events.test[type=="ParkingEvent"] vehicle.test$vehicleId <- as.character(vehicle.test$vehicleId) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index a517223aff7..54d5cb4e872 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -308,8 +308,7 @@ beam.agentsim.agents.vehicles.enroute.noRefuelThresholdOffsetInMeters = 32186.9 beam.agentsim.agents.vehicles.enroute.noRefuelAtRemainingDistanceThresholdInMeters = 500 # 500 meters beam.agentsim.agents.vehicles.enroute.estimateOfMeanChargingDurationInSecond = 1800 # 80% of the battery charges in 30min beam.agentsim.agents.vehicles.enroute.remainingDistanceWrtBatteryCapacityThreshold = 2 # this represents +/- the number of times an agent will enroute when ranger is x times lower than the remaining distance -beam.agentsim.agents.vehicles.destination.work.refuelRequiredThresholdInMeters = 64373.8 # 40 miles -beam.agentsim.agents.vehicles.destination.secondary.refuelRequiredThresholdInMeters = 32180.0 # 20 miles +beam.agentsim.agents.vehicles.destination.refuelRequiredThresholdInMeters = 64373.8 # 40 miles beam.agentsim.agents.vehicles.destination.home.refuelRequiredThresholdInMeters = 128747.6 # 80 miles beam.agentsim.agents.vehicles.destination.noRefuelThresholdInMeters = 128720.0 # 80 miles # these must be one of the shared vehicle types diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 29c198fe3b4..180f13cec47 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -260,17 +260,11 @@ trait ChoosesParking extends { remainingTourDistance + conf.home.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters ) - case ParkingActivityType.Work => -// vehicle.isRefuelNeeded( -// remainingTourDistance + conf.work.refuelRequiredThresholdInMeters, -// conf.noRefuelThresholdInMeters -// ) - true case _ => -// vehicle.isRefuelNeeded( -// remainingTourDistance + conf.secondary.refuelRequiredThresholdInMeters, -// conf.noRefuelThresholdInMeters -// ) + vehicle.isRefuelNeeded( + remainingTourDistance + conf.refuelRequiredThresholdInMeters, + conf.noRefuelThresholdInMeters + ) true } } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 22547cff8fa..26e9a647441 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,5218 +3,3548 @@ package beam.sim.config case class BeamConfig( - beam: BeamConfig.Beam, - matsim: BeamConfig.Matsim + beam : BeamConfig.Beam, + matsim : BeamConfig.Matsim ) - object BeamConfig { - case class Beam( - actorSystemName: java.lang.String, - agentsim: BeamConfig.Beam.Agentsim, - calibration: BeamConfig.Beam.Calibration, - cluster: BeamConfig.Beam.Cluster, - debug: BeamConfig.Beam.Debug, - exchange: BeamConfig.Beam.Exchange, - experimental: BeamConfig.Beam.Experimental, - input: BeamConfig.Beam.Input, - inputDirectory: java.lang.String, - logger: BeamConfig.Beam.Logger, - metrics: BeamConfig.Beam.Metrics, - output: BeamConfig.Beam.Output, - outputs: BeamConfig.Beam.Outputs, - physsim: BeamConfig.Beam.Physsim, - replanning: BeamConfig.Beam.Replanning, - router: BeamConfig.Beam.Router, - routing: BeamConfig.Beam.Routing, - sim: BeamConfig.Beam.Sim, - spatial: BeamConfig.Beam.Spatial, - urbansim: BeamConfig.Beam.Urbansim, - useLocalWorker: scala.Boolean, - warmStart: BeamConfig.Beam.WarmStart + actorSystemName : java.lang.String, + agentsim : BeamConfig.Beam.Agentsim, + calibration : BeamConfig.Beam.Calibration, + cluster : BeamConfig.Beam.Cluster, + debug : BeamConfig.Beam.Debug, + exchange : BeamConfig.Beam.Exchange, + experimental : BeamConfig.Beam.Experimental, + input : BeamConfig.Beam.Input, + inputDirectory : java.lang.String, + logger : BeamConfig.Beam.Logger, + metrics : BeamConfig.Beam.Metrics, + output : BeamConfig.Beam.Output, + outputs : BeamConfig.Beam.Outputs, + physsim : BeamConfig.Beam.Physsim, + replanning : BeamConfig.Beam.Replanning, + router : BeamConfig.Beam.Router, + routing : BeamConfig.Beam.Routing, + sim : BeamConfig.Beam.Sim, + spatial : BeamConfig.Beam.Spatial, + urbansim : BeamConfig.Beam.Urbansim, + useLocalWorker : scala.Boolean, + warmStart : BeamConfig.Beam.WarmStart ) - object Beam { - case class Agentsim( - agentSampleSizeAsFractionOfPopulation: scala.Double, - agents: BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime: java.lang.String, - firstIteration: scala.Int, - fractionOfPlansWithSingleActivity: scala.Double, - h3taz: BeamConfig.Beam.Agentsim.H3taz, - lastIteration: scala.Int, - populationAdjustment: java.lang.String, - randomSeedForPopulationSampling: scala.Option[scala.Int], - scenarios: BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow: scala.Int, - simulationName: java.lang.String, - snapLocationAndRemoveInvalidInputs: scala.Boolean, - taz: BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters: scala.Int, - thresholdForWalkingInMeters: scala.Int, - timeBinSize: scala.Int, - toll: BeamConfig.Beam.Agentsim.Toll, - tuning: BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation : scala.Double, + agents : BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime : java.lang.String, + firstIteration : scala.Int, + fractionOfPlansWithSingleActivity : scala.Double, + h3taz : BeamConfig.Beam.Agentsim.H3taz, + lastIteration : scala.Int, + populationAdjustment : java.lang.String, + randomSeedForPopulationSampling : scala.Option[scala.Int], + scenarios : BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow : scala.Int, + simulationName : java.lang.String, + snapLocationAndRemoveInvalidInputs : scala.Boolean, + taz : BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters : scala.Int, + thresholdForWalkingInMeters : scala.Int, + timeBinSize : scala.Int, + toll : BeamConfig.Beam.Agentsim.Toll, + tuning : BeamConfig.Beam.Agentsim.Tuning ) - object Agentsim { - case class Agents( - activities: BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType: java.lang.String, - freight: BeamConfig.Beam.Agentsim.Agents.Freight, - households: BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking: BeamConfig.Beam.Agentsim.Agents.Parking, - plans: BeamConfig.Beam.Agentsim.Agents.Plans, - population: BeamConfig.Beam.Agentsim.Agents.Population, - ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles + activities : BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType : java.lang.String, + freight : BeamConfig.Beam.Agentsim.Agents.Freight, + households : BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking : BeamConfig.Beam.Agentsim.Agents.Parking, + plans : BeamConfig.Beam.Agentsim.Agents.Plans, + population : BeamConfig.Beam.Agentsim.Agents.Population, + ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles ) - object Agents { - case class Activities( - activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] ) - object Activities { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = - if (c.hasPathOrNull("activityTypeToFixedDurationMap")) - scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) - else None + activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None ) } } - + case class Freight( - carrierParkingFilePath: scala.Option[java.lang.String], - carriersFilePath: java.lang.String, - convertWgs2Utm: scala.Boolean, - enabled: scala.Boolean, - generateFixedActivitiesDurations: scala.Boolean, - name: java.lang.String, - plansFilePath: java.lang.String, - reader: java.lang.String, - replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath: java.lang.String + carrierParkingFilePath : scala.Option[java.lang.String], + carriersFilePath : java.lang.String, + convertWgs2Utm : scala.Boolean, + enabled : scala.Boolean, + generateFixedActivitiesDurations : scala.Boolean, + name : java.lang.String, + plansFilePath : java.lang.String, + reader : java.lang.String, + replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath : java.lang.String ) - object Freight { - case class Replanning( - departureTime: scala.Int, - disableAfterIteration: scala.Int, - strategy: java.lang.String + departureTime : scala.Int, + disableAfterIteration : scala.Int, + strategy : java.lang.String ) - object Replanning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = - if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = - if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") - else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = - c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = - if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") - else "/test/input/beamville/freight/payload-plans.csv", - reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - toursFilePath = - if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") - else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", + reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath: java.lang.String, - inputHouseholdAttributesFilePath: java.lang.String + inputFilePath : java.lang.String, + inputHouseholdAttributesFilePath : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = - if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") - else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = - if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") - else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime: scala.Double, - highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts: scala.Int, - minimumValueOfTime: scala.Double, - modeChoiceClass: java.lang.String, - modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT: scala.Boolean, - overrideAutomationLevel: scala.Int, - poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] + defaultValueOfTime : scala.Double, + highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts : scala.Int, + minimumValueOfTime : scala.Double, + modeChoiceClass : java.lang.String, + modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT : scala.Boolean, + overrideAutomationLevel : scala.Int, + poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] ) - object ModalBehaviors { - case class HighTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) - object HighTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class Lccm( - filePath: java.lang.String + filePath : java.lang.String ) - object Lccm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) - object LowTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class ModeVotMultiplier( - CAV: scala.Double, - bike: scala.Double, - drive: scala.Double, - rideHail: scala.Double, - rideHailPooled: scala.Double, - rideHailTransit: scala.Double, - transit: scala.Double, - waiting: scala.Double, - walk: scala.Double + CAV : scala.Double, + bike : scala.Double, + drive : scala.Double, + rideHail : scala.Double, + rideHailPooled : scala.Double, + rideHailTransit : scala.Double, + transit : scala.Double, + waiting : scala.Double, + walk : scala.Double ) - object ModeVotMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor: scala.Double + params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor : scala.Double ) - object MulitnomialLogit { - case class Params( - bike_intercept: scala.Double, - bike_transit_intercept: scala.Double, - car_intercept: scala.Double, - cav_intercept: scala.Double, - drive_transit_intercept: scala.Double, - ride_hail_intercept: scala.Double, - ride_hail_pooled_intercept: scala.Double, - ride_hail_transit_intercept: scala.Double, - transfer: scala.Double, - transit_crowding: scala.Double, - transit_crowding_VOT_multiplier: scala.Double, - transit_crowding_VOT_threshold: scala.Double, - transit_crowding_percentile: scala.Double, - walk_intercept: scala.Double, - walk_transit_intercept: scala.Double + bike_intercept : scala.Double, + bike_transit_intercept : scala.Double, + car_intercept : scala.Double, + cav_intercept : scala.Double, + drive_transit_intercept : scala.Double, + ride_hail_intercept : scala.Double, + ride_hail_pooled_intercept : scala.Double, + ride_hail_transit_intercept : scala.Double, + transfer : scala.Double, + transit_crowding : scala.Double, + transit_crowding_VOT_multiplier : scala.Double, + transit_crowding_VOT_threshold : scala.Double, + transit_crowding_percentile : scala.Double, + walk_intercept : scala.Double, + walk_transit_intercept : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = - if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = - if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = - if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = - if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") - else 0.0, - ride_hail_transit_intercept = - if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") - else 0.0, - transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = - if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) - c.getDouble("transit_crowding_VOT_multiplier") - else 0.0, - transit_crowding_VOT_threshold = - if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") - else 0.5, - transit_crowding_percentile = - if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") - else 90.0, - walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = - if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, + ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, + transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, + transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, + transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, + walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ), - utility_scale_factor = - if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), + utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object PoolingMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = - if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") - ), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - if (c.hasPathOrNull("lccm")) c.getConfig("lccm") - else com.typesafe.config.ConfigFactory.parseString("lccm{}") - ), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") - ), - maximumNumberOfReplanningAttempts = - if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") - else 3, - minimumValueOfTime = - if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = - if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") - else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") - else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - overrideAutomationForVOTT = - c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = - if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") - else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") - ), - transitVehicleTypeVOTMultipliers = - if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) - scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) - else None - ) - } - } - + defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), + maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, + minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), + transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None + ) + } + } + case class ModeIncentive( - filePath: java.lang.String + filePath : java.lang.String ) - object ModeIncentive { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - estimatedMinParkingDurationInSeconds: scala.Double, - fractionOfSameTypeZones: scala.Double, - maxSearchRadius: scala.Double, - minNumberOfSameTypeZones: scala.Int, - minSearchRadius: scala.Double, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - overnightChargingSampleSize: scala.Double, - rangeAnxietyBuffer: scala.Double, - searchMaxDistanceRelativeToEllipseFoci: scala.Double + estimatedMinParkingDurationInSeconds : scala.Double, + fractionOfSameTypeZones : scala.Double, + maxSearchRadius : scala.Double, + minNumberOfSameTypeZones : scala.Int, + minSearchRadius : scala.Double, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + overnightChargingSampleSize : scala.Double, + rangeAnxietyBuffer : scala.Double, + searchMaxDistanceRelativeToEllipseFoci : scala.Double ) - object Parking { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - distanceMultiplier: scala.Double, - enrouteDetourMultiplier: scala.Double, - homeActivityPrefersResidentialParkingMultiplier: scala.Double, - parkingPriceMultiplier: scala.Double, - rangeAnxietyMultiplier: scala.Double + distanceMultiplier : scala.Double, + enrouteDetourMultiplier : scala.Double, + homeActivityPrefersResidentialParkingMultiplier : scala.Double, + parkingPriceMultiplier : scala.Double, + rangeAnxietyMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = - if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = - if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = - if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) - c.getDouble("homeActivityPrefersResidentialParkingMultiplier") - else 1.0, - parkingPriceMultiplier = - if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = - if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else -0.05, + homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, + parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - estimatedMinParkingDurationInSeconds = - if (c.hasPathOrNull("estimatedMinParkingDurationInSeconds")) - c.getDouble("estimatedMinParkingDurationInSeconds") - else 60.0, - fractionOfSameTypeZones = - if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, - maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minNumberOfSameTypeZones = - if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, - minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ), - overnightChargingSampleSize = - if (c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0.5, - rangeAnxietyBuffer = - if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = - if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) - c.getDouble("searchMaxDistanceRelativeToEllipseFoci") - else 4.0 + estimatedMinParkingDurationInSeconds = if(c.hasPathOrNull("estimatedMinParkingDurationInSeconds")) c.getDouble("estimatedMinParkingDurationInSeconds") else 60.0, + fractionOfSameTypeZones = if(c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, + maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minNumberOfSameTypeZones = if(c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, + minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), + overnightChargingSampleSize = if(c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0, + rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath: java.lang.String, - inputPlansFilePath: java.lang.String, - merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath : java.lang.String, + inputPlansFilePath : java.lang.String, + merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) - object Plans { - case class Merge( - fraction: scala.Double + fraction : scala.Double ) - object Merge { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = - if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") - else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = - if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") - else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - if (c.hasPathOrNull("merge")) c.getConfig("merge") - else com.typesafe.config.ConfigFactory.parseString("merge{}") - ) + inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) ) } } - + case class Population( - industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling: scala.Boolean + industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling : scala.Boolean ) - object Population { - case class IndustryRemovalProbabilty( - enabled: scala.Boolean, - inputFilePath: java.lang.String, - removalStrategy: java.lang.String + enabled : scala.Boolean, + inputFilePath : java.lang.String, + removalStrategy : java.lang.String ) - object IndustryRemovalProbabilty { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = - if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") - else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") - ), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath: java.lang.String + filePath : java.lang.String ) - object PtFare { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost: scala.Double, - defaultCostPerMile: scala.Double, - defaultCostPerMinute: scala.Double, - human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations: scala.Boolean, - name: java.lang.String, - pooledBaseCost: scala.Double, - pooledCostPerMile: scala.Double, - pooledCostPerMinute: scala.Double, - rangeBufferForDispatchInMeters: scala.Int, - repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost : scala.Double, + defaultCostPerMile : scala.Double, + defaultCostPerMinute : scala.Double, + human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations : scala.Boolean, + name : java.lang.String, + pooledBaseCost : scala.Double, + pooledCostPerMile : scala.Double, + pooledCostPerMinute : scala.Double, + rangeBufferForDispatchInMeters : scala.Int, + repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) - object RideHail { - case class AllocationManager( - alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm: java.lang.String, - maxExcessRideTime: scala.Double, - maxWaitingTimeInSec: scala.Int, - name: java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, - repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds: scala.Int + alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm : java.lang.String, + maxExcessRideTime : scala.Double, + maxWaitingTimeInSec : scala.Int, + name : java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, + repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds : scala.Int ) - object AllocationManager { - case class AlonsoMora( - maxRequestsPerVehicle: scala.Int + maxRequestsPerVehicle : scala.Int ) - object AlonsoMora { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = - if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, - demandWeight: scala.Double, - distanceWeight: scala.Double, - keepMaxTopNScores: scala.Int, - minDemandPercentageInRadius: scala.Double, - minScoreThresholdForRepositioning: scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, - percentageOfVehiclesToReposition: scala.Double, - produceDebugImages: scala.Boolean, - repositionCircleRadiusInMeters: scala.Double, - repositioningMethod: java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, - waitingTimeWeight: scala.Double + allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, + demandWeight : scala.Double, + distanceWeight : scala.Double, + keepMaxTopNScores : scala.Int, + minDemandPercentageInRadius : scala.Double, + minScoreThresholdForRepositioning : scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, + percentageOfVehiclesToReposition : scala.Double, + produceDebugImages : scala.Boolean, + repositionCircleRadiusInMeters : scala.Double, + repositioningMethod : java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, + waitingTimeWeight : scala.Double ) - object RepositionLowWaitingTimes { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( - "allowIncreasingRadiusIfDemandInRadiusLow" - ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = - if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") - else 0.1, - minScoreThresholdForRepositioning = - if (c.hasPathOrNull("minScoreThresholdForRepositioning")) - c.getDouble("minScoreThresholdForRepositioning") - else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = - if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) - c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") - else 1, - percentageOfVehiclesToReposition = - if (c.hasPathOrNull("percentageOfVehiclesToReposition")) - c.getDouble("percentageOfVehiclesToReposition") - else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = - if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") - else 3000, - repositioningMethod = - if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = - if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) - c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") - else 1200, - waitingTimeWeight = - if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, + minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, + percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, + repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, + waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") - else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") - ), - matchingAlgorithm = - if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") - else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = - if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = - if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) - c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") - else 1, - repositionLowWaitingTimes = - BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") - else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") - ), - requestBufferTimeoutInSeconds = - if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), + matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, + repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), + requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int, - valueOfTime: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int, + valueOfTime : scala.Int ) - object Cav { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 16090, - valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, + valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) - object Charging { - case class VehicleChargingManager( - defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager ) - object VehicleChargingManager { - case class DefaultVehicleChargingManager( - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit ) - object DefaultVehicleChargingManager { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) - object MulitnomialLogit { - case class Params( - chargingTimeMultiplier: scala.Double, - drivingTimeMultiplier: scala.Double, - insufficientRangeMultiplier: scala.Double, - queueingTimeMultiplier: scala.Double + chargingTimeMultiplier : scala.Double, + drivingTimeMultiplier : scala.Double, + insufficientRangeMultiplier : scala.Double, + queueingTimeMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - chargingTimeMultiplier = - if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") - else -0.01666667, - drivingTimeMultiplier = - if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") - else -0.01666667, - insufficientRangeMultiplier = - if (c.hasPathOrNull("insufficientRangeMultiplier")) - c.getDouble("insufficientRangeMultiplier") - else -60.0, - queueingTimeMultiplier = - if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") - else -0.01666667 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( + chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, + drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, + insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, + queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - params = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit - .Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - mulitnomialLogit = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - if (c.hasPathOrNull("defaultVehicleChargingManager")) - c.getConfig("defaultVehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") - ) + defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") - ) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) ) } } - + case class Human( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int ) - object Human { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 ) } } - + case class Initialization( - filePath: java.lang.String, - initType: java.lang.String, - parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath : java.lang.String, + initType : java.lang.String, + parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) - object Initialization { - case class Parking( - filePath: java.lang.String + filePath : java.lang.String ) - object Parking { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet: scala.Double, - initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId: java.lang.String, - vehicleTypePrefix: java.lang.String + fractionOfInitialVehicleFleet : scala.Double, + initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId : java.lang.String, + vehicleTypePrefix : java.lang.String ) - object Procedural { - case class InitialLocation( - home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name: java.lang.String + home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name : java.lang.String ) - object InitialLocation { - case class Home( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object Home { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - if (c.hasPathOrNull("home")) c.getConfig("home") - else com.typesafe.config.ConfigFactory.parseString("home{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") - else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") - ), - vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = - if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - if (c.hasPathOrNull("procedural")) c.getConfig("procedural") - else com.typesafe.config.ConfigFactory.parseString("procedural{}") - ) + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) ) } } - + case class IterationStats( - timeBinSizeInSec: scala.Double + timeBinSizeInSec : scala.Double ) - object IterationStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name: java.lang.String, - timeout: scala.Int + demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name : java.lang.String, + timeout : scala.Int ) - object RepositioningManager { - case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider: scala.Double, - horizon: scala.Int, - numberOfClustersForDemand: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDemandForCAVs: scala.Double + fractionOfClosestClustersToConsider : scala.Double, + horizon : scala.Int, + numberOfClustersForDemand : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDemandForCAVs : scala.Double ) - object DemandFollowingRepositioningManager { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = - if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) - c.getDouble("fractionOfClosestClustersToConsider") - else 0.2, - horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = - if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 1, - sensitivityOfRepositioningToDemandForCAVs = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) - c.getDouble("sensitivityOfRepositioningToDemandForCAVs") - else 1 + fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, + horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, + sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDistance: scala.Double + predictionHorizon : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDistance : scala.Double ) - object InverseSquareDistanceRepositioningFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 0.4, - sensitivityOfRepositioningToDistance = - if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) - c.getDouble("sensitivityOfRepositioningToDistance") - else 0.9 + predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, + sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - if (c.hasPathOrNull("demandFollowingRepositioningManager")) - c.getConfig("demandFollowingRepositioningManager") - else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") - ), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager - .InverseSquareDistanceRepositioningFactor( - if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) - c.getConfig("inverseSquareDistanceRepositioningFactor") - else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object RideHailManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel: scala.Double, - numberOfCategories: scala.Int, - priceAdjustmentStrategy: java.lang.String, - surgeLevelAdaptionStep: scala.Double + minimumSurgeLevel : scala.Double, + numberOfCategories : scala.Int, + priceAdjustmentStrategy : java.lang.String, + surgeLevelAdaptionStep : scala.Double ) - object SurgePricing { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = - if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") - else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = - if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") - else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") - ), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - if (c.hasPathOrNull("cav")) c.getConfig("cav") - else com.typesafe.config.ConfigFactory.parseString("cav{}") - ), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - if (c.hasPathOrNull("charging")) c.getConfig("charging") - else com.typesafe.config.ConfigFactory.parseString("charging{}") - ), - defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = - if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = - if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - if (c.hasPathOrNull("human")) c.getConfig("human") - else com.typesafe.config.ConfigFactory.parseString("human{}") - ), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - if (c.hasPathOrNull("initialization")) c.getConfig("initialization") - else com.typesafe.config.ConfigFactory.parseString("initialization{}") - ), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") - else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") - ), - linkFleetStateAcrossIterations = - c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = - if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - rangeBufferForDispatchInMeters = - if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") - else 10000, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") - else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") - ), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") - else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") - ), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") - else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") - ) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), + defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), + linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) + ) + } + } + case class RideHailTransit( - modesToConsider: java.lang.String + modesToConsider : java.lang.String ) - object RideHailTransit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) - object TripBehaviors { - case class CarUsage( - minDistanceToTrainStop: scala.Double + minDistanceToTrainStop : scala.Double ) - object CarUsage { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = - if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path: java.lang.String, - additional_trip_utility: scala.Double, - destination_nest_scale_factor: scala.Double, - generate_secondary_activities: scala.Boolean, - intercept_file_path: java.lang.String, - max_destination_choice_set_size: scala.Int, - max_destination_distance_meters: scala.Double, - mode_nest_scale_factor: scala.Double, - trip_nest_scale_factor: scala.Double + activity_file_path : java.lang.String, + additional_trip_utility : scala.Double, + destination_nest_scale_factor : scala.Double, + generate_secondary_activities : scala.Boolean, + intercept_file_path : java.lang.String, + max_destination_choice_set_size : scala.Int, + max_destination_distance_meters : scala.Double, + mode_nest_scale_factor : scala.Double, + trip_nest_scale_factor : scala.Double ) - object MulitnomialLogit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = - if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = - if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = - if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") - else 1.0, - generate_secondary_activities = - c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = - if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = - if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") - else 20, - max_destination_distance_meters = - if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") - else 32000, - mode_nest_scale_factor = - if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = - if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, + generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, + max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, + mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") - else com.typesafe.config.ConfigFactory.parseString("carUsage{}") - ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") - ) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) ) } } - + case class Vehicles( - destination: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination, - downsamplingMethod: java.lang.String, - dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet: scala.Double, - fractionOfPeopleWithBicycle: scala.Double, - fuelTypesFilePath: java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, - linkSocAcrossIterations: scala.Boolean, - linkToGradePercentFilePath: java.lang.String, - meanPrivateVehicleStartingSOC: scala.Double, - meanRidehailVehicleStartingSOC: scala.Double, - sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile: java.lang.String, - vehicleAdjustmentMethod: java.lang.String, - vehicleTypesFilePath: java.lang.String, - vehiclesFilePath: java.lang.String + destination : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination, + downsamplingMethod : java.lang.String, + dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet : scala.Double, + fractionOfPeopleWithBicycle : scala.Double, + fuelTypesFilePath : java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, + linkSocAcrossIterations : scala.Boolean, + linkToGradePercentFilePath : java.lang.String, + meanPrivateVehicleStartingSOC : scala.Double, + meanRidehailVehicleStartingSOC : scala.Double, + sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile : java.lang.String, + vehicleAdjustmentMethod : java.lang.String, + vehicleTypesFilePath : java.lang.String, + vehiclesFilePath : java.lang.String ) - object Vehicles { - case class Destination( - home: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home, - noRefuelThresholdInMeters: scala.Int, - secondary: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary, - work: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work + home : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home, + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Double ) - object Destination { - case class Home( - refuelRequiredThresholdInMeters: scala.Double + refuelRequiredThresholdInMeters : scala.Double ) - object Home { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) - c.getDouble("refuelRequiredThresholdInMeters") - else 128747.6 - ) - } - } - - case class Secondary( - refuelRequiredThresholdInMeters: scala.Int - ) - - object Secondary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary( - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180 + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getDouble("refuelRequiredThresholdInMeters") else 128747.6 ) } } - - case class Work( - refuelRequiredThresholdInMeters: scala.Double - ) - - object Work { - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work( - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) - c.getDouble("refuelRequiredThresholdInMeters") - else 64373.8 - ) - } - } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( - home = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( - if (c.hasPathOrNull("home")) c.getConfig("home") - else com.typesafe.config.ConfigFactory.parseString("home{}") - ), - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - secondary = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Secondary( - if (c.hasPathOrNull("secondary")) c.getConfig("secondary") - else com.typesafe.config.ConfigFactory.parseString("secondary{}") - ), - work = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Work( - if (c.hasPathOrNull("work")) c.getConfig("work") - else com.typesafe.config.ConfigFactory.parseString("work{}") - ) + home = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getDouble("refuelRequiredThresholdInMeters") else 64373.8 ) } } - + case class DummySharedBike( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedBike { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedCar { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond: scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, - noRefuelThresholdOffsetInMeters: scala.Double, - refuelRequiredThresholdOffsetInMeters: scala.Int, - remainingDistanceWrtBatteryCapacityThreshold: scala.Int + estimateOfMeanChargingDurationInSecond : scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, + noRefuelThresholdOffsetInMeters : scala.Double, + refuelRequiredThresholdOffsetInMeters : scala.Int, + remainingDistanceWrtBatteryCapacityThreshold : scala.Int ) - object Enroute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = - if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) - c.getInt("estimateOfMeanChargingDurationInSecond") - else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = - if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) - c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") - else 500, - noRefuelThresholdOffsetInMeters = - if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") - else 32186.9, - refuelRequiredThresholdOffsetInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdOffsetInMeters")) - c.getInt("refuelRequiredThresholdOffsetInMeters") - else 0, - remainingDistanceWrtBatteryCapacityThreshold = - if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) - c.getInt("remainingDistanceWrtBatteryCapacityThreshold") - else 2 + estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, + noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, + refuelRequiredThresholdOffsetInMeters = if(c.hasPathOrNull("refuelRequiredThresholdOffsetInMeters")) c.getInt("refuelRequiredThresholdOffsetInMeters") else 0, + remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving - ], - fixed_non_reserving_fleet_by_taz: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz - ], - inexhaustible_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving - ], - managerType: java.lang.String, - name: java.lang.String, - parkingFilePath: java.lang.String, - reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], + fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], + inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], + managerType : java.lang.String, + name : java.lang.String, + parkingFilePath : java.lang.String, + reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) - object SharedFleets$Elm { - case class FixedNonReserving( - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String ) - object FixedNonReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize: scala.Int, - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String, - vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] + fleetSize : scala.Int, + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String, + vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] ) - object FixedNonReservingFleetByTaz { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = - if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) - else None + fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object InexhaustibleReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm - ], - name: java.lang.String, - repositionTimeBin: scala.Int, - statTimeBin: scala.Int + min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], + name : java.lang.String, + repositionTimeBin : scala.Int, + statTimeBin : scala.Int ) - object Reposition { - case class MinAvailabilityUndersupplyAlgorithm( - matchLimit: scala.Int + matchLimit : scala.Int ) - object MinAvailabilityUndersupplyAlgorithm { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm( - matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( + matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = - if (c.hasPathOrNull("min-availability-undersupply-algorithm")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) - ) - else None, - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = - if (c.hasPathOrNull("fixed-non-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReserving(c.getConfig("fixed-non-reserving")) - ) - else None, - fixed_non_reserving_fleet_by_taz = - if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) - ) - else None, - inexhaustible_reserving = - if (c.hasPathOrNull("inexhaustible-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) - ) - else None, - managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = - if (c.hasPathOrNull("reposition")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) - ) - else None + fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, + fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, + inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, + managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - destination = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( - if (c.hasPathOrNull("destination")) c.getConfig("destination") - else com.typesafe.config.ConfigFactory.parseString("destination{}") - ), - downsamplingMethod = - if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") - else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") - else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") - ), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") - else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") - ), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - if (c.hasPathOrNull("enroute")) c.getConfig("enroute") - else com.typesafe.config.ConfigFactory.parseString("enroute{}") - ), - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 1.0, - fractionOfPeopleWithBicycle = - if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = - if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") - else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( - "generateEmergencyHouseholdVehicleWhenPlansRequireIt" - ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = - c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = - if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = - if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") - else 1.0, - meanRidehailVehicleStartingSOC = - if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") - else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = - if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") - else "", - vehicleAdjustmentMethod = - if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = - if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") - else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = - if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") - else "/test/input/beamville/vehicles.csv" - ) - } - - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + destination = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination(if(c.hasPathOrNull("destination")) c.getConfig("destination") else com.typesafe.config.ConfigFactory.parseString("destination{}")), + downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, + fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, + meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", + vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" + ) + } + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Agentsim.Agents.Vehicles - .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities( - if (c.hasPathOrNull("activities")) c.getConfig("activities") - else com.typesafe.config.ConfigFactory.parseString("activities{}") - ), - bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight( - if (c.hasPathOrNull("freight")) c.getConfig("freight") - else com.typesafe.config.ConfigFactory.parseString("freight{}") - ), - households = BeamConfig.Beam.Agentsim.Agents.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") - else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") - ), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") - else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") - ), - parking = BeamConfig.Beam.Agentsim.Agents.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - plans = BeamConfig.Beam.Agentsim.Agents.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - population = BeamConfig.Beam.Agentsim.Agents.Population( - if (c.hasPathOrNull("population")) c.getConfig("population") - else com.typesafe.config.ConfigFactory.parseString("population{}") - ), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( - if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") - else com.typesafe.config.ConfigFactory.parseString("ptFare{}") - ), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( - if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") - else com.typesafe.config.ConfigFactory.parseString("rideHail{}") - ), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") - else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") - ), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") - else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") - ), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), + bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), + households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), + parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor: scala.Double, - chargingPointCountScalingFactor: scala.Double, - chargingPointFilePath: java.lang.String, - helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - maxChargingSessionsInSeconds: scala.Int, - overnightChargingEnabled: scala.Boolean, - scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds: scala.Int + chargingPointCostScalingFactor : scala.Double, + chargingPointCountScalingFactor : scala.Double, + chargingPointFilePath : java.lang.String, + helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + maxChargingSessionsInSeconds : scala.Int, + overnightChargingEnabled : scala.Boolean, + scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds : scala.Int ) - object ChargingNetworkManager { - case class Helics( - bufferSize: scala.Int, - connectionEnabled: scala.Boolean, - coreInitString: java.lang.String, - coreType: java.lang.String, - dataInStreamPoint: java.lang.String, - dataOutStreamPoint: java.lang.String, - federateName: java.lang.String, - feedbackEnabled: scala.Boolean, - intLogLevel: scala.Int, - timeDeltaProperty: scala.Double + bufferSize : scala.Int, + connectionEnabled : scala.Boolean, + coreInitString : java.lang.String, + coreType : java.lang.String, + dataInStreamPoint : java.lang.String, + dataOutStreamPoint : java.lang.String, + federateName : java.lang.String, + feedbackEnabled : scala.Boolean, + intLogLevel : scala.Int, + timeDeltaProperty : scala.Double ) - object Helics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = - if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") - else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = - if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") - else "GridFed/PhysicalBounds", - dataOutStreamPoint = - if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", + dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled: scala.Boolean, - expansionFactor_charge_activity: scala.Double, - expansionFactor_home_activity: scala.Double, - expansionFactor_init_activity: scala.Double, - expansionFactor_wherever_activity: scala.Double, - expansionFactor_work_activity: scala.Double + enabled : scala.Boolean, + expansionFactor_charge_activity : scala.Double, + expansionFactor_home_activity : scala.Double, + expansionFactor_init_activity : scala.Double, + expansionFactor_wherever_activity : scala.Double, + expansionFactor_work_activity : scala.Double ) - object ScaleUp { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = - if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") - else 1.0, - expansionFactor_home_activity = - if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") - else 1.0, - expansionFactor_init_activity = - if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") - else 1.0, - expansionFactor_wherever_activity = - if (c.hasPathOrNull("expansionFactor_wherever_activity")) - c.getDouble("expansionFactor_wherever_activity") - else 1.0, - expansionFactor_work_activity = - if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") - else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, + expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, + expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, + expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, + expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = - if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") - else 1.0, - chargingPointCountScalingFactor = - if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") - else 1.0, - chargingPointFilePath = - if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - if (c.hasPathOrNull("helics")) c.getConfig("helics") - else com.typesafe.config.ConfigFactory.parseString("helics{}") - ), - maxChargingSessionsInSeconds = - if (c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, - overnightChargingEnabled = - c.hasPathOrNull("overnightChargingEnabled") && c.getBoolean("overnightChargingEnabled"), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") - else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") - ), - timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, + chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, + chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), + maxChargingSessionsInSeconds = if(c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, + overnightChargingEnabled = c.hasPathOrNull("overnightChargingEnabled") && c.getBoolean("overnightChargingEnabled"), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), + timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution: scala.Int, - upperBoundResolution: scala.Int + lowerBoundResolution : scala.Int, + upperBoundResolution : scala.Int ) - object H3taz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile: java.lang.String + frequencyAdjustmentFile : java.lang.String ) - object Scenarios { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = - if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") - else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay: scala.Int, - interval: scala.Int + initialDelay : scala.Int, + interval : scala.Int ) - object ScheduleMonitorTask { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath: java.lang.String, - parkingCostScalingFactor: scala.Double, - parkingFilePath: java.lang.String, - parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor: scala.Double + filePath : java.lang.String, + parkingCostScalingFactor : scala.Double, + parkingFilePath : java.lang.String, + parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor : scala.Double ) - object Taz { - case class ParkingManager( - displayPerformanceTimings: scala.Boolean, - method: java.lang.String, - parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings : scala.Boolean, + method : java.lang.String, + parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) - object ParkingManager { - case class Parallel( - numberOfClusters: scala.Int + numberOfClusters : scala.Int ) - object Parallel { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - if (c.hasPathOrNull("parallel")) c.getConfig("parallel") - else com.typesafe.config.ConfigFactory.parseString("parallel{}") - ) + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = - if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( - if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") - else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") - ), - parkingStallCountScalingFactor = - if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") - else 1.0 + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), + parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 ) } } - + case class Toll( - filePath: java.lang.String + filePath : java.lang.String ) - object Toll { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules: scala.Double, - rideHailPrice: scala.Double, - tollPrice: scala.Double, - transitCapacity: scala.Option[scala.Double], - transitPrice: scala.Double + fuelCapacityInJoules : scala.Double, + rideHailPrice : scala.Double, + tollPrice : scala.Double, + transitCapacity : scala.Option[scala.Double], + transitPrice : scala.Double ) - object Tuning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = - if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = - if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) - c.getDouble("agentSampleSizeAsFractionOfPopulation") - else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents( - if (c.hasPathOrNull("agents")) c.getConfig("agents") - else com.typesafe.config.ConfigFactory.parseString("agents{}") - ), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( - if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") - else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") - ), - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = - if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") - else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz( - if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") - else com.typesafe.config.ConfigFactory.parseString("h3taz{}") - ), - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = - if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - randomSeedForPopulationSampling = - if (c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) - else None, - scenarios = BeamConfig.Beam.Agentsim.Scenarios( - if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") - else com.typesafe.config.ConfigFactory.parseString("scenarios{}") - ), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") - else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") - ), - schedulerParallelismWindow = - if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - snapLocationAndRemoveInvalidInputs = - c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), - taz = BeamConfig.Beam.Agentsim.Taz( - if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") - ), - thresholdForMakingParkingChoiceInMeters = - if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) - c.getInt("thresholdForMakingParkingChoiceInMeters") - else 100, - thresholdForWalkingInMeters = - if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll( - if (c.hasPathOrNull("toll")) c.getConfig("toll") - else com.typesafe.config.ConfigFactory.parseString("toll{}") - ), - tuning = BeamConfig.Beam.Agentsim.Tuning( - if (c.hasPathOrNull("tuning")) c.getConfig("tuning") - else com.typesafe.config.ConfigFactory.parseString("tuning{}") - ) + agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + randomSeedForPopulationSampling = if(c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) else None, + scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), + schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + snapLocationAndRemoveInvalidInputs = c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), + taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), + thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, + thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), + tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) ) } } - + case class Calibration( - counts: BeamConfig.Beam.Calibration.Counts, - google: BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio: scala.Double, - mode: BeamConfig.Beam.Calibration.Mode, - objectiveFunction: java.lang.String, - roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, - studyArea: BeamConfig.Beam.Calibration.StudyArea + counts : BeamConfig.Beam.Calibration.Counts, + google : BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio : scala.Double, + mode : BeamConfig.Beam.Calibration.Mode, + objectiveFunction : java.lang.String, + roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, + studyArea : BeamConfig.Beam.Calibration.StudyArea ) - object Calibration { - case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Int, - inputCountsFile: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Int, + inputCountsFile : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes ) - object Google { - case class TravelTimes( - enable: scala.Boolean, - iterationInterval: scala.Int, - minDistanceInMeters: scala.Double, - numDataPointsOver24Hours: scala.Int, - offPeakEnabled: scala.Boolean, - queryDate: java.lang.String, - tolls: scala.Boolean + enable : scala.Boolean, + iterationInterval : scala.Int, + minDistanceInMeters : scala.Double, + numDataPointsOver24Hours : scala.Int, + offPeakEnabled : scala.Boolean, + queryDate : java.lang.String, + tolls : scala.Boolean ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = - if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = - if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class Mode( - benchmarkFilePath: java.lang.String + benchmarkFilePath : java.lang.String ) - object Mode { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) - object RoadNetwork { - case class TravelTimes( - zoneBoundariesFilePath: java.lang.String, - zoneODTravelTimesFilePath: java.lang.String + zoneBoundariesFilePath : java.lang.String, + zoneODTravelTimesFilePath : java.lang.String ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = - if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = - if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class StudyArea( - enabled: scala.Boolean, - lat: scala.Double, - lon: scala.Double, - radius: scala.Double + enabled : scala.Boolean, + lat : scala.Double, + lon : scala.Double, + radius : scala.Double ) - object StudyArea { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - google = BeamConfig.Beam.Calibration.Google( - if (c.hasPathOrNull("google")) c.getConfig("google") - else com.typesafe.config.ConfigFactory.parseString("google{}") - ), - meanToCountsWeightRatio = - if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode( - if (c.hasPathOrNull("mode")) c.getConfig("mode") - else com.typesafe.config.ConfigFactory.parseString("mode{}") - ), - objectiveFunction = - if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") - else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( - if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") - else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") - ), - studyArea = BeamConfig.Beam.Calibration.StudyArea( - if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") - else com.typesafe.config.ConfigFactory.parseString("studyArea{}") - ) + counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), + meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), + objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), + studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) ) } } - + case class Cluster( - clusterType: scala.Option[java.lang.String], - enabled: scala.Boolean + clusterType : scala.Option[java.lang.String], + enabled : scala.Boolean ) - object Cluster { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor: BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval: scala.Int, - clearRoutedOutstandingWorkEnabled: scala.Boolean, - debugActorTimerIntervalInSec: scala.Int, - debugEnabled: scala.Boolean, - memoryConsumptionDisplayTimeoutInSec: scala.Int, - messageLogging: scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork: scala.Int, - stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation: BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives: scala.Boolean, - writeRealizedModeChoiceFile: scala.Boolean + actor : BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval : scala.Int, + clearRoutedOutstandingWorkEnabled : scala.Boolean, + debugActorTimerIntervalInSec : scala.Int, + debugEnabled : scala.Boolean, + memoryConsumptionDisplayTimeoutInSec : scala.Int, + messageLogging : scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork : scala.Int, + stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation : BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives : scala.Boolean, + writeRealizedModeChoiceFile : scala.Boolean ) - object Debug { - case class Actor( - logDepth: scala.Int + logDepth : scala.Int ) - object Actor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs: scala.Long, - checkMaxNumberOfMessagesEnabled: scala.Boolean, - defaultTimeoutMs: scala.Long, - enabled: scala.Boolean, - overallSimulationTimeoutMs: scala.Long, - thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs : scala.Long, + checkMaxNumberOfMessagesEnabled : scala.Boolean, + defaultTimeoutMs : scala.Long, + enabled : scala.Boolean, + overallSimulationTimeoutMs : scala.Long, + thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) - object StuckAgentDetection { - case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs: scala.Long, - triggerType: java.lang.String + actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs : scala.Long, + triggerType : java.lang.String ) - object Thresholds$Elm { - case class ActorTypeToMaxNumberOfMessages( - population: scala.Option[scala.Int], - rideHailAgent: scala.Option[scala.Int], - rideHailManager: scala.Option[scala.Int], - transitDriverAgent: scala.Option[scala.Int] + population : scala.Option[scala.Int], + rideHailAgent : scala.Option[scala.Int], + rideHailManager : scala.Option[scala.Int], + transitDriverAgent : scala.Option[scala.Int] ) - object ActorTypeToMaxNumberOfMessages { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = - if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = - BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") - else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") - ), - markAsStuckAfterMs = - if (c.hasPathOrNull("markAsStuckAfterMs")) - c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 20000, - triggerType = - if (c.hasPathOrNull("triggerType")) c.getString("triggerType") - else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), + markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, + triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = - if (c.hasPathOrNull("checkIntervalMs")) - c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 200, - checkMaxNumberOfMessagesEnabled = - !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = - if (c.hasPathOrNull("defaultTimeoutMs")) - c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = - if (c.hasPathOrNull("overallSimulationTimeoutMs")) - c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, + checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Debug.StuckAgentDetection - .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class TriggerMeasurer( - enabled: scala.Boolean, - writeStuckAgentDetectionConfig: scala.Boolean + enabled : scala.Boolean, + writeStuckAgentDetectionConfig : scala.Boolean ) - object TriggerMeasurer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = - !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram: scala.Boolean + createGCClassHistogram : scala.Boolean ) - object VmInformation { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor( - if (c.hasPathOrNull("actor")) c.getConfig("actor") - else com.typesafe.config.ConfigFactory.parseString("actor{}") - ), - agentTripScoresInterval = - if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = - c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = - if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = - if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) - c.getInt("memoryConsumptionDisplayTimeoutInSec") - else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = - if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) - c.getInt("secondsToWaitToClearRoutedOutstandingWork") - else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( - if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") - else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") - ), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( - if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") - else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") - ), - vmInformation = BeamConfig.Beam.Debug.VmInformation( - if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") - else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") - ), - writeModeChoiceAlternatives = - c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = - c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), + agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), + vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), + writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output: BeamConfig.Beam.Exchange.Output, - scenario: BeamConfig.Beam.Exchange.Scenario + output : BeamConfig.Beam.Exchange.Output, + scenario : BeamConfig.Beam.Exchange.Scenario ) - object Exchange { - case class Output( - activitySimSkimsEnabled: scala.Boolean, - geo: BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled : scala.Boolean, + geo : BeamConfig.Beam.Exchange.Output.Geo ) - object Output { - case class Geo( - filePath: scala.Option[java.lang.String] + filePath : scala.Option[java.lang.String] ) - object Geo { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = - c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo( - if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") - ) + activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) ) } } - + case class Scenario( - convertWgs2Utm: scala.Boolean, - fileFormat: java.lang.String, - folder: java.lang.String, - modeMap: scala.Option[scala.List[java.lang.String]], - source: java.lang.String, - urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm : scala.Boolean, + fileFormat : java.lang.String, + folder : java.lang.String, + modeMap : scala.Option[scala.List[java.lang.String]], + source : java.lang.String, + urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim ) - object Scenario { - case class Urbansim( - activitySimEnabled: scala.Boolean + activitySimEnabled : scala.Boolean ) - object Urbansim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ) + fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - scenario = BeamConfig.Beam.Exchange.Scenario( - if (c.hasPathOrNull("scenario")) c.getConfig("scenario") - else com.typesafe.config.ConfigFactory.parseString("scenario{}") - ) + output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) ) } } - + case class Experimental( - optimizer: BeamConfig.Beam.Experimental.Optimizer + optimizer : BeamConfig.Beam.Experimental.Optimizer ) - object Experimental { - case class Optimizer( - enabled: scala.Boolean + enabled : scala.Boolean ) - object Optimizer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer( - if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") - else com.typesafe.config.ConfigFactory.parseString("optimizer{}") - ) + optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) ) } } - + case class Input( - lastBaseOutputDir: java.lang.String, - simulationPrefix: java.lang.String + lastBaseOutputDir : java.lang.String, + simulationPrefix : java.lang.String ) - object Input { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn: scala.Boolean + keepConsoleAppenderOn : scala.Boolean ) - object Logger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level: java.lang.String + level : java.lang.String ) - object Metrics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation: scala.Boolean + writePlansAndStopSimulation : scala.Boolean ) - object Output { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = - c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory: scala.Boolean, - baseOutputDirectory: java.lang.String, - collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, - defaultWriteInterval: scala.Int, - displayPerformanceTimings: scala.Boolean, - events: BeamConfig.Beam.Outputs.Events, - generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval: scala.Int, - matsim: BeamConfig.Beam.Outputs.Matsim, - stats: BeamConfig.Beam.Outputs.Stats, - writeAnalysis: scala.Boolean, - writeEventsInterval: scala.Int, - writeGraphs: scala.Boolean, - writePlansInterval: scala.Int, - writeR5RoutesInterval: scala.Int + addTimestampToOutputDirectory : scala.Boolean, + baseOutputDirectory : java.lang.String, + collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, + defaultWriteInterval : scala.Int, + displayPerformanceTimings : scala.Boolean, + events : BeamConfig.Beam.Outputs.Events, + generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval : scala.Int, + matsim : BeamConfig.Beam.Outputs.Matsim, + stats : BeamConfig.Beam.Outputs.Stats, + writeAnalysis : scala.Boolean, + writeEventsInterval : scala.Int, + writeGraphs : scala.Boolean, + writePlansInterval : scala.Int, + writeR5RoutesInterval : scala.Int ) - object Outputs { - case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime: scala.Int, - startTime: scala.Int + endTime : scala.Int, + startTime : scala.Int ) - object GeneralizedLinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles: java.lang.String, - deleteRootFolderFiles: java.lang.String + deleteITERSFolderFiles : java.lang.String, + deleteRootFolderFiles : java.lang.String ) - object Matsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = - if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = - if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize: scala.Int + binSize : scala.Int ) - object Stats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = - !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = - if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = - !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( - "collectAndCreateBeamAnalysisAndGraphs" - ), - defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( - if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") - else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") - ), - generalizedLinkStatsInterval = - if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ), - stats = BeamConfig.Beam.Outputs.Stats( - if (c.hasPathOrNull("stats")) c.getConfig("stats") - else com.typesafe.config.ConfigFactory.parseString("stats{}") - ), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), + defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), + generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), + stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim: BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager: BeamConfig.Beam.Physsim.EventManager, - events: BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia: scala.Boolean, - eventsSampling: scala.Double, - flowCapacityFactor: scala.Double, - initializeRouterWithFreeFlowTimes: scala.Boolean, - inputNetworkFilePath: java.lang.String, - jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize: scala.Int, - linkStatsWriteInterval: scala.Int, - maxLinkLengthToApplySpeedScalingFactor: scala.Double, - name: java.lang.String, - network: BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath: java.lang.String, - parbprsim: BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize: scala.Double, - quick_fix_minCarSpeedInMetersPerSecond: scala.Double, - relaxation: BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim: scala.Boolean, - speedScalingFactor: scala.Double, - storageCapacityFactor: scala.Double, - writeEventsInterval: scala.Int, - writePlansInterval: scala.Int, - writeRouteHistoryInterval: scala.Int + bprsim : BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager : BeamConfig.Beam.Physsim.EventManager, + events : BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia : scala.Boolean, + eventsSampling : scala.Double, + flowCapacityFactor : scala.Double, + initializeRouterWithFreeFlowTimes : scala.Boolean, + inputNetworkFilePath : java.lang.String, + jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize : scala.Int, + linkStatsWriteInterval : scala.Int, + maxLinkLengthToApplySpeedScalingFactor : scala.Double, + name : java.lang.String, + network : BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath : java.lang.String, + parbprsim : BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize : scala.Double, + quick_fix_minCarSpeedInMetersPerSecond : scala.Double, + relaxation : BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim : scala.Boolean, + speedScalingFactor : scala.Double, + storageCapacityFactor : scala.Double, + writeEventsInterval : scala.Int, + writePlansInterval : scala.Int, + writeRouteHistoryInterval : scala.Int ) - object Physsim { - case class Bprsim( - inFlowAggregationTimeWindowInSeconds: scala.Int, - minFlowToUseBPRFunction: scala.Int, - travelTimeFunction: java.lang.String + inFlowAggregationTimeWindowInSeconds : scala.Int, + minFlowToUseBPRFunction : scala.Int, + travelTimeFunction : java.lang.String ) - object Bprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = - if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) - c.getInt("inFlowAggregationTimeWindowInSeconds") - else 900, - minFlowToUseBPRFunction = - if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, + minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor: scala.Double + congestionFactor : scala.Double ) - object CchRoutingAssignment { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax: scala.Int, - departureTimeShiftMin: scala.Int, - fractionOfEventsToDuplicate: scala.Double + departureTimeShiftMax : scala.Int, + departureTimeShiftMin : scala.Int, + fractionOfEventsToDuplicate : scala.Double ) - object DuplicatePTE { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = - if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = - if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = - if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads: scala.Int, - `type`: java.lang.String + numberOfThreads : scala.Int, + `type` : java.lang.String ) - object EventManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) - object Jdeqsim { - case class AgentSimPhysSimInterfaceDebugger( - enabled: scala.Boolean + enabled : scala.Boolean ) - object AgentSimPhysSimInterfaceDebugger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, - capacityPlansWriteInterval: scala.Int, - enabled: scala.Boolean, - minRoadCapacity: scala.Int, - minSpeedMetersPerSec: scala.Int, - speedAdjustmentFactor: scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, + capacityPlansWriteInterval : scala.Int, + enabled : scala.Boolean, + minRoadCapacity : scala.Int, + minSpeedMetersPerSec : scala.Int, + speedAdjustmentFactor : scala.Double ) - object Cacc { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = - if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) - c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") - else 1.3, - capacityPlansWriteInterval = - if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = - if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = - if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, + capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( - if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") - else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") - ), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - if (c.hasPathOrNull("cacc")) c.getConfig("cacc") - else com.typesafe.config.ConfigFactory.parseString("cacc{}") - ) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) ) } } - + case class Network( - maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) - object Network { - case class MaxSpeedInference( - enabled: scala.Boolean, - `type`: java.lang.String + enabled : scala.Boolean, + `type` : java.lang.String ) - object MaxSpeedInference { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled: scala.Boolean, - livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled : scala.Boolean, + livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) - object OverwriteRoadTypeProperties { - case class LivingStreet( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object LivingStreet { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Minor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Motorway { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object MotorwayLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Primary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object PrimaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Residential { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Secondary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object SecondaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Tertiary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TertiaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Trunk { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TrunkLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Unclassified { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") - else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") - ), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - if (c.hasPathOrNull("minor")) c.getConfig("minor") - else com.typesafe.config.ConfigFactory.parseString("minor{}") - ), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - if (c.hasPathOrNull("motorway")) c.getConfig("motorway") - else com.typesafe.config.ConfigFactory.parseString("motorway{}") - ), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") - else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") - ), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - if (c.hasPathOrNull("primary")) c.getConfig("primary") - else com.typesafe.config.ConfigFactory.parseString("primary{}") - ), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") - else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") - ), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - if (c.hasPathOrNull("residential")) c.getConfig("residential") - else com.typesafe.config.ConfigFactory.parseString("residential{}") - ), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - if (c.hasPathOrNull("secondary")) c.getConfig("secondary") - else com.typesafe.config.ConfigFactory.parseString("secondary{}") - ), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") - else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") - ), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") - else com.typesafe.config.ConfigFactory.parseString("tertiary{}") - ), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") - else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") - ), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - if (c.hasPathOrNull("trunk")) c.getConfig("trunk") - else com.typesafe.config.ConfigFactory.parseString("trunk{}") - ), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") - else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") - ), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") - else com.typesafe.config.ConfigFactory.parseString("unclassified{}") - ) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( - if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") - else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") - ), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") - else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") - ) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) ) } } - + case class Parbprsim( - numberOfClusters: scala.Int, - syncInterval: scala.Int + numberOfClusters : scala.Int, + syncInterval : scala.Int ) - object Parbprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier: scala.Double, - enabled: scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime: scala.Int + additionalTravelTimeMultiplier : scala.Double, + enabled : scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime : scala.Int ) - object PickUpDropOffAnalysis { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = - if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") - else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = - if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) - c.getInt("secondsFromPickUpPropOffToAffectTravelTime") - else 600 + additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 ) } } - + case class Relaxation( - experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type`: java.lang.String + experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type` : java.lang.String ) - object Relaxation { - case class Experiment20( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment20 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment21 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment30 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment40 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment50 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment51 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment52 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( - if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") - else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") - ), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( - if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") - else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") - ), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( - if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") - else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") - ), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( - if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") - else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") - ), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( - if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") - else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") - ), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( - if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") - else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") - ), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( - if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") - else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") - ), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim( - if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") - else com.typesafe.config.ConfigFactory.parseString("bprsim{}") - ), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( - if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") - else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") - ), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( - if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") - else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") - ), - eventManager = BeamConfig.Beam.Physsim.EventManager( - if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") - else com.typesafe.config.ConfigFactory.parseString("eventManager{}") - ), - events = BeamConfig.Beam.Physsim.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - eventsForFullVersionOfVia = - !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = - !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = - if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") - else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( - if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") - else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") - ), - linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = - if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = - if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) - c.getDouble("maxLinkLengthToApplySpeedScalingFactor") - else 50.0, - name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - overwriteLinkParamPath = - if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim( - if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") - else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") - ), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") - else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") - ), - ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = - if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) - c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") - else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation( - if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") - else com.typesafe.config.ConfigFactory.parseString("relaxation{}") - ), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = - if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = - if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), + eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), + events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), + linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, + name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), + ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1: scala.Double, - ModuleProbability_2: scala.Double, - ModuleProbability_3: scala.Double, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - clearModes: BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation: scala.Double, - maxAgentPlanMemorySize: scala.Int + ModuleProbability_1 : scala.Double, + ModuleProbability_2 : scala.Double, + ModuleProbability_3 : scala.Double, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + clearModes : BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation : scala.Double, + maxAgentPlanMemorySize : scala.Int ) - object Replanning { - case class ClearModes( - iteration: scala.Int, - modes: scala.Option[scala.List[java.lang.String]], - strategy: java.lang.String + iteration : scala.Int, + modes : scala.Option[scala.List[java.lang.String]], + strategy : java.lang.String ) - object ClearModes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes( - if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") - else com.typesafe.config.ConfigFactory.parseString("clearModes{}") - ), - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getDouble("fractionOfIterationsToDisableInnovation") - else Double.PositiveInfinity, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim: BeamConfig.Beam.Router.Skim + skim : BeamConfig.Beam.Router.Skim ) - object Router { - case class Skim( - activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims: scala.Int, - origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval: scala.Int, - writeSkimsInterval: scala.Int + activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims : scala.Int, + origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval : scala.Int, + writeSkimsInterval : scala.Int ) - object Skim { - case class ActivitySimSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object ActivitySimSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object DriveTimeSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") - else "skimsTravelTimeObservedVsSimulated", - name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", + name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String, - poolingTravelTimeOveheadFactor: scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, - writeFullSkimsInterval: scala.Int + fileBaseName : java.lang.String, + name : java.lang.String, + poolingTravelTimeOveheadFactor : scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, + writeFullSkimsInterval : scala.Int ) - object OriginDestinationSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = - if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") - else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = - if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) - c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") - else 0, - writeFullSkimsInterval = - if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, + writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName: java.lang.String, - geoHierarchy: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + geoHierarchy : java.lang.String, + name : java.lang.String ) - object TazSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object TransitCrowdingSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") - else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") - ), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") - else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") - ), - keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") - else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") - ), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( - if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") - else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") - ), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") - else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") - ), - writeAggregatedSkimsInterval = - if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), + keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), + writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim( - if (c.hasPathOrNull("skim")) c.getConfig("skim") - else com.typesafe.config.ConfigFactory.parseString("skim{}") - ) + skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) ) } } - + case class Routing( - baseDate: java.lang.String, - carRouter: java.lang.String, - gh: BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS: scala.Int, - overrideNetworkTravelTimesUsingSkims: scala.Boolean, - r5: BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor: scala.Double, - startingIterationForTravelTimesMSA: scala.Int, - transitOnStreetNetwork: scala.Boolean, - writeRoutingStatistic: scala.Boolean + baseDate : java.lang.String, + carRouter : java.lang.String, + gh : BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS : scala.Int, + overrideNetworkTravelTimesUsingSkims : scala.Boolean, + r5 : BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor : scala.Double, + startingIterationForTravelTimesMSA : scala.Int, + transitOnStreetNetwork : scala.Boolean, + writeRoutingStatistic : scala.Boolean ) - object Routing { - case class Gh( - useAlternativeRoutes: scala.Boolean + useAlternativeRoutes : scala.Boolean ) - object Gh { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath: java.lang.String, - bikeLaneScaleFactor: scala.Double, - departureWindow: scala.Double, - directory: java.lang.String, - directory2: scala.Option[java.lang.String], - linkRadiusMeters: scala.Double, - mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples: scala.Int, - osmMapdbFile: java.lang.String, - travelTimeNoiseFraction: scala.Double + bikeLaneLinkIdsFilePath : java.lang.String, + bikeLaneScaleFactor : scala.Double, + departureWindow : scala.Double, + directory : java.lang.String, + directory2 : scala.Option[java.lang.String], + linkRadiusMeters : scala.Double, + mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples : scala.Int, + osmMapdbFile : java.lang.String, + travelTimeNoiseFraction : scala.Double ) - object R5 { - case class MNetBuilder( - fromCRS: java.lang.String, - toCRS: java.lang.String + fromCRS : java.lang.String, + toCRS : java.lang.String ) - object MNetBuilder { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike: scala.Int + bike : scala.Int ) - object MaxDistanceLimitByModeInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = - if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = - if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( - if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") - else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") - ), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") - ), - numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmMapdbFile = - if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") - else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = - if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), + numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh( - if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") - ), - minimumPossibleSkimBasedTravelTimeInS = - if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) - c.getInt("minimumPossibleSkimBasedTravelTimeInS") - else 60, - overrideNetworkTravelTimesUsingSkims = - c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( - "overrideNetworkTravelTimesUsingSkims" - ), - r5 = BeamConfig.Beam.Routing.R5( - if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") - ), - skimTravelTimesScalingFactor = - if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = - if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") - else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), + minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, + overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), + r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), + skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric: BeamConfig.Beam.Sim.Metric, - termination: BeamConfig.Beam.Sim.Termination + metric : BeamConfig.Beam.Sim.Metric, + termination : BeamConfig.Beam.Sim.Termination ) - object Sim { - case class Metric( - collector: BeamConfig.Beam.Sim.Metric.Collector + collector : BeamConfig.Beam.Sim.Metric.Collector ) - object Metric { - case class Collector( - influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics: java.lang.String + influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics : java.lang.String ) - object Collector { - case class InfluxDbSimulationMetricCollector( - connectionString: java.lang.String, - database: java.lang.String + connectionString : java.lang.String, + database : java.lang.String ) - object InfluxDbSimulationMetricCollector { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = - if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = - BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - if (c.hasPathOrNull("influxDbSimulationMetricCollector")) - c.getConfig("influxDbSimulationMetricCollector") - else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") - ), - metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), + metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector( - if (c.hasPathOrNull("collector")) c.getConfig("collector") - else com.typesafe.config.ConfigFactory.parseString("collector{}") - ) + collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) ) } } - + case class Termination( - criterionName: java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName : java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) - object Termination { - case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration: scala.Int, - minLastIteration: scala.Int, - relativeTolerance: scala.Double + maxLastIteration : scala.Int, + minLastIteration : scala.Int, + relativeTolerance : scala.Double ) - object TerminateAtRideHailFleetStoredElectricityConvergence { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = - if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = - BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) - c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") - else - com.typesafe.config.ConfigFactory - .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") - ) + criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric( - if (c.hasPathOrNull("metric")) c.getConfig("metric") - else com.typesafe.config.ConfigFactory.parseString("metric{}") - ), - termination = BeamConfig.Beam.Sim.Termination( - if (c.hasPathOrNull("termination")) c.getConfig("termination") - else com.typesafe.config.ConfigFactory.parseString("termination{}") - ) + metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), + termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) ) } } - + case class Spatial( - boundingBoxBuffer: scala.Int, - localCRS: java.lang.String + boundingBoxBuffer : scala.Int, + localCRS : java.lang.String ) - object Spatial { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear ) - object Urbansim { - case class BackgroundODSkimsCreator( - calculationTimeoutHours: scala.Int, - enabled: scala.Boolean, - maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes: scala.Int, - peakHours: scala.Option[scala.List[scala.Double]], - routerType: java.lang.String, - skimsGeoType: java.lang.String, - skimsKind: java.lang.String + calculationTimeoutHours : scala.Int, + enabled : scala.Boolean, + maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes : scala.Int, + peakHours : scala.Option[scala.List[scala.Double]], + routerType : java.lang.String, + skimsGeoType : java.lang.String, + skimsKind : java.lang.String ) - object BackgroundODSkimsCreator { - case class MaxTravelDistanceInMeters( - bike: scala.Int, - walk: scala.Int + bike : scala.Int, + walk : scala.Int ) - object MaxTravelDistanceInMeters { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive: scala.Boolean, - transit: scala.Boolean, - walk: scala.Boolean + drive : scala.Boolean, + transit : scala.Boolean, + walk : scala.Boolean ) - object ModesToBuild { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = - if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") - ), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") - else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") - ), - numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), + numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes: scala.Double, - bike: scala.Double, - car: scala.Double, - drive_transit: scala.Double, - walk: scala.Double, - walk_transit: scala.Double + allModes : scala.Double, + bike : scala.Double, + car : scala.Double, + drive_transit : scala.Double, + walk : scala.Double, + walk_transit : scala.Double ) - object FractionOfModesToClear { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") - else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") - ), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( - if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") - else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") - ) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) ) } } - + case class WarmStart( - path: java.lang.String, - prepareData: scala.Boolean, - samplePopulationIntegerFlag: scala.Int, - skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type`: java.lang.String + path : java.lang.String, + prepareData : scala.Boolean, + samplePopulationIntegerFlag : scala.Int, + skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type` : java.lang.String ) - object WarmStart { - case class SkimsFilePaths$Elm( - skimType: java.lang.String, - skimsFilePath: java.lang.String + skimType : java.lang.String, + skimsFilePath : java.lang.String ) - object SkimsFilePaths$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if (c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = - if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = - if (c.hasPathOrNull("skimsFilePaths")) - scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) - else None, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if(c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim( - if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") - else com.typesafe.config.ConfigFactory.parseString("agentsim{}") - ), - calibration = BeamConfig.Beam.Calibration( - if (c.hasPathOrNull("calibration")) c.getConfig("calibration") - else com.typesafe.config.ConfigFactory.parseString("calibration{}") - ), - cluster = BeamConfig.Beam.Cluster( - if (c.hasPathOrNull("cluster")) c.getConfig("cluster") - else com.typesafe.config.ConfigFactory.parseString("cluster{}") - ), - debug = BeamConfig.Beam.Debug( - if (c.hasPathOrNull("debug")) c.getConfig("debug") - else com.typesafe.config.ConfigFactory.parseString("debug{}") - ), - exchange = BeamConfig.Beam.Exchange( - if (c.hasPathOrNull("exchange")) c.getConfig("exchange") - else com.typesafe.config.ConfigFactory.parseString("exchange{}") - ), - experimental = BeamConfig.Beam.Experimental( - if (c.hasPathOrNull("experimental")) c.getConfig("experimental") - else com.typesafe.config.ConfigFactory.parseString("experimental{}") - ), - input = BeamConfig.Beam.Input( - if (c.hasPathOrNull("input")) c.getConfig("input") - else com.typesafe.config.ConfigFactory.parseString("input{}") - ), - inputDirectory = - if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger( - if (c.hasPathOrNull("logger")) c.getConfig("logger") - else com.typesafe.config.ConfigFactory.parseString("logger{}") - ), - metrics = BeamConfig.Beam.Metrics( - if (c.hasPathOrNull("metrics")) c.getConfig("metrics") - else com.typesafe.config.ConfigFactory.parseString("metrics{}") - ), - output = BeamConfig.Beam.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - outputs = BeamConfig.Beam.Outputs( - if (c.hasPathOrNull("outputs")) c.getConfig("outputs") - else com.typesafe.config.ConfigFactory.parseString("outputs{}") - ), - physsim = BeamConfig.Beam.Physsim( - if (c.hasPathOrNull("physsim")) c.getConfig("physsim") - else com.typesafe.config.ConfigFactory.parseString("physsim{}") - ), - replanning = BeamConfig.Beam.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - router = BeamConfig.Beam.Router( - if (c.hasPathOrNull("router")) c.getConfig("router") - else com.typesafe.config.ConfigFactory.parseString("router{}") - ), - routing = BeamConfig.Beam.Routing( - if (c.hasPathOrNull("routing")) c.getConfig("routing") - else com.typesafe.config.ConfigFactory.parseString("routing{}") - ), - sim = BeamConfig.Beam.Sim( - if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") - ), - spatial = BeamConfig.Beam.Spatial( - if (c.hasPathOrNull("spatial")) c.getConfig("spatial") - else com.typesafe.config.ConfigFactory.parseString("spatial{}") - ), - urbansim = BeamConfig.Beam.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart( - if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") - else com.typesafe.config.ConfigFactory.parseString("warmStart{}") - ) + actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), + calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), + cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), + debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), + exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), + experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), + input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), + inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), + metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), + output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), + physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), + replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), + routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), + sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), + spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), + urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) ) } } - + case class Matsim( - conversion: BeamConfig.Matsim.Conversion, - modules: BeamConfig.Matsim.Modules + conversion : BeamConfig.Matsim.Conversion, + modules : BeamConfig.Matsim.Modules ) - object Matsim { - case class Conversion( - defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles: scala.Boolean, - matsimNetworkFile: java.lang.String, - osmFile: java.lang.String, - populationFile: java.lang.String, - scenarioDirectory: java.lang.String, - shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile: java.lang.String + defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles : scala.Boolean, + matsimNetworkFile : java.lang.String, + osmFile : java.lang.String, + populationFile : java.lang.String, + scenarioDirectory : java.lang.String, + shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile : java.lang.String ) - object Conversion { - case class DefaultHouseholdIncome( - currency: java.lang.String, - period: java.lang.String, - value: scala.Int + currency : java.lang.String, + period : java.lang.String, + value : scala.Int ) - object DefaultHouseholdIncome { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if (c.hasPathOrNull("period")) c.getString("period") else "year", - value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if(c.hasPathOrNull("period")) c.getString("period") else "year", + value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile: java.lang.String, - tazIdFieldName: java.lang.String + shapeFile : java.lang.String, + tazIdFieldName : java.lang.String ) - object ShapeConfig { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") - else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") - ), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = - if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = - if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = - if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") - else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( - if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") - else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") - ), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode: BeamConfig.Matsim.Modules.ChangeMode, - controler: BeamConfig.Matsim.Modules.Controler, - counts: BeamConfig.Matsim.Modules.Counts, - global: BeamConfig.Matsim.Modules.Global, - households: BeamConfig.Matsim.Modules.Households, - linkStats: BeamConfig.Matsim.Modules.LinkStats, - network: BeamConfig.Matsim.Modules.Network, - parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, - plans: BeamConfig.Matsim.Modules.Plans, - qsim: BeamConfig.Matsim.Modules.Qsim, - strategy: BeamConfig.Matsim.Modules.Strategy, - transit: BeamConfig.Matsim.Modules.Transit, - vehicles: BeamConfig.Matsim.Modules.Vehicles + changeMode : BeamConfig.Matsim.Modules.ChangeMode, + controler : BeamConfig.Matsim.Modules.Controler, + counts : BeamConfig.Matsim.Modules.Counts, + global : BeamConfig.Matsim.Modules.Global, + households : BeamConfig.Matsim.Modules.Households, + linkStats : BeamConfig.Matsim.Modules.LinkStats, + network : BeamConfig.Matsim.Modules.Network, + parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, + plans : BeamConfig.Matsim.Modules.Plans, + qsim : BeamConfig.Matsim.Modules.Qsim, + strategy : BeamConfig.Matsim.Modules.Strategy, + transit : BeamConfig.Matsim.Modules.Transit, + vehicles : BeamConfig.Matsim.Modules.Vehicles ) - object Modules { - case class ChangeMode( - modes: java.lang.String + modes : java.lang.String ) - object ChangeMode { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat: java.lang.String, - firstIteration: scala.Int, - lastIteration: scala.Int, - mobsim: java.lang.String, - outputDirectory: java.lang.String, - overwriteFiles: java.lang.String + eventsFileFormat : java.lang.String, + firstIteration : scala.Int, + lastIteration : scala.Int, + mobsim : java.lang.String, + outputDirectory : java.lang.String, + overwriteFiles : java.lang.String ) - object Controler { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = - if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Double, - inputCountsFile: java.lang.String, - outputformat: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Double, + inputCountsFile : java.lang.String, + outputformat : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem: java.lang.String, - randomSeed: scala.Int + coordinateSystem : java.lang.String, + randomSeed : scala.Int ) - object Global { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile: java.lang.String, - inputHouseholdAttributesFile: java.lang.String + inputFile : java.lang.String, + inputHouseholdAttributesFile : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = - if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = - if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") - else "/test/input/beamville/householdAttributes.xml" + inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations: scala.Int, - writeLinkStatsInterval: scala.Int + averageLinkStatsOverIterations : scala.Int, + writeLinkStatsInterval : scala.Int ) - object LinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = - if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = - if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile: java.lang.String + inputNetworkFile : java.lang.String ) - object Network { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = - if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") - else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents: scala.Int, - numberOfThreads: scala.Int, - oneThreadPerHandler: scala.Boolean, - synchronizeOnSimSteps: scala.Boolean + estimatedNumberOfEvents : scala.Int, + numberOfThreads : scala.Int, + oneThreadPerHandler : scala.Boolean, + synchronizeOnSimSteps : scala.Boolean ) - object ParallelEventHandling { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = - if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta: scala.Long, - earlyDeparture: scala.Long, - lateArrival: scala.Long, - learningRate: scala.Long, - parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing: scala.Long, - traveling: scala.Long, - waiting: scala.Long, - writeExperiencedPlans: scala.Boolean + BrainExpBeta : scala.Long, + earlyDeparture : scala.Long, + lateArrival : scala.Long, + learningRate : scala.Long, + parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing : scala.Long, + traveling : scala.Long, + waiting : scala.Long, + writeExperiencedPlans : scala.Boolean ) - object PlanCalcScore { - case class Parameterset$Elm( - activityType: java.lang.String, - priority: scala.Int, - scoringThisActivityAtAll: scala.Boolean, - `type`: java.lang.String, - typicalDuration: java.lang.String, - typicalDurationScoreComputation: java.lang.String + activityType : java.lang.String, + priority : scala.Int, + scoringThisActivityAtAll : scala.Boolean, + `type` : java.lang.String, + typicalDuration : java.lang.String, + typicalDurationScoreComputation : java.lang.String ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = - !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = - if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") - else "uniform" + activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = - if (c.hasPathOrNull("BrainExpBeta")) - c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) - else 2, - earlyDeparture = - if (c.hasPathOrNull("earlyDeparture")) - c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, - lateArrival = - if (c.hasPathOrNull("lateArrival")) - c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) - else -18, - learningRate = - if (c.hasPathOrNull("learningRate")) - c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) - else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = - if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) - else 6, - traveling = - if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) - else -6, - waiting = - if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, + BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, + earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, + learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, + traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, + waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.PlanCalcScore - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Plans( - inputPersonAttributesFile: java.lang.String, - inputPlansFile: java.lang.String + inputPersonAttributesFile : java.lang.String, + inputPlansFile : java.lang.String ) - object Plans { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = - if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") - else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = - if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") - else "/test/input/beamville/population.xml" + inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime: java.lang.String, - snapshotperiod: java.lang.String, - startTime: java.lang.String + endTime : java.lang.String, + snapshotperiod : java.lang.String, + startTime : java.lang.String ) - object Qsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1: scala.Int, - ModuleProbability_2: scala.Int, - ModuleProbability_3: scala.Int, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - fractionOfIterationsToDisableInnovation: scala.Int, - maxAgentPlanMemorySize: scala.Int, - parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval: java.lang.String + ModuleProbability_1 : scala.Int, + ModuleProbability_2 : scala.Int, + ModuleProbability_3 : scala.Int, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + fractionOfIterationsToDisableInnovation : scala.Int, + maxAgentPlanMemorySize : scala.Int, + parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval : java.lang.String ) - object Strategy { - case class Parameterset$Elm( - disableAfterIteration: scala.Int, - strategyName: java.lang.String, - `type`: java.lang.String, - weight: scala.Int + disableAfterIteration : scala.Int, + strategyName : java.lang.String, + `type` : java.lang.String, + weight : scala.Int ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getInt("fractionOfIterationsToDisableInnovation") - else 999999, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = - if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") - else "WorstPlanForRemovalSelector" - ) - } - - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" + ) + } + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.Strategy - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Transit( - transitModes: java.lang.String, - useTransit: scala.Boolean, - vehiclesFile: java.lang.String + transitModes : java.lang.String, + useTransit : scala.Boolean, + vehiclesFile : java.lang.String ) - object Transit { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile: java.lang.String + vehiclesFile : java.lang.String ) - object Vehicles { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode( - if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") - else com.typesafe.config.ConfigFactory.parseString("changeMode{}") - ), - controler = BeamConfig.Matsim.Modules.Controler( - if (c.hasPathOrNull("controler")) c.getConfig("controler") - else com.typesafe.config.ConfigFactory.parseString("controler{}") - ), - counts = BeamConfig.Matsim.Modules.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - global = BeamConfig.Matsim.Modules.Global( - if (c.hasPathOrNull("global")) c.getConfig("global") - else com.typesafe.config.ConfigFactory.parseString("global{}") - ), - households = BeamConfig.Matsim.Modules.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - linkStats = BeamConfig.Matsim.Modules.LinkStats( - if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") - else com.typesafe.config.ConfigFactory.parseString("linkStats{}") - ), - network = BeamConfig.Matsim.Modules.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( - if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") - else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") - ), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( - if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") - else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") - ), - plans = BeamConfig.Matsim.Modules.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - qsim = BeamConfig.Matsim.Modules.Qsim( - if (c.hasPathOrNull("qsim")) c.getConfig("qsim") - else com.typesafe.config.ConfigFactory.parseString("qsim{}") - ), - strategy = BeamConfig.Matsim.Modules.Strategy( - if (c.hasPathOrNull("strategy")) c.getConfig("strategy") - else com.typesafe.config.ConfigFactory.parseString("strategy{}") - ), - transit = BeamConfig.Matsim.Modules.Transit( - if (c.hasPathOrNull("transit")) c.getConfig("transit") - else com.typesafe.config.ConfigFactory.parseString("transit{}") - ), - vehicles = BeamConfig.Matsim.Modules.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) + changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), + controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), + counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), + households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), + network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), + plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), + strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), + transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), + vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion( - if (c.hasPathOrNull("conversion")) c.getConfig("conversion") - else com.typesafe.config.ConfigFactory.parseString("conversion{}") - ), - modules = BeamConfig.Matsim.Modules( - if (c.hasPathOrNull("modules")) c.getConfig("modules") - else com.typesafe.config.ConfigFactory.parseString("modules{}") - ) + conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), + modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam( - if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") - ), - matsim = BeamConfig.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ) + beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), + matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) ) } - private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - - private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - - private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { + private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ( - (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number] - ) throw $_expE(cv, "double") + if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - - private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { + private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException( - cv.origin.lineNumber + + new java.lang.RuntimeException(cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) - ) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) } - - private def $_str(cv: com.typesafe.config.ConfigValue) = + private def $_str(cv:com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } + From 80c1ce96ae1e0a6873710bd2c483dc1971b638e6 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 7 Jun 2022 13:30:00 -0700 Subject: [PATCH 127/307] testing performance improvement --- build.gradle | 2 +- .../infrastructure/ChargingNetwork.scala | 2 +- .../ChargingNetworkManager.scala | 6 +- .../ChargingNetworkManagerHelper.scala | 2 +- .../power/PowerController.scala | 6 +- .../power/SitePowerManager.scala | 3 +- .../scala/beam/sim/config/BeamConfig.scala | 5563 +++++++++++------ .../power/PowerControllerSpec.scala | 4 +- 8 files changed, 3608 insertions(+), 1980 deletions(-) diff --git a/build.gradle b/build.gradle index 00e4717e40c..26afd93519d 100755 --- a/build.gradle +++ b/build.gradle @@ -539,7 +539,7 @@ def jfr = ["-XX:+UnlockCommercialFeatures", "-XX:+FlightRecorder", // On the running machine there should be file /usr/lib/jvm/java-8-oracle/jre/lib/jfr/profile_heap_exception.jfc with content from // https://pastebin.com/N3uuUfPz - it's Java Mission Control with metrics about heap allocation and details about exceptions def jfrWithMem = ["-XX:+UnlockCommercialFeatures", "-XX:+UnlockDiagnosticVMOptions", "-XX:+DebugNonSafepoints", - "-XX:StartFlightRecording=delay=2s,duration=60m,name=mem_ex,filename=recording.jfr,settings=profile_heap_exception", + "-XX:StartFlightRecording=delay=2s,duration=180m,name=mem_ex,filename=recording.jfr,settings=profile_heap_exception", "-XX:+FlightRecorder", "-XX:FlightRecorderOptions=disk=true,maxage=10h,dumponexit=true,loglevel=info"] diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 3781f7eb393..2a2b13f0bb7 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -245,7 +245,7 @@ object ChargingNetwork extends LazyLogging { zone.maxStalls - howManyVehiclesAreCharging - howManyVehiclesAreInGracePeriodAfterCharging private[ChargingNetwork] def connectedVehicles: Map[Id[BeamVehicle], ChargingVehicle] = - chargingVehiclesInternal.toMap + chargingVehiclesInternal.asInstanceOf[Map[Id[BeamVehicle], ChargingVehicle]] def howManyVehiclesAreWaiting: Int = waitingLineInternal.size def howManyVehiclesAreCharging: Int = chargingVehiclesInternal.size diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index f3a6e61bd98..3a59e66982a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -110,11 +110,9 @@ class ChargingNetworkManager( val s = System.currentTimeMillis log.debug(s"Planning energy dispatch for vehicles currently connected to a charging point, at t=$timeBin") val loadEstimate = sitePowerManager.requiredPowerInKWOverNextPlanningHorizon(timeBin) - log.debug("Total Load estimated is {} at tick {}", loadEstimate.values.sum, timeBin) val simulatedParkingInquiries = simulateEventsIfScalingEnabled(timeBin, triggerId) - log.debug("number of simulatedParkingInquiries is {} at tick {}", simulatedParkingInquiries.size, timeBin) // obtaining physical bounds - val physicalBounds = powerController.obtainPowerPhysicalBounds(timeBin, Some(loadEstimate)) + val physicalBounds = powerController.obtainPowerPhysicalBounds(timeBin, loadEstimate) val allConnectedVehicles = chargingNetwork.connectedVehicles ++ rideHailNetwork.connectedVehicles val triggers = allConnectedVehicles.par.flatMap { case (_, chargingVehicle) => // Refuel @@ -206,7 +204,7 @@ class ChargingNetworkManager( case ChargingUnplugRequest(tick, vehicle, triggerId) => log.debug(s"ChargingUnplugRequest received for vehicle $vehicle from plug ${vehicle.stall} at $tick") - val bounds = powerController.obtainPowerPhysicalBounds(tick, None) + val bounds = powerController.obtainPowerPhysicalBounds(tick) val responseHasTriggerId = vehicle.stall match { case Some(stall) => chargingNetworkHelper.get(stall.reservedFor.managerId).disconnectVehicle(vehicle.id, tick) match { diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index e0b5504c084..38c765ba3e8 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -138,7 +138,7 @@ trait ChargingNetworkManagerHelper extends { if (vehicle.stall.isEmpty) vehicle.useParkingStall(chargingVehicle.stall) log.debug(s"Starting charging for vehicle $vehicle at $tick") - val physicalBounds = powerController.obtainPowerPhysicalBounds(tick, None) + val physicalBounds = powerController.obtainPowerPhysicalBounds(tick) processStartChargingEvent(tick, chargingVehicle) dispatchEnergyAndProcessChargingCycle(chargingVehicle, tick, nextTick, physicalBounds, triggerId).foreach( getScheduler ! _ diff --git a/src/main/scala/beam/agentsim/infrastructure/power/PowerController.scala b/src/main/scala/beam/agentsim/infrastructure/power/PowerController.scala index d048015f259..928e753492b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/power/PowerController.scala +++ b/src/main/scala/beam/agentsim/infrastructure/power/PowerController.scala @@ -62,14 +62,14 @@ class PowerController(chargingNetworkHelper: ChargingNetworkHelper, beamConfig: */ def obtainPowerPhysicalBounds( currentTime: Int, - estimatedLoad: Option[Map[ChargingStation, PowerInKW]] = None + estimatedLoad: Seq[(ChargingStation, PowerInKW)] = Seq.empty ): Map[ChargingStation, PhysicalBounds] = { physicalBounds = beamFederateOption match { case Some(beamFederate) - if isConnectedToHelics && estimatedLoad.isDefined && (physicalBounds.isEmpty || currentBin < currentTime / timeStep) => + if isConnectedToHelics && estimatedLoad.nonEmpty && (physicalBounds.isEmpty || currentBin < currentTime / timeStep) => logger.debug("Sending power over next planning horizon to the grid at time {}...", currentTime) // PUBLISH - val msgToPublish = estimatedLoad.get.map { case (station, powerInKW) => + val msgToPublish = estimatedLoad.map { case (station, powerInKW) => Map( "reservedFor" -> station.zone.reservedFor, "parkingZoneId" -> station.zone.parkingZoneId, diff --git a/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala b/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala index b90b17caf58..fbea80fbcf2 100644 --- a/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala @@ -26,11 +26,10 @@ class SitePowerManager( * @param tick current time * @return power (in Kilo Watt) over planning horizon */ - def requiredPowerInKWOverNextPlanningHorizon(tick: Int): Map[ChargingStation, PowerInKW] = { + def requiredPowerInKWOverNextPlanningHorizon(tick: Int): Seq[(ChargingStation, PowerInKW)] = { val plans = chargingNetworkHelper.allChargingStations.par .map(station => station -> temporaryLoadEstimate.getOrElse(station, 0.0)) .seq - .toMap temporaryLoadEstimate.clear() if (plans.isEmpty) { logger.debug(s"Charging Replan did not produce allocations on tick: [$tick]") diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 26e9a647441..1662cc1bd41 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,3548 +3,5179 @@ package beam.sim.config case class BeamConfig( - beam : BeamConfig.Beam, - matsim : BeamConfig.Matsim + beam: BeamConfig.Beam, + matsim: BeamConfig.Matsim ) + object BeamConfig { + case class Beam( - actorSystemName : java.lang.String, - agentsim : BeamConfig.Beam.Agentsim, - calibration : BeamConfig.Beam.Calibration, - cluster : BeamConfig.Beam.Cluster, - debug : BeamConfig.Beam.Debug, - exchange : BeamConfig.Beam.Exchange, - experimental : BeamConfig.Beam.Experimental, - input : BeamConfig.Beam.Input, - inputDirectory : java.lang.String, - logger : BeamConfig.Beam.Logger, - metrics : BeamConfig.Beam.Metrics, - output : BeamConfig.Beam.Output, - outputs : BeamConfig.Beam.Outputs, - physsim : BeamConfig.Beam.Physsim, - replanning : BeamConfig.Beam.Replanning, - router : BeamConfig.Beam.Router, - routing : BeamConfig.Beam.Routing, - sim : BeamConfig.Beam.Sim, - spatial : BeamConfig.Beam.Spatial, - urbansim : BeamConfig.Beam.Urbansim, - useLocalWorker : scala.Boolean, - warmStart : BeamConfig.Beam.WarmStart + actorSystemName: java.lang.String, + agentsim: BeamConfig.Beam.Agentsim, + calibration: BeamConfig.Beam.Calibration, + cluster: BeamConfig.Beam.Cluster, + debug: BeamConfig.Beam.Debug, + exchange: BeamConfig.Beam.Exchange, + experimental: BeamConfig.Beam.Experimental, + input: BeamConfig.Beam.Input, + inputDirectory: java.lang.String, + logger: BeamConfig.Beam.Logger, + metrics: BeamConfig.Beam.Metrics, + output: BeamConfig.Beam.Output, + outputs: BeamConfig.Beam.Outputs, + physsim: BeamConfig.Beam.Physsim, + replanning: BeamConfig.Beam.Replanning, + router: BeamConfig.Beam.Router, + routing: BeamConfig.Beam.Routing, + sim: BeamConfig.Beam.Sim, + spatial: BeamConfig.Beam.Spatial, + urbansim: BeamConfig.Beam.Urbansim, + useLocalWorker: scala.Boolean, + warmStart: BeamConfig.Beam.WarmStart ) + object Beam { + case class Agentsim( - agentSampleSizeAsFractionOfPopulation : scala.Double, - agents : BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime : java.lang.String, - firstIteration : scala.Int, - fractionOfPlansWithSingleActivity : scala.Double, - h3taz : BeamConfig.Beam.Agentsim.H3taz, - lastIteration : scala.Int, - populationAdjustment : java.lang.String, - randomSeedForPopulationSampling : scala.Option[scala.Int], - scenarios : BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow : scala.Int, - simulationName : java.lang.String, - snapLocationAndRemoveInvalidInputs : scala.Boolean, - taz : BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters : scala.Int, - thresholdForWalkingInMeters : scala.Int, - timeBinSize : scala.Int, - toll : BeamConfig.Beam.Agentsim.Toll, - tuning : BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation: scala.Double, + agents: BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime: java.lang.String, + firstIteration: scala.Int, + fractionOfPlansWithSingleActivity: scala.Double, + h3taz: BeamConfig.Beam.Agentsim.H3taz, + lastIteration: scala.Int, + populationAdjustment: java.lang.String, + randomSeedForPopulationSampling: scala.Option[scala.Int], + scenarios: BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow: scala.Int, + simulationName: java.lang.String, + snapLocationAndRemoveInvalidInputs: scala.Boolean, + taz: BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters: scala.Int, + thresholdForWalkingInMeters: scala.Int, + timeBinSize: scala.Int, + toll: BeamConfig.Beam.Agentsim.Toll, + tuning: BeamConfig.Beam.Agentsim.Tuning ) + object Agentsim { + case class Agents( - activities : BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType : java.lang.String, - freight : BeamConfig.Beam.Agentsim.Agents.Freight, - households : BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking : BeamConfig.Beam.Agentsim.Agents.Parking, - plans : BeamConfig.Beam.Agentsim.Agents.Plans, - population : BeamConfig.Beam.Agentsim.Agents.Population, - ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles + activities: BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType: java.lang.String, + freight: BeamConfig.Beam.Agentsim.Agents.Freight, + households: BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking: BeamConfig.Beam.Agentsim.Agents.Parking, + plans: BeamConfig.Beam.Agentsim.Agents.Plans, + population: BeamConfig.Beam.Agentsim.Agents.Population, + ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles ) + object Agents { + case class Activities( - activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] ) + object Activities { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None + activityTypeToFixedDurationMap = + if (c.hasPathOrNull("activityTypeToFixedDurationMap")) + scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) + else None ) } } - + case class Freight( - carrierParkingFilePath : scala.Option[java.lang.String], - carriersFilePath : java.lang.String, - convertWgs2Utm : scala.Boolean, - enabled : scala.Boolean, - generateFixedActivitiesDurations : scala.Boolean, - name : java.lang.String, - plansFilePath : java.lang.String, - reader : java.lang.String, - replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath : java.lang.String + carrierParkingFilePath: scala.Option[java.lang.String], + carriersFilePath: java.lang.String, + convertWgs2Utm: scala.Boolean, + enabled: scala.Boolean, + generateFixedActivitiesDurations: scala.Boolean, + name: java.lang.String, + plansFilePath: java.lang.String, + reader: java.lang.String, + replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath: java.lang.String ) + object Freight { + case class Replanning( - departureTime : scala.Int, - disableAfterIteration : scala.Int, - strategy : java.lang.String + departureTime: scala.Int, + disableAfterIteration: scala.Int, + strategy: java.lang.String ) + object Replanning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", - reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = + if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = + if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") + else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = + c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = + if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") + else "/test/input/beamville/freight/payload-plans.csv", + reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + toursFilePath = + if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") + else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath : java.lang.String, - inputHouseholdAttributesFilePath : java.lang.String + inputFilePath: java.lang.String, + inputHouseholdAttributesFilePath: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = + if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") + else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = + if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") + else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - defaultValueOfTime : scala.Double, - highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts : scala.Int, - minimumValueOfTime : scala.Double, - modeChoiceClass : java.lang.String, - modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, - overrideAutomationForVOTT : scala.Boolean, - overrideAutomationLevel : scala.Int, - poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] + defaultValueOfTime: scala.Double, + highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts: scala.Int, + minimumValueOfTime: scala.Double, + modeChoiceClass: java.lang.String, + modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + overrideAutomationForVOTT: scala.Boolean, + overrideAutomationLevel: scala.Int, + poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] ) + object ModalBehaviors { + case class HighTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) + object HighTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class Lccm( - filePath : java.lang.String + filePath: java.lang.String ) + object Lccm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) + object LowTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class ModeVotMultiplier( - CAV : scala.Double, - bike : scala.Double, - drive : scala.Double, - rideHail : scala.Double, - rideHailPooled : scala.Double, - rideHailTransit : scala.Double, - transit : scala.Double, - waiting : scala.Double, - walk : scala.Double + CAV: scala.Double, + bike: scala.Double, + drive: scala.Double, + rideHail: scala.Double, + rideHailPooled: scala.Double, + rideHailTransit: scala.Double, + transit: scala.Double, + waiting: scala.Double, + walk: scala.Double ) + object ModeVotMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, - utility_scale_factor : scala.Double + params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + utility_scale_factor: scala.Double ) + object MulitnomialLogit { + case class Params( - bike_intercept : scala.Double, - bike_transit_intercept : scala.Double, - car_intercept : scala.Double, - cav_intercept : scala.Double, - drive_transit_intercept : scala.Double, - ride_hail_intercept : scala.Double, - ride_hail_pooled_intercept : scala.Double, - ride_hail_transit_intercept : scala.Double, - transfer : scala.Double, - transit_crowding : scala.Double, - transit_crowding_VOT_multiplier : scala.Double, - transit_crowding_VOT_threshold : scala.Double, - transit_crowding_percentile : scala.Double, - walk_intercept : scala.Double, - walk_transit_intercept : scala.Double + bike_intercept: scala.Double, + bike_transit_intercept: scala.Double, + car_intercept: scala.Double, + cav_intercept: scala.Double, + drive_transit_intercept: scala.Double, + ride_hail_intercept: scala.Double, + ride_hail_pooled_intercept: scala.Double, + ride_hail_transit_intercept: scala.Double, + transfer: scala.Double, + transit_crowding: scala.Double, + transit_crowding_VOT_multiplier: scala.Double, + transit_crowding_VOT_threshold: scala.Double, + transit_crowding_percentile: scala.Double, + walk_intercept: scala.Double, + walk_transit_intercept: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( - bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, - ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, - transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, - transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, - transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, - walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = + if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = + if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = + if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = + if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") + else 0.0, + ride_hail_transit_intercept = + if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") + else 0.0, + transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = + if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) + c.getDouble("transit_crowding_VOT_multiplier") + else 0.0, + transit_crowding_VOT_threshold = + if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") + else 0.5, + transit_crowding_percentile = + if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") + else 90.0, + walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = + if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), - utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ), + utility_scale_factor = + if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object PoolingMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), - maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, - minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), - transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None - ) - } - } - + defaultValueOfTime = + if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( + if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") + ), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( + if (c.hasPathOrNull("lccm")) c.getConfig("lccm") + else com.typesafe.config.ConfigFactory.parseString("lccm{}") + ), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( + if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") + ), + maximumNumberOfReplanningAttempts = + if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") + else 3, + minimumValueOfTime = + if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = + if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") + else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( + if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") + else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + overrideAutomationForVOTT = + c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = + if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( + if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") + else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") + ), + transitVehicleTypeVOTMultipliers = + if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) + scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) + else None + ) + } + } + case class ModeIncentive( - filePath : java.lang.String + filePath: java.lang.String ) + object ModeIncentive { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - estimatedMinParkingDurationInSeconds : scala.Double, - fractionOfSameTypeZones : scala.Double, - maxSearchRadius : scala.Double, - minNumberOfSameTypeZones : scala.Int, - minSearchRadius : scala.Double, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, - overnightChargingSampleSize : scala.Double, - rangeAnxietyBuffer : scala.Double, - searchMaxDistanceRelativeToEllipseFoci : scala.Double + estimatedMinParkingDurationInSeconds: scala.Double, + fractionOfSameTypeZones: scala.Double, + maxSearchRadius: scala.Double, + minNumberOfSameTypeZones: scala.Int, + minSearchRadius: scala.Double, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + overnightChargingSampleSize: scala.Double, + rangeAnxietyBuffer: scala.Double, + searchMaxDistanceRelativeToEllipseFoci: scala.Double ) + object Parking { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - distanceMultiplier : scala.Double, - enrouteDetourMultiplier : scala.Double, - homeActivityPrefersResidentialParkingMultiplier : scala.Double, - parkingPriceMultiplier : scala.Double, - rangeAnxietyMultiplier : scala.Double + distanceMultiplier: scala.Double, + enrouteDetourMultiplier: scala.Double, + homeActivityPrefersResidentialParkingMultiplier: scala.Double, + parkingPriceMultiplier: scala.Double, + rangeAnxietyMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( - distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else -0.05, - homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, - parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = + if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = + if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else -0.05, + homeActivityPrefersResidentialParkingMultiplier = + if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) + c.getDouble("homeActivityPrefersResidentialParkingMultiplier") + else 1.0, + parkingPriceMultiplier = + if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = + if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - estimatedMinParkingDurationInSeconds = if(c.hasPathOrNull("estimatedMinParkingDurationInSeconds")) c.getDouble("estimatedMinParkingDurationInSeconds") else 60.0, - fractionOfSameTypeZones = if(c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, - maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minNumberOfSameTypeZones = if(c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, - minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")), - overnightChargingSampleSize = if(c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0, - rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 + estimatedMinParkingDurationInSeconds = + if (c.hasPathOrNull("estimatedMinParkingDurationInSeconds")) + c.getDouble("estimatedMinParkingDurationInSeconds") + else 60.0, + fractionOfSameTypeZones = + if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, + maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minNumberOfSameTypeZones = + if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, + minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ), + overnightChargingSampleSize = + if (c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0, + rangeAnxietyBuffer = + if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = + if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) + c.getDouble("searchMaxDistanceRelativeToEllipseFoci") + else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath : java.lang.String, - inputPlansFilePath : java.lang.String, - merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath: java.lang.String, + inputPlansFilePath: java.lang.String, + merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) + object Plans { + case class Merge( - fraction : scala.Double + fraction: scala.Double ) + object Merge { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) + inputPersonAttributesFilePath = + if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") + else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = + if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") + else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( + if (c.hasPathOrNull("merge")) c.getConfig("merge") + else com.typesafe.config.ConfigFactory.parseString("merge{}") + ) ) } } - + case class Population( - industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling : scala.Boolean + industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling: scala.Boolean ) + object Population { + case class IndustryRemovalProbabilty( - enabled : scala.Boolean, - inputFilePath : java.lang.String, - removalStrategy : java.lang.String + enabled: scala.Boolean, + inputFilePath: java.lang.String, + removalStrategy: java.lang.String ) + object IndustryRemovalProbabilty { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = + if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( + if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") + else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") + ), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath : java.lang.String + filePath: java.lang.String ) + object PtFare { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost : scala.Double, - defaultCostPerMile : scala.Double, - defaultCostPerMinute : scala.Double, - human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations : scala.Boolean, - name : java.lang.String, - pooledBaseCost : scala.Double, - pooledCostPerMile : scala.Double, - pooledCostPerMinute : scala.Double, - rangeBufferForDispatchInMeters : scala.Int, - repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost: scala.Double, + defaultCostPerMile: scala.Double, + defaultCostPerMinute: scala.Double, + human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations: scala.Boolean, + name: java.lang.String, + pooledBaseCost: scala.Double, + pooledCostPerMile: scala.Double, + pooledCostPerMinute: scala.Double, + rangeBufferForDispatchInMeters: scala.Int, + repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) + object RideHail { + case class AllocationManager( - alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm : java.lang.String, - maxExcessRideTime : scala.Double, - maxWaitingTimeInSec : scala.Int, - name : java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, - repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds : scala.Int + alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm: java.lang.String, + maxExcessRideTime: scala.Double, + maxWaitingTimeInSec: scala.Int, + name: java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, + repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds: scala.Int ) + object AllocationManager { + case class AlonsoMora( - maxRequestsPerVehicle : scala.Int + maxRequestsPerVehicle: scala.Int ) + object AlonsoMora { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = + if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, - demandWeight : scala.Double, - distanceWeight : scala.Double, - keepMaxTopNScores : scala.Int, - minDemandPercentageInRadius : scala.Double, - minScoreThresholdForRepositioning : scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, - percentageOfVehiclesToReposition : scala.Double, - produceDebugImages : scala.Boolean, - repositionCircleRadiusInMeters : scala.Double, - repositioningMethod : java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, - waitingTimeWeight : scala.Double + allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, + demandWeight: scala.Double, + distanceWeight: scala.Double, + keepMaxTopNScores: scala.Int, + minDemandPercentageInRadius: scala.Double, + minScoreThresholdForRepositioning: scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, + percentageOfVehiclesToReposition: scala.Double, + produceDebugImages: scala.Boolean, + repositionCircleRadiusInMeters: scala.Double, + repositioningMethod: java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, + waitingTimeWeight: scala.Double ) + object RepositionLowWaitingTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, - minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, - percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, - repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, - waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( + "allowIncreasingRadiusIfDemandInRadiusLow" + ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = + if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") + else 0.1, + minScoreThresholdForRepositioning = + if (c.hasPathOrNull("minScoreThresholdForRepositioning")) + c.getDouble("minScoreThresholdForRepositioning") + else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = + if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) + c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") + else 1, + percentageOfVehiclesToReposition = + if (c.hasPathOrNull("percentageOfVehiclesToReposition")) + c.getDouble("percentageOfVehiclesToReposition") + else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = + if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") + else 3000, + repositioningMethod = + if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = + if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) + c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") + else 1200, + waitingTimeWeight = + if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), - matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, - repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), - requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( + if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") + else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") + ), + matchingAlgorithm = + if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") + else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = + if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = + if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) + c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") + else 1, + repositionLowWaitingTimes = + BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( + if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") + else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") + ), + requestBufferTimeoutInSeconds = + if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Int ) + object Cav { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 16090, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) + object Charging { + case class VehicleChargingManager( - defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager ) + object VehicleChargingManager { + case class DefaultVehicleChargingManager( - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit ) + object DefaultVehicleChargingManager { + case class MulitnomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params ) + object MulitnomialLogit { + case class Params( - chargingTimeMultiplier : scala.Double, - drivingTimeMultiplier : scala.Double, - insufficientRangeMultiplier : scala.Double, - queueingTimeMultiplier : scala.Double + chargingTimeMultiplier: scala.Double, + drivingTimeMultiplier: scala.Double, + insufficientRangeMultiplier: scala.Double, + queueingTimeMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params( - chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, - drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, - insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, - queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + chargingTimeMultiplier = + if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") + else -0.01666667, + drivingTimeMultiplier = + if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") + else -0.01666667, + insufficientRangeMultiplier = + if (c.hasPathOrNull("insufficientRangeMultiplier")) + c.getDouble("insufficientRangeMultiplier") + else -60.0, + queueingTimeMultiplier = + if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") + else -0.01666667 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + params = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + .Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + mulitnomialLogit = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")) + defaultVehicleChargingManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + if (c.hasPathOrNull("defaultVehicleChargingManager")) + c.getConfig("defaultVehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( + if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") + ) ) } } - + case class Human( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int ) + object Human { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180 ) } } - + case class Initialization( - filePath : java.lang.String, - initType : java.lang.String, - parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath: java.lang.String, + initType: java.lang.String, + parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) + object Initialization { + case class Parking( - filePath : java.lang.String + filePath: java.lang.String ) + object Parking { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet : scala.Double, - initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId : java.lang.String, - vehicleTypePrefix : java.lang.String + fractionOfInitialVehicleFleet: scala.Double, + initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId: java.lang.String, + vehicleTypePrefix: java.lang.String ) + object Procedural { + case class InitialLocation( - home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name : java.lang.String + home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name: java.lang.String ) + object InitialLocation { + case class Home( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object Home { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( + if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") + else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") + ), + vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = + if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( + if (c.hasPathOrNull("procedural")) c.getConfig("procedural") + else com.typesafe.config.ConfigFactory.parseString("procedural{}") + ) ) } } - + case class IterationStats( - timeBinSizeInSec : scala.Double + timeBinSizeInSec: scala.Double ) + object IterationStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name : java.lang.String, - timeout : scala.Int + demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name: java.lang.String, + timeout: scala.Int ) + object RepositioningManager { + case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider : scala.Double, - horizon : scala.Int, - numberOfClustersForDemand : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDemandForCAVs : scala.Double + fractionOfClosestClustersToConsider: scala.Double, + horizon: scala.Int, + numberOfClustersForDemand: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDemandForCAVs: scala.Double ) + object DemandFollowingRepositioningManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, - horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, - sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 + fractionOfClosestClustersToConsider = + if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) + c.getDouble("fractionOfClosestClustersToConsider") + else 0.2, + horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = + if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 1, + sensitivityOfRepositioningToDemandForCAVs = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) + c.getDouble("sensitivityOfRepositioningToDemandForCAVs") + else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDistance : scala.Double + predictionHorizon: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDistance: scala.Double ) + object InverseSquareDistanceRepositioningFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, - sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 + predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 0.4, + sensitivityOfRepositioningToDistance = + if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) + c.getDouble("sensitivityOfRepositioningToDistance") + else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( + if (c.hasPathOrNull("demandFollowingRepositioningManager")) + c.getConfig("demandFollowingRepositioningManager") + else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") + ), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager + .InverseSquareDistanceRepositioningFactor( + if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) + c.getConfig("inverseSquareDistanceRepositioningFactor") + else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object RideHailManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel : scala.Double, - numberOfCategories : scala.Int, - priceAdjustmentStrategy : java.lang.String, - surgeLevelAdaptionStep : scala.Double + minimumSurgeLevel: scala.Double, + numberOfCategories: scala.Int, + priceAdjustmentStrategy: java.lang.String, + surgeLevelAdaptionStep: scala.Double ) + object SurgePricing { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = + if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") + else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = + if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), - defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), - linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( + if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") + else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") + ), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( + if (c.hasPathOrNull("cav")) c.getConfig("cav") + else com.typesafe.config.ConfigFactory.parseString("cav{}") + ), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( + if (c.hasPathOrNull("charging")) c.getConfig("charging") + else com.typesafe.config.ConfigFactory.parseString("charging{}") + ), + defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = + if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = + if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( + if (c.hasPathOrNull("human")) c.getConfig("human") + else com.typesafe.config.ConfigFactory.parseString("human{}") + ), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( + if (c.hasPathOrNull("initialization")) c.getConfig("initialization") + else com.typesafe.config.ConfigFactory.parseString("initialization{}") + ), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( + if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") + else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") + ), + linkFleetStateAcrossIterations = + c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = + if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + rangeBufferForDispatchInMeters = + if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") + else 10000, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( + if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") + else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") + ), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( + if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") + else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") + ), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( + if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") + else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") + ) + ) + } + } + case class RideHailTransit( - modesToConsider : java.lang.String + modesToConsider: java.lang.String ) + object RideHailTransit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit ) + object TripBehaviors { + case class CarUsage( - minDistanceToTrainStop : scala.Double + minDistanceToTrainStop: scala.Double ) + object CarUsage { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = + if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MulitnomialLogit( - activity_file_path : java.lang.String, - additional_trip_utility : scala.Double, - destination_nest_scale_factor : scala.Double, - generate_secondary_activities : scala.Boolean, - intercept_file_path : java.lang.String, - max_destination_choice_set_size : scala.Int, - max_destination_distance_meters : scala.Double, - mode_nest_scale_factor : scala.Double, - trip_nest_scale_factor : scala.Double + activity_file_path: java.lang.String, + additional_trip_utility: scala.Double, + destination_nest_scale_factor: scala.Double, + generate_secondary_activities: scala.Boolean, + intercept_file_path: java.lang.String, + max_destination_choice_set_size: scala.Int, + max_destination_distance_meters: scala.Double, + mode_nest_scale_factor: scala.Double, + trip_nest_scale_factor: scala.Double ) + object MulitnomialLogit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, - generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, - max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, - mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = + if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = + if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = + if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") + else 1.0, + generate_secondary_activities = + c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = + if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = + if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") + else 20, + max_destination_distance_meters = + if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") + else 32000, + mode_nest_scale_factor = + if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = + if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit(if(c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}")) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( + if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") + else com.typesafe.config.ConfigFactory.parseString("carUsage{}") + ), + mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( + if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") + else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + ) ) } } - + case class Vehicles( - destination : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination, - downsamplingMethod : java.lang.String, - dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet : scala.Double, - fractionOfPeopleWithBicycle : scala.Double, - fuelTypesFilePath : java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, - linkSocAcrossIterations : scala.Boolean, - linkToGradePercentFilePath : java.lang.String, - meanPrivateVehicleStartingSOC : scala.Double, - meanRidehailVehicleStartingSOC : scala.Double, - sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile : java.lang.String, - vehicleAdjustmentMethod : java.lang.String, - vehicleTypesFilePath : java.lang.String, - vehiclesFilePath : java.lang.String + destination: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination, + downsamplingMethod: java.lang.String, + dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet: scala.Double, + fractionOfPeopleWithBicycle: scala.Double, + fuelTypesFilePath: java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, + linkSocAcrossIterations: scala.Boolean, + linkToGradePercentFilePath: java.lang.String, + meanPrivateVehicleStartingSOC: scala.Double, + meanRidehailVehicleStartingSOC: scala.Double, + sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile: java.lang.String, + vehicleAdjustmentMethod: java.lang.String, + vehicleTypesFilePath: java.lang.String, + vehiclesFilePath: java.lang.String ) + object Vehicles { + case class Destination( - home : BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home, - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Double + home: BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home, + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Double ) + object Destination { + case class Home( - refuelRequiredThresholdInMeters : scala.Double + refuelRequiredThresholdInMeters: scala.Double ) + object Home { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getDouble("refuelRequiredThresholdInMeters") else 128747.6 + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) + c.getDouble("refuelRequiredThresholdInMeters") + else 128747.6 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( - home = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getDouble("refuelRequiredThresholdInMeters") else 64373.8 + home = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getDouble("refuelRequiredThresholdInMeters") + else 64373.8 ) } } - + case class DummySharedBike( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedBike { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedCar { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond : scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, - noRefuelThresholdOffsetInMeters : scala.Double, - refuelRequiredThresholdOffsetInMeters : scala.Int, - remainingDistanceWrtBatteryCapacityThreshold : scala.Int + estimateOfMeanChargingDurationInSecond: scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, + noRefuelThresholdOffsetInMeters: scala.Double, + refuelRequiredThresholdOffsetInMeters: scala.Int, + remainingDistanceWrtBatteryCapacityThreshold: scala.Int ) + object Enroute { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, - noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, - refuelRequiredThresholdOffsetInMeters = if(c.hasPathOrNull("refuelRequiredThresholdOffsetInMeters")) c.getInt("refuelRequiredThresholdOffsetInMeters") else 0, - remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 + estimateOfMeanChargingDurationInSecond = + if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) + c.getInt("estimateOfMeanChargingDurationInSecond") + else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = + if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) + c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") + else 500, + noRefuelThresholdOffsetInMeters = + if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") + else 32186.9, + refuelRequiredThresholdOffsetInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdOffsetInMeters")) + c.getInt("refuelRequiredThresholdOffsetInMeters") + else 0, + remainingDistanceWrtBatteryCapacityThreshold = + if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) + c.getInt("remainingDistanceWrtBatteryCapacityThreshold") + else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], - fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], - inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], - managerType : java.lang.String, - name : java.lang.String, - parkingFilePath : java.lang.String, - reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving + ], + fixed_non_reserving_fleet_by_taz: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz + ], + inexhaustible_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving + ], + managerType: java.lang.String, + name: java.lang.String, + parkingFilePath: java.lang.String, + reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) + object SharedFleets$Elm { + case class FixedNonReserving( - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String ) + object FixedNonReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize : scala.Int, - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String, - vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] + fleetSize: scala.Int, + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String, + vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] ) + object FixedNonReservingFleetByTaz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None + fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = + if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) + else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object InexhaustibleReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], - name : java.lang.String, - repositionTimeBin : scala.Int, - statTimeBin : scala.Int + min_availability_undersupply_algorithm: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm + ], + name: java.lang.String, + repositionTimeBin: scala.Int, + statTimeBin: scala.Int ) + object Reposition { + case class MinAvailabilityUndersupplyAlgorithm( - matchLimit : scala.Int + matchLimit: scala.Int ) + object MinAvailabilityUndersupplyAlgorithm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( - matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm( + matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = + if (c.hasPathOrNull("min-availability-undersupply-algorithm")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) + ) + else None, + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, - fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, - inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, - managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None + fixed_non_reserving = + if (c.hasPathOrNull("fixed-non-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReserving(c.getConfig("fixed-non-reserving")) + ) + else None, + fixed_non_reserving_fleet_by_taz = + if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) + ) + else None, + inexhaustible_reserving = + if (c.hasPathOrNull("inexhaustible-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) + ) + else None, + managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = + if (c.hasPathOrNull("reposition")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) + ) + else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - destination = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination(if(c.hasPathOrNull("destination")) c.getConfig("destination") else com.typesafe.config.ConfigFactory.parseString("destination{}")), - downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, - fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, - meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", - vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" - ) - } - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + destination = BeamConfig.Beam.Agentsim.Agents.Vehicles.Destination( + if (c.hasPathOrNull("destination")) c.getConfig("destination") + else com.typesafe.config.ConfigFactory.parseString("destination{}") + ), + downsamplingMethod = + if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") + else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( + if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") + else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") + ), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( + if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") + else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") + ), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( + if (c.hasPathOrNull("enroute")) c.getConfig("enroute") + else com.typesafe.config.ConfigFactory.parseString("enroute{}") + ), + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 1.0, + fractionOfPeopleWithBicycle = + if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = + if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") + else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( + "generateEmergencyHouseholdVehicleWhenPlansRequireIt" + ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = + c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = + if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = + if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") + else 1.0, + meanRidehailVehicleStartingSOC = + if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") + else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = + if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") + else "", + vehicleAdjustmentMethod = + if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = + if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") + else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = + if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") + else "/test/input/beamville/vehicles.csv" + ) + } + + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Agentsim.Agents.Vehicles + .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), - bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), - households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), - parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities( + if (c.hasPathOrNull("activities")) c.getConfig("activities") + else com.typesafe.config.ConfigFactory.parseString("activities{}") + ), + bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight( + if (c.hasPathOrNull("freight")) c.getConfig("freight") + else com.typesafe.config.ConfigFactory.parseString("freight{}") + ), + households = BeamConfig.Beam.Agentsim.Agents.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( + if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") + else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") + ), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( + if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") + else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") + ), + parking = BeamConfig.Beam.Agentsim.Agents.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + plans = BeamConfig.Beam.Agentsim.Agents.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + population = BeamConfig.Beam.Agentsim.Agents.Population( + if (c.hasPathOrNull("population")) c.getConfig("population") + else com.typesafe.config.ConfigFactory.parseString("population{}") + ), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( + if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") + else com.typesafe.config.ConfigFactory.parseString("ptFare{}") + ), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( + if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") + else com.typesafe.config.ConfigFactory.parseString("rideHail{}") + ), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( + if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") + else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") + ), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( + if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") + else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") + ), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor : scala.Double, - chargingPointCountScalingFactor : scala.Double, - chargingPointFilePath : java.lang.String, - helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - maxChargingSessionsInSeconds : scala.Int, - overnightChargingEnabled : scala.Boolean, - scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds : scala.Int + chargingPointCostScalingFactor: scala.Double, + chargingPointCountScalingFactor: scala.Double, + chargingPointFilePath: java.lang.String, + helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + maxChargingSessionsInSeconds: scala.Int, + overnightChargingEnabled: scala.Boolean, + scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds: scala.Int ) + object ChargingNetworkManager { + case class Helics( - bufferSize : scala.Int, - connectionEnabled : scala.Boolean, - coreInitString : java.lang.String, - coreType : java.lang.String, - dataInStreamPoint : java.lang.String, - dataOutStreamPoint : java.lang.String, - federateName : java.lang.String, - feedbackEnabled : scala.Boolean, - intLogLevel : scala.Int, - timeDeltaProperty : scala.Double + bufferSize: scala.Int, + connectionEnabled: scala.Boolean, + coreInitString: java.lang.String, + coreType: java.lang.String, + dataInStreamPoint: java.lang.String, + dataOutStreamPoint: java.lang.String, + federateName: java.lang.String, + feedbackEnabled: scala.Boolean, + intLogLevel: scala.Int, + timeDeltaProperty: scala.Double ) + object Helics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", - dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = + if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") + else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = + if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") + else "GridFed/PhysicalBounds", + dataOutStreamPoint = + if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled : scala.Boolean, - expansionFactor_charge_activity : scala.Double, - expansionFactor_home_activity : scala.Double, - expansionFactor_init_activity : scala.Double, - expansionFactor_wherever_activity : scala.Double, - expansionFactor_work_activity : scala.Double + enabled: scala.Boolean, + expansionFactor_charge_activity: scala.Double, + expansionFactor_home_activity: scala.Double, + expansionFactor_init_activity: scala.Double, + expansionFactor_wherever_activity: scala.Double, + expansionFactor_work_activity: scala.Double ) + object ScaleUp { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, - expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, - expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, - expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, - expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = + if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") + else 1.0, + expansionFactor_home_activity = + if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") + else 1.0, + expansionFactor_init_activity = + if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") + else 1.0, + expansionFactor_wherever_activity = + if (c.hasPathOrNull("expansionFactor_wherever_activity")) + c.getDouble("expansionFactor_wherever_activity") + else 1.0, + expansionFactor_work_activity = + if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") + else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, - chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, - chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), - maxChargingSessionsInSeconds = if(c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, - overnightChargingEnabled = c.hasPathOrNull("overnightChargingEnabled") && c.getBoolean("overnightChargingEnabled"), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), - timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = + if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") + else 1.0, + chargingPointCountScalingFactor = + if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") + else 1.0, + chargingPointFilePath = + if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( + if (c.hasPathOrNull("helics")) c.getConfig("helics") + else com.typesafe.config.ConfigFactory.parseString("helics{}") + ), + maxChargingSessionsInSeconds = + if (c.hasPathOrNull("maxChargingSessionsInSeconds")) c.getInt("maxChargingSessionsInSeconds") else 43200, + overnightChargingEnabled = + c.hasPathOrNull("overnightChargingEnabled") && c.getBoolean("overnightChargingEnabled"), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( + if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") + else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") + ), + timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution : scala.Int, - upperBoundResolution : scala.Int + lowerBoundResolution: scala.Int, + upperBoundResolution: scala.Int ) + object H3taz { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile : java.lang.String + frequencyAdjustmentFile: java.lang.String ) + object Scenarios { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = + if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") + else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay : scala.Int, - interval : scala.Int + initialDelay: scala.Int, + interval: scala.Int ) + object ScheduleMonitorTask { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath : java.lang.String, - parkingCostScalingFactor : scala.Double, - parkingFilePath : java.lang.String, - parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor : scala.Double + filePath: java.lang.String, + parkingCostScalingFactor: scala.Double, + parkingFilePath: java.lang.String, + parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor: scala.Double ) + object Taz { + case class ParkingManager( - displayPerformanceTimings : scala.Boolean, - method : java.lang.String, - parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings: scala.Boolean, + method: java.lang.String, + parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) + object ParkingManager { + case class Parallel( - numberOfClusters : scala.Int + numberOfClusters: scala.Int ) + object Parallel { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( + if (c.hasPathOrNull("parallel")) c.getConfig("parallel") + else com.typesafe.config.ConfigFactory.parseString("parallel{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), - parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = + if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( + if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") + else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") + ), + parkingStallCountScalingFactor = + if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") + else 1.0 ) } } - + case class Toll( - filePath : java.lang.String + filePath: java.lang.String ) + object Toll { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules : scala.Double, - rideHailPrice : scala.Double, - tollPrice : scala.Double, - transitCapacity : scala.Option[scala.Double], - transitPrice : scala.Double + fuelCapacityInJoules: scala.Double, + rideHailPrice: scala.Double, + tollPrice: scala.Double, + transitCapacity: scala.Option[scala.Double], + transitPrice: scala.Double ) + object Tuning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = + if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - randomSeedForPopulationSampling = if(c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) else None, - scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), - schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - snapLocationAndRemoveInvalidInputs = c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), - taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), - thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, - thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), - tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) + agentSampleSizeAsFractionOfPopulation = + if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) + c.getDouble("agentSampleSizeAsFractionOfPopulation") + else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents( + if (c.hasPathOrNull("agents")) c.getConfig("agents") + else com.typesafe.config.ConfigFactory.parseString("agents{}") + ), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( + if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") + else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") + ), + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = + if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") + else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz( + if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") + else com.typesafe.config.ConfigFactory.parseString("h3taz{}") + ), + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = + if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + randomSeedForPopulationSampling = + if (c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) + else None, + scenarios = BeamConfig.Beam.Agentsim.Scenarios( + if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") + else com.typesafe.config.ConfigFactory.parseString("scenarios{}") + ), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( + if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") + else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") + ), + schedulerParallelismWindow = + if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + snapLocationAndRemoveInvalidInputs = + c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), + taz = BeamConfig.Beam.Agentsim.Taz( + if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") + ), + thresholdForMakingParkingChoiceInMeters = + if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) + c.getInt("thresholdForMakingParkingChoiceInMeters") + else 100, + thresholdForWalkingInMeters = + if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll( + if (c.hasPathOrNull("toll")) c.getConfig("toll") + else com.typesafe.config.ConfigFactory.parseString("toll{}") + ), + tuning = BeamConfig.Beam.Agentsim.Tuning( + if (c.hasPathOrNull("tuning")) c.getConfig("tuning") + else com.typesafe.config.ConfigFactory.parseString("tuning{}") + ) ) } } - + case class Calibration( - counts : BeamConfig.Beam.Calibration.Counts, - google : BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio : scala.Double, - mode : BeamConfig.Beam.Calibration.Mode, - objectiveFunction : java.lang.String, - roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, - studyArea : BeamConfig.Beam.Calibration.StudyArea + counts: BeamConfig.Beam.Calibration.Counts, + google: BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio: scala.Double, + mode: BeamConfig.Beam.Calibration.Mode, + objectiveFunction: java.lang.String, + roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, + studyArea: BeamConfig.Beam.Calibration.StudyArea ) + object Calibration { + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Int, - inputCountsFile : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Int, + inputCountsFile: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes ) + object Google { + case class TravelTimes( - enable : scala.Boolean, - iterationInterval : scala.Int, - minDistanceInMeters : scala.Double, - numDataPointsOver24Hours : scala.Int, - offPeakEnabled : scala.Boolean, - queryDate : java.lang.String, - tolls : scala.Boolean + enable: scala.Boolean, + iterationInterval: scala.Int, + minDistanceInMeters: scala.Double, + numDataPointsOver24Hours: scala.Int, + offPeakEnabled: scala.Boolean, + queryDate: java.lang.String, + tolls: scala.Boolean ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = + if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = + if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class Mode( - benchmarkFilePath : java.lang.String + benchmarkFilePath: java.lang.String ) + object Mode { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) + object RoadNetwork { + case class TravelTimes( - zoneBoundariesFilePath : java.lang.String, - zoneODTravelTimesFilePath : java.lang.String + zoneBoundariesFilePath: java.lang.String, + zoneODTravelTimesFilePath: java.lang.String ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = + if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = + if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class StudyArea( - enabled : scala.Boolean, - lat : scala.Double, - lon : scala.Double, - radius : scala.Double + enabled: scala.Boolean, + lat: scala.Double, + lon: scala.Double, + radius: scala.Double ) + object StudyArea { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), - meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), - objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), - studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) + counts = BeamConfig.Beam.Calibration.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + google = BeamConfig.Beam.Calibration.Google( + if (c.hasPathOrNull("google")) c.getConfig("google") + else com.typesafe.config.ConfigFactory.parseString("google{}") + ), + meanToCountsWeightRatio = + if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode( + if (c.hasPathOrNull("mode")) c.getConfig("mode") + else com.typesafe.config.ConfigFactory.parseString("mode{}") + ), + objectiveFunction = + if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") + else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( + if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") + else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") + ), + studyArea = BeamConfig.Beam.Calibration.StudyArea( + if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") + else com.typesafe.config.ConfigFactory.parseString("studyArea{}") + ) ) } } - + case class Cluster( - clusterType : scala.Option[java.lang.String], - enabled : scala.Boolean + clusterType: scala.Option[java.lang.String], + enabled: scala.Boolean ) + object Cluster { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor : BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval : scala.Int, - clearRoutedOutstandingWorkEnabled : scala.Boolean, - debugActorTimerIntervalInSec : scala.Int, - debugEnabled : scala.Boolean, - memoryConsumptionDisplayTimeoutInSec : scala.Int, - messageLogging : scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork : scala.Int, - stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation : BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives : scala.Boolean, - writeRealizedModeChoiceFile : scala.Boolean + actor: BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval: scala.Int, + clearRoutedOutstandingWorkEnabled: scala.Boolean, + debugActorTimerIntervalInSec: scala.Int, + debugEnabled: scala.Boolean, + memoryConsumptionDisplayTimeoutInSec: scala.Int, + messageLogging: scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork: scala.Int, + stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation: BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives: scala.Boolean, + writeRealizedModeChoiceFile: scala.Boolean ) + object Debug { + case class Actor( - logDepth : scala.Int + logDepth: scala.Int ) + object Actor { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs : scala.Long, - checkMaxNumberOfMessagesEnabled : scala.Boolean, - defaultTimeoutMs : scala.Long, - enabled : scala.Boolean, - overallSimulationTimeoutMs : scala.Long, - thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs: scala.Long, + checkMaxNumberOfMessagesEnabled: scala.Boolean, + defaultTimeoutMs: scala.Long, + enabled: scala.Boolean, + overallSimulationTimeoutMs: scala.Long, + thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) + object StuckAgentDetection { + case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs : scala.Long, - triggerType : java.lang.String + actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs: scala.Long, + triggerType: java.lang.String ) + object Thresholds$Elm { + case class ActorTypeToMaxNumberOfMessages( - population : scala.Option[scala.Int], - rideHailAgent : scala.Option[scala.Int], - rideHailManager : scala.Option[scala.Int], - transitDriverAgent : scala.Option[scala.Int] + population: scala.Option[scala.Int], + rideHailAgent: scala.Option[scala.Int], + rideHailManager: scala.Option[scala.Int], + transitDriverAgent: scala.Option[scala.Int] ) + object ActorTypeToMaxNumberOfMessages { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = + if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), - markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, - triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = + BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( + if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") + else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") + ), + markAsStuckAfterMs = + if (c.hasPathOrNull("markAsStuckAfterMs")) + c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 20000, + triggerType = + if (c.hasPathOrNull("triggerType")) c.getString("triggerType") + else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, - checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = + if (c.hasPathOrNull("checkIntervalMs")) + c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 200, + checkMaxNumberOfMessagesEnabled = + !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = + if (c.hasPathOrNull("defaultTimeoutMs")) + c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = + if (c.hasPathOrNull("overallSimulationTimeoutMs")) + c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Debug.StuckAgentDetection + .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class TriggerMeasurer( - enabled : scala.Boolean, - writeStuckAgentDetectionConfig : scala.Boolean + enabled: scala.Boolean, + writeStuckAgentDetectionConfig: scala.Boolean ) + object TriggerMeasurer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = + !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram : scala.Boolean + createGCClassHistogram: scala.Boolean ) + object VmInformation { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), - agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), - vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), - writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor( + if (c.hasPathOrNull("actor")) c.getConfig("actor") + else com.typesafe.config.ConfigFactory.parseString("actor{}") + ), + agentTripScoresInterval = + if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = + c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = + if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + memoryConsumptionDisplayTimeoutInSec = + if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) + c.getInt("memoryConsumptionDisplayTimeoutInSec") + else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = + if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) + c.getInt("secondsToWaitToClearRoutedOutstandingWork") + else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( + if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") + else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") + ), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( + if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") + else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") + ), + vmInformation = BeamConfig.Beam.Debug.VmInformation( + if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") + else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") + ), + writeModeChoiceAlternatives = + c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = + c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output : BeamConfig.Beam.Exchange.Output, - scenario : BeamConfig.Beam.Exchange.Scenario + output: BeamConfig.Beam.Exchange.Output, + scenario: BeamConfig.Beam.Exchange.Scenario ) + object Exchange { + case class Output( - activitySimSkimsEnabled : scala.Boolean, - geo : BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled: scala.Boolean, + geo: BeamConfig.Beam.Exchange.Output.Geo ) + object Output { + case class Geo( - filePath : scala.Option[java.lang.String] + filePath: scala.Option[java.lang.String] ) + object Geo { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) + activitySimSkimsEnabled = + c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo( + if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") + ) ) } } - + case class Scenario( - convertWgs2Utm : scala.Boolean, - fileFormat : java.lang.String, - folder : java.lang.String, - modeMap : scala.Option[scala.List[java.lang.String]], - source : java.lang.String, - urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm: scala.Boolean, + fileFormat: java.lang.String, + folder: java.lang.String, + modeMap: scala.Option[scala.List[java.lang.String]], + source: java.lang.String, + urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim ) + object Scenario { + case class Urbansim( - activitySimEnabled : scala.Boolean + activitySimEnabled: scala.Boolean ) + object Urbansim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) + fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) + output = BeamConfig.Beam.Exchange.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + scenario = BeamConfig.Beam.Exchange.Scenario( + if (c.hasPathOrNull("scenario")) c.getConfig("scenario") + else com.typesafe.config.ConfigFactory.parseString("scenario{}") + ) ) } } - + case class Experimental( - optimizer : BeamConfig.Beam.Experimental.Optimizer + optimizer: BeamConfig.Beam.Experimental.Optimizer ) + object Experimental { + case class Optimizer( - enabled : scala.Boolean + enabled: scala.Boolean ) + object Optimizer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) + optimizer = BeamConfig.Beam.Experimental.Optimizer( + if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") + else com.typesafe.config.ConfigFactory.parseString("optimizer{}") + ) ) } } - + case class Input( - lastBaseOutputDir : java.lang.String, - simulationPrefix : java.lang.String + lastBaseOutputDir: java.lang.String, + simulationPrefix: java.lang.String ) + object Input { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn : scala.Boolean + keepConsoleAppenderOn: scala.Boolean ) + object Logger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level : java.lang.String + level: java.lang.String ) + object Metrics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation : scala.Boolean + writePlansAndStopSimulation: scala.Boolean ) + object Output { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = + c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory : scala.Boolean, - baseOutputDirectory : java.lang.String, - collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, - defaultWriteInterval : scala.Int, - displayPerformanceTimings : scala.Boolean, - events : BeamConfig.Beam.Outputs.Events, - generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval : scala.Int, - matsim : BeamConfig.Beam.Outputs.Matsim, - stats : BeamConfig.Beam.Outputs.Stats, - writeAnalysis : scala.Boolean, - writeEventsInterval : scala.Int, - writeGraphs : scala.Boolean, - writePlansInterval : scala.Int, - writeR5RoutesInterval : scala.Int + addTimestampToOutputDirectory: scala.Boolean, + baseOutputDirectory: java.lang.String, + collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, + defaultWriteInterval: scala.Int, + displayPerformanceTimings: scala.Boolean, + events: BeamConfig.Beam.Outputs.Events, + generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval: scala.Int, + matsim: BeamConfig.Beam.Outputs.Matsim, + stats: BeamConfig.Beam.Outputs.Stats, + writeAnalysis: scala.Boolean, + writeEventsInterval: scala.Int, + writeGraphs: scala.Boolean, + writePlansInterval: scala.Int, + writeR5RoutesInterval: scala.Int ) + object Outputs { + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime : scala.Int, - startTime : scala.Int + endTime: scala.Int, + startTime: scala.Int ) + object GeneralizedLinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles : java.lang.String, - deleteRootFolderFiles : java.lang.String + deleteITERSFolderFiles: java.lang.String, + deleteRootFolderFiles: java.lang.String ) + object Matsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = + if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = + if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize : scala.Int + binSize: scala.Int ) + object Stats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), - defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), - generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), - stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = + !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = + if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = + !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( + "collectAndCreateBeamAnalysisAndGraphs" + ), + defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( + if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") + else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") + ), + generalizedLinkStatsInterval = + if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ), + stats = BeamConfig.Beam.Outputs.Stats( + if (c.hasPathOrNull("stats")) c.getConfig("stats") + else com.typesafe.config.ConfigFactory.parseString("stats{}") + ), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim : BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager : BeamConfig.Beam.Physsim.EventManager, - events : BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia : scala.Boolean, - eventsSampling : scala.Double, - flowCapacityFactor : scala.Double, - initializeRouterWithFreeFlowTimes : scala.Boolean, - inputNetworkFilePath : java.lang.String, - jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize : scala.Int, - linkStatsWriteInterval : scala.Int, - maxLinkLengthToApplySpeedScalingFactor : scala.Double, - name : java.lang.String, - network : BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath : java.lang.String, - parbprsim : BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize : scala.Double, - quick_fix_minCarSpeedInMetersPerSecond : scala.Double, - relaxation : BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim : scala.Boolean, - speedScalingFactor : scala.Double, - storageCapacityFactor : scala.Double, - writeEventsInterval : scala.Int, - writePlansInterval : scala.Int, - writeRouteHistoryInterval : scala.Int + bprsim: BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager: BeamConfig.Beam.Physsim.EventManager, + events: BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia: scala.Boolean, + eventsSampling: scala.Double, + flowCapacityFactor: scala.Double, + initializeRouterWithFreeFlowTimes: scala.Boolean, + inputNetworkFilePath: java.lang.String, + jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize: scala.Int, + linkStatsWriteInterval: scala.Int, + maxLinkLengthToApplySpeedScalingFactor: scala.Double, + name: java.lang.String, + network: BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath: java.lang.String, + parbprsim: BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize: scala.Double, + quick_fix_minCarSpeedInMetersPerSecond: scala.Double, + relaxation: BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim: scala.Boolean, + speedScalingFactor: scala.Double, + storageCapacityFactor: scala.Double, + writeEventsInterval: scala.Int, + writePlansInterval: scala.Int, + writeRouteHistoryInterval: scala.Int ) + object Physsim { + case class Bprsim( - inFlowAggregationTimeWindowInSeconds : scala.Int, - minFlowToUseBPRFunction : scala.Int, - travelTimeFunction : java.lang.String + inFlowAggregationTimeWindowInSeconds: scala.Int, + minFlowToUseBPRFunction: scala.Int, + travelTimeFunction: java.lang.String ) + object Bprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, - minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = + if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) + c.getInt("inFlowAggregationTimeWindowInSeconds") + else 900, + minFlowToUseBPRFunction = + if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor : scala.Double + congestionFactor: scala.Double ) + object CchRoutingAssignment { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax : scala.Int, - departureTimeShiftMin : scala.Int, - fractionOfEventsToDuplicate : scala.Double + departureTimeShiftMax: scala.Int, + departureTimeShiftMin: scala.Int, + fractionOfEventsToDuplicate: scala.Double ) + object DuplicatePTE { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = + if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = + if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = + if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads : scala.Int, - `type` : java.lang.String + numberOfThreads: scala.Int, + `type`: java.lang.String ) + object EventManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) + object Jdeqsim { + case class AgentSimPhysSimInterfaceDebugger( - enabled : scala.Boolean + enabled: scala.Boolean ) + object AgentSimPhysSimInterfaceDebugger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, - capacityPlansWriteInterval : scala.Int, - enabled : scala.Boolean, - minRoadCapacity : scala.Int, - minSpeedMetersPerSec : scala.Int, - speedAdjustmentFactor : scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, + capacityPlansWriteInterval: scala.Int, + enabled: scala.Boolean, + minRoadCapacity: scala.Int, + minSpeedMetersPerSec: scala.Int, + speedAdjustmentFactor: scala.Double ) + object Cacc { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, - capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = + if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) + c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") + else 1.3, + capacityPlansWriteInterval = + if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = + if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = + if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( + if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") + else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") + ), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( + if (c.hasPathOrNull("cacc")) c.getConfig("cacc") + else com.typesafe.config.ConfigFactory.parseString("cacc{}") + ) ) } } - + case class Network( - maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties + maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties ) + object Network { + case class MaxSpeedInference( - enabled : scala.Boolean, - `type` : java.lang.String + enabled: scala.Boolean, + `type`: java.lang.String ) + object MaxSpeedInference { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled : scala.Boolean, - livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled: scala.Boolean, + livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) + object OverwriteRoadTypeProperties { + case class LivingStreet( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object LivingStreet { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Minor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Motorway { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object MotorwayLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Primary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object PrimaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Residential { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Secondary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object SecondaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Tertiary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TertiaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Trunk { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TrunkLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Unclassified { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( + if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") + else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") + ), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( + if (c.hasPathOrNull("minor")) c.getConfig("minor") + else com.typesafe.config.ConfigFactory.parseString("minor{}") + ), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( + if (c.hasPathOrNull("motorway")) c.getConfig("motorway") + else com.typesafe.config.ConfigFactory.parseString("motorway{}") + ), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( + if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") + else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") + ), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( + if (c.hasPathOrNull("primary")) c.getConfig("primary") + else com.typesafe.config.ConfigFactory.parseString("primary{}") + ), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( + if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") + else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") + ), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( + if (c.hasPathOrNull("residential")) c.getConfig("residential") + else com.typesafe.config.ConfigFactory.parseString("residential{}") + ), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( + if (c.hasPathOrNull("secondary")) c.getConfig("secondary") + else com.typesafe.config.ConfigFactory.parseString("secondary{}") + ), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( + if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") + else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") + ), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( + if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") + else com.typesafe.config.ConfigFactory.parseString("tertiary{}") + ), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( + if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") + else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") + ), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( + if (c.hasPathOrNull("trunk")) c.getConfig("trunk") + else com.typesafe.config.ConfigFactory.parseString("trunk{}") + ), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( + if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") + else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") + ), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( + if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") + else com.typesafe.config.ConfigFactory.parseString("unclassified{}") + ) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")) + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( + if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") + else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") + ), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( + if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") + else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") + ) ) } } - + case class Parbprsim( - numberOfClusters : scala.Int, - syncInterval : scala.Int + numberOfClusters: scala.Int, + syncInterval: scala.Int ) + object Parbprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier : scala.Double, - enabled : scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime : scala.Int + additionalTravelTimeMultiplier: scala.Double, + enabled: scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime: scala.Int ) + object PickUpDropOffAnalysis { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 + additionalTravelTimeMultiplier = + if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") + else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = + if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) + c.getInt("secondsFromPickUpPropOffToAffectTravelTime") + else 600 ) } } - + case class Relaxation( - experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type` : java.lang.String + experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type`: java.lang.String ) + object Relaxation { + case class Experiment20( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment20 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment21 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment30 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment40 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment50 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment51 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment52 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( + if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") + else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") + ), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( + if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") + else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") + ), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( + if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") + else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") + ), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( + if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") + else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") + ), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( + if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") + else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") + ), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( + if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") + else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") + ), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( + if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") + else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") + ), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), - eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), - events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), - linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, - name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), - ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim( + if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") + else com.typesafe.config.ConfigFactory.parseString("bprsim{}") + ), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( + if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") + else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") + ), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( + if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") + else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") + ), + eventManager = BeamConfig.Beam.Physsim.EventManager( + if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") + else com.typesafe.config.ConfigFactory.parseString("eventManager{}") + ), + events = BeamConfig.Beam.Physsim.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + eventsForFullVersionOfVia = + !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = + !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = + if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") + else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( + if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") + else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") + ), + linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = + if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = + if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) + c.getDouble("maxLinkLengthToApplySpeedScalingFactor") + else 50.0, + name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + overwriteLinkParamPath = + if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim( + if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") + else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") + ), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( + if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") + else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") + ), + ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = + if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) + c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") + else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation( + if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") + else com.typesafe.config.ConfigFactory.parseString("relaxation{}") + ), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = + if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = + if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1 : scala.Double, - ModuleProbability_2 : scala.Double, - ModuleProbability_3 : scala.Double, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - clearModes : BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation : scala.Double, - maxAgentPlanMemorySize : scala.Int + ModuleProbability_1: scala.Double, + ModuleProbability_2: scala.Double, + ModuleProbability_3: scala.Double, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + clearModes: BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation: scala.Double, + maxAgentPlanMemorySize: scala.Int ) + object Replanning { + case class ClearModes( - iteration : scala.Int, - modes : scala.Option[scala.List[java.lang.String]], - strategy : java.lang.String + iteration: scala.Int, + modes: scala.Option[scala.List[java.lang.String]], + strategy: java.lang.String ) + object ClearModes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes( + if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") + else com.typesafe.config.ConfigFactory.parseString("clearModes{}") + ), + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getDouble("fractionOfIterationsToDisableInnovation") + else Double.PositiveInfinity, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim : BeamConfig.Beam.Router.Skim + skim: BeamConfig.Beam.Router.Skim ) + object Router { + case class Skim( - activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims : scala.Int, - origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval : scala.Int, - writeSkimsInterval : scala.Int + activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims: scala.Int, + origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval: scala.Int, + writeSkimsInterval: scala.Int ) + object Skim { + case class ActivitySimSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object ActivitySimSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object DriveTimeSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", - name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") + else "skimsTravelTimeObservedVsSimulated", + name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String, - poolingTravelTimeOveheadFactor : scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, - writeFullSkimsInterval : scala.Int + fileBaseName: java.lang.String, + name: java.lang.String, + poolingTravelTimeOveheadFactor: scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, + writeFullSkimsInterval: scala.Int ) + object OriginDestinationSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, - writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = + if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") + else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = + if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) + c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") + else 0, + writeFullSkimsInterval = + if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName : java.lang.String, - geoHierarchy : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + geoHierarchy: java.lang.String, + name: java.lang.String ) + object TazSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object TransitCrowdingSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), - keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), - writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( + if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") + else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") + ), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( + if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") + else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") + ), + keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( + if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") + else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") + ), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( + if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") + else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") + ), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( + if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") + else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") + ), + writeAggregatedSkimsInterval = + if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) + skim = BeamConfig.Beam.Router.Skim( + if (c.hasPathOrNull("skim")) c.getConfig("skim") + else com.typesafe.config.ConfigFactory.parseString("skim{}") + ) ) } } - + case class Routing( - baseDate : java.lang.String, - carRouter : java.lang.String, - gh : BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS : scala.Int, - overrideNetworkTravelTimesUsingSkims : scala.Boolean, - r5 : BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor : scala.Double, - startingIterationForTravelTimesMSA : scala.Int, - transitOnStreetNetwork : scala.Boolean, - writeRoutingStatistic : scala.Boolean + baseDate: java.lang.String, + carRouter: java.lang.String, + gh: BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS: scala.Int, + overrideNetworkTravelTimesUsingSkims: scala.Boolean, + r5: BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor: scala.Double, + startingIterationForTravelTimesMSA: scala.Int, + transitOnStreetNetwork: scala.Boolean, + writeRoutingStatistic: scala.Boolean ) + object Routing { + case class Gh( - useAlternativeRoutes : scala.Boolean + useAlternativeRoutes: scala.Boolean ) + object Gh { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath : java.lang.String, - bikeLaneScaleFactor : scala.Double, - departureWindow : scala.Double, - directory : java.lang.String, - directory2 : scala.Option[java.lang.String], - linkRadiusMeters : scala.Double, - mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples : scala.Int, - osmMapdbFile : java.lang.String, - travelTimeNoiseFraction : scala.Double + bikeLaneLinkIdsFilePath: java.lang.String, + bikeLaneScaleFactor: scala.Double, + departureWindow: scala.Double, + directory: java.lang.String, + directory2: scala.Option[java.lang.String], + linkRadiusMeters: scala.Double, + mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples: scala.Int, + osmMapdbFile: java.lang.String, + travelTimeNoiseFraction: scala.Double ) + object R5 { + case class MNetBuilder( - fromCRS : java.lang.String, - toCRS : java.lang.String + fromCRS: java.lang.String, + toCRS: java.lang.String ) + object MNetBuilder { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike : scala.Int + bike: scala.Int ) + object MaxDistanceLimitByModeInMeters { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), - numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = + if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = + if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( + if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") + else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") + ), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( + if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") + ), + numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmMapdbFile = + if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") + else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = + if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), - minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, - overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), - r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), - skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh( + if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") + ), + minimumPossibleSkimBasedTravelTimeInS = + if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) + c.getInt("minimumPossibleSkimBasedTravelTimeInS") + else 60, + overrideNetworkTravelTimesUsingSkims = + c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( + "overrideNetworkTravelTimesUsingSkims" + ), + r5 = BeamConfig.Beam.Routing.R5( + if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") + ), + skimTravelTimesScalingFactor = + if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = + if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") + else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric : BeamConfig.Beam.Sim.Metric, - termination : BeamConfig.Beam.Sim.Termination + metric: BeamConfig.Beam.Sim.Metric, + termination: BeamConfig.Beam.Sim.Termination ) + object Sim { + case class Metric( - collector : BeamConfig.Beam.Sim.Metric.Collector + collector: BeamConfig.Beam.Sim.Metric.Collector ) + object Metric { + case class Collector( - influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics : java.lang.String + influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics: java.lang.String ) + object Collector { + case class InfluxDbSimulationMetricCollector( - connectionString : java.lang.String, - database : java.lang.String + connectionString: java.lang.String, + database: java.lang.String ) + object InfluxDbSimulationMetricCollector { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = + if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), - metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = + BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( + if (c.hasPathOrNull("influxDbSimulationMetricCollector")) + c.getConfig("influxDbSimulationMetricCollector") + else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") + ), + metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) + collector = BeamConfig.Beam.Sim.Metric.Collector( + if (c.hasPathOrNull("collector")) c.getConfig("collector") + else com.typesafe.config.ConfigFactory.parseString("collector{}") + ) ) } } - + case class Termination( - criterionName : java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName: java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) + object Termination { + case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration : scala.Int, - minLastIteration : scala.Int, - relativeTolerance : scala.Double + maxLastIteration: scala.Int, + minLastIteration: scala.Int, + relativeTolerance: scala.Double ) + object TerminateAtRideHailFleetStoredElectricityConvergence { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) + criterionName = + if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = + BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( + if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) + c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") + else + com.typesafe.config.ConfigFactory + .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), - termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) + metric = BeamConfig.Beam.Sim.Metric( + if (c.hasPathOrNull("metric")) c.getConfig("metric") + else com.typesafe.config.ConfigFactory.parseString("metric{}") + ), + termination = BeamConfig.Beam.Sim.Termination( + if (c.hasPathOrNull("termination")) c.getConfig("termination") + else com.typesafe.config.ConfigFactory.parseString("termination{}") + ) ) } } - + case class Spatial( - boundingBoxBuffer : scala.Int, - localCRS : java.lang.String + boundingBoxBuffer: scala.Int, + localCRS: java.lang.String ) + object Spatial { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear ) + object Urbansim { + case class BackgroundODSkimsCreator( - calculationTimeoutHours : scala.Int, - enabled : scala.Boolean, - maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes : scala.Int, - peakHours : scala.Option[scala.List[scala.Double]], - routerType : java.lang.String, - skimsGeoType : java.lang.String, - skimsKind : java.lang.String + calculationTimeoutHours: scala.Int, + enabled: scala.Boolean, + maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes: scala.Int, + peakHours: scala.Option[scala.List[scala.Double]], + routerType: java.lang.String, + skimsGeoType: java.lang.String, + skimsKind: java.lang.String ) + object BackgroundODSkimsCreator { + case class MaxTravelDistanceInMeters( - bike : scala.Int, - walk : scala.Int + bike: scala.Int, + walk: scala.Int ) + object MaxTravelDistanceInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive : scala.Boolean, - transit : scala.Boolean, - walk : scala.Boolean + drive: scala.Boolean, + transit: scala.Boolean, + walk: scala.Boolean ) + object ModesToBuild { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), - numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = + if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( + if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") + ), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( + if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") + else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") + ), + numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes : scala.Double, - bike : scala.Double, - car : scala.Double, - drive_transit : scala.Double, - walk : scala.Double, - walk_transit : scala.Double + allModes: scala.Double, + bike: scala.Double, + car: scala.Double, + drive_transit: scala.Double, + walk: scala.Double, + walk_transit: scala.Double ) + object FractionOfModesToClear { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( + if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") + else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") + ), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( + if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") + else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") + ) ) } } - + case class WarmStart( - path : java.lang.String, - prepareData : scala.Boolean, - samplePopulationIntegerFlag : scala.Int, - skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type` : java.lang.String + path: java.lang.String, + prepareData: scala.Boolean, + samplePopulationIntegerFlag: scala.Int, + skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type`: java.lang.String ) + object WarmStart { + case class SkimsFilePaths$Elm( - skimType : java.lang.String, - skimsFilePath : java.lang.String + skimType: java.lang.String, + skimsFilePath: java.lang.String ) + object SkimsFilePaths$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if(c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if (c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = + if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = + if (c.hasPathOrNull("skimsFilePaths")) + scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) + else None, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), - calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), - cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), - debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), - exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), - experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), - input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), - inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), - metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), - output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), - physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), - replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), - routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), - sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), - spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), - urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) + actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim( + if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") + else com.typesafe.config.ConfigFactory.parseString("agentsim{}") + ), + calibration = BeamConfig.Beam.Calibration( + if (c.hasPathOrNull("calibration")) c.getConfig("calibration") + else com.typesafe.config.ConfigFactory.parseString("calibration{}") + ), + cluster = BeamConfig.Beam.Cluster( + if (c.hasPathOrNull("cluster")) c.getConfig("cluster") + else com.typesafe.config.ConfigFactory.parseString("cluster{}") + ), + debug = BeamConfig.Beam.Debug( + if (c.hasPathOrNull("debug")) c.getConfig("debug") + else com.typesafe.config.ConfigFactory.parseString("debug{}") + ), + exchange = BeamConfig.Beam.Exchange( + if (c.hasPathOrNull("exchange")) c.getConfig("exchange") + else com.typesafe.config.ConfigFactory.parseString("exchange{}") + ), + experimental = BeamConfig.Beam.Experimental( + if (c.hasPathOrNull("experimental")) c.getConfig("experimental") + else com.typesafe.config.ConfigFactory.parseString("experimental{}") + ), + input = BeamConfig.Beam.Input( + if (c.hasPathOrNull("input")) c.getConfig("input") + else com.typesafe.config.ConfigFactory.parseString("input{}") + ), + inputDirectory = + if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger( + if (c.hasPathOrNull("logger")) c.getConfig("logger") + else com.typesafe.config.ConfigFactory.parseString("logger{}") + ), + metrics = BeamConfig.Beam.Metrics( + if (c.hasPathOrNull("metrics")) c.getConfig("metrics") + else com.typesafe.config.ConfigFactory.parseString("metrics{}") + ), + output = BeamConfig.Beam.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + outputs = BeamConfig.Beam.Outputs( + if (c.hasPathOrNull("outputs")) c.getConfig("outputs") + else com.typesafe.config.ConfigFactory.parseString("outputs{}") + ), + physsim = BeamConfig.Beam.Physsim( + if (c.hasPathOrNull("physsim")) c.getConfig("physsim") + else com.typesafe.config.ConfigFactory.parseString("physsim{}") + ), + replanning = BeamConfig.Beam.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + router = BeamConfig.Beam.Router( + if (c.hasPathOrNull("router")) c.getConfig("router") + else com.typesafe.config.ConfigFactory.parseString("router{}") + ), + routing = BeamConfig.Beam.Routing( + if (c.hasPathOrNull("routing")) c.getConfig("routing") + else com.typesafe.config.ConfigFactory.parseString("routing{}") + ), + sim = BeamConfig.Beam.Sim( + if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") + ), + spatial = BeamConfig.Beam.Spatial( + if (c.hasPathOrNull("spatial")) c.getConfig("spatial") + else com.typesafe.config.ConfigFactory.parseString("spatial{}") + ), + urbansim = BeamConfig.Beam.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart( + if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") + else com.typesafe.config.ConfigFactory.parseString("warmStart{}") + ) ) } } - + case class Matsim( - conversion : BeamConfig.Matsim.Conversion, - modules : BeamConfig.Matsim.Modules + conversion: BeamConfig.Matsim.Conversion, + modules: BeamConfig.Matsim.Modules ) + object Matsim { + case class Conversion( - defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles : scala.Boolean, - matsimNetworkFile : java.lang.String, - osmFile : java.lang.String, - populationFile : java.lang.String, - scenarioDirectory : java.lang.String, - shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile : java.lang.String + defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles: scala.Boolean, + matsimNetworkFile: java.lang.String, + osmFile: java.lang.String, + populationFile: java.lang.String, + scenarioDirectory: java.lang.String, + shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile: java.lang.String ) + object Conversion { + case class DefaultHouseholdIncome( - currency : java.lang.String, - period : java.lang.String, - value : scala.Int + currency: java.lang.String, + period: java.lang.String, + value: scala.Int ) + object DefaultHouseholdIncome { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if(c.hasPathOrNull("period")) c.getString("period") else "year", - value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if (c.hasPathOrNull("period")) c.getString("period") else "year", + value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile : java.lang.String, - tazIdFieldName : java.lang.String + shapeFile: java.lang.String, + tazIdFieldName: java.lang.String ) + object ShapeConfig { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( + if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") + else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") + ), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = + if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = + if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = + if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") + else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( + if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") + else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") + ), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode : BeamConfig.Matsim.Modules.ChangeMode, - controler : BeamConfig.Matsim.Modules.Controler, - counts : BeamConfig.Matsim.Modules.Counts, - global : BeamConfig.Matsim.Modules.Global, - households : BeamConfig.Matsim.Modules.Households, - linkStats : BeamConfig.Matsim.Modules.LinkStats, - network : BeamConfig.Matsim.Modules.Network, - parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, - plans : BeamConfig.Matsim.Modules.Plans, - qsim : BeamConfig.Matsim.Modules.Qsim, - strategy : BeamConfig.Matsim.Modules.Strategy, - transit : BeamConfig.Matsim.Modules.Transit, - vehicles : BeamConfig.Matsim.Modules.Vehicles + changeMode: BeamConfig.Matsim.Modules.ChangeMode, + controler: BeamConfig.Matsim.Modules.Controler, + counts: BeamConfig.Matsim.Modules.Counts, + global: BeamConfig.Matsim.Modules.Global, + households: BeamConfig.Matsim.Modules.Households, + linkStats: BeamConfig.Matsim.Modules.LinkStats, + network: BeamConfig.Matsim.Modules.Network, + parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, + plans: BeamConfig.Matsim.Modules.Plans, + qsim: BeamConfig.Matsim.Modules.Qsim, + strategy: BeamConfig.Matsim.Modules.Strategy, + transit: BeamConfig.Matsim.Modules.Transit, + vehicles: BeamConfig.Matsim.Modules.Vehicles ) + object Modules { + case class ChangeMode( - modes : java.lang.String + modes: java.lang.String ) + object ChangeMode { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat : java.lang.String, - firstIteration : scala.Int, - lastIteration : scala.Int, - mobsim : java.lang.String, - outputDirectory : java.lang.String, - overwriteFiles : java.lang.String + eventsFileFormat: java.lang.String, + firstIteration: scala.Int, + lastIteration: scala.Int, + mobsim: java.lang.String, + outputDirectory: java.lang.String, + overwriteFiles: java.lang.String ) + object Controler { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = + if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Double, - inputCountsFile : java.lang.String, - outputformat : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Double, + inputCountsFile: java.lang.String, + outputformat: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem : java.lang.String, - randomSeed : scala.Int + coordinateSystem: java.lang.String, + randomSeed: scala.Int ) + object Global { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile : java.lang.String, - inputHouseholdAttributesFile : java.lang.String + inputFile: java.lang.String, + inputHouseholdAttributesFile: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" + inputFile = + if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = + if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") + else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations : scala.Int, - writeLinkStatsInterval : scala.Int + averageLinkStatsOverIterations: scala.Int, + writeLinkStatsInterval: scala.Int ) + object LinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = + if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = + if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile : java.lang.String + inputNetworkFile: java.lang.String ) + object Network { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = + if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") + else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents : scala.Int, - numberOfThreads : scala.Int, - oneThreadPerHandler : scala.Boolean, - synchronizeOnSimSteps : scala.Boolean + estimatedNumberOfEvents: scala.Int, + numberOfThreads: scala.Int, + oneThreadPerHandler: scala.Boolean, + synchronizeOnSimSteps: scala.Boolean ) + object ParallelEventHandling { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = + if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta : scala.Long, - earlyDeparture : scala.Long, - lateArrival : scala.Long, - learningRate : scala.Long, - parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing : scala.Long, - traveling : scala.Long, - waiting : scala.Long, - writeExperiencedPlans : scala.Boolean + BrainExpBeta: scala.Long, + earlyDeparture: scala.Long, + lateArrival: scala.Long, + learningRate: scala.Long, + parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing: scala.Long, + traveling: scala.Long, + waiting: scala.Long, + writeExperiencedPlans: scala.Boolean ) + object PlanCalcScore { + case class Parameterset$Elm( - activityType : java.lang.String, - priority : scala.Int, - scoringThisActivityAtAll : scala.Boolean, - `type` : java.lang.String, - typicalDuration : java.lang.String, - typicalDurationScoreComputation : java.lang.String + activityType: java.lang.String, + priority: scala.Int, + scoringThisActivityAtAll: scala.Boolean, + `type`: java.lang.String, + typicalDuration: java.lang.String, + typicalDurationScoreComputation: java.lang.String ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" + activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = + !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = + if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") + else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, - earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, - lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, - learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, - traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, - waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + BrainExpBeta = + if (c.hasPathOrNull("BrainExpBeta")) + c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) + else 2, + earlyDeparture = + if (c.hasPathOrNull("earlyDeparture")) + c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, + lateArrival = + if (c.hasPathOrNull("lateArrival")) + c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) + else -18, + learningRate = + if (c.hasPathOrNull("learningRate")) + c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) + else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = + if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) + else 6, + traveling = + if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) + else -6, + waiting = + if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.PlanCalcScore + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Plans( - inputPersonAttributesFile : java.lang.String, - inputPlansFile : java.lang.String + inputPersonAttributesFile: java.lang.String, + inputPlansFile: java.lang.String ) + object Plans { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" + inputPersonAttributesFile = + if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") + else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = + if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") + else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime : java.lang.String, - snapshotperiod : java.lang.String, - startTime : java.lang.String + endTime: java.lang.String, + snapshotperiod: java.lang.String, + startTime: java.lang.String ) + object Qsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1 : scala.Int, - ModuleProbability_2 : scala.Int, - ModuleProbability_3 : scala.Int, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - fractionOfIterationsToDisableInnovation : scala.Int, - maxAgentPlanMemorySize : scala.Int, - parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval : java.lang.String + ModuleProbability_1: scala.Int, + ModuleProbability_2: scala.Int, + ModuleProbability_3: scala.Int, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + fractionOfIterationsToDisableInnovation: scala.Int, + maxAgentPlanMemorySize: scala.Int, + parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval: java.lang.String ) + object Strategy { + case class Parameterset$Elm( - disableAfterIteration : scala.Int, - strategyName : java.lang.String, - `type` : java.lang.String, - weight : scala.Int + disableAfterIteration: scala.Int, + strategyName: java.lang.String, + `type`: java.lang.String, + weight: scala.Int ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" - ) - } - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getInt("fractionOfIterationsToDisableInnovation") + else 999999, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = + if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") + else "WorstPlanForRemovalSelector" + ) + } + + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.Strategy + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Transit( - transitModes : java.lang.String, - useTransit : scala.Boolean, - vehiclesFile : java.lang.String + transitModes: java.lang.String, + useTransit: scala.Boolean, + vehiclesFile: java.lang.String ) + object Transit { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile : java.lang.String + vehiclesFile: java.lang.String ) + object Vehicles { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), - controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), - counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), - households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), - network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), - plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), - strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), - transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), - vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + changeMode = BeamConfig.Matsim.Modules.ChangeMode( + if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") + else com.typesafe.config.ConfigFactory.parseString("changeMode{}") + ), + controler = BeamConfig.Matsim.Modules.Controler( + if (c.hasPathOrNull("controler")) c.getConfig("controler") + else com.typesafe.config.ConfigFactory.parseString("controler{}") + ), + counts = BeamConfig.Matsim.Modules.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + global = BeamConfig.Matsim.Modules.Global( + if (c.hasPathOrNull("global")) c.getConfig("global") + else com.typesafe.config.ConfigFactory.parseString("global{}") + ), + households = BeamConfig.Matsim.Modules.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + linkStats = BeamConfig.Matsim.Modules.LinkStats( + if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") + else com.typesafe.config.ConfigFactory.parseString("linkStats{}") + ), + network = BeamConfig.Matsim.Modules.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( + if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") + else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") + ), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( + if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") + else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") + ), + plans = BeamConfig.Matsim.Modules.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + qsim = BeamConfig.Matsim.Modules.Qsim( + if (c.hasPathOrNull("qsim")) c.getConfig("qsim") + else com.typesafe.config.ConfigFactory.parseString("qsim{}") + ), + strategy = BeamConfig.Matsim.Modules.Strategy( + if (c.hasPathOrNull("strategy")) c.getConfig("strategy") + else com.typesafe.config.ConfigFactory.parseString("strategy{}") + ), + transit = BeamConfig.Matsim.Modules.Transit( + if (c.hasPathOrNull("transit")) c.getConfig("transit") + else com.typesafe.config.ConfigFactory.parseString("transit{}") + ), + vehicles = BeamConfig.Matsim.Modules.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), - modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) + conversion = BeamConfig.Matsim.Conversion( + if (c.hasPathOrNull("conversion")) c.getConfig("conversion") + else com.typesafe.config.ConfigFactory.parseString("conversion{}") + ), + modules = BeamConfig.Matsim.Modules( + if (c.hasPathOrNull("modules")) c.getConfig("modules") + else com.typesafe.config.ConfigFactory.parseString("modules{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), - matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) + beam = BeamConfig.Beam( + if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") + ), + matsim = BeamConfig.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ) ) } - private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + + private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { + + private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") + if ( + (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number] + ) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { + + private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException(cv.origin.lineNumber + + new java.lang.RuntimeException( + cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) + ) } - private def $_str(cv:com.typesafe.config.ConfigValue) = + + private def $_str(cv: com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } - diff --git a/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala index 0d3a4735a80..7d9ee3a1cf0 100644 --- a/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala @@ -92,7 +92,7 @@ class PowerControllerSpec extends AnyWordSpecLike with Matchers with BeforeAndAf "obtain power physical bounds" in { val bounds = powerController.obtainPowerPhysicalBounds( 300, - Some(Map[ChargingStation, Double](dummyChargingStation -> 5678.90)) + Seq[(ChargingStation, Double)]((dummyChargingStation, 5678.90)) ) bounds shouldBe Map(dummyChargingStation -> PhysicalBounds(dummyChargingStation, 7.2, 7.2, 0.0)) // TODO: test beam federate connection @@ -109,7 +109,7 @@ class PowerControllerSpec extends AnyWordSpecLike with Matchers with BeforeAndAf "obtain default (0.0) power physical bounds" in { val bounds = - powerController.obtainPowerPhysicalBounds(300, Some(Map[ChargingStation, Double](dummyChargingStation -> 0.0))) + powerController.obtainPowerPhysicalBounds(300, Seq[(ChargingStation, Double)]((dummyChargingStation, 0.0))) bounds shouldBe Map(ChargingStation(dummyChargingZone) -> PhysicalBounds(dummyChargingStation, 7.2, 7.2, 0.0)) verify(beamFederateMock, never()).sync(300) verify(beamFederateMock, never()).collectJSON() From 5b05467ade3fa9f8afd100c2e48c881cbe5844e4 Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Wed, 8 Jun 2022 10:29:40 +0300 Subject: [PATCH 128/307] Fixed ClassCastException --- .../scala/beam/agentsim/infrastructure/ChargingNetwork.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 2a2b13f0bb7..5bf49472279 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -244,8 +244,8 @@ object ChargingNetwork extends LazyLogging { def numAvailableChargers: Int = zone.maxStalls - howManyVehiclesAreCharging - howManyVehiclesAreInGracePeriodAfterCharging - private[ChargingNetwork] def connectedVehicles: Map[Id[BeamVehicle], ChargingVehicle] = - chargingVehiclesInternal.asInstanceOf[Map[Id[BeamVehicle], ChargingVehicle]] + private[ChargingNetwork] def connectedVehicles: collection.Map[Id[BeamVehicle], ChargingVehicle] = + chargingVehiclesInternal def howManyVehiclesAreWaiting: Int = waitingLineInternal.size def howManyVehiclesAreCharging: Int = chargingVehiclesInternal.size From 4737bc15bb324a23f5a757d872287c9d3c2eb950 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 8 Jun 2022 01:24:02 -0700 Subject: [PATCH 129/307] fix compilation problem --- .../scala/beam/agentsim/infrastructure/ChargingNetwork.scala | 5 ++--- .../agentsim/infrastructure/ChargingNetworkManager.scala | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 2a2b13f0bb7..6b4d0ae8301 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -39,7 +39,7 @@ class ChargingNetwork(val parkingZones: Map[Id[ParkingZoneId], ParkingZone]) ext /** * @return all vehicles still connected to a charging point */ - def connectedVehicles: Map[Id[BeamVehicle], ChargingVehicle] = + def connectedVehicles: Iterable[ChargingVehicle] = chargingZoneKeyToChargingStationMap.flatMap(_._2.connectedVehicles) /** @@ -244,8 +244,7 @@ object ChargingNetwork extends LazyLogging { def numAvailableChargers: Int = zone.maxStalls - howManyVehiclesAreCharging - howManyVehiclesAreInGracePeriodAfterCharging - private[ChargingNetwork] def connectedVehicles: Map[Id[BeamVehicle], ChargingVehicle] = - chargingVehiclesInternal.asInstanceOf[Map[Id[BeamVehicle], ChargingVehicle]] + private[ChargingNetwork] def connectedVehicles: Iterable[ChargingVehicle] = chargingVehiclesInternal.values def howManyVehiclesAreWaiting: Int = waitingLineInternal.size def howManyVehiclesAreCharging: Int = chargingVehiclesInternal.size diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 3a59e66982a..cd502225695 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -114,7 +114,7 @@ class ChargingNetworkManager( // obtaining physical bounds val physicalBounds = powerController.obtainPowerPhysicalBounds(timeBin, loadEstimate) val allConnectedVehicles = chargingNetwork.connectedVehicles ++ rideHailNetwork.connectedVehicles - val triggers = allConnectedVehicles.par.flatMap { case (_, chargingVehicle) => + val triggers = allConnectedVehicles.par.flatMap { chargingVehicle => // Refuel handleRefueling(chargingVehicle) // Calculate the energy to charge and prepare for next current cycle of charging From c9863ba8779e4e9898eb6ae935cd6f9c374b4398 Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Wed, 8 Jun 2022 12:41:31 +0300 Subject: [PATCH 130/307] Exiting beam in case of no progress --- src/main/resources/beam-template.conf | 3 ++ .../scheduler/BeamAgentScheduler.scala | 45 +++++++++++++++++-- .../scala/beam/sim/config/BeamConfig.scala | 7 +++ 3 files changed, 52 insertions(+), 3 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 30d26f75bd6..9a44195a6a8 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -764,6 +764,9 @@ beam.debug { writeRealizedModeChoiceFile = "boolean | false" messageLogging = "boolean | false" + # the max of the next 2 values is taken for the initialization step + simulationStuckThresholdMin = "int | 999999" + initialiazationStuckThresholdMin = "int | 180" } beam.logger.keepConsoleAppenderOn = "boolean | true" diff --git a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala index 1a39be308bc..2ee5fc02c39 100644 --- a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala +++ b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala @@ -47,6 +47,8 @@ object BeamAgentScheduler { case object Monitor extends SchedulerMessage + case object SimulationStuckCheck extends SchedulerMessage + case object RequestCurrentTime extends SchedulerMessage case object SkipOverBadActors extends SchedulerMessage @@ -146,6 +148,8 @@ class BeamAgentScheduler( private var idCount: Long = 0L private var startSender: ActorRef = _ private var nowInSeconds: Int = 0 + private var nowUpdateTime: Long = System.currentTimeMillis() + private var longestNowUpdateDelay: Long = 0 private val maybeTriggerMeasurer: Option[TriggerMeasurer] = if (beamConfig.beam.debug.triggerMeasurer.enabled) { Some(new TriggerMeasurer(beamConfig.beam.debug.triggerMeasurer)) @@ -164,6 +168,10 @@ class BeamAgentScheduler( private val scheduledTriggerToStuckTimes: mutable.HashMap[ScheduledTrigger, Int] = mutable.HashMap.empty + import scala.concurrent.duration._ + + private val shutdownOnStuckTask: Cancellable = + context.system.scheduler.scheduleWithFixedDelay(10.minutes, 1.minute, self, SimulationStuckCheck) private var monitorTask: Option[Cancellable] = None private var stuckAgentChecker: Option[Cancellable] = None @@ -191,6 +199,7 @@ class BeamAgentScheduler( log.info("aroundPostStop. Stopping all scheduled tasks...") stuckAgentChecker.foreach(_.cancel()) monitorTask.foreach(_.cancel()) + shutdownOnStuckTask.cancel() super.aroundPostStop() } @@ -203,6 +212,7 @@ class BeamAgentScheduler( startedAt = Deadline.now stuckAgentChecker = scheduleStuckAgentCheck monitorTask = scheduleMonitorTask + nowUpdateTime = System.currentTimeMillis() doSimStep(0) case DoSimStep(newNow: Int) => @@ -247,6 +257,22 @@ class BeamAgentScheduler( case Terminated(actor) => terminateActor(actor) + case SimulationStuckCheck => + if (started) { + val stuckThreshold = + if (nowInSeconds == 0) + Math.max( + beamConfig.beam.debug.initialiazationStuckThresholdMin, + beamConfig.beam.debug.simulationStuckThresholdMin + ) + else beamConfig.beam.debug.simulationStuckThresholdMin + val currentDelay = System.currentTimeMillis() - nowUpdateTime + if (currentDelay > stuckThreshold * 60 * 1000) { + log.error("Forcibly terminating beam because of too long update delay: {}", currentDelay) + System.exit(10) + } + } + case Monitor => if (beamConfig.beam.debug.debugEnabled) { val logStr = @@ -364,7 +390,7 @@ class BeamAgentScheduler( .trigger .tick <= stopTick ) { - nowInSeconds = newNow + updateNow(newNow) if ( awaitingResponse.isEmpty || nowInSeconds - awaitingResponse .keySet() @@ -393,19 +419,21 @@ class BeamAgentScheduler( ) { if (nowInSeconds > 0 && nowInSeconds % 1800 == 0) { log.info( - "Hour " + nowInSeconds / 3600.0 + " completed. " + math.round( + "Hour " + nowInSeconds / 3600.0 + " completed. Longest delay " + longestNowUpdateDelay + " ms. " + + math.round( 10 * (Runtime.getRuntime.totalMemory() - Runtime.getRuntime .freeMemory()) / Math .pow(1000, 3) ) / 10.0 + "(GB)" ) + longestNowUpdateDelay = 0 } doSimStep(nowInSeconds + 1) } } } else { - nowInSeconds = newNow + updateNow(newNow) if (awaitingResponse.isEmpty) { val duration = Deadline.now - startedAt stuckAgentChecker.foreach(_.cancel) @@ -441,6 +469,17 @@ class BeamAgentScheduler( } } + private def updateNow(newNow: Int): Unit = { + if (nowInSeconds != newNow) { + nowInSeconds = newNow + val currentTime = System.currentTimeMillis() + val delay = currentTime - nowUpdateTime + nowUpdateTime = currentTime + if (longestNowUpdateDelay < delay) + longestNowUpdateDelay = delay + } + } + override def postStop(): Unit = { monitorTask.foreach(_.cancel()) stuckAgentChecker.foreach(_.cancel()) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 06bb010677e..4107607effa 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -2419,9 +2419,11 @@ object BeamConfig { clearRoutedOutstandingWorkEnabled: scala.Boolean, debugActorTimerIntervalInSec: scala.Int, debugEnabled: scala.Boolean, + initialiazationStuckThresholdMin: scala.Int, memoryConsumptionDisplayTimeoutInSec: scala.Int, messageLogging: scala.Boolean, secondsToWaitToClearRoutedOutstandingWork: scala.Int, + simulationStuckThresholdMin: scala.Int, stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, vmInformation: BeamConfig.Beam.Debug.VmInformation, @@ -2579,6 +2581,9 @@ object BeamConfig { debugActorTimerIntervalInSec = if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + initialiazationStuckThresholdMin = + if (c.hasPathOrNull("initialiazationStuckThresholdMin")) c.getInt("initialiazationStuckThresholdMin") + else 180, memoryConsumptionDisplayTimeoutInSec = if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") @@ -2588,6 +2593,8 @@ object BeamConfig { if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, + simulationStuckThresholdMin = + if (c.hasPathOrNull("simulationStuckThresholdMin")) c.getInt("simulationStuckThresholdMin") else 999999, stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") From e6f46ea4880ead2e9b97b023d866004fd3cbf345 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 9 Jun 2022 19:14:49 +0600 Subject: [PATCH 131/307] Package name fixes --- src/main/scala/scripts/PlansBuilder.scala | 4 ++-- src/main/scala/scripts/PlansSamplerApp.scala | 8 ++++---- .../scripts/beam_to_matsim/EventsByVehicleMode.scala | 12 ++++++------ .../scripts/beam_to_matsim/events/BeamActivity.scala | 2 +- .../scripts/beam_to_matsim/events/BeamEvent.scala | 2 +- .../beam_to_matsim/events/BeamModeChoice.scala | 2 +- .../beam_to_matsim/events/BeamPathTraversal.scala | 4 ++-- .../events/BeamPersonEntersVehicle.scala | 2 +- .../events/BeamPersonLeavesVehicle.scala | 2 +- .../MutablePopulationEventsFilter.scala | 4 ++-- .../events_filter/MutablePopulationFilter.scala | 4 ++-- .../events_filter/MutableSamplingFilter.scala | 4 ++-- .../events_filter/MutableVehiclesFilter.scala | 4 ++-- .../beam_to_matsim/events_filter/PersonEvents.scala | 4 ++-- .../beam_to_matsim/events_filter/PersonTrip.scala | 4 ++-- .../events_filter/PopulationSample.scala | 2 +- .../beam_to_matsim/events_filter/VehicleSample.scala | 2 +- .../beam_to_matsim/events_filter/VehicleTrip.scala | 4 ++-- .../scripts/beam_to_matsim/io/BeamEventsReader.scala | 4 ++-- .../scripts/beam_to_matsim/io/ConsoleProgress.scala | 2 +- .../scripts/beam_to_matsim/io/HashSetReader.scala | 2 +- .../scala/scripts/beam_to_matsim/io/Reader.scala | 8 ++++---- .../scala/scripts/beam_to_matsim/io/Writer.scala | 4 ++-- .../scripts/beam_to_matsim/utils/CollectIds.scala | 6 +++--- .../beam_to_matsim/utils/FindIdsInCircles.scala | 6 +++--- .../utils/FindPersonsUsesVehicles.scala | 6 +++--- .../beam_to_matsim/utils/LinkCoordinate.scala | 2 +- .../beam_to_matsim/utils/ZipViaEventsFiles.scala | 2 +- .../beam_to_matsim/via_event/ViaActivity.scala | 2 +- .../scripts/beam_to_matsim/via_event/ViaEvent.scala | 2 +- .../via_event/ViaEventsCollection.scala | 2 +- .../via_event/ViaPersonArrivalEvent.scala | 2 +- .../via_event/ViaPersonDepartureEvent.scala | 2 +- .../via_event/ViaTraverseLinkEvent.scala | 2 +- .../visualization/via/visualization_11.scala | 10 +++++----- .../visualization/via/visualization_12.scala | 8 ++++---- .../visualization/via/visualization_20_24.scala | 10 +++++----- .../visualization/via/visualization_33_34.scala | 10 +++++----- .../visualization/via/visualization_35.scala | 10 +++++----- .../via/visualization_35_person1_alternatives.scala | 4 ++-- .../visualization/via/visualization_3_4_5.scala | 10 +++++----- .../visualization/via/visualization_6.scala | 10 +++++----- .../visualization/via/visualization_9.scala | 10 +++++----- .../scala/scripts/shapefiles/WriteShapeFile.scala | 2 +- .../utils => scripts}/PlansSamplerAppSpec.scala | 6 +++--- .../scripts/beam_to_matsim/LinkCoordinateTest.scala | 4 ++-- .../scala/scripts/beam_to_matsim/io/WriterTest.scala | 4 ++-- test/input/beamville/link-network.csv | 4 ++-- test/input/beamville/merge-network.csv | 4 ++-- 49 files changed, 115 insertions(+), 115 deletions(-) rename src/test/scala/{beam/utils => scripts}/PlansSamplerAppSpec.scala (96%) diff --git a/src/main/scala/scripts/PlansBuilder.scala b/src/main/scala/scripts/PlansBuilder.scala index 1bcf66bafb6..1c6a53e5c8e 100644 --- a/src/main/scala/scripts/PlansBuilder.scala +++ b/src/main/scala/scripts/PlansBuilder.scala @@ -1,8 +1,8 @@ package scripts import beam.utils.plan.sampling.AvailableModeUtils.AllowAllModes -import beam.utils.plan.sampling.HouseholdAttrib.{HomeCoordX, HomeCoordY, HousingType} -import beam.utils.plan.sampling.PopulationAttrib.Rank +import scripts.HouseholdAttrib.{HomeCoordX, HomeCoordY, HousingType} +import scripts.PopulationAttrib.Rank import beam.utils.plan.sampling._ import org.matsim.api.core.v01.network.Node import org.matsim.api.core.v01.population.{Activity, Person, Plan, Population} diff --git a/src/main/scala/scripts/PlansSamplerApp.scala b/src/main/scala/scripts/PlansSamplerApp.scala index 805c7b65091..319e2f452e9 100644 --- a/src/main/scala/scripts/PlansSamplerApp.scala +++ b/src/main/scala/scripts/PlansSamplerApp.scala @@ -1,11 +1,12 @@ -package beam.utils.plan.sampling +package scripts import beam.router.Modes.BeamMode import java.util import beam.utils.matsim_conversion.{MatsimConversionTool, ShapeUtils} -import beam.utils.plan.sampling.HouseholdAttrib.{HomeCoordX, HomeCoordY, HousingType} -import beam.utils.plan.sampling.PopulationAttrib.Rank +import beam.utils.plan.sampling.AvailableModeUtils +import scripts.HouseholdAttrib.{HomeCoordX, HomeCoordY, HousingType} +import scripts.PopulationAttrib.Rank import com.vividsolutions.jts.geom.{Envelope, Geometry, GeometryCollection, GeometryFactory, Point} import enumeratum.EnumEntry._ import enumeratum._ @@ -35,7 +36,6 @@ import org.matsim.utils.objectattributes.{ObjectAttributes, ObjectAttributesXmlW import org.matsim.vehicles.{Vehicle, VehicleUtils, VehicleWriterV1, Vehicles} import org.opengis.feature.simple.SimpleFeature import org.opengis.referencing.crs.CoordinateReferenceSystem -import scripts.PopulationWriterCSV import scala.collection.JavaConverters._ import scala.collection.{immutable, mutable, JavaConverters} diff --git a/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala index 7d28f29b977..29a5a96877f 100644 --- a/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala +++ b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala @@ -1,10 +1,10 @@ -package beam.utils.beam_to_matsim +package scripts.beam_to_matsim -import beam.utils.beam_to_matsim.io.{BeamEventsReader, Reader, Writer} -import beam.utils.beam_to_matsim.utils.{LinkCoordinate, Point} -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} -import beam.utils.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter} -import beam.utils.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.io.{BeamEventsReader, Reader, Writer} +import scripts.beam_to_matsim.utils.{LinkCoordinate, Point} +import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} +import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter} +import scripts.beam_to_matsim.via_event.ViaEvent import scala.collection.mutable import scala.xml.XML diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala index 571b9db8ea8..f3d1bb71f99 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala index c83860c769d..3eae66150e3 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala index 93341a4aae9..a89f16f8eaf 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala index 11fb4e961b3..df692ad59bf 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import beam.router.Modes.BeamMode -import beam.utils.beam_to_matsim.via_event.ViaTraverseLinkEvent +import scripts.beam_to_matsim.via_event.ViaTraverseLinkEvent import org.matsim.api.core.v01.events.Event import scala.collection.JavaConverters._ diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala index 6c0a6f45953..c76d0c9b42f 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala index f762a7525a7..f432f9165b0 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala index 86efbecbd47..bfe5317096c 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.{BeamActivityEnd, BeamActivityStart, BeamEvent, BeamModeChoice} +import scripts.beam_to_matsim.events.{BeamActivityEnd, BeamActivityStart, BeamEvent, BeamModeChoice} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala index b88f2d1c5c5..9174b6d23c2 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events._ +import scripts.beam_to_matsim.events._ import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala index fae5d00d9a0..c8f3162183c 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.BeamEvent +import scripts.beam_to_matsim.events.BeamEvent trait MutableSamplingFilter { def filter(event: BeamEvent): Unit diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala index 51a9818c18e..c505edc07fa 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} +import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala index f752d79ab1f..aba7d56246d 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.BeamEvent +import scripts.beam_to_matsim.events.BeamEvent import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala index 1c74053754c..58fba78496d 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events.BeamPathTraversal import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala index 03d66c813a3..abba684d9f3 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala @@ -1,3 +1,3 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter case class PopulationSample(percentage: Double, personIsInteresting: String => Boolean) diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala index bb648431b56..3716149335d 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala @@ -1,3 +1,3 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter case class VehicleSample(vehicleType: String, percentage: Double) diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala index fc5c6ebae94..e7750e50e11 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events.BeamPathTraversal import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala b/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala index ae150ac804a..3fee160b933 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io import beam.utils.EventReader -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamEventReader} +import scripts.beam_to_matsim.events.{BeamEvent, BeamEventReader} object BeamEventsReader { diff --git a/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala b/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala index 7ee63509c15..ca9a24ca8c5 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io class ConsoleProgress(message: String, maxSteps: Int, percentageToWrite: Int = 10) { diff --git a/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala b/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala index 7b96aace509..9817024f253 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/io/Reader.scala b/src/main/scala/scripts/beam_to_matsim/io/Reader.scala index df492782225..e1b60545e9d 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/Reader.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/Reader.scala @@ -1,8 +1,8 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io -import beam.utils.beam_to_matsim.events.{BeamActivityEnd, BeamActivityStart, BeamModeChoice, BeamPathTraversal} -import beam.utils.beam_to_matsim.events_filter.{MutableSamplingFilter, PersonEvents, VehicleTrip} -import beam.utils.beam_to_matsim.via_event._ +import scripts.beam_to_matsim.events.{BeamActivityEnd, BeamActivityStart, BeamModeChoice, BeamPathTraversal} +import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, PersonEvents, VehicleTrip} +import scripts.beam_to_matsim.via_event._ import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/io/Writer.scala b/src/main/scala/scripts/beam_to_matsim/io/Writer.scala index 50e7c29f9b2..a893064babb 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/Writer.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/Writer.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io import beam.utils.FileUtils -import beam.utils.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} +import scripts.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} import java.io.{File, PrintWriter} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/utils/CollectIds.scala b/src/main/scala/scripts/beam_to_matsim/utils/CollectIds.scala index 53ef1699b45..35302ce8654 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/CollectIds.scala +++ b/src/main/scala/scripts/beam_to_matsim/utils/CollectIds.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.utils +package scripts.beam_to_matsim.utils -import beam.utils.beam_to_matsim.io.{BeamEventsReader, HashSetReader, Writer} -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} +import scripts.beam_to_matsim.io.{BeamEventsReader, HashSetReader, Writer} +import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala b/src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala index 4e1f50e9ded..aa6771215ec 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala +++ b/src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.utils +package scripts.beam_to_matsim.utils -import beam.utils.beam_to_matsim.io.{BeamEventsReader, Writer} -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} +import scripts.beam_to_matsim.io.{BeamEventsReader, Writer} +import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} import scala.collection.mutable import scala.xml.XML diff --git a/src/main/scala/scripts/beam_to_matsim/utils/FindPersonsUsesVehicles.scala b/src/main/scala/scripts/beam_to_matsim/utils/FindPersonsUsesVehicles.scala index f8419bb4572..8c48d0f6a72 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/FindPersonsUsesVehicles.scala +++ b/src/main/scala/scripts/beam_to_matsim/utils/FindPersonsUsesVehicles.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.utils +package scripts.beam_to_matsim.utils -import beam.utils.beam_to_matsim.io.{BeamEventsReader, Writer} -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPersonEntersVehicle} +import scripts.beam_to_matsim.io.{BeamEventsReader, Writer} +import scripts.beam_to_matsim.events.{BeamEvent, BeamPersonEntersVehicle} import scala.collection.mutable import scala.io.Source diff --git a/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala b/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala index c08934343e4..ef6406c0025 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala +++ b/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.utils +package scripts.beam_to_matsim.utils import scala.collection.mutable import scala.xml.{Elem, Node} diff --git a/src/main/scala/scripts/beam_to_matsim/utils/ZipViaEventsFiles.scala b/src/main/scala/scripts/beam_to_matsim/utils/ZipViaEventsFiles.scala index ffbe0d435cc..92d7077d6f4 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/ZipViaEventsFiles.scala +++ b/src/main/scala/scripts/beam_to_matsim/utils/ZipViaEventsFiles.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.utils +package scripts.beam_to_matsim.utils import java.io.{File, PrintWriter} diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala index 0a97b5daa41..88eb607320c 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event sealed trait ActType object ActionStart extends ActType diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala index 928ae0ed0bb..f311a18ef1d 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event trait ViaEvent { var time: Double diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala index d6aa780043e..a5bf9804da6 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event import scala.collection.mutable.ArrayBuffer diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala index 40d33f62583..bfcc7da380b 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event case class ViaPersonArrivalEvent(var time: Double, person: String, link: Int) extends ViaEvent { diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala index a9288920361..0a82b20abf5 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event case class ViaPersonDepartureEvent(var time: Double, person: String, link: Int) extends ViaEvent { diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala index 8650b3b95fd..8b0a9bb48fb 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event sealed trait ViaTraverseLinkEventType object EnteredLink extends ViaTraverseLinkEventType diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala index 0f0dffcbdff..0f5394021d3 100755 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala +++ b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala @@ -1,9 +1,9 @@ -package beam.utils.beam_to_matsim.visualization.via +package scripts.beam_to_matsim.visualization.via -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter, VehicleSample} -import beam.utils.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import beam.utils.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter, VehicleSample} +import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} +import scripts.beam_to_matsim.via_event.ViaEvent import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala index 14298170704..dc21ddae26f 100755 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala +++ b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala @@ -1,8 +1,8 @@ -package beam.utils.beam_to_matsim.visualization.via +package scripts.beam_to_matsim.visualization.via -import beam.utils.beam_to_matsim.events_filter.{MutablePopulationFilter, MutableSamplingFilter, PopulationSample} -import beam.utils.beam_to_matsim.io.{Reader, Writer} -import beam.utils.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} +import scripts.beam_to_matsim.events_filter.{MutablePopulationFilter, MutableSamplingFilter, PopulationSample} +import scripts.beam_to_matsim.io.{Reader, Writer} +import scripts.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} import java.io.File import java.nio.file.Files diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala index 652149a57d6..faef760dc11 100755 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala +++ b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala @@ -1,9 +1,9 @@ -package beam.utils.beam_to_matsim.visualization.via +package scripts.beam_to_matsim.visualization.via -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.events_filter.{MutablePopulationFilter, MutableSamplingFilter, PopulationSample} -import beam.utils.beam_to_matsim.io.{Reader, Writer} -import beam.utils.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events_filter.{MutablePopulationFilter, MutableSamplingFilter, PopulationSample} +import scripts.beam_to_matsim.io.{Reader, Writer} +import scripts.beam_to_matsim.via_event.ViaEvent object visualization_20_24 extends App { val beamEventsFilePath = "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half.csv" diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala index aa15c7ee782..cd608462b89 100755 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala +++ b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala @@ -1,9 +1,9 @@ -package beam.utils.beam_to_matsim.visualization.via +package scripts.beam_to_matsim.visualization.via -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.events_filter.MutableVehiclesFilter -import beam.utils.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import beam.utils.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events_filter.MutableVehiclesFilter +import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} +import scripts.beam_to_matsim.via_event.ViaEvent object visualization_33_34 extends App { val dirPath = "D:/Work/BEAM/visualizations/" diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala index c7a4aeed907..e39ac461771 100755 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala +++ b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala @@ -1,9 +1,9 @@ -package beam.utils.beam_to_matsim.visualization.via +package scripts.beam_to_matsim.visualization.via -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.events_filter.{MutableVehiclesFilter, VehicleTrip} -import beam.utils.beam_to_matsim.io.{Reader, Writer} -import beam.utils.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events_filter.{MutableVehiclesFilter, VehicleTrip} +import scripts.beam_to_matsim.io.{Reader, Writer} +import scripts.beam_to_matsim.via_event.ViaEvent import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala index 8ea22d32755..2974118df7b 100755 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala +++ b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.visualization.via +package scripts.beam_to_matsim.visualization.via -import beam.utils.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events.BeamPathTraversal import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala index 86dc81aa1f9..eeac8a2ea33 100755 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala +++ b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala @@ -1,9 +1,9 @@ -package beam.utils.beam_to_matsim.visualization.via +package scripts.beam_to_matsim.visualization.via -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter, VehicleSample} -import beam.utils.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import beam.utils.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter, VehicleSample} +import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} +import scripts.beam_to_matsim.via_event.ViaEvent object visualization_3_4_5 extends App { diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala index ed4518e6128..bf35d26ad12 100755 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala +++ b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala @@ -1,9 +1,9 @@ -package beam.utils.beam_to_matsim.visualization.via +package scripts.beam_to_matsim.visualization.via -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter, VehicleSample} -import beam.utils.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import beam.utils.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter, VehicleSample} +import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} +import scripts.beam_to_matsim.via_event.ViaEvent object visualization_6 extends App { diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala index 922f1d830b9..23a81e9896a 100755 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala +++ b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala @@ -1,9 +1,9 @@ -package beam.utils.beam_to_matsim.visualization.via +package scripts.beam_to_matsim.visualization.via -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.events_filter.{MutablePopulationFilter, MutableSamplingFilter, PopulationSample} -import beam.utils.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import beam.utils.beam_to_matsim.via_event.ViaEventsCollection +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events_filter.{MutablePopulationFilter, MutableSamplingFilter, PopulationSample} +import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} +import scripts.beam_to_matsim.via_event.ViaEventsCollection object visualization_9 extends App { val personsInCircleFilePath = "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half_in_SF.persons.txt" diff --git a/src/main/scala/scripts/shapefiles/WriteShapeFile.scala b/src/main/scala/scripts/shapefiles/WriteShapeFile.scala index abf0b2aff52..b3e348b0e34 100644 --- a/src/main/scala/scripts/shapefiles/WriteShapeFile.scala +++ b/src/main/scala/scripts/shapefiles/WriteShapeFile.scala @@ -1,4 +1,4 @@ -package beam.utils.shapefiles +package scripts.shapefiles import java.nio.file.{Files, Paths} diff --git a/src/test/scala/beam/utils/PlansSamplerAppSpec.scala b/src/test/scala/scripts/PlansSamplerAppSpec.scala similarity index 96% rename from src/test/scala/beam/utils/PlansSamplerAppSpec.scala rename to src/test/scala/scripts/PlansSamplerAppSpec.scala index fc884901b13..b493f80f5c6 100755 --- a/src/test/scala/beam/utils/PlansSamplerAppSpec.scala +++ b/src/test/scala/scripts/PlansSamplerAppSpec.scala @@ -1,13 +1,13 @@ -package beam.utils +package scripts import beam.sim.population.PopulationAdjustment import beam.tags.{ExcludeRegular, Periodic} -import beam.utils.plan.sampling.PlansSampler +import beam.utils.FileUtils import org.matsim.core.config.ConfigUtils import org.matsim.core.scenario.{MutableScenario, ScenarioUtils} import org.matsim.utils.objectattributes.ObjectAttributes -import org.scalatest.wordspec.AnyWordSpecLike import org.scalatest.matchers.should.Matchers +import org.scalatest.wordspec.AnyWordSpecLike class PlansSamplerAppSpec extends AnyWordSpecLike with Matchers { diff --git a/src/test/scala/scripts/beam_to_matsim/LinkCoordinateTest.scala b/src/test/scala/scripts/beam_to_matsim/LinkCoordinateTest.scala index a6169795853..c1fadf7acc6 100644 --- a/src/test/scala/scripts/beam_to_matsim/LinkCoordinateTest.scala +++ b/src/test/scala/scripts/beam_to_matsim/LinkCoordinateTest.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim +package scripts.beam_to_matsim -import beam.utils.beam_to_matsim.utils.{LinkCoordinate, Point} +import scripts.beam_to_matsim.utils.{LinkCoordinate, Point} import org.scalatest.flatspec.AnyFlatSpecLike import org.scalatest.matchers.should.Matchers diff --git a/src/test/scala/scripts/beam_to_matsim/io/WriterTest.scala b/src/test/scala/scripts/beam_to_matsim/io/WriterTest.scala index c248737bd65..22e38f8e011 100644 --- a/src/test/scala/scripts/beam_to_matsim/io/WriterTest.scala +++ b/src/test/scala/scripts/beam_to_matsim/io/WriterTest.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io -import beam.utils.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} +import scripts.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} import org.scalatest.funsuite.AnyFunSuite import org.scalatest.matchers.should.Matchers diff --git a/test/input/beamville/link-network.csv b/test/input/beamville/link-network.csv index 51340e3c17a..37d46792c7f 100644 --- a/test/input/beamville/link-network.csv +++ b/test/input/beamville/link-network.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d43e1824bd06fa8752719c129e8610547a1b5adb83e5203b2923a1b4cc07ed51 -size 27097 +oid sha256:0ef9bd51fce96fff8bf747d298009eef45626f663616f2641b0a0180380e15ec +size 31885 diff --git a/test/input/beamville/merge-network.csv b/test/input/beamville/merge-network.csv index adf79f2772e..9c7c560bb13 100644 --- a/test/input/beamville/merge-network.csv +++ b/test/input/beamville/merge-network.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:505c90fd3b671367bbfe39b157fdbc12d2a203f55fe6bed225653b997faa02f4 -size 56735 +oid sha256:58b9d546bbc27977e1a6e80af268c820a05fbac6f6ea42018b0f07864cb2308c +size 61523 From 45e37f062a90bc81b864d93b7ad052b0bc5625ed Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 9 Jun 2022 20:40:34 +0600 Subject: [PATCH 132/307] Detect git commit sha in case it is not set instead of using HEAD --- aws/build.gradle | 7 ++++++- gradle.deploy.properties | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index 40195542042..bd1832caff1 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -87,7 +87,7 @@ task deploy(type: AWSLambdaInvokeTask) { "deploy_type_tag": "${ext.getParameterValue('deployTypeTag')}", "branch": "${ext.getParameterValue('beamBranch') ?: getCurrentGitBranch()}", "data_branch": "$dataBranch", - "commit": "${ext.getParameterValue('beamCommit') ?: 'HEAD'}", + "commit": "${ext.getParameterValue('beamCommit') ?: getCurrentGitCommit()}", "deploy_mode": "${ext.getParameterValue('deployMode')}", "configs": "${ext.getParameterValue('beamConfigs') ?: ext.getParameterValue(getCurrentGitBranch() + '.configs')}", "experiments": "${ext.getParameterValue('beamExperiments') ?: ext.getParameterValue(getCurrentGitBranch() + '.experiments')}", @@ -147,6 +147,7 @@ task deployPilates(type: AWSLambdaInvokeTask) { defaultParamVals['region'] = defRegion defaultParamVals['dataRegion'] = defRegion defaultParamVals['beamBranch'] = getCurrentGitBranch() + defaultParamVals['beamCommit'] = getCurrentGitCommit() defaultParamVals['dataBranch'] = 'develop' def paramMap = [:] @@ -280,6 +281,10 @@ def getCurrentGitBranch() { return getGitResultFromWorkingDirUsing('git rev-parse --abbrev-ref HEAD', "$defaultBranch") } +def getCurrentGitCommit() { + return getGitResultFromWorkingDirUsing('git log -1 --pretty=format:%H', 'HEAD') +} + def getCurrentGitUserEmail() { def rawGitUserEmail = getGitResultFromWorkingDirUsing('git config user.email', "GitUserEmailNotFound") return rawGitUserEmail.replaceAll('@', "AT").replaceAll("\\.", "_") diff --git a/gradle.deploy.properties b/gradle.deploy.properties index 0f687ec06c7..08c32853ce4 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -1,6 +1,6 @@ runName=inm/austin-100k-teleportation-ON-vs-OFF beamBranch=develop -beamCommit=dc4b0b05a3885357c7b5b65fb91181c8163aa9b6 +#beamCommit=dc4b0b05a3885357c7b5b65fb91181c8163aa9b6 beamConfigs=test/input/sf-light/sf-light-1k-with-PTE-duplicates-1.conf,test/input/sf-light/sf-light-1k-with-PTE-duplicates-2.conf instanceType=r5.8xlarge From 58a47c1aed19e3b0676a15afafb27994216ab375 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 9 Jun 2022 23:27:44 -0700 Subject: [PATCH 133/307] testing performance --- src/main/R/gemini/gemini-main.R | 8 ++++++-- .../beam/agentsim/infrastructure/ChargingNetwork.scala | 5 ++--- .../agentsim/infrastructure/ChargingNetworkManager.scala | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 3c3660e13c8..fe6c0a03100 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -55,7 +55,10 @@ for(j in 1:nrow(publicLoads)){ temp <- publicLoads.ByChargeType[code==publicLoads[j,]$code] temp$fuelShare <- temp$fuel/publicLoads[j,]$fuel print(publicLoads[j,]$code) - print(temp[,.(loadType,fuelShare)][order(factor(loadType,levels=names(chargingTypes.colors)))]) + charging <- temp[,.(loadType,fuelShare)][order(factor(loadType,levels=names(chargingTypes.colors)))] + print(charging) + print(pp("FC: ", charging[loadType=="XFC"]$fuelShare+charging[loadType=="DCFC"]$fuelShare)) + print(pp("Home: ", charging[loadType=="Home-L1"]$fuelShare+charging[loadType=="Home-L2"]$fuelShare)) } scens <- as.data.table(readCsv(pp(resultsDir,'/../scenarios.csv'))) all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) @@ -65,7 +68,8 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') -scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') +#scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') +scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5') #scenarioNames <- c('BaseXFC', 'HighEV') #scenarioBaselineLabel <- 'BaseXFC' diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 5bf49472279..6b4d0ae8301 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -39,7 +39,7 @@ class ChargingNetwork(val parkingZones: Map[Id[ParkingZoneId], ParkingZone]) ext /** * @return all vehicles still connected to a charging point */ - def connectedVehicles: Map[Id[BeamVehicle], ChargingVehicle] = + def connectedVehicles: Iterable[ChargingVehicle] = chargingZoneKeyToChargingStationMap.flatMap(_._2.connectedVehicles) /** @@ -244,8 +244,7 @@ object ChargingNetwork extends LazyLogging { def numAvailableChargers: Int = zone.maxStalls - howManyVehiclesAreCharging - howManyVehiclesAreInGracePeriodAfterCharging - private[ChargingNetwork] def connectedVehicles: collection.Map[Id[BeamVehicle], ChargingVehicle] = - chargingVehiclesInternal + private[ChargingNetwork] def connectedVehicles: Iterable[ChargingVehicle] = chargingVehiclesInternal.values def howManyVehiclesAreWaiting: Int = waitingLineInternal.size def howManyVehiclesAreCharging: Int = chargingVehiclesInternal.size diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 3a59e66982a..cd502225695 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -114,7 +114,7 @@ class ChargingNetworkManager( // obtaining physical bounds val physicalBounds = powerController.obtainPowerPhysicalBounds(timeBin, loadEstimate) val allConnectedVehicles = chargingNetwork.connectedVehicles ++ rideHailNetwork.connectedVehicles - val triggers = allConnectedVehicles.par.flatMap { case (_, chargingVehicle) => + val triggers = allConnectedVehicles.par.flatMap { chargingVehicle => // Refuel handleRefueling(chargingVehicle) // Calculate the energy to charge and prepare for next current cycle of charging From b1d8c9bffb51cfce74119c0b5158968687324ccd Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 10 Jun 2022 19:30:24 -0700 Subject: [PATCH 134/307] rolling back previous change --- .../scala/beam/agentsim/infrastructure/ChargingNetwork.scala | 5 +++-- .../agentsim/infrastructure/ChargingNetworkManager.scala | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 6b4d0ae8301..5bf49472279 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -39,7 +39,7 @@ class ChargingNetwork(val parkingZones: Map[Id[ParkingZoneId], ParkingZone]) ext /** * @return all vehicles still connected to a charging point */ - def connectedVehicles: Iterable[ChargingVehicle] = + def connectedVehicles: Map[Id[BeamVehicle], ChargingVehicle] = chargingZoneKeyToChargingStationMap.flatMap(_._2.connectedVehicles) /** @@ -244,7 +244,8 @@ object ChargingNetwork extends LazyLogging { def numAvailableChargers: Int = zone.maxStalls - howManyVehiclesAreCharging - howManyVehiclesAreInGracePeriodAfterCharging - private[ChargingNetwork] def connectedVehicles: Iterable[ChargingVehicle] = chargingVehiclesInternal.values + private[ChargingNetwork] def connectedVehicles: collection.Map[Id[BeamVehicle], ChargingVehicle] = + chargingVehiclesInternal def howManyVehiclesAreWaiting: Int = waitingLineInternal.size def howManyVehiclesAreCharging: Int = chargingVehiclesInternal.size diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index cd502225695..3a59e66982a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -114,7 +114,7 @@ class ChargingNetworkManager( // obtaining physical bounds val physicalBounds = powerController.obtainPowerPhysicalBounds(timeBin, loadEstimate) val allConnectedVehicles = chargingNetwork.connectedVehicles ++ rideHailNetwork.connectedVehicles - val triggers = allConnectedVehicles.par.flatMap { chargingVehicle => + val triggers = allConnectedVehicles.par.flatMap { case (_, chargingVehicle) => // Refuel handleRefueling(chargingVehicle) // Calculate the energy to charge and prepare for next current cycle of charging From eb79d053a359eadbf0ff74f42aae57543905110a Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Mon, 13 Jun 2022 10:44:41 +0300 Subject: [PATCH 135/307] Addressed peer review notes --- src/main/resources/beam-template.conf | 4 ++-- .../agentsim/scheduler/BeamAgentScheduler.scala | 6 +++--- src/main/scala/beam/sim/config/BeamConfig.scala | 15 +++++++++------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 9a44195a6a8..8eb4ebc89db 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -765,8 +765,8 @@ beam.debug { writeRealizedModeChoiceFile = "boolean | false" messageLogging = "boolean | false" # the max of the next 2 values is taken for the initialization step - simulationStuckThresholdMin = "int | 999999" - initialiazationStuckThresholdMin = "int | 180" + maxSimulationStepTimeBeforeConsideredStuckMin = "int | 999999" + maxInitializationTimeBeforeConsideredStuckMin = "int | 180" } beam.logger.keepConsoleAppenderOn = "boolean | true" diff --git a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala index 2ee5fc02c39..1a30802b7ca 100644 --- a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala +++ b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala @@ -262,10 +262,10 @@ class BeamAgentScheduler( val stuckThreshold = if (nowInSeconds == 0) Math.max( - beamConfig.beam.debug.initialiazationStuckThresholdMin, - beamConfig.beam.debug.simulationStuckThresholdMin + beamConfig.beam.debug.maxInitializationTimeBeforeConsideredStuckMin, + beamConfig.beam.debug.maxSimulationStepTimeBeforeConsideredStuckMin ) - else beamConfig.beam.debug.simulationStuckThresholdMin + else beamConfig.beam.debug.maxSimulationStepTimeBeforeConsideredStuckMin val currentDelay = System.currentTimeMillis() - nowUpdateTime if (currentDelay > stuckThreshold * 60 * 1000) { log.error("Forcibly terminating beam because of too long update delay: {}", currentDelay) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 4107607effa..4e6f5e99d1c 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -2419,11 +2419,11 @@ object BeamConfig { clearRoutedOutstandingWorkEnabled: scala.Boolean, debugActorTimerIntervalInSec: scala.Int, debugEnabled: scala.Boolean, - initialiazationStuckThresholdMin: scala.Int, + maxInitializationTimeBeforeConsideredStuckMin: scala.Int, + maxSimulationStepTimeBeforeConsideredStuckMin: scala.Int, memoryConsumptionDisplayTimeoutInSec: scala.Int, messageLogging: scala.Boolean, secondsToWaitToClearRoutedOutstandingWork: scala.Int, - simulationStuckThresholdMin: scala.Int, stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, vmInformation: BeamConfig.Beam.Debug.VmInformation, @@ -2581,9 +2581,14 @@ object BeamConfig { debugActorTimerIntervalInSec = if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - initialiazationStuckThresholdMin = - if (c.hasPathOrNull("initialiazationStuckThresholdMin")) c.getInt("initialiazationStuckThresholdMin") + maxInitializationTimeBeforeConsideredStuckMin = + if (c.hasPathOrNull("maxInitializationTimeBeforeConsideredStuckMin")) + c.getInt("maxInitializationTimeBeforeConsideredStuckMin") else 180, + maxSimulationStepTimeBeforeConsideredStuckMin = + if (c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) + c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") + else 999999, memoryConsumptionDisplayTimeoutInSec = if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") @@ -2593,8 +2598,6 @@ object BeamConfig { if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, - simulationStuckThresholdMin = - if (c.hasPathOrNull("simulationStuckThresholdMin")) c.getInt("simulationStuckThresholdMin") else 999999, stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") From 0dbde4c51da34a77cbf2b5de456e6eeb828564be Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 13 Jun 2022 17:00:13 -0700 Subject: [PATCH 136/307] fix --- src/main/R/gemini/gemini-main.R | 11 ++++++++--- src/main/python/gemini/events_processing.py | 4 ++-- src/main/resources/beam-template.conf | 3 ++- .../agents/household/HouseholdFleetManager.scala | 2 +- .../beam/agentsim/agents/parking/ChoosesParking.scala | 6 +++++- src/main/scala/beam/sim/config/BeamConfig.scala | 5 ++++- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index fe6c0a03100..48c8b66fd81 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -59,17 +59,20 @@ for(j in 1:nrow(publicLoads)){ print(charging) print(pp("FC: ", charging[loadType=="XFC"]$fuelShare+charging[loadType=="DCFC"]$fuelShare)) print(pp("Home: ", charging[loadType=="Home-L1"]$fuelShare+charging[loadType=="Home-L2"]$fuelShare)) + print(pp("tot fuel: ", sum(temp$fuel))) } scens <- as.data.table(readCsv(pp(resultsDir,'/../scenarios.csv'))) all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) - +# let’s squeeze a short date some time this weeklet’s squeeze a short date some time this week ##### # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') -#scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') -scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5') +scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') +# scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5') +# scenarioNames <- c('5b1', '5b2') +# scenarioNames <- c('5b3', '5b4', '5b5', '5b6', '5b7') #scenarioNames <- c('BaseXFC', 'HighEV') #scenarioBaselineLabel <- 'BaseXFC' @@ -206,6 +209,8 @@ ggsave(pp(plotsDir,'/baseline-ev-charging-loads-by-space-time-in-oakland.png'),p ## ************************************** ## public charging by scenario +#scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') +scenarioNames <- c('5b1', '5b2') p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ theme_marain() + diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index accd1f75a20..89c701b3816 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,8 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022-04-28-bis/' -filename = '0.events.5bBase.csv.gz' +work_directory = '~/Data/GEMINI/2022-04-27-Calibration/' +filename = '0.events.5b7.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 54d5cb4e872..d9c075f7fc5 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -172,7 +172,8 @@ beam.agentsim.agents.parking.searchMaxDistanceRelativeToEllipseFoci = "double | beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds = "double | 60.0" # in seconds, something small enough but has meaningful impact on pricing beam.agentsim.agents.parking.fractionOfSameTypeZones = "double | 0.5" beam.agentsim.agents.parking.minNumberOfSameTypeZones = "int | 10" -beam.agentsim.agents.parking.overnightChargingSampleSize = "double | 0" +beam.agentsim.agents.parking.overnightChargingSampleSize = "double | 0.0" +beam.agentsim.agents.parking.homeChargingSampleSize = "double | 1.0" #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index ec4a20edf1b..6292c809a83 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -105,7 +105,7 @@ class HouseholdFleetManager( ) // TODO Overnight charging is still a work in progress and might produce unexpected results val probabilityOfOvernightCharging = - rand.nextDouble() < beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize + rand.nextDouble() <= beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize if (vehicle.isEV && probabilityOfOvernightCharging) (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) else (parkingManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 180f13cec47..76978e13d50 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -38,6 +38,7 @@ import org.slf4j.LoggerFactory import scala.concurrent.duration._ import scala.language.postfixOps +import scala.util.Random /** * BEAM @@ -254,12 +255,15 @@ trait ChoosesParking extends { remainingTourDistance: Double ): Boolean = { val conf = beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination + val rand = new Random(beamScenario.beamConfig.matsim.modules.global.randomSeed) + val homeChargingSampleSize = beamScenario.beamConfig.beam.agentsim.agents.parking.homeChargingSampleSize ParkingInquiry.activityTypeStringToEnum(activityType) match { - case ParkingActivityType.Home => + case ParkingActivityType.Home if rand.nextDouble() <= homeChargingSampleSize => vehicle.isRefuelNeeded( remainingTourDistance + conf.home.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters ) + case ParkingActivityType.Home => false case _ => vehicle.isRefuelNeeded( remainingTourDistance + conf.refuelRequiredThresholdInMeters, diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 1662cc1bd41..3e527b215a6 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -717,6 +717,7 @@ object BeamConfig { case class Parking( estimatedMinParkingDurationInSeconds: scala.Double, fractionOfSameTypeZones: scala.Double, + homeChargingSampleSize: scala.Double, maxSearchRadius: scala.Double, minNumberOfSameTypeZones: scala.Int, minSearchRadius: scala.Double, @@ -782,6 +783,8 @@ object BeamConfig { else 60.0, fractionOfSameTypeZones = if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, + homeChargingSampleSize = + if (c.hasPathOrNull("homeChargingSampleSize")) c.getDouble("homeChargingSampleSize") else 1.0, maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, minNumberOfSameTypeZones = if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, @@ -791,7 +794,7 @@ object BeamConfig { else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") ), overnightChargingSampleSize = - if (c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0, + if (c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0.0, rangeAnxietyBuffer = if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, searchMaxDistanceRelativeToEllipseFoci = From 3809c41629a9485883c170210160e91cc52e00b3 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 14 Jun 2022 16:27:03 -0700 Subject: [PATCH 137/307] fmt --- .../beam/agentsim/agents/parking/ChoosesParking.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 76978e13d50..9d66e6b8d12 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -257,13 +257,13 @@ trait ChoosesParking extends { val conf = beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination val rand = new Random(beamScenario.beamConfig.matsim.modules.global.randomSeed) val homeChargingSampleSize = beamScenario.beamConfig.beam.agentsim.agents.parking.homeChargingSampleSize - ParkingInquiry.activityTypeStringToEnum(activityType) match { - case ParkingActivityType.Home if rand.nextDouble() <= homeChargingSampleSize => + val parkingTypeActivity = ParkingInquiry.activityTypeStringToEnum(activityType) + val refuelDecision = parkingTypeActivity match { + case ParkingActivityType.Home => vehicle.isRefuelNeeded( remainingTourDistance + conf.home.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters ) - case ParkingActivityType.Home => false case _ => vehicle.isRefuelNeeded( remainingTourDistance + conf.refuelRequiredThresholdInMeters, @@ -271,6 +271,9 @@ trait ChoosesParking extends { ) true } + if (refuelDecision && parkingTypeActivity == ParkingActivityType.Home) + rand.nextDouble() <= homeChargingSampleSize + else refuelDecision } onTransition { case ReadyToChooseParking -> ChoosingParkingSpot => From b2fbaf11e18449b4669b204ed902992e66ee3417 Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Wed, 15 Jun 2022 18:32:19 +0300 Subject: [PATCH 138/307] Fixed int overflow --- .../beam/agentsim/scheduler/BeamAgentScheduler.scala | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala index 1a30802b7ca..014d9999147 100644 --- a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala +++ b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala @@ -259,16 +259,20 @@ class BeamAgentScheduler( case SimulationStuckCheck => if (started) { - val stuckThreshold = + val stuckThresholdMin = if (nowInSeconds == 0) Math.max( beamConfig.beam.debug.maxInitializationTimeBeforeConsideredStuckMin, beamConfig.beam.debug.maxSimulationStepTimeBeforeConsideredStuckMin ) else beamConfig.beam.debug.maxSimulationStepTimeBeforeConsideredStuckMin - val currentDelay = System.currentTimeMillis() - nowUpdateTime - if (currentDelay > stuckThreshold * 60 * 1000) { - log.error("Forcibly terminating beam because of too long update delay: {}", currentDelay) + val currentDelayMillis = System.currentTimeMillis() - nowUpdateTime + if (currentDelayMillis > stuckThresholdMin * 60000L) { + log.error( + "Forcibly terminating beam because of too long update delay: {} at simulation time {}", + currentDelayMillis, + nowInSeconds + ) System.exit(10) } } From e5cf78aca8c7cb43cbdabdd652a4df86558cfde7 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 15 Jun 2022 17:14:31 -0700 Subject: [PATCH 139/307] rollback change --- docs/behaviors.rst | 2 +- src/main/R/gemini/gemini-main.R | 2 +- src/main/resources/beam-template.conf | 1 - .../beam/agentsim/agents/parking/ChoosesParking.scala | 9 +-------- .../infrastructure/parking/ParkingZoneFileUtils.scala | 8 ++------ src/main/scala/beam/sim/config/BeamConfig.scala | 3 --- test/input/beamville/beam-urbansimv2.conf | 1 - test/input/beamville/beam.conf | 1 - test/input/equil-square/equil-0.001k.conf | 1 - 9 files changed, 5 insertions(+), 23 deletions(-) diff --git a/docs/behaviors.rst b/docs/behaviors.rst index 4a231e5adf8..cb30ee95c55 100755 --- a/docs/behaviors.rst +++ b/docs/behaviors.rst @@ -70,7 +70,7 @@ In BEAM, parking is issued at the granularity of a Traffic Analysis Zone (TAZ). | *reservedFor* | Any, RideHailManager | +----------------+----------------------------------------------+ -BEAM agents seek parking mid-tour, from within a leg of their trip. A search is run which starts at the trip destination and expands outward, seeking to find the closest TAZ centers with increasing search radii. Agents will pick the closest and cheapest parking alternative with attributes which match their use case. The location can be overridden for ride hail agents using the config parameter *beam.agentsim.agents.rideHail.refuelLocationType*, which may be set to "AtRequestLocation" or "AtTAZCenter". +BEAM agents seek parking mid-tour, from within a leg of their trip. A search is run which starts at the trip destination and expands outward, seeking to find the closest TAZ centers with increasing search radii. Agents will pick the closest and cheapest parking alternative with attributes which match their use case. The following should be considered when configuring a set of parking alternatives. The default behavior is to provide a nearly unbounded number of parking stalls for each combination of attributes, per TAZ, for the public, and provide no parking alternatives for ride hail agents. This behavior can be overridden manually by providing replacement values in the parking configuration file. Parking which is *reservedFor* a RideHailManager should only appear as *Workplace* parking. Free parking can be instantiated by setting *feeInCents* to zero. *numStalls* should be non-negative. Charging behavior is currently implemented for ride hail agents only. diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 48c8b66fd81..d4baf5b8fc3 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -210,7 +210,7 @@ ggsave(pp(plotsDir,'/baseline-ev-charging-loads-by-space-time-in-oakland.png'),p ## ************************************** ## public charging by scenario #scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') -scenarioNames <- c('5b1', '5b2') +scenarioNames <- c('5b1', '5b2', '5b3', '5b5', '5b6', '5b7') p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ theme_marain() + diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index d9c075f7fc5..f37a22a4cc4 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -173,7 +173,6 @@ beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds = "double | 6 beam.agentsim.agents.parking.fractionOfSameTypeZones = "double | 0.5" beam.agentsim.agents.parking.minNumberOfSameTypeZones = "int | 10" beam.agentsim.agents.parking.overnightChargingSampleSize = "double | 0.0" -beam.agentsim.agents.parking.homeChargingSampleSize = "double | 1.0" #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 9d66e6b8d12..180f13cec47 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -38,7 +38,6 @@ import org.slf4j.LoggerFactory import scala.concurrent.duration._ import scala.language.postfixOps -import scala.util.Random /** * BEAM @@ -255,10 +254,7 @@ trait ChoosesParking extends { remainingTourDistance: Double ): Boolean = { val conf = beamScenario.beamConfig.beam.agentsim.agents.vehicles.destination - val rand = new Random(beamScenario.beamConfig.matsim.modules.global.randomSeed) - val homeChargingSampleSize = beamScenario.beamConfig.beam.agentsim.agents.parking.homeChargingSampleSize - val parkingTypeActivity = ParkingInquiry.activityTypeStringToEnum(activityType) - val refuelDecision = parkingTypeActivity match { + ParkingInquiry.activityTypeStringToEnum(activityType) match { case ParkingActivityType.Home => vehicle.isRefuelNeeded( remainingTourDistance + conf.home.refuelRequiredThresholdInMeters, @@ -271,9 +267,6 @@ trait ChoosesParking extends { ) true } - if (refuelDecision && parkingTypeActivity == ParkingActivityType.Home) - rand.nextDouble() <= homeChargingSampleSize - else refuelDecision } onTransition { case ReadyToChooseParking -> ChoosingParkingSpot => diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala index 2c808f100a1..2c744b36a6b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingZoneFileUtils.scala @@ -521,12 +521,8 @@ object ParkingZoneFileUtils extends ExponentialLazyLogging { defaultReservedFor: Option[ReservedFor] = None ): ReservedFor = { VehicleManager.createOrGetReservedFor(reservedForString, beamConfigMaybe) match { - case Some(reservedFor) => - logger.info(s"ParkingZoneFileUtils. reservedFor: ${reservedFor.toString}") - reservedFor - case None if defaultReservedFor.nonEmpty => - logger.info(s"ParkingZoneFileUtils. defaultReservedFor: ${reservedForString}") - defaultReservedFor.get + case Some(reservedFor) => reservedFor + case None if defaultReservedFor.nonEmpty => defaultReservedFor.get case _ => logger.warn( s"The following reservedFor value $reservedForString in parking file " + diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 3e527b215a6..f01b860f423 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -717,7 +717,6 @@ object BeamConfig { case class Parking( estimatedMinParkingDurationInSeconds: scala.Double, fractionOfSameTypeZones: scala.Double, - homeChargingSampleSize: scala.Double, maxSearchRadius: scala.Double, minNumberOfSameTypeZones: scala.Int, minSearchRadius: scala.Double, @@ -783,8 +782,6 @@ object BeamConfig { else 60.0, fractionOfSameTypeZones = if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, - homeChargingSampleSize = - if (c.hasPathOrNull("homeChargingSampleSize")) c.getDouble("homeChargingSampleSize") else 1.0, maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, minNumberOfSameTypeZones = if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, diff --git a/test/input/beamville/beam-urbansimv2.conf b/test/input/beamville/beam-urbansimv2.conf index 65db71b6e4c..e4ee1908923 100755 --- a/test/input/beamville/beam-urbansimv2.conf +++ b/test/input/beamville/beam-urbansimv2.conf @@ -180,7 +180,6 @@ beam.agentsim.agents.rideHail.defaultCostPerMinute=0.75 beam.agentsim.agents.rideHail.refuelThresholdInMeters=5000.0 beam.agentsim.agents.rideHail.rideHailManager.radiusInMeters=5000 beam.agentsim.agents.rideHail.iterationStats.timeBinSizeInSec=3600 -beam.agentsim.agents.rideHail.refuelLocationType="AtRequestLocation" # SurgePricing parameters beam.agentsim.agents.rideHail.surgePricing.surgeLevelAdaptionStep=0.1 beam.agentsim.agents.rideHail.surgePricing.minimumSurgeLevel=0.1 diff --git a/test/input/beamville/beam.conf b/test/input/beamville/beam.conf index 47bde83a52f..bd2cb34a2d7 100755 --- a/test/input/beamville/beam.conf +++ b/test/input/beamville/beam.conf @@ -159,7 +159,6 @@ beam.agentsim.agents.rideHail.defaultCostPerMinute=0.75 beam.agentsim.agents.rideHail.refuelThresholdInMeters=5000.0 beam.agentsim.agents.rideHail.rideHailManager.radiusInMeters=5000 beam.agentsim.agents.rideHail.iterationStats.timeBinSizeInSec=3600 -beam.agentsim.agents.rideHail.refuelLocationType="AtRequestLocation" # SurgePricing parameters beam.agentsim.agents.rideHail.surgePricing.surgeLevelAdaptionStep=0.1 beam.agentsim.agents.rideHail.surgePricing.minimumSurgeLevel=0.1 diff --git a/test/input/equil-square/equil-0.001k.conf b/test/input/equil-square/equil-0.001k.conf index 3b25664b456..9f393da07c6 100755 --- a/test/input/equil-square/equil-0.001k.conf +++ b/test/input/equil-square/equil-0.001k.conf @@ -96,7 +96,6 @@ beam.agentsim.agents.rideHail.defaultCostPerMile=1.25 beam.agentsim.agents.rideHail.defaultCostPerMinute=0.75 beam.agentsim.agents.rideHail.initialization.procedural.vehicleTypeId="BEV" beam.agentsim.agents.rideHail.refuelThresholdInMeters=5000.0 -beam.agentsim.agents.rideHail.refuelLocationType="AtRequestLocation" # SurgePricing parameters beam.agentsim.agents.rideHail.surgePricing.surgeLevelAdaptionStep=0.1 beam.agentsim.agents.rideHail.surgePricing.minimumSurgeLevel=0.1 From 56632c5d465d3eb634d2385139b0ae0e75940544 Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Thu, 16 Jun 2022 01:49:11 -0400 Subject: [PATCH 140/307] More control of EC2 instances and budgeting (#3532) * initial lambda code * add instance blocker for non-used zones * recent changes * Other avenues of instance creation * new slack notification * Review fix and change to false default * Sync against current lambda * More syncing --- aws/build.gradle | 8 +- .../python/beam_lambda/lambda_function.py | 74 +++--- .../budget_notifier/budget_notifier.yaml | 17 ++ .../python/budget_notifier/lambda_function.py | 39 +++ .../ec2StartStop_lambda/lambda_function.py | 15 +- .../instanceNotifier/instance_notifier.py | 226 ++++++++++++++++++ .../instanceNotifier/instance_notifier.yaml | 19 ++ .../instance_blocker/instance_blocker.yaml | 26 ++ .../instance_blocker/lambda_function.py | 90 +++++++ .../main/python/runPilates/lambda_function.py | 61 ++--- docs/devops.rst | 107 ++++++++- 11 files changed, 618 insertions(+), 64 deletions(-) create mode 100644 aws/src/main/python/budget_notifier/budget_notifier.yaml create mode 100644 aws/src/main/python/budget_notifier/lambda_function.py create mode 100644 aws/src/main/python/instanceNotifier/instance_notifier.py create mode 100644 aws/src/main/python/instanceNotifier/instance_notifier.yaml create mode 100644 aws/src/main/python/instance_blocker/instance_blocker.yaml create mode 100644 aws/src/main/python/instance_blocker/lambda_function.py diff --git a/aws/build.gradle b/aws/build.gradle index 40195542042..a90abb4e17e 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -109,7 +109,8 @@ task deploy(type: AWSLambdaInvokeTask) { "min_cores": ${ext.getParameterValue('minCores') ?: 0}, "max_cores": ${ext.getParameterValue('maxCores') ?: 0}, "min_memory": ${ext.getParameterValue('minMemory') ?: 0}, - "max_memory": ${ext.getParameterValue('maxMemory') ?: 0} + "max_memory": ${ext.getParameterValue('maxMemory') ?: 0}, + "budget_override": ${ext.getParameterValue('budgetOverride') ?: false} }""" payload = pload println "Using data branch $dataBranch" @@ -148,6 +149,7 @@ task deployPilates(type: AWSLambdaInvokeTask) { defaultParamVals['dataRegion'] = defRegion defaultParamVals['beamBranch'] = getCurrentGitBranch() defaultParamVals['dataBranch'] = 'develop' + defaultParamVals['budgetOverride'] = False def paramMap = [:] def missing = [] @@ -155,7 +157,7 @@ task deployPilates(type: AWSLambdaInvokeTask) { // all possible parameters ['runName', 'pilatesScenarioName', 'beamBranch', 'dataBranch', 'beamCommit', - 'beamConfig', + 'beamConfig', 'budgetOverride', 'startYear', 'countOfYears', 'beamItLen', 'urbansimItLen', 'initialS3UrbansimInput', 'initialS3UrbansimOutput', 'initialSkimPath', 'pilatesImageVersion', 'pilatesImageName', @@ -174,6 +176,7 @@ task deployPilates(type: AWSLambdaInvokeTask) { } paramMap['runName'] = paramMap['runName'] + '_' + getCurrentGitUserEmail() + paramMap['budget_override'] = paramMap['budgetOverride'] println("parameters wasn't specified: " + missing.join(', ')) @@ -267,6 +270,7 @@ def buildPayload(command) { return """{ "instance_ids": "${project.findProperty('instanceIds')}", "region": "${project.findProperty('region') ?: defaultRegion}", + "budget_override": ${ext.getParameterValue('budgetOverride') ?: false} "command": "$command" }""" } diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 602524d393c..cc65620d854 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -1,5 +1,6 @@ # coding=utf-8 import boto3 +import logging import time import uuid import os @@ -7,6 +8,9 @@ import base64 from botocore.errorfactory import ClientError +logger = logging.getLogger() +logger.setLevel(logging.INFO) + HELICS_RUN = '''sudo /home/ubuntu/install-and-run-helics-scripts.sh - cd /home/ubuntu/git/beam - ''' @@ -20,7 +24,7 @@ - finalPath="$path2"; - done; - done; - - finalPath="${finalPath}/helics_output" + - finalPath="${finalPath}/helics_output" - mkdir "$finalPath" - sudo mv /home/ubuntu/git/beam/src/main/python/gemini/*.log "$finalPath" - sudo mv /home/ubuntu/git/beam/src/main/python/gemini/recording_output.txt "$finalPath" @@ -112,8 +116,10 @@ cd - path: /home/ubuntu/install-and-run-helics-scripts.sh - runcmd: + - cd /home/ubuntu/git + - sudo rm -rf beam + - sudo git clone https://github.com/LBNL-UCB-STI/beam.git - ln -sf /var/log/cloud-init-output.log /home/ubuntu/git/beam/cloud-init-output.log - echo "-------------------Starting Beam Sim----------------------" - echo $(date +%s) > /tmp/.starttime @@ -152,12 +158,15 @@ - crontab /tmp/slack_notification - crontab -l - echo "notification scheduled..." - - git fetch - - 'echo "git checkout: $(date)"' + - 'echo "sudo git fetch"' + - sudo git fetch + - 'echo "GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH $(date)"' - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH + - 'echo "sudo git pull"' - sudo git pull + - 'echo "sudo git lfs pull"' - sudo git lfs pull - - echo "git checkout -qf ..." + - echo "sudo git checkout -qf ..." - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout -qf $COMMIT - production_data_submodules=$(git submodule | awk '{ print $2 }') @@ -176,6 +185,8 @@ - 'echo "gradlew assemble: $(date)"' - ./gradlew assemble + - 'echo "sudo chown -R ubuntu:ubuntu ."' + - sudo chown -R ubuntu:ubuntu . - echo "looping config ..." - export MAXRAM=$MAX_RAM - export SIGOPT_CLIENT_ID="$SIGOPT_CLIENT_ID" @@ -197,7 +208,8 @@ - do - export $metric=$count - done < RunHealthAnalysis.txt - + + - curl -H "Authorization:Bearer $SLACK_TOKEN" -F file=@RunHealthAnalysis.txt -F initial_comment="Beam Health Analysis" -F channels="$SLACK_CHANNEL" "https://slack.com/api/files.upload" - s3glip="" - if [ "$S3_PUBLISH" = "True" ] - then @@ -233,7 +245,7 @@ \\"sigopt_dev_id\\":\\"$SIGOPT_DEV_ID\\" } }" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname) "${s3p#","}") - - curl -H "Authorization:Bearer $SLACK_TOKEN" -F file=@RunHealthAnalysis.txt -F initial_comment="$bye_msg" -F channels="$SLACK_CHANNEL" "https://slack.com/api/files.upload" + - /tmp/slack.sh "$bye_msg" - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$stop_json" - $END_SCRIPT - sudo shutdown -h +$SHUTDOWN_WAIT @@ -295,11 +307,11 @@ shutdown_behaviours = ['stop', 'terminate'] instance_operations = ['start', 'stop', 'terminate'] -s3 = boto3.client('s3') -ec2 = None max_system_ram = 15 percent_towards_system_ram = .25 +s3 = boto3.client('s3') +ec2 = None def init_ec2(region): global ec2 @@ -309,7 +321,6 @@ def calculate_max_ram(instance_type): ram = instance_type_to_memory[instance_type] return ram - min(ram * percent_towards_system_ram, max_system_ram) - def check_resource(bucket, key): try: s3.head_object(Bucket=bucket, Key=key) @@ -436,7 +447,7 @@ def get_spot_fleet_instances_based_on(min_cores, max_cores, min_memory, max_memo raise Exception('0 spot instances matched min_cores: ' + str(min_cores) + ' - max_cores: ' + str(max_cores) + 'and min_mem: ' + str(min_memory) + ' - max_mem: ' + str(max_memory) ) return list(dict.fromkeys(output_instance_types)) -def deploy_spot_fleet(context, script, instance_type, region_prefix, shutdown_behaviour, instance_name, volume_size, git_user_email, deploy_type_tag, min_cores, max_cores, min_memory, max_memory): +def deploy_spot_fleet(context, script, instance_type, region_prefix, shutdown_behaviour, instance_name, volume_size, git_user_email, deploy_type_tag, min_cores, max_cores, min_memory, max_memory, budget_override): security_group_id_array = (os.environ[region_prefix + 'SECURITY_GROUP']).split(',') security_group_ids = [] for security_group_id in security_group_id_array: @@ -474,6 +485,9 @@ def deploy_spot_fleet(context, script, instance_type, region_prefix, shutdown_be }, { 'Key': 'DeployType', 'Value': deploy_type_tag + }, { + 'Key': 'BudgetOverride', + 'Value': budget_override } ] } @@ -577,7 +591,7 @@ def deploy_spot_fleet(context, script, instance_type, region_prefix, shutdown_be print 'Spot instance ready to go!' return instance_id -def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_name, volume_size, git_user_email, deploy_type_tag): +def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_name, volume_size, git_user_email, deploy_type_tag, budget_override): res = ec2.run_instances(BlockDeviceMappings=[ { 'DeviceName': '/dev/sda1', @@ -609,6 +623,9 @@ def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_na },{ 'Key': 'DeployType', 'Value': deploy_type_tag + }, { + 'Key': 'BudgetOverride', + 'Value': budget_override } ] } ]) return res['Instances'][0]['InstanceId'] @@ -673,6 +690,7 @@ def get_param(param_name): run_grafana = event.get('run_grafana', False) run_helics = event.get('run_helics', False) profiler_type = event.get('profiler_type', 'null') + budget_override = event.get('budget_override', False) git_user_email = get_param('git_user_email') deploy_type_tag = event.get('deploy_type_tag', '') @@ -691,10 +709,6 @@ def get_param(param_name): if not is_spot and instance_type not in instance_types: return "Unable to start run, {instance_type} instance type not supported.".format(instance_type=instance_type) - max_ram = event.get('forced_max_ram') - if parameter_wasnt_specified(max_ram): - max_ram = calculate_max_ram(instance_type) - if shutdown_behaviour not in shutdown_behaviours: return "Unable to start run, {shutdown_behaviour} shutdown behaviour not supported.".format(shutdown_behaviour=shutdown_behaviour) @@ -704,6 +718,10 @@ def get_param(param_name): if volume_size < 64 or volume_size > 256: volume_size = 64 + max_ram = event.get('forced_max_ram') + if parameter_wasnt_specified(max_ram): + max_ram = calculate_max_ram(instance_type) + selected_script = CONFIG_SCRIPT if run_grafana: selected_script = CONFIG_SCRIPT_WITH_GRAFANA @@ -742,21 +760,13 @@ def get_param(param_name): runName = titled if len(params) > 1: runName += "-" + `runNum` - script = initscript.replace('$RUN_SCRIPT',selected_script) \ - .replace('$REGION',region) \ - .replace('$S3_REGION', os.environ['REGION']) \ - .replace('$BRANCH', branch) \ - .replace('$DATA_BRANCH', data_branch) \ - .replace('$COMMIT', commit_id) \ - .replace('$CONFIG', arg) \ - .replace('$MAIN_CLASS', execute_class) \ - .replace('$UID', uid) \ - .replace('$SHUTDOWN_WAIT', shutdown_wait) \ - .replace('$TITLED', runName) \ + script = initscript.replace('$RUN_SCRIPT',selected_script).replace('$REGION',region).replace('$S3_REGION', os.environ['REGION']) \ + .replace('$BRANCH', branch).replace('$DATA_BRANCH', data_branch).replace('$COMMIT', commit_id).replace('$CONFIG', arg) \ + .replace('$MAIN_CLASS', execute_class).replace('$UID', uid).replace('$SHUTDOWN_WAIT', shutdown_wait) \ + .replace('$TITLED', runName)\ .replace('$MAX_RAM', str(max_ram)) \ .replace('$S3_PUBLISH', str(s3_publish)) \ - .replace('$SIGOPT_CLIENT_ID', sigopt_client_id) \ - .replace('$SIGOPT_DEV_ID', sigopt_dev_id) \ + .replace('$SIGOPT_CLIENT_ID', sigopt_client_id).replace('$SIGOPT_DEV_ID', sigopt_dev_id) \ .replace('$GOOGLE_API_KEY', google_api_key) \ .replace('$PROFILER', profiler_type) \ .replace('$END_SCRIPT', end_script) \ @@ -769,9 +779,9 @@ def get_param(param_name): max_cores = event.get('max_cores', 0) min_memory = event.get('min_memory', 0) max_memory = event.get('max_memory', 0) - instance_id = deploy_spot_fleet(context, script, instance_type, region.replace("-", "_")+'_', shutdown_behaviour, runName, volume_size, git_user_email, deploy_type_tag, min_cores, max_cores, min_memory, max_memory) + instance_id = deploy_spot_fleet(context, script, instance_type, region.replace("-", "_")+'_', shutdown_behaviour, runName, volume_size, git_user_email, deploy_type_tag, min_cores, max_cores, min_memory, max_memory, budget_override) else: - instance_id = deploy(script, instance_type, region.replace("-", "_")+'_', shutdown_behaviour, runName, volume_size, git_user_email, deploy_type_tag) + instance_id = deploy(script, instance_type, region.replace("-", "_")+'_', shutdown_behaviour, runName, volume_size, git_user_email, deploy_type_tag, budget_override) host = get_dns(instance_id) txt += 'Started batch: {batch} with run name: {titled} for branch/commit {branch}/{commit} at host {dns} (InstanceID: {instance_id}). '.format(branch=branch, titled=runName, commit=commit_id, dns=host, batch=uid, instance_id=instance_id) @@ -819,6 +829,8 @@ def instance_handler(event): def lambda_handler(event, context): command_id = event.get('command', 'deploy') # deploy | start | stop | terminate | log + logger.info("Incoming event: " + str(event)) + if command_id == 'deploy': return deploy_handler(event, context) diff --git a/aws/src/main/python/budget_notifier/budget_notifier.yaml b/aws/src/main/python/budget_notifier/budget_notifier.yaml new file mode 100644 index 00000000000..f4c42867944 --- /dev/null +++ b/aws/src/main/python/budget_notifier/budget_notifier.yaml @@ -0,0 +1,17 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Serverless Specification template describing your function. +Resources: + budgetnotifier: + Type: 'AWS::Serverless::Function' + Properties: + Handler: lambda_function.lambda_handler + Runtime: python3.8 + CodeUri: . + Description: '' + MemorySize: 128 + Timeout: 30 + Role: 'arn:aws:iam::340032650202:role/BeamLambdaExecution' + Environment: + Variables: + SLACK_HOOK: SENSITIVE_SO_REDACTED diff --git a/aws/src/main/python/budget_notifier/lambda_function.py b/aws/src/main/python/budget_notifier/lambda_function.py new file mode 100644 index 00000000000..991bb75eca6 --- /dev/null +++ b/aws/src/main/python/budget_notifier/lambda_function.py @@ -0,0 +1,39 @@ +# coding=utf-8 +import os +import logging +import re +import json +import urllib.parse +import http.client + +logger = logging.getLogger() +logger.setLevel(logging.INFO) + +def lambda_handler(event, context): + budget_message = json.loads(str(event.get('Records')[0]).replace("'",'"')).get('Sns').get('Message') + budget_name = re.findall(".*Budget Name: (.*)", budget_message)[0] + budget_limit = re.findall("Budgeted Amount: (.*)", budget_message)[0] + budget_threshold = re.findall("Alert Threshold: (.*)", budget_message)[0] + budget_actual = re.findall("ACTUAL Amount: (.*)", budget_message)[0] + budget_name_url_encoded = urllib.parse.quote(budget_name) + budget_link = f"https://console.aws.amazon.com/billing/home?#/budgets/details?name={budget_name_url_encoded}" + slack_message = f" <{budget_link}|*Alert triggered for '{budget_name}'*>\n> The current amount spent so far this month is {budget_actual}\n> *Budget Threshold*:\n> {budget_threshold}\n> *Budget limit:*\n> {budget_limit}" + headers = {'Content-type': 'application/json'} + payload = { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": slack_message + } + } + ] + } + slack_hook = os.environ['SLACK_HOOK'] + logger.info('Slack notification for budget alert: ' + str(payload)) + conn = http.client.HTTPSConnection('hooks.slack.com') + conn.request('POST', slack_hook, json.dumps(payload), headers) + response = conn.getresponse() + logger.info('Received response from slack notification: ' + response.read().decode()) + return 'Done' \ No newline at end of file diff --git a/aws/src/main/python/ec2StartStop_lambda/lambda_function.py b/aws/src/main/python/ec2StartStop_lambda/lambda_function.py index 56f475f293e..68c58f5a47f 100755 --- a/aws/src/main/python/ec2StartStop_lambda/lambda_function.py +++ b/aws/src/main/python/ec2StartStop_lambda/lambda_function.py @@ -31,7 +31,17 @@ def check_instance_id(instance_ids): instance_ids.remove(instance['InstanceId']) return instance_ids -def start_instance(instance_ids): +def start_instance(instance_ids, budget_override): + if budget_override: + ec2.create_tags( + Resources=instance_ids, + Tags=[ + { + 'Key': 'BudgetOverride', + 'Value': 'True' + } + ] + ) return ec2.start_instances(InstanceIds=instance_ids) def stop_instance(instance_ids): @@ -39,6 +49,7 @@ def stop_instance(instance_ids): def instance_handler(event): region = event.get('region', os.environ['REGION']) + budget_override = event.get('budget_override', False) instance_ids = event.get('instance_ids') command_id = event.get('command') system_instances = os.environ['SYSTEM_INSTANCES'] @@ -52,7 +63,7 @@ def instance_handler(event): allowed_ids = [item for item in valid_ids if item not in system_instances] if command_id == 'start': - start_instance(allowed_ids) + start_instance(allowed_ids, budget_override) return "Started instance(s) {insts}.".format(insts=', '.join([': '.join(inst) for inst in zip(allowed_ids, list(map(get_dns, allowed_ids)))])) if command_id == 'stop': diff --git a/aws/src/main/python/instanceNotifier/instance_notifier.py b/aws/src/main/python/instanceNotifier/instance_notifier.py new file mode 100644 index 00000000000..bfb6a9a80c7 --- /dev/null +++ b/aws/src/main/python/instanceNotifier/instance_notifier.py @@ -0,0 +1,226 @@ +# coding=utf-8 +import boto3 +import os +from datetime import date +from calendar import monthrange +from decimal import Decimal +import json +import logging +import http.client +from pkg_resources import resource_filename +from botocore.errorfactory import ClientError + +ec2_client = None +budget_client = None +pricing_client = None +sns_client = None + +logger = logging.getLogger() +logger.setLevel(logging.INFO) + +PRODUCT_OPERATING_SYSTEMS = ["Linux","RHEL","Windows","SUSE","Red Hat Enterprise Linux with HA","Windows"] + +# Search product filter. This will reduce the amount of data returned by the +# get_products function of the Pricing API +FLT = '[{{"Field": "tenancy", "Value": "shared", "Type": "TERM_MATCH"}},'\ + '{{"Field": "preInstalledSw", "Value": "NA", "Type": "TERM_MATCH"}},'\ + '{{"Field": "operatingSystem", "Value": "{o}", "Type": "TERM_MATCH"}},'\ + '{{"Field": "instanceType", "Value": "{t}", "Type": "TERM_MATCH"}},'\ + '{{"Field": "location", "Value": "{r}", "Type": "TERM_MATCH"}},'\ + '{{"Field": "capacitystatus", "Value": "Used", "Type": "TERM_MATCH"}}]' + +class EC2Instance: + def __init__(self, instance_id, instance_type, operating_system, instance_name, instance_git_user_email, budget_override): + self.instance_id = instance_id + self.instance_type = instance_type + self.operating_system = operating_system + self.instance_name = instance_name + self.instance_git_user_email = instance_git_user_email + self.budget_override = budget_override.lower() + + def __str__(self): + return 'InstanceId: ' + self.instance_id + '; Instance Type: ' + self.instance_type + '; Operating System: ' + self.operating_system + '; Instance Name: ' + self.instance_name + '; Instance Git User Email: ' + self.instance_git_user_email + '; Budget Override: ' + self.budget_override + +def init_ec2_client(region): + global ec2_client + ec2_client = boto3.client('ec2',region_name=region) + +def init_budget_client(): + global budget_client + budget_client = boto3.client('budgets') + +def init_pricing_client(region): + global pricing_client + pricing_client = boto3.client('pricing', region_name=region) + +def init_sns_client(): + global sns_client + sns_client = boto3.client('sns') + +def convert_to_pricing_operating_system_from(ec2_operating_system): + for pricing_os in PRODUCT_OPERATING_SYSTEMS: + if pricing_os in ec2_operating_system: + return pricing_os + return "Linux" # Default to Linux since that is mostly what we use anyway + +# Translate region code to region name. Even though the API data contains +# regionCode field, it will not return accurate data. However using the location +# field will, but then we need to translate the region code into a region name. +# You could skip this by using the region names in your code directly, but most +# other APIs are using the region code. +def get_region_name(region_code): + default_region = 'US East (N. Virginia)' + endpoint_file = resource_filename('botocore', 'data/endpoints.json') + try: + with open(endpoint_file, 'r') as f: + data = json.load(f) + # Botocore is using Europe while Pricing API using EU...sigh... + return data['partitions'][0]['regions'][region_code]['description'].replace('Europe', 'EU') + except IOError: + return default_region + +def get_price(region, instance, os): + f = FLT.format(r=region, t=instance, o=os) + data = pricing_client.get_products(ServiceCode='AmazonEC2', Filters=json.loads(f)) + priceList = data.get('PriceList') + od = json.loads(data['PriceList'][0])['terms']['OnDemand'] + id1 = list(od)[0] + id2 = list(od[id1]['priceDimensions'])[0] + return od[id1]['priceDimensions'][id2]['pricePerUnit']['USD'] + +def get_instance_details_for_(instance_id): + instance_details = ec2_client.describe_instances(InstanceIds=[instance_id]) + instance = instance_details.get("Reservations")[0].get("Instances")[0] + instance_type = instance.get("InstanceType") + operating_system = instance.get("PlatformDetails") + instance_git_user_email = "" + instance_name = "" + budget_override = "" + tags = instance.get("Tags") + for tag in tags: + key = tag.get("Key") + if key == "GitUserEmail": + instance_git_user_email = tag.get("Value") + elif key == "Name": + instance_name = tag.get("Value") + elif key == "BudgetOverride": + budget_override = tag.get("Value") + return EC2Instance(instance_id, instance_type, operating_system, instance_name, instance_git_user_email, budget_override) + +def send_to_sns_notification(message, subject): + sns_client.publish( + TopicArn='arn:aws:sns:us-east-2:340032650202:instance_notifier', + Message=message, + Subject=subject) + +def notify_slack_using_(message): + logger.info('Notifying about attempted instance use') + headers = {'Content-type': 'application/json'} + payload = { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": message + } + } + ] + } + slack_hook = os.environ['SLACK_HOOK'] + logger.info('Slack notification for stopped instance: ' + str(payload)) + conn = http.client.HTTPSConnection('hooks.slack.com') + conn.request('POST', slack_hook, json.dumps(payload), headers) + response = conn.getresponse() + logger.info('Received response from slack notification for attempted instance use: ' + response.read().decode()) + +def stop_instance(instance_id): + logger.info(f"Stopping {instance_id}") + ec2_client.stop_instances(InstanceIds=[instance_id]) + +def set_override_tag_to_empty_for_(instance_id): + ec2_client.create_tags( + Resources=[instance_id], + Tags=[ + { + 'Key': 'BudgetOverride', + 'Value': '', + }, + ], +) + +# Expected format: {"instance-id": , "state": , "region": , "account-id": } +def lambda_handler(event, context): + state = event.get('state') + if state != "running": + return "Instance state change of {state} is not supported for this lambda - only 'running' is considered".format(state=state) + region = event.get('region') + instance_id = event.get('instance-id') + account_id = event.get('account-id') + + allowed_instances = os.environ['ALLOWED_INSTANCES'] + if instance_id in allowed_instances: + logger.info(f"Allowing {instance_id} to run") + return "Done" + + init_budget_client() + budget_response = budget_client.describe_budget( + AccountId=account_id, + BudgetName=os.environ["BUDGET_NAME"] + ) + + budget_details = budget_response.get('Budget') + budget_limit_amount = Decimal(budget_details.get('BudgetLimit').get('Amount')) + current_spent_amount = Decimal(budget_details.get('CalculatedSpend').get('ActualSpend').get('Amount')) + percent_of_budget_used = (current_spent_amount / budget_limit_amount) * 100 + + # 150%+ require tag - notify slack if blocked + if percent_of_budget_used <= 150: + return "Budget is not over 150%. Stopping check." + + today = date.today() + current_day = Decimal(today.strftime("%d")) + current_month = today.strftime("%m") + current_year = today.strftime("%Y") + days_in_current_month = monthrange(int(current_year), int(current_month))[1] + percent_of_month = (current_day / Decimal(days_in_current_month)) * 100 + + # LATER TODO: Add link to budget? + # LATER TODO: Add an override option that is not emptied (true_always?) or for # of starts (true_3? - decrement and update tag) + # LATER TODO: Add a link to trigger an automatic approval. Maybe link to instance is enough, since can tag there? + # LATER TODO: Create a report of all usages and cost and send as a daily/weekly? email + init_ec2_client(region) + instance_details = get_instance_details_for_(instance_id) + + instance_stopped = False + if percent_of_budget_used >= 300: + stop_instance(instance_id) + instance_stopped = True + elif percent_of_budget_used >= 150 and instance_details.budget_override.lower() != "true": + stop_instance(instance_id) + instance_stopped = True + set_override_tag_to_empty_for_(instance_id) + + forecasted_spend_amount = Decimal(budget_details.get('CalculatedSpend').get('ForecastedSpend').get('Amount')) + init_pricing_client("us-east-1") + price_per_hour = Decimal(get_price(get_region_name("us-east-1"), instance_details.instance_type, convert_to_pricing_operating_system_from(instance_details.operating_system))) + price_per_day = price_per_hour * 24 + instance_name = instance_details.instance_name + instance_git_user_email = instance_details.instance_git_user_email + instance_link = f"https://console.aws.amazon.com/ec2/home?region={region}#Instances:instanceId={instance_id}" + + number_of_days_left_in_month = days_in_current_month - current_day + instance_cost_for_rest_of_month = price_per_day * number_of_days_left_in_month + spend_amount_if_instance_rest_of_month = current_spent_amount + instance_cost_for_rest_of_month + + # Temporarily keeping the email logic in case it is needed sometime soon + # email_message = "Instance with ID '" + instance_id + "' just started to run" + instance_stopped + " and the current amount spent this month ($" + str(current_spent_amount) + ") is " + str(round(percent_of_budget_used, 2)) + "% of the budgeted amount ($" + str(budget_limit_amount) + ").\r\nInstance Name: " + instance_name + "\r\nGit email of who created the instance: " + instance_git_user_email + "\r\nForecasted amount to be spent this month: $" + str(forecasted_spend_amount) + "\r\nPercent of month completed: " + str(round(percent_of_month, 2)) + "%\r\nInstance hourly cost: $" + str(price_per_hour) + "\r\nInstance daily cost: $" + str(price_per_day) + "\r\nInstance cost if ran through until the rest of the month: $" + str(round(instance_cost_for_rest_of_month, 2)) + "\r\nFinal AWS amount spent if instance is ran to the end of the month: $" + str(round(spend_amount_if_instance_rest_of_month, 2)) + "\r\nInstance link: " + instance_link + "\r\n*****If stopped then please verify it is allowed to run and add a tag 'BudgetOverride' set to 'True', then restart the instance.*****" + # subject = "Instance just started" + instance_stopped + " and BEAM is " + str(round(percent_of_budget_used, 2)) + "% of monthly budget" + # init_sns_client() + # logger.info(subject + "\r\n" + email_message) + # send_to_sns_notification(email_message, subject[:99]) + if instance_stopped: + slack_message = f"*Instance with ID '{instance_id}' immediately stopped*\nThe current amount spent this month (${str(round(current_spent_amount, 2))}) is {str(round(percent_of_budget_used, 2))}% of the budgeted amount (${str(round(budget_limit_amount, 2))}).\n*Instance Name*:\n{instance_name}\n*Git email of who created the instance*:\n{instance_git_user_email}\n*Forecasted amount to be spent this month*: \n${str(round(forecasted_spend_amount, 2))}\n*Percent of month completed*:\n{str(round(percent_of_month, 2))}%\n*Instance hourly cost*:\n${str(round(price_per_hour, 2))}\n*Instance daily cost*:\n${str(round(price_per_day, 2))}\n*Instance cost if ran through until the rest of the month*:\n${str(round(instance_cost_for_rest_of_month, 2))}\n*Final AWS amount spent if instance is ran to the end of the month*:\n${str(round(spend_amount_if_instance_rest_of_month, 2))}\n*Instance link*:\n{instance_link}\n*****If stopped then please verify it is allowed to run and add a tag 'BudgetOverride' set to 'True', then restart the instance.*****" + notify_slack_using_(slack_message) + + return "Done" \ No newline at end of file diff --git a/aws/src/main/python/instanceNotifier/instance_notifier.yaml b/aws/src/main/python/instanceNotifier/instance_notifier.yaml new file mode 100644 index 00000000000..d1782b1c34d --- /dev/null +++ b/aws/src/main/python/instanceNotifier/instance_notifier.yaml @@ -0,0 +1,19 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Serverless Specification template describing your function. +Resources: + testingnotice: + Type: 'AWS::Serverless::Function' + Properties: + Handler: lambda_function.lambda_handler + Runtime: python3.8 + CodeUri: . + Description: '' + MemorySize: 256 + Timeout: 30 + Role: 'arn:aws:iam::340032650202:role/BeamLambdaExecution' + Environment: + Variables: + ALLOWED_INSTANCES: '[''i-0b31829f99cc9a7ce'']' + BUDGET_NAME: Total Monthly Budget + SLACK_HOOK: SENSITIVE_SO_REDACTED diff --git a/aws/src/main/python/instance_blocker/instance_blocker.yaml b/aws/src/main/python/instance_blocker/instance_blocker.yaml new file mode 100644 index 00000000000..8a65a1ecb88 --- /dev/null +++ b/aws/src/main/python/instance_blocker/instance_blocker.yaml @@ -0,0 +1,26 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Serverless Specification template describing your function. +Resources: + instanceblocker: + Type: 'AWS::Serverless::Function' + Properties: + Handler: lambda_function.lambda_handler + Runtime: python3.8 + CodeUri: . + Description: '' + MemorySize: 128 + Timeout: 30 + Role: 'arn:aws:iam::340032650202:role/BeamLambdaExecution' + Events: + CloudWatchEvent1: + Type: CloudWatchEvent + Properties: + Pattern: + detail-type: + - EC2 Instance State-change Notification + source: + - aws.ec2 + Environment: + Variables: + SLACK_HOOK: SENSITIVE_SO_REDACTED diff --git a/aws/src/main/python/instance_blocker/lambda_function.py b/aws/src/main/python/instance_blocker/lambda_function.py new file mode 100644 index 00000000000..49dea12cdc5 --- /dev/null +++ b/aws/src/main/python/instance_blocker/lambda_function.py @@ -0,0 +1,90 @@ +# coding=utf-8 +import boto3 +import json +import os +import logging +import http.client + +ec2_client = None + +logger = logging.getLogger() +logger.setLevel(logging.INFO) + +class EC2Instance: + def __init__(self, instance_id, instance_type, instance_name, instance_region, instance_git_user_email): + self.instance_id = instance_id + self.instance_type = instance_type + self.instance_name = instance_name + self.instance_region = instance_region + self.instance_git_user_email = instance_git_user_email + + def __str__(self): + return 'InstanceId: ' + self.instance_id + '; Instance Type: ' + self.instance_type + '; Instance Name: ' + self.instance_name + '; Instance Region: ' + self.instance_region + '; Instance Git User Email: ' + self.instance_git_user_email + +def init_ec2_client(region): + global ec2_client + ec2_client = boto3.client('ec2',region_name=region) + +def get_instance_details_for_(instance_id, instance_region): + instance_details = ec2_client.describe_instances(InstanceIds=[instance_id]) + instance = instance_details.get("Reservations")[0].get("Instances")[0] + instance_type = instance.get("InstanceType") + instance_git_user_email = "" + instance_name = "" + tags = safe_get_with_default(instance, "Tags", []) + for tag in tags: + key = tag.get("Key") + if key == "GitUserEmail": + instance_git_user_email = tag.get("Value") + elif key == "Name": + instance_name = tag.get("Value") + return EC2Instance(instance_id, instance_type, instance_name, instance_region, instance_git_user_email) + +def terminate_instance(instance_id, instance_region): + logger.info(f"Terminating unexpected instance '{instance_id}' in region '{instance_region}'") + ec2_client.terminate_instances(InstanceIds=[instance_id]) + +def notify_slack_using(instance_details): + logger.info('Notifying about attempted instance use') + instance_link = f"https://console.aws.amazon.com/ec2/home?region={instance_details.instance_region}#Instances:instanceId={instance_details.instance_id}" + headers = {'Content-type': 'application/json'} + payload = { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": f"*Unexpected Instance Creation Was Immediately Terminated*\n> *Instance ID*\n> {instance_details.instance_id}\n> *Instance Region*\n> {instance_details.instance_region}\n> *Instance Name:*\n>{instance_details.instance_name}\n> *Instance Type:*\n>{instance_details.instance_type}\n> *Git email of who created the instance:*\n>{instance_details.instance_git_user_email}\n> *Instance Link:*\n>{instance_link}" + } + } + ] + } + slack_hook = os.environ['SLACK_HOOK'] + logger.info('Slack notification for terminated instance: ' + str(payload)) + conn = http.client.HTTPSConnection('hooks.slack.com') + conn.request('POST', slack_hook, json.dumps(payload), headers) + response = conn.getresponse() + logger.info('Received response from slack notification for attempted instance use: ' + response.read().decode()) + +# Minimum expected format: {"instance-id": , "region": , "state": } +def lambda_handler(event, context): + region = event.get('region') + instance_id = event.get('instance-id') + state = event.get('state') + + init_ec2_client(region) + instance_details = get_instance_details_for_(instance_id, region) + terminate_instance(instance_id, region) + if state == 'terminated': + notify_slack_using(instance_details) + + return "Done" + +def safe_get_with_default(dict_obj, key, default): + if dict_obj is not None: + got_value = dict_obj.get(key) + if got_value: + return got_value + else: + return default + return default \ No newline at end of file diff --git a/aws/src/main/python/runPilates/lambda_function.py b/aws/src/main/python/runPilates/lambda_function.py index fc19e56febd..13b3c134365 100644 --- a/aws/src/main/python/runPilates/lambda_function.py +++ b/aws/src/main/python/runPilates/lambda_function.py @@ -244,6 +244,32 @@ 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', 'z1d.large', 'z1d.xlarge', 'z1d.2xlarge', 'z1d.3xlarge', 'z1d.6xlarge', 'z1d.12xlarge'] +instance_type_to_memory = { + 't2.nano': 0.5, 't2.micro': 1, 't2.small': 2, 't2.medium': 4, 't2.large': 8, 't2.xlarge': 16, 't2.2xlarge': 32, + 'm4.large': 8, 'm4.xlarge': 16, 'm4.2xlarge': 32, 'm4.4xlarge': 64, 'm4.10xlarge': 160, 'm4.16xlarge': 256, + 'm5.large': 8, 'm5.xlarge': 16, 'm5.2xlarge': 32, 'm5.4xlarge': 64, 'm5.12xlarge': 192, 'm5.24xlarge': 384, + 'c4.large': 3.75, 'c4.xlarge': 7.5, 'c4.2xlarge': 15, 'c4.4xlarge': 30, 'c4.8xlarge': 60, + 'f1.2xlarge': 122, 'f1.16xlarge': 976, + 'g2.2xlarge': 15.25, 'g2.8xlarge': 61, + 'g3.4xlarge': 122, 'g3.8xlarge': 244, 'g3.16xlarge': 488, + 'p2.xlarge': 61, 'p2.8xlarge': 488, 'p2.16xlarge': 732, + 'p3.2xlarge': 61, 'p3.8xlarge': 244, 'p3.16xlarge': 488, + 'r4.large': 15.25, 'r4.xlarge': 30.5, 'r4.2xlarge': 61, 'r4.4xlarge': 122, 'r4.8xlarge': 244, 'r4.16xlarge': 488, + 'r3.large': 15, 'r3.xlarge': 30.5, 'r3.2xlarge': 61, 'r3.4xlarge': 122, 'r3.8xlarge': 244, + 'x1.16xlarge': 976, 'x1.32xlarge': 1952, + 'x1e.xlarge': 122, 'x1e.2xlarge': 244, 'x1e.4xlarge': 488, 'x1e.8xlarge': 976, 'x1e.16xlarge': 1952, 'x1e.32xlarge': 3904, + 'd2.xlarge': 30.5, 'd2.2xlarge': 61, 'd2.4xlarge': 122, 'd2.8xlarge': 244, + 'i2.xlarge': 30.5, 'i2.2xlarge': 61, 'i2.4xlarge': 122, 'i2.8xlarge': 244, + 'h1.2xlarge': 32, 'h1.4xlarge': 64, 'h1.8xlarge': 128, 'h1.16xlarge': 256, + 'i3.large': 15.25, 'i3.xlarge': 30.5, 'i3.2xlarge': 61, 'i3.4xlarge': 122, 'i3.8xlarge': 244, 'i3.16xlarge': 488, 'i3.metal': 512, + 'c5.large': 4, 'c5.xlarge': 8, 'c5.2xlarge': 16, 'c5.4xlarge': 32, 'c5.9xlarge': 72, 'c5.18xlarge': 96, + 'c5d.large': 4, 'c5d.xlarge': 8, 'c5d.2xlarge': 16, 'c5d.4xlarge': 32, 'c5d.9xlarge': 72, 'c5d.18xlarge': 144, 'c5d.24xlarge': 192, + 'r5.large': 16, 'r5.xlarge': 32, 'r5.2xlarge': 64, 'r5.4xlarge': 128, 'r5.8xlarge': 256, 'r5.12xlarge': 384, 'r5.24xlarge': 768, + 'r5d.large': 16, 'r5d.xlarge': 32, 'r5d.2xlarge': 64, 'r5d.4xlarge': 128, 'r5d.12xlarge': 384, 'r5d.24xlarge': 768, + 'm5d.large': 8, 'm5d.xlarge': 16, 'm5d.2xlarge': 32, 'm5d.4xlarge': 64, 'm5d.12xlarge': 192, 'm5d.24xlarge': 384, + 'z1d.large': 2, 'z1d.xlarge': 4, 'z1d.2xlarge': 8, 'z1d.3xlarge': 12, 'z1d.6xlarge': 24, 'z1d.12xlarge': 48 +} + regions = ['us-east-1', 'us-east-2', 'us-west-2'] shutdown_behaviours = ['stop', 'terminate'] @@ -258,7 +284,7 @@ def init_ec2(region): ec2 = boto3.client('ec2', region_name=region) -def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_name, volume_size): +def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_name, volume_size, budget_override): res = ec2.run_instances(BlockDeviceMappings=[ { 'DeviceName': '/dev/sda1', @@ -282,6 +308,9 @@ def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_na 'Tags': [{ 'Key': 'Name', 'Value': instance_name + }, { + 'Key': 'BudgetOverride', + 'Value': budget_override }] }]) return res['Instances'][0]['InstanceId'] @@ -308,32 +337,6 @@ def get_dns(instance_id): return host -instance_type_to_memory = { - 't2.nano': 0.5, 't2.micro': 1, 't2.small': 2, 't2.medium': 4, 't2.large': 8, 't2.xlarge': 16, 't2.2xlarge': 32, - 'm4.large': 8, 'm4.xlarge': 16, 'm4.2xlarge': 32, 'm4.4xlarge': 64, 'm4.10xlarge': 160, 'm4.16xlarge': 256, - 'm5.large': 8, 'm5.xlarge': 16, 'm5.2xlarge': 32, 'm5.4xlarge': 64, 'm5.12xlarge': 192, 'm5.24xlarge': 384, - 'c4.large': 3.75, 'c4.xlarge': 7.5, 'c4.2xlarge': 15, 'c4.4xlarge': 30, 'c4.8xlarge': 60, - 'f1.2xlarge': 122, 'f1.16xlarge': 976, - 'g2.2xlarge': 15.25, 'g2.8xlarge': 61, - 'g3.4xlarge': 122, 'g3.8xlarge': 244, 'g3.16xlarge': 488, - 'p2.xlarge': 61, 'p2.8xlarge': 488, 'p2.16xlarge': 732, - 'p3.2xlarge': 61, 'p3.8xlarge': 244, 'p3.16xlarge': 488, - 'r4.large': 15.25, 'r4.xlarge': 30.5, 'r4.2xlarge': 61, 'r4.4xlarge': 122, 'r4.8xlarge': 244, 'r4.16xlarge': 488, - 'r3.large': 15, 'r3.xlarge': 30.5, 'r3.2xlarge': 61, 'r3.4xlarge': 122, 'r3.8xlarge': 244, - 'x1.16xlarge': 976, 'x1.32xlarge': 1952, - 'x1e.xlarge': 122, 'x1e.2xlarge': 244, 'x1e.4xlarge': 488, 'x1e.8xlarge': 976, 'x1e.16xlarge': 1952, 'x1e.32xlarge': 3904, - 'd2.xlarge': 30.5, 'd2.2xlarge': 61, 'd2.4xlarge': 122, 'd2.8xlarge': 244, - 'i2.xlarge': 30.5, 'i2.2xlarge': 61, 'i2.4xlarge': 122, 'i2.8xlarge': 244, - 'h1.2xlarge': 32, 'h1.4xlarge': 64, 'h1.8xlarge': 128, 'h1.16xlarge': 256, - 'i3.large': 15.25, 'i3.xlarge': 30.5, 'i3.2xlarge': 61, 'i3.4xlarge': 122, 'i3.8xlarge': 244, 'i3.16xlarge': 488, 'i3.metal': 512, - 'c5.large': 4, 'c5.xlarge': 8, 'c5.2xlarge': 16, 'c5.4xlarge': 32, 'c5.9xlarge': 72, 'c5.18xlarge': 96, - 'c5d.large': 4, 'c5d.xlarge': 8, 'c5d.2xlarge': 16, 'c5d.4xlarge': 32, 'c5d.9xlarge': 72, 'c5d.18xlarge': 144, 'c5d.24xlarge': 192, - 'r5.large': 16, 'r5.xlarge': 32, 'r5.2xlarge': 64, 'r5.4xlarge': 128, 'r5.8xlarge': 256, 'r5.12xlarge': 384, 'r5.24xlarge': 768, - 'r5d.large': 16, 'r5d.xlarge': 32, 'r5d.2xlarge': 64, 'r5d.4xlarge': 128, 'r5d.12xlarge': 384, 'r5d.24xlarge': 768, - 'm5d.large': 8, 'm5d.xlarge': 16, 'm5d.2xlarge': 32, 'm5d.4xlarge': 64, 'm5d.12xlarge': 192, 'm5d.24xlarge': 384, - 'z1d.large': 2, 'z1d.xlarge': 4, 'z1d.2xlarge': 8, 'z1d.3xlarge': 12, 'z1d.6xlarge': 24, 'z1d.12xlarge': 48 -} - def calculate_max_ram(instance_type): ram = instance_type_to_memory[instance_type] return ram - min(ram * percent_towards_system_ram, max_system_ram) @@ -393,6 +396,8 @@ def get_param(param_name): if parameter_wasnt_specified(s3_output_base_path): s3_output_base_path = "" + budget_override = event.get('budget_override', False) + initial_urbansim_output = event.get('initialS3UrbansimOutput') initial_skims_path = event.get('initialSkimPath') if parameter_wasnt_specified(initial_urbansim_output) and parameter_wasnt_specified(initial_skims_path): @@ -471,7 +476,7 @@ def get_param(param_name): .replace('$RUN_PARAMS_FOR_FILE', all_run_params_comma_le) \ .replace('$RUN_PARAMS', all_run_params_comma) - instance_id = deploy(script, instance_type, region.replace("-", "_") + '_', shutdown_behaviour, run_name, volume_size) + instance_id = deploy(script, instance_type, region.replace("-", "_") + '_', shutdown_behaviour, run_name, volume_size, budget_override) host = get_dns(instance_id) return 'Started with run name: {titled} for branch/commit {branch}/{commit} at host {dns} (InstanceID: {instance_id}). '\ diff --git a/docs/devops.rst b/docs/devops.rst index 40bfb3a7b60..b5fabcd8b41 100755 --- a/docs/devops.rst +++ b/docs/devops.rst @@ -573,4 +573,109 @@ Automatic Image (AMI) Update In Automated Cloud Deployment capability, there is a baseline image (AMI) that used to instantiate new EC2 instance. It contains copy of git repository and gradle dependency libraries. All of these are outdated in few days due to active development of BEAM. And when we start instance from an outdated image it take additional time to update them before starting the simulation/run. This process help Cloud Automatic Deployment to keep up to date image for fast execution. To trigger this update process a Cloud Watch Event is setup with one week frequency. This event triggers an AWS Lambda (named `updateDependencies`) and lambda then starts an instance from the outdated image with instructions to update the image with latest LFS files for pre configured branches (these branches are mentioned in its environment variables that we can configure easily without any change in lambda code). One LFS files and gradle dependencies are updated in the new instance, the instance invoke a new lambda (named `updateBeamAMI`) to take its new image. This new lambda creates an image of the instance, terminate the instance and update this new image id to Automated Cloud Deployment process for future use. -This process is designed to get latest LFS files from different branches. To add a new branch or update existing one, an environment variable named `BRANCHES` need to update with space as branch name delimiter. +This process is designed to get latest LFS files from different branches. To add a new branch or update existing one, an environment variable named `BRANCHES` need to update with space as branch name delimiter. + +AWS Budget Control +^^^^^^^^^^^^^^^^^^ + +==== +Documentation of AWS budget management +==== +There are a few levels of budget protection in place: + +1. Alert notifications are sent at 60%-150% of monthly spend (at 10% increments) via a `Billing Budget `_ named ``Total Monthly Budget`` + * An email per below: + * The email subject is ``AWS Budgets: Test budget has exceeded your alert threshold`` with more specific information in the body + * The original email list (the source of truth is in the budget): + * `Rashid Waraich `_ + * `Justin Pihony `_ + * `Zach Needell `_ + * `Haitam Laarabi `_ + * `Nikolay Ilin `_ + * A slack notification per below: + * The message is headed as ``Alert triggered for 'Total Monthly Budget'`` + * It is sent to the ``#aws-notifications`` using an ``@here`` notifier + * This is possible as the budget alerts to the SNS topic ``budget_notifier`` with a subscription to the lambda ``budget_notifier`` +2. For the below regions [1]_ the `Eventbridge `_ ``instance_state_change_notifier`` is triggered on instance state change, which forwards to the `Lambda `_ ``instance_monitor`` that follows the below rules: + * At 150% of budget spent then any new instances can **only** be successfully started if they add the tag ``BudgetOverride`` with the value ``True``. + * The tag can be added to the EC2 instance manually + * The tag can be added as part of the deploy command using the ``budgetOverride`` key + * **NOTE**: The tag will be removed upon successful start, so it will need set on each instance run + * At 300% of budget spent then all instances will automatically be stopped (unless it is the Jenkins instance) + * If an instance is stopped then a slack notification will be made, so that it can be addressed + * The regions for this setup are: + * ``us-east-1`` + * ``us-east-2`` + * ``us-west-1`` + * ``us-west-2`` + * Eventbridge pattern:: + + { + "source": ["aws.ec2"], + "detail-type": ["EC2 Instance State-change Notification"] + "detail": { + "state": ["running"] + } + } + + * Eventbridge transformer input path:: + + { + "account-id": "$.account", + "instance-id": "$.detail.instance-id", + "region": "$.region", + "state": "$.detail.state" + } + + * Eventbridge template:: + + { + "instance-id": , + "state": , + "region": , + "account-id": + } +3. For the below regions the `Eventbridge `_ ``instance_state_change_notifier`` is triggered on instance state change, which forwards to the `Lambda `_ ``instance_blocker`` that follows the below rules: + * Automatically **terminate** any instance since these are regions not utilized by BEAM. + * Notify slack (on ``terminated`` state change) that an instance was attempted on an unexpected zone. + * The regions for this setup are: + * ``sa-east-1`` + * ``eu-north-1`` + * ``eu-west-3`` + * ``eu-west-2`` + * ``eu-west-1`` + * ``eu-central-1`` + * ``ca-central-1`` + * ``ap-northeast-1`` + * ``ap-southeast-2`` + * ``ap-southeast-1`` + * ``ap-northeast-2`` + * ``ap-northeast-3`` + * ``ap-south-1`` + * **NOTE**: Regions ``me-south-1``, ``eu-south-1``, ``af-south-1``, ``ap-east-1``, and ``ap-southeast-3`` are currently not enabled, so no need to block + * Eventbridge pattern:: + + { + "source": ["aws.ec2"], + "detail-type": ["EC2 Instance State-change Notification"] + } + + * Eventbridge transformer input path:: + + { + "account-id": "$.account", + "instance-id": "$.detail.instance-id", + "region": "$.region", + "state": "$.detail.state" + } + + * Eventbridge template:: + + { + "instance-id": , + "state": , + "region": , + "account-id": + } + +.. [1] **NOTE**: These AWS components are region specific, so they need to be duplicated across **EVERY** region to be fully effective. There are some possible workarounds (via Route53?), but this region specificity works in our favor currently. In this way we can totally shut down entire regions which are not in use. From 399d0b7f0473763c533ed4c0328ddda98f5eee30 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 16 Jun 2022 19:33:19 +0600 Subject: [PATCH 141/307] Move remaining utilities --- .../physsim/jdeqsim => scripts}/PhysSimReplayer.scala | 10 +++++----- .../scala/{beam/router => scripts}/R5Requester.scala | 6 +++--- .../scala/{beam/router => scripts}/R5RoutingApp.scala | 5 +++-- .../scala/{beam/utils => scripts}/RouteRequester.scala | 4 ++-- .../{beam/utils => scripts}/gtfs/GTFSReader.scala | 4 ++-- .../{beam/utils => scripts}/gtfs/GTFSToShape.scala | 4 ++-- .../scala/{beam/utils => scripts}/gtfs/Model.scala | 2 +- src/main/scala/scripts/map/NewYorkRouteDebugging.scala | 2 +- 8 files changed, 19 insertions(+), 18 deletions(-) rename src/main/scala/{beam/physsim/jdeqsim => scripts}/PhysSimReplayer.scala (98%) rename src/main/scala/{beam/router => scripts}/R5Requester.scala (99%) rename src/main/scala/{beam/router => scripts}/R5RoutingApp.scala (98%) rename src/main/scala/{beam/utils => scripts}/RouteRequester.scala (99%) rename src/main/scala/{beam/utils => scripts}/gtfs/GTFSReader.scala (96%) rename src/main/scala/{beam/utils => scripts}/gtfs/GTFSToShape.scala (99%) rename src/main/scala/{beam/utils => scripts}/gtfs/Model.scala (98%) diff --git a/src/main/scala/beam/physsim/jdeqsim/PhysSimReplayer.scala b/src/main/scala/scripts/PhysSimReplayer.scala similarity index 98% rename from src/main/scala/beam/physsim/jdeqsim/PhysSimReplayer.scala rename to src/main/scala/scripts/PhysSimReplayer.scala index 4bacb1f2629..bb08b87a449 100644 --- a/src/main/scala/beam/physsim/jdeqsim/PhysSimReplayer.scala +++ b/src/main/scala/scripts/PhysSimReplayer.scala @@ -1,10 +1,7 @@ -package beam.physsim.jdeqsim - -import java.io.{Closeable, File} -import java.nio.charset.StandardCharsets -import java.nio.file.Files +package scripts import beam.agentsim.events.PathTraversalEvent +import beam.physsim.jdeqsim.AgentSimToPhysSimPlanConverter import beam.sim.{BeamConfigChangesObservable, BeamHelper} import beam.utils.{BeamConfigUtils, EventReader} import com.typesafe.config.{Config, ConfigFactory, ConfigResolveOptions, ConfigValueFactory} @@ -13,6 +10,9 @@ import org.matsim.api.core.v01.events.Event import org.matsim.core.controler.events.IterationEndsEvent import org.matsim.core.events.EventsManagerImpl +import java.io.{Closeable, File} +import java.nio.charset.StandardCharsets +import java.nio.file.Files import scala.io.Source import scala.util.Try diff --git a/src/main/scala/beam/router/R5Requester.scala b/src/main/scala/scripts/R5Requester.scala similarity index 99% rename from src/main/scala/beam/router/R5Requester.scala rename to src/main/scala/scripts/R5Requester.scala index 1e133b21d5d..b93e08ed1d6 100644 --- a/src/main/scala/beam/router/R5Requester.scala +++ b/src/main/scala/scripts/R5Requester.scala @@ -1,6 +1,4 @@ -package beam.router - -import java.time.{LocalDateTime, ZoneOffset} +package scripts import beam.agentsim.agents.vehicles.BeamVehicleType import beam.agentsim.agents.vehicles.VehicleProtocol.StreetVehicle @@ -8,6 +6,7 @@ import beam.agentsim.events.SpaceTime import beam.router.BeamRouter.{Location, RoutingRequest} import beam.router.Modes.BeamMode import beam.router.r5.{R5Parameters, R5Wrapper} +import beam.router.{BeamRouter, FreeFlowTravelTime} import beam.sim.BeamHelper import beam.sim.common.GeoUtils import beam.sim.population.{AttributesOfIndividual, HouseholdAttributes} @@ -19,6 +18,7 @@ import com.conveyal.r5.streets.{RoutingVisitor, StreetRouter} import com.typesafe.config.Config import org.matsim.api.core.v01.{Coord, Id} +import java.time.{LocalDateTime, ZoneOffset} import scala.collection.mutable.ArrayBuffer import scala.util.Random diff --git a/src/main/scala/beam/router/R5RoutingApp.scala b/src/main/scala/scripts/R5RoutingApp.scala similarity index 98% rename from src/main/scala/beam/router/R5RoutingApp.scala rename to src/main/scala/scripts/R5RoutingApp.scala index a5beef60f13..5c33534d9e5 100644 --- a/src/main/scala/beam/router/R5RoutingApp.scala +++ b/src/main/scala/scripts/R5RoutingApp.scala @@ -1,6 +1,5 @@ -package beam.router +package scripts -import java.util.concurrent.TimeUnit import akka.actor.{ActorRef, ActorSystem, Identify, Props} import akka.http.scaladsl.Http import akka.http.scaladsl.model.{HttpResponse, StatusCodes} @@ -13,6 +12,7 @@ import beam.agentsim.agents.vehicles.VehicleProtocol.StreetVehicle import beam.agentsim.events.SpaceTime import beam.router.BeamRouter.{Location, RoutingRequest, RoutingResponse, UpdateTravelTimeLocal} import beam.router.Modes.BeamMode.CAR +import beam.router.RoutingWorker import beam.sim.config.BeamConfig import beam.sim.{BeamHelper, BeamWarmStart} import beam.utils.{DateUtils, FileUtils, LoggingUtil} @@ -21,6 +21,7 @@ import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport import io.circe.syntax._ import org.matsim.api.core.v01.Id +import java.util.concurrent.TimeUnit import scala.concurrent.Await import scala.concurrent.duration._ diff --git a/src/main/scala/beam/utils/RouteRequester.scala b/src/main/scala/scripts/RouteRequester.scala similarity index 99% rename from src/main/scala/beam/utils/RouteRequester.scala rename to src/main/scala/scripts/RouteRequester.scala index 020b850b373..3f9dda5b378 100644 --- a/src/main/scala/beam/utils/RouteRequester.scala +++ b/src/main/scala/scripts/RouteRequester.scala @@ -1,4 +1,4 @@ -package beam.utils +package scripts import beam.agentsim.agents.vehicles.BeamVehicleType import beam.agentsim.agents.vehicles.VehicleProtocol.StreetVehicle @@ -13,7 +13,7 @@ import beam.router.skim.urbansim.ODRouterR5GHForActivitySimSkims import beam.sim.BeamHelper import beam.sim.config.BeamConfig import beam.sim.population.{AttributesOfIndividual, HouseholdAttributes} -import beam.utils.gtfs.GTFSToShape +import scripts.gtfs.GTFSToShape import com.conveyal.osmlib.OSM import com.typesafe.config.Config import org.matsim.api.core.v01.{Coord, Id} diff --git a/src/main/scala/beam/utils/gtfs/GTFSReader.scala b/src/main/scala/scripts/gtfs/GTFSReader.scala similarity index 96% rename from src/main/scala/beam/utils/gtfs/GTFSReader.scala rename to src/main/scala/scripts/gtfs/GTFSReader.scala index fa725a13232..ba03d080546 100644 --- a/src/main/scala/beam/utils/gtfs/GTFSReader.scala +++ b/src/main/scala/scripts/gtfs/GTFSReader.scala @@ -1,10 +1,10 @@ -package beam.utils.gtfs +package scripts.gtfs import java.io.{Closeable, InputStream} import java.util.zip.ZipFile import beam.utils.csv.GenericCsvReader -import beam.utils.gtfs.Model._ +import scripts.gtfs.Model._ import com.typesafe.scalalogging.LazyLogging import scala.reflect.ClassTag diff --git a/src/main/scala/beam/utils/gtfs/GTFSToShape.scala b/src/main/scala/scripts/gtfs/GTFSToShape.scala similarity index 99% rename from src/main/scala/beam/utils/gtfs/GTFSToShape.scala rename to src/main/scala/scripts/gtfs/GTFSToShape.scala index c8896810bab..a3de0c8a9c3 100644 --- a/src/main/scala/beam/utils/gtfs/GTFSToShape.scala +++ b/src/main/scala/scripts/gtfs/GTFSToShape.scala @@ -1,11 +1,11 @@ -package beam.utils.gtfs +package scripts.gtfs import java.io.{File, IOException} import java.util.zip.ZipFile import beam.agentsim.infrastructure.geozone.WgsCoordinate import beam.utils.csv.CsvWriter -import beam.utils.gtfs.Model._ +import scripts.gtfs.Model._ import com.typesafe.scalalogging.LazyLogging import org.matsim.core.utils.geometry.geotools.MGC import org.matsim.core.utils.gis.{PointFeatureFactory, ShapeFileWriter} diff --git a/src/main/scala/beam/utils/gtfs/Model.scala b/src/main/scala/scripts/gtfs/Model.scala similarity index 98% rename from src/main/scala/beam/utils/gtfs/Model.scala rename to src/main/scala/scripts/gtfs/Model.scala index 8738510934d..f292b80b829 100644 --- a/src/main/scala/beam/utils/gtfs/Model.scala +++ b/src/main/scala/scripts/gtfs/Model.scala @@ -1,4 +1,4 @@ -package beam.utils.gtfs +package scripts.gtfs import java.util diff --git a/src/main/scala/scripts/map/NewYorkRouteDebugging.scala b/src/main/scala/scripts/map/NewYorkRouteDebugging.scala index 008935d58aa..111e2170fa9 100644 --- a/src/main/scala/scripts/map/NewYorkRouteDebugging.scala +++ b/src/main/scala/scripts/map/NewYorkRouteDebugging.scala @@ -9,7 +9,7 @@ import beam.router.BeamRouter.RoutingRequest import beam.router.{BeamRouter, FreeFlowTravelTime} import beam.router.Modes.BeamMode.{DRIVE_TRANSIT, WALK_TRANSIT} import beam.router.Modes.{toR5StreetMode, BeamMode} -import beam.router.R5Requester.prepareConfig +import scripts.R5Requester.prepareConfig import beam.router.r5.{R5Parameters, R5Wrapper} import beam.sim.common.GeoUtils import beam.utils.{NetworkHelperImpl, ParquetReader} From da3319a175348cadefe48fe9d6247f0d8bd1e3d0 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 16 Jun 2022 20:11:20 +0600 Subject: [PATCH 142/307] Add spreadsheetData lambda function --- .../python/spreadsheetData/lambda_function.py | 513 ++++++++++++++++++ .../python/spreadsheetData/requirements.txt | 3 + .../spreadsheetData/spreadsheetData.yaml | 17 + 3 files changed, 533 insertions(+) create mode 100644 aws/src/main/python/spreadsheetData/lambda_function.py create mode 100644 aws/src/main/python/spreadsheetData/requirements.txt create mode 100644 aws/src/main/python/spreadsheetData/spreadsheetData.yaml diff --git a/aws/src/main/python/spreadsheetData/lambda_function.py b/aws/src/main/python/spreadsheetData/lambda_function.py new file mode 100644 index 00000000000..338d8e38a24 --- /dev/null +++ b/aws/src/main/python/spreadsheetData/lambda_function.py @@ -0,0 +1,513 @@ +# coding=utf-8 +from __future__ import print_function +import pickle +import os.path +import boto3 +import time +import os +import sys, getopt +from datetime import datetime +from googleapiclient.discovery import build +from google.oauth2 import service_account +from google_auth_oauthlib.flow import InstalledAppFlow +from google.auth.transport.requests import Request +from botocore.errorfactory import ClientError + +# If modifying these scopes, delete the file token.pickle. +SCOPES = ['https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/spreadsheets'] +SHEET_NAME_PREFIX = 'Run BEAM instances and results' +INSTANCE_OPERATIONS = ['start', 'stop'] +REGIONS = ['us-east-1', 'us-east-2', 'us-west-2'] + +ec2 = None + + +def init_ec2(region): + global ec2 + ec2 = boto3.client('ec2', region_name=region) + + +def create_spreadsheet(sheet_api, title): + spreadsheet = { + 'properties': { + 'title': title + } + } + spreadsheet = sheet_api.create(body=spreadsheet, + fields='spreadsheetId').execute() + sheet_id = spreadsheet.get('spreadsheetId') + print('Spreadsheet ID: {0}'.format(sheet_id)) + apply_beam_formatting(sheet_api, sheet_id) + return sheet_id + + +def apply_pilates_formatting(sheet_api, sheet_id): + body = { + 'requests': [ + { + "updateDimensionProperties": { + "range": { + "sheetId": 1, + "dimension": "COLUMNS", + "startIndex": 0, + "endIndex": 32 + }, + "properties": { + "pixelSize": 160 + }, + "fields": "pixelSize" + } + }, + { + "repeatCell": { + "range": { + "sheetId": 1, + "startRowIndex": 0, + "endRowIndex": 1 + }, + "cell": { + "userEnteredFormat": { + "backgroundColor": { + "red": 0.5, + "green": 0.5, + "blue": 0.5 + }, + "horizontalAlignment": "CENTER", + "textFormat": { + "foregroundColor": { + "red": 1.0, + "green": 1.0, + "blue": 1.0 + }, + "fontSize": 10, + "bold": 'true' + } + } + }, + "fields": "userEnteredFormat(backgroundColor,textFormat,horizontalAlignment)" + } + } + ] + } + sheet_api.batchUpdate(spreadsheetId=sheet_id, body=body).execute() + header = { + 'values': [ + ["Status", "Run Name", "Instance ID", "Instance type", "Time", "Host name", "Web browser", + "Instance region", "Data region", "Branch", "Commit", "S3 URL", "S3 Path", "Title", "Start year", + "Count of years", "BEAM it len", "Urbansim it len", "In year output", "Config File", + "PILATES Image Version", "PILATES Image Name", "PILATES Scenario Name", "UrbanSim Input", + "UrbanSim Output", + "Skim Path", "S3 Output", "S3 Base Path", "Max RAM", "Storage Size", "Shutdown Wait", "Shutdown Behavior"] + ] + } + sheet_api.values().append( + spreadsheetId=sheet_id, range="PILATES Instances!A1:K1", + valueInputOption="USER_ENTERED", insertDataOption='OVERWRITE', body=header).execute() + empty = { + 'values': [ + [] + ] + } + sheet_api.values().append( + spreadsheetId=sheet_id, range="PILATES Instances!A2:K2", + valueInputOption="USER_ENTERED", insertDataOption='OVERWRITE', body=empty).execute() + row_range = { + 'sheetId': 1, + 'startRowIndex': 1, + 'startColumnIndex': 0, + 'endColumnIndex': 1 + } + requests = [{ + 'addConditionalFormatRule': { + 'rule': { + 'ranges': [row_range], + 'booleanRule': { + 'condition': { + 'type': 'TEXT_CONTAINS', + 'values': [{ + 'userEnteredValue': 'Started' + }] + }, + 'format': { + 'backgroundColor': { + 'red': 0.4, + 'green': 1, + 'blue': 0.4 + } + } + } + }, + 'index': 0 + } + }, { + 'addConditionalFormatRule': { + 'rule': { + 'ranges': [row_range], + 'booleanRule': { + 'condition': { + 'type': 'TEXT_CONTAINS', + 'values': [{ + 'userEnteredValue': 'Completed' + }] + }, + 'format': { + 'backgroundColor': { + 'red': 1, + 'green': 0.4, + 'blue': 0.4 + } + } + } + }, + 'index': 0 + } + }] + body = { + 'requests': requests + } + sheet_api.batchUpdate(spreadsheetId=sheet_id, body=body).execute() + + +def add_pilates_sheet(sheet_api, sheet_id): + body = { + 'requests': [ + { + "addSheet": { + "properties": { + "sheetId": 1, + "title": "PILATES Instances", + "gridProperties": { + "frozenRowCount": 1 + }, + "tabColor": { + "red": 1.0, + "green": 0.3, + "blue": 0.4 + } + } + } + } + ] + } + sheet_api.batchUpdate(spreadsheetId=sheet_id, body=body).execute() + + +def apply_beam_formatting(sheet_api, sheet_id): + body = { + 'requests': [ + { + 'updateSheetProperties': { + 'properties': { + 'sheetId': 0, + 'title': 'BEAM Instances', + "gridProperties": { + "frozenRowCount": 1 + } + }, + 'fields': '(title,gridProperties.frozenRowCount)' + } + }, + { + "updateDimensionProperties": { + "range": { + "sheetId": 0, + "dimension": "COLUMNS", + "startIndex": 0, + "endIndex": 26 + }, + "properties": { + "pixelSize": 160 + }, + "fields": "pixelSize" + } + }, + { + "repeatCell": { + "range": { + "sheetId": 0, + "startRowIndex": 0, + "endRowIndex": 1 + }, + "cell": { + "userEnteredFormat": { + "backgroundColor": { + "red": 0.5, + "green": 0.5, + "blue": 0.5 + }, + "horizontalAlignment": "CENTER", + "textFormat": { + "foregroundColor": { + "red": 1.0, + "green": 1.0, + "blue": 1.0 + }, + "fontSize": 10, + "bold": 'true' + } + } + }, + "fields": "userEnteredFormat(backgroundColor,textFormat,horizontalAlignment)" + } + } + ] + } + sheet_api.batchUpdate(spreadsheetId=sheet_id, body=body).execute() + header = { + 'values': [ + ["Status", "Run Name", "Instance ID", "Instance type", "Time", "Host name", "Web browser", "Region", + "Batch", "Branch", "Data Branch", "Commit", "S3 Url", "Config File"] + ] + } + sheet_api.values().append( + spreadsheetId=sheet_id, range="BEAM Instances!A1:K1", + valueInputOption="USER_ENTERED", insertDataOption='OVERWRITE', body=header).execute() + empty = { + 'values': [ + [] + ] + } + sheet_api.values().append( + spreadsheetId=sheet_id, range="BEAM Instances!A2:K2", + valueInputOption="USER_ENTERED", insertDataOption='OVERWRITE', body=empty).execute() + row_range = { + 'sheetId': 0, + 'startRowIndex': 1, + 'startColumnIndex': 0, + 'endColumnIndex': 1 + } + requests = [{ + 'addConditionalFormatRule': { + 'rule': { + 'ranges': [row_range], + 'booleanRule': { + 'condition': { + 'type': 'TEXT_EQ', + 'values': [{ + 'userEnteredValue': 'Run Started' + }] + }, + 'format': { + 'backgroundColor': { + 'red': 0.4, + 'green': 1, + 'blue': 0.4 + } + } + } + }, + 'index': 0 + } + }, { + 'addConditionalFormatRule': { + 'rule': { + 'ranges': [row_range], + 'booleanRule': { + 'condition': { + 'type': 'TEXT_EQ', + 'values': [{ + 'userEnteredValue': 'Run Completed' + }] + }, + 'format': { + 'backgroundColor': { + 'red': 1, + 'green': 0.4, + 'blue': 0.4 + } + } + } + }, + 'index': 0 + } + }] + body = { + 'requests': requests + } + sheet_api.batchUpdate(spreadsheetId=sheet_id, body=body).execute() + + +def find_actual_sheet(creds): + datem = datetime.now().strftime('%h.%Y') + drive_service = build('drive', 'v3', credentials=creds) + page_token = None + response = drive_service.files().list( + q="mimeType='application/vnd.google-apps.spreadsheet' and name='{0} {1}'".format(SHEET_NAME_PREFIX, datem), + spaces='drive', + fields='nextPageToken, files(id, name)', + pageToken=page_token).execute() + items = response.get('files', []) + if not items: + return False + else: + return True + + +def add_beam_row(sheet_id, row_data, sheet_api): + empty = { + 'values': [ + [ + row_data.pop('status'), + row_data.pop('name'), + row_data.pop('instance_id'), + row_data.pop('instance_type'), + datetime.now().strftime('%m/%d/%Y, %H:%M:%S'), + row_data.pop('host_name'), + row_data.pop('browser'), + row_data.pop('region'), + row_data.pop('batch'), + row_data.pop('branch'), + row_data.pop('data_branch'), + row_data.pop('commit'), + row_data.pop('s3_link', ''), + row_data.pop('config_file', ''), + row_data.pop('max_ram', ''), + row_data.pop('stacktrace', ''), + row_data.pop('died_actors', ''), + row_data.pop('error', ''), + row_data.pop('warning', ''), + row_data.pop('sigopt_client_id', ''), + row_data.pop('sigopt_dev_id', ''), + *row_data.values() + ] + ] + } + sheet_api.values().append( + spreadsheetId=sheet_id, range="BEAM Instances!A2:F2", + valueInputOption="USER_ENTERED", insertDataOption='OVERWRITE', body=empty).execute() + + +def add_pilates_row(sheet_id, row_data, sheet_api): + empty = { + 'values': [ + [ + row_data.pop('status'), + row_data.pop('name'), + row_data.pop('instance_id'), + row_data.pop('instance_type'), + datetime.now().strftime('%m/%d/%Y, %H:%M:%S'), + row_data.pop('host_name'), + row_data.pop('browser'), + row_data.pop('instance_region'), + row_data.pop('data_region'), + row_data.pop('branch'), + row_data.pop('data_branch'), + row_data.pop('commit'), + row_data.pop('s3_URL'), + row_data.pop('s3_path', ''), + row_data.pop('title', ''), + row_data.pop('start_year', ''), + row_data.pop('count_of_years', ''), + row_data.pop('beam_it_len', ''), + row_data.pop('urbansim_it_len', ''), + row_data.pop('in_year_output', ''), + row_data.pop('config', ''), + row_data.pop('pilates_image_version', ''), + row_data.pop('pilates_image_name', ''), + row_data.pop('pilates_scenario_name', ''), + row_data.pop('initial_urbansim_input', ''), + row_data.pop('initial_urbansim_output', ''), + row_data.pop('initial_skims_path', ''), + row_data.pop('s3_output_bucket', ''), + row_data.pop('s3_output_base_path', ''), + row_data.pop('max_ram', ''), + row_data.pop('storage_size', ''), + row_data.pop('shutdown_wait', ''), + row_data.pop('shutdown_behaviour', ''), + *row_data.values() + ] + ] + } + sheet_api.values().append( + spreadsheetId=sheet_id, range="PILATES Instances!A2:F2", + valueInputOption="USER_ENTERED", insertDataOption='OVERWRITE', body=empty).execute() + + +def load_creds(): + creds = None + # The file token.pickle stores the user's access and refresh tokens, and is + # created automatically when the authorization flow completes for the first + # time. + if os.path.exists('token.pickle'): + with open('token.pickle', 'rb') as token: + creds = pickle.load(token) + + if os.path.exists('/tmp/token.pickle'): + with open('/tmp/token.pickle', 'rb') as token: + creds = pickle.load(token) + # If there are no (valid) credentials available, let the user log in. + if not creds or not creds.valid: + if creds and creds.expired and creds.refresh_token: + creds.refresh(Request()) + else: + flow = InstalledAppFlow.from_client_secrets_file( + 'credentials.json', SCOPES) + creds = flow.run_local_server(port=0) + # Save the credentials for the next run + with open('/tmp/token.pickle', 'wb') as token: + pickle.dump(creds, token) + return creds + + +def load_service_creds(): + creds_data = dict( + "type" = "service_account", + "project_id" = os.environ["project_id"], + "private_key_id" = os.environ["private_key_id"], + "private_key" = os.environ["private_key"], + "client_email" = os.environ["client_email"], + "client_id" = os.environ["client_id"], + "auth_uri" = "https://accounts.google.com/o/oauth2/auth", + "token_uri" = "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url" = "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url" = os.environ["client_x509_cert_url"] + ) + creds = service_account.Credentials.from_service_account_info(creds_data, scopes=SCOPES) + return creds + + +def add_handler(event): + print(event) + creds = load_service_creds() + service = build('sheets', 'v4', credentials=creds) + sheet = service.spreadsheets() + row_type = event.get('type') + if row_type == 'beam': + return add_beam_row(event.get('sheet_id'), event.get('run'), sheet) + if row_type == 'pilates': + return add_pilates_row(event.get('sheet_id'), event.get('run'), sheet) + + +def create_handler(event): + creds = load_creds() + service = build('sheets', 'v4', credentials=creds) + sheet = service.spreadsheets() + datem = datetime.now().strftime('%h.%Y') + return create_spreadsheet(sheet, event.get('spreadsheet_id'), '{0} {1}'.format(SHEET_NAME_PREFIX, datem)) + + +def lambda_handler(event, context): + command_id = event.get('command', 'create') # start | stop | add | create + + if command_id == 'create': + return create_handler(event) + + if command_id == 'add': + return add_handler(event) + + return "Operation {command} not supported, please specify one of the supported operations (create | add). ".format( + command=command_id) + + +def main(sheet_id): + creds = load_service_creds() + service = build('sheets', 'v4', credentials=creds) + # Call the Sheets API + sheet = service.spreadsheets() + # apply_beam_formatting(sheet, sheet_id) + add_pilates_sheet(sheet, sheet_id) + apply_pilates_formatting(sheet, sheet_id) + + +if __name__ == '__main__': + main(sys.argv[1]) diff --git a/aws/src/main/python/spreadsheetData/requirements.txt b/aws/src/main/python/spreadsheetData/requirements.txt new file mode 100644 index 00000000000..10eeaeb773b --- /dev/null +++ b/aws/src/main/python/spreadsheetData/requirements.txt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37dcc5b9796ca97a2bb15a94d094225c529528f4ae155018fa7b0a98c60f6254 +size 141 diff --git a/aws/src/main/python/spreadsheetData/spreadsheetData.yaml b/aws/src/main/python/spreadsheetData/spreadsheetData.yaml new file mode 100644 index 00000000000..5d132c91944 --- /dev/null +++ b/aws/src/main/python/spreadsheetData/spreadsheetData.yaml @@ -0,0 +1,17 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: Beam Run Data +Resources: + spreadsheetData: + Type: 'AWS::Serverless::Function' + Properties: + Handler: lambda_function.lambda_handler + Runtime: python3.6 + CodeUri: . + Description: Beam Run Data + MemorySize: 256 + Timeout: 60 + Role: 'arn:aws:iam::340032650202:role/BeamLambdaExecution' + Environment: + Variables: + REGION: us-west-2 From 00dcc425f585dda430c4db6a06facff2b589b33b Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 16 Jun 2022 20:57:27 +0600 Subject: [PATCH 143/307] Add data branch commit --- aws/build.gradle | 11 +++++--- .../python/beam_lambda/lambda_function.py | 14 +++++++--- .../python/spreadsheetData/lambda_function.py | 28 ++++++++++--------- gradle.deploy.properties | 2 ++ gradle.deployPILATES.properties | 1 + 5 files changed, 35 insertions(+), 21 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index bd1832caff1..7477b5dec74 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -80,14 +80,16 @@ task deploy(type: AWSLambdaInvokeTask) { def tempInstanceType = "${ext.getParameterValue('instanceType') ?: (project.hasProperty('defaultInstanceType') ? defaultInstanceType : '')}" def finalInstanceType = tempInstanceType != "" ? tempInstanceType : null def dataBranch = "${ext.getParameterValue('dataBranch') ?: 'develop'}" + def dataCommit = "${ext.getParameterValue('dataCommit') ?: 'HEAD'}" def pload = """{ "title": "${ext.getParameterValue('runName') + '_' + getCurrentGitUserEmail()}", "git_user_email": "${getCurrentGitUserEmail()}", "deploy_type_tag": "${ext.getParameterValue('deployTypeTag')}", "branch": "${ext.getParameterValue('beamBranch') ?: getCurrentGitBranch()}", - "data_branch": "$dataBranch", "commit": "${ext.getParameterValue('beamCommit') ?: getCurrentGitCommit()}", + "data_branch": "$dataBranch", + "data_commit": "$dataCommit", "deploy_mode": "${ext.getParameterValue('deployMode')}", "configs": "${ext.getParameterValue('beamConfigs') ?: ext.getParameterValue(getCurrentGitBranch() + '.configs')}", "experiments": "${ext.getParameterValue('beamExperiments') ?: ext.getParameterValue(getCurrentGitBranch() + '.experiments')}", @@ -112,7 +114,7 @@ task deploy(type: AWSLambdaInvokeTask) { "max_memory": ${ext.getParameterValue('maxMemory') ?: 0} }""" payload = pload - println "Using data branch $dataBranch" + println "Using data branch $dataBranch at commit $dataCommit" println payload println "Please note that if you set isSpot to true then it could take an excessive time period. In fact it could time out at 15 minutes and still complete later on. ALSO! volumes using spot instances must be MANUALLY deleted. This is done so you do not lose data in the case of a premature shutdown." functionName = "simulateBeam" @@ -149,13 +151,14 @@ task deployPilates(type: AWSLambdaInvokeTask) { defaultParamVals['beamBranch'] = getCurrentGitBranch() defaultParamVals['beamCommit'] = getCurrentGitCommit() defaultParamVals['dataBranch'] = 'develop' + defaultParamVals['dataCommit'] = 'HEAD' def paramMap = [:] def missing = [] // all possible parameters ['runName', 'pilatesScenarioName', - 'beamBranch', 'dataBranch', 'beamCommit', + 'beamBranch', 'beamCommit', 'dataBranch', 'dataCommit', 'beamConfig', 'startYear', 'countOfYears', 'beamItLen', 'urbansimItLen', 'initialS3UrbansimInput', 'initialS3UrbansimOutput', 'initialSkimPath', @@ -178,7 +181,7 @@ task deployPilates(type: AWSLambdaInvokeTask) { println("parameters wasn't specified: " + missing.join(', ')) - println "Using data branch ${paramMap['dataBranch']}" + println "Using data branch ${paramMap['dataBranch']} at commit ${paramMap['dataCommit']}" // create a string with json object which contains all parameters def pload = "{\n" + paramMap.collect { key, val -> " \"$key\": \"$val\"" }.join(",\n") + "\n}" diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 602524d393c..a97d806f183 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -63,6 +63,8 @@ DATA_BRANCH_DEFAULT = 'develop' +DATA_COMMIT_DEFAULT = 'HEAD' + COMMIT_DEFAULT = 'HEAD' MAXRAM_DEFAULT = '2g' @@ -132,10 +134,11 @@ \\"host_name\\":\\"%s\\", \\"browser\\":\\"http://%s:8000\\", \\"branch\\":\\"$BRANCH\\", + \\"commit\\":\\"$COMMIT\\", \\"data_branch\\":\\"$DATA_BRANCH\\", + \\"data_commit\\":\\"$DATA_COMMIT\\", \\"region\\":\\"$REGION\\", \\"batch\\":\\"$UID\\", - \\"commit\\":\\"$COMMIT\\", \\"s3_link\\":\\"%s\\", \\"max_ram\\":\\"$MAX_RAM\\", \\"profiler_type\\":\\"$PROFILER\\", @@ -217,10 +220,11 @@ \\"host_name\\":\\"%s\\", \\"browser\\":\\"http://%s:8000\\", \\"branch\\":\\"$BRANCH\\", + \\"commit\\":\\"$COMMIT\\", \\"data_branch\\":\\"$DATA_BRANCH\\", + \\"data_branch\\":\\"$DATA_COMMIT\\", \\"region\\":\\"$REGION\\", \\"batch\\":\\"$UID\\", - \\"commit\\":\\"$COMMIT\\", \\"s3_link\\":\\"%s\\", \\"max_ram\\":\\"$MAX_RAM\\", \\"profiler_type\\":\\"$PROFILER\\", @@ -655,8 +659,9 @@ def get_param(param_name): return param_value branch = event.get('branch', BRANCH_DEFAULT) - data_branch = event.get('data_branch', DATA_BRANCH_DEFAULT) commit_id = event.get('commit', COMMIT_DEFAULT) + data_branch = event.get('data_branch', DATA_BRANCH_DEFAULT) + data_commit = event.get('data_commit', DATA_COMMIT_DEFAULT) deploy_mode = event.get('deploy_mode', 'config') configs = event.get('configs', CONFIG_DEFAULT) experiments = event.get('experiments', EXPERIMENT_DEFAULT) @@ -746,8 +751,9 @@ def get_param(param_name): .replace('$REGION',region) \ .replace('$S3_REGION', os.environ['REGION']) \ .replace('$BRANCH', branch) \ - .replace('$DATA_BRANCH', data_branch) \ .replace('$COMMIT', commit_id) \ + .replace('$DATA_BRANCH', data_branch) \ + .replace('$DATA_BRANCH', data_commit) \ .replace('$CONFIG', arg) \ .replace('$MAIN_CLASS', execute_class) \ .replace('$UID', uid) \ diff --git a/aws/src/main/python/spreadsheetData/lambda_function.py b/aws/src/main/python/spreadsheetData/lambda_function.py index 338d8e38a24..094ddfbc07c 100644 --- a/aws/src/main/python/spreadsheetData/lambda_function.py +++ b/aws/src/main/python/spreadsheetData/lambda_function.py @@ -256,7 +256,7 @@ def apply_beam_formatting(sheet_api, sheet_id): header = { 'values': [ ["Status", "Run Name", "Instance ID", "Instance type", "Time", "Host name", "Web browser", "Region", - "Batch", "Branch", "Data Branch", "Commit", "S3 Url", "Config File"] + "Batch", "Branch", "Commit", "Data Branch", "Data Commit", "S3 Url", "Config File"] ] } sheet_api.values().append( @@ -357,8 +357,9 @@ def add_beam_row(sheet_id, row_data, sheet_api): row_data.pop('region'), row_data.pop('batch'), row_data.pop('branch'), - row_data.pop('data_branch'), row_data.pop('commit'), + row_data.pop('data_branch'), + row_data.pop('data_commit'), row_data.pop('s3_link', ''), row_data.pop('config_file', ''), row_data.pop('max_ram', ''), @@ -391,8 +392,9 @@ def add_pilates_row(sheet_id, row_data, sheet_api): row_data.pop('instance_region'), row_data.pop('data_region'), row_data.pop('branch'), - row_data.pop('data_branch'), row_data.pop('commit'), + row_data.pop('data_branch'), + row_data.pop('data_commit'), row_data.pop('s3_URL'), row_data.pop('s3_path', ''), row_data.pop('title', ''), @@ -451,16 +453,16 @@ def load_creds(): def load_service_creds(): creds_data = dict( - "type" = "service_account", - "project_id" = os.environ["project_id"], - "private_key_id" = os.environ["private_key_id"], - "private_key" = os.environ["private_key"], - "client_email" = os.environ["client_email"], - "client_id" = os.environ["client_id"], - "auth_uri" = "https://accounts.google.com/o/oauth2/auth", - "token_uri" = "https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url" = "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url" = os.environ["client_x509_cert_url"] + type = "service_account", + project_id = os.environ["project_id"], + private_key_id = os.environ["private_key_id"], + private_key = os.environ["private_key"].replace('\\n', '\n'), + client_email = os.environ["client_email"], + client_id = os.environ["client_id"], + auth_uri = "https://accounts.google.com/o/oauth2/auth", + token_uri = "https://oauth2.googleapis.com/token", + auth_provider_x509_cert_url = "https://www.googleapis.com/oauth2/v1/certs", + client_x509_cert_url = os.environ["client_x509_cert_url"] ) creds = service_account.Credentials.from_service_account_info(creds_data, scopes=SCOPES) return creds diff --git a/gradle.deploy.properties b/gradle.deploy.properties index 08c32853ce4..c905d91beb4 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -4,6 +4,8 @@ beamBranch=develop beamConfigs=test/input/sf-light/sf-light-1k-with-PTE-duplicates-1.conf,test/input/sf-light/sf-light-1k-with-PTE-duplicates-2.conf instanceType=r5.8xlarge +dataCommit=HEAD + # shutdownBehaviour = stop | terminate shutdownBehaviour=terminate s3Backup=true diff --git a/gradle.deployPILATES.properties b/gradle.deployPILATES.properties index 67bb11052bb..2bfa2e5c850 100644 --- a/gradle.deployPILATES.properties +++ b/gradle.deployPILATES.properties @@ -18,6 +18,7 @@ beamConfig=production/sfbay/smart/smart-baseline-pilates-small-test.conf beamBranch=develop beamCommit=HEAD dataBranch=develop +dataCommit=HEAD instanceType=t2.small From a44a77a9d6a256687731e35ea74b3649f709904a Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 16 Jun 2022 22:21:35 +0600 Subject: [PATCH 144/307] Fixes --- aws/src/main/python/beam_lambda/lambda_function.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index a97d806f183..f38f4703f78 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -173,6 +173,7 @@ - echo "Loading remote production data for $i" - git config submodule.$i.branch $DATA_BRANCH - git submodule update --init --remote $i + - cd $i; git checkout $DATA_COMMIT; cd - - esac - done - done @@ -222,7 +223,7 @@ \\"branch\\":\\"$BRANCH\\", \\"commit\\":\\"$COMMIT\\", \\"data_branch\\":\\"$DATA_BRANCH\\", - \\"data_branch\\":\\"$DATA_COMMIT\\", + \\"data_commit\\":\\"$DATA_COMMIT\\", \\"region\\":\\"$REGION\\", \\"batch\\":\\"$UID\\", \\"s3_link\\":\\"%s\\", @@ -753,7 +754,7 @@ def get_param(param_name): .replace('$BRANCH', branch) \ .replace('$COMMIT', commit_id) \ .replace('$DATA_BRANCH', data_branch) \ - .replace('$DATA_BRANCH', data_commit) \ + .replace('$DATA_COMMIT', data_commit) \ .replace('$CONFIG', arg) \ .replace('$MAIN_CLASS', execute_class) \ .replace('$UID', uid) \ From ed9e7e62ad5e93141b46b6ffd71f10cdac10e62a Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 16 Jun 2022 22:41:54 +0600 Subject: [PATCH 145/307] Restore file contents that were previously in LFS --- .gitattributes | 1 + aws/src/main/python/spreadsheetData/requirements.txt | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 8d63c6e5413..ef0fcfbaa1d 100755 --- a/.gitattributes +++ b/.gitattributes @@ -35,3 +35,4 @@ text eol=lf test/**/*.xml filter=lfs diff=lfs merge=lfs -text production/**/*.xml filter=lfs diff=lfs merge=lfs -text test/input/sf-light/TechTakeover_longTerm_lowTech/ filter=lfs diff=lfs merge=lfs -text +aws/**/*.txt !filter !diff !merge text diff --git a/aws/src/main/python/spreadsheetData/requirements.txt b/aws/src/main/python/spreadsheetData/requirements.txt index 10eeaeb773b..c2f7455c5d3 100644 --- a/aws/src/main/python/spreadsheetData/requirements.txt +++ b/aws/src/main/python/spreadsheetData/requirements.txt @@ -1,3 +1,6 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:37dcc5b9796ca97a2bb15a94d094225c529528f4ae155018fa7b0a98c60f6254 -size 141 +boto3==1.9.134 +botocore==1.12.134 +google-api-python-client==1.7.11 +google-auth==1.6.3 +google-auth-httplib2==0.0.3 +google-auth-oauthlib==0.4.1 \ No newline at end of file From 058517d74227908a556f90fa42cdae36b49cee16 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 16 Jun 2022 22:50:00 +0600 Subject: [PATCH 146/307] Deduct client_x509_cert_url --- aws/src/main/python/spreadsheetData/lambda_function.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aws/src/main/python/spreadsheetData/lambda_function.py b/aws/src/main/python/spreadsheetData/lambda_function.py index 094ddfbc07c..ee9c594766c 100644 --- a/aws/src/main/python/spreadsheetData/lambda_function.py +++ b/aws/src/main/python/spreadsheetData/lambda_function.py @@ -12,6 +12,7 @@ from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from botocore.errorfactory import ClientError +import urllib.parse # If modifying these scopes, delete the file token.pickle. SCOPES = ['https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/spreadsheets'] @@ -462,7 +463,7 @@ def load_service_creds(): auth_uri = "https://accounts.google.com/o/oauth2/auth", token_uri = "https://oauth2.googleapis.com/token", auth_provider_x509_cert_url = "https://www.googleapis.com/oauth2/v1/certs", - client_x509_cert_url = os.environ["client_x509_cert_url"] + client_x509_cert_url = "https://www.googleapis.com/robot/v1/metadata/x509/" + urllib.parse.quote(os.environ["client_email"]) ) creds = service_account.Credentials.from_service_account_info(creds_data, scopes=SCOPES) return creds From d823c34bb6ce64a680675864618c76309322ec3d Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Thu, 16 Jun 2022 23:08:49 -0400 Subject: [PATCH 147/307] Update lambda to 3.x and sync (#3542) * simulateBeam * last bumps needed * bump to latest python --- .../python/beam_lambda/lambda_function.py | 38 +++++++++---------- .../main/python/beam_lambda/simulateBeam.yaml | 2 +- .../ec2StartStop_lambda/ec2StartStop.yaml | 2 +- .../main/python/runPilates/lambda_function.py | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index cc65620d854..8e58330805a 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -325,8 +325,8 @@ def check_resource(bucket, key): try: s3.head_object(Bucket=bucket, Key=key) return True - except ClientError as ex: - print 'error sending Slack response: ' + str(ex) + except ClientError as clientError: + print(f"error sending Slack response: {clientError}") return False def check_branch(branch): @@ -442,7 +442,7 @@ def get_spot_fleet_instances_based_on(min_cores, max_cores, min_memory, max_memo if preferred_instance_type: output_instance_types.append(preferred_instance_type) except NameError: - print 'No preferred spot instance type provided' + print('No preferred spot instance type provided') if not output_instance_types: raise Exception('0 spot instances matched min_cores: ' + str(min_cores) + ' - max_cores: ' + str(max_cores) + 'and min_mem: ' + str(min_memory) + ' - max_mem: ' + str(max_memory) ) return list(dict.fromkeys(output_instance_types)) @@ -507,18 +507,18 @@ def deploy_spot_fleet(context, script, instance_type, region_prefix, shutdown_be status = 'pending_fulfillment' state = 'submitted' spot_fleet_req_id = spot_fleet_req.get('SpotFleetRequestId') - print 'SpotFleetRequestId is ' + spot_fleet_req_id + print('SpotFleetRequestId is ' + spot_fleet_req_id) #Flow as far as I know is that state goes to submitted, then active, but isn't done until status is out of pending_fulfillment while status == 'pending_fulfillment' or state == 'submitted': remaining_time = context.get_remaining_time_in_millis() - print 'Waiting for spot fleet request id to finish pending_fulfillment - Status: ' + status + ' and State: ' + state + ' and Remaining Time (ms): ' + str(remaining_time) + print('Waiting for spot fleet request id to finish pending_fulfillment - Status: ' + status + ' and State: ' + state + ' and Remaining Time (ms): ' + str(remaining_time)) if remaining_time <= 60000: ec2.cancel_spot_fleet_requests( DryRun=False, SpotFleetRequestIds=[spot_fleet_req_id], TerminateInstances=True ) - print 'Waiting 30 seconds to let spot fleet cancel and then shutting down due to getting too close to lambda timeout' + print('Waiting 30 seconds to let spot fleet cancel and then shutting down due to getting too close to lambda timeout') time.sleep(30) exit(123) else: @@ -533,10 +533,10 @@ def deploy_spot_fleet(context, script, instance_type, region_prefix, shutdown_be TerminateInstances=True ) #TODO: This situation should be ?IMPOSSIBLE? but if it does occur then it could orphan a volume - not worth it unless it becomes an issue - print 'Waiting 30 seconds to let spot fleet cancel and then shutting down due to reaching this point and the state is ' + state + ' and status is ' + status + ' - maybe double check for orphaned volume?' + print('Waiting 30 seconds to let spot fleet cancel and then shutting down due to reaching this point and the state is ' + state + ' and status is ' + status + ' - maybe double check for orphaned volume?') time.sleep(30) exit(1) - print 'Getting spot fleet instances' + print('Getting spot fleet instances') fleet_instances = ec2.describe_spot_fleet_instances(SpotFleetRequestId=spot_fleet_req_id) fleet_instance = fleet_instances.get('ActiveInstances')[0] #TODO: Check if InstanceHealth is healthy vs unhealthy? bd_count = 0 @@ -546,7 +546,7 @@ def deploy_spot_fleet(context, script, instance_type, region_prefix, shutdown_be bd_count = len(instance.get('BlockDeviceMappings')) if bd_count < 1: remaining_time = context.get_remaining_time_in_millis() - print 'Spot request state now ' + state + ' and status ' + status + ' so getting instance using ' + instance_id + ' and Remaining Time (ms): ' + str(remaining_time) + print('Spot request state now ' + state + ' and status ' + status + ' so getting instance using ' + instance_id + ' and Remaining Time (ms): ' + str(remaining_time)) if remaining_time <= 60000: ec2.cancel_spot_fleet_requests( DryRun=False, @@ -554,13 +554,13 @@ def deploy_spot_fleet(context, script, instance_type, region_prefix, shutdown_be TerminateInstances=True ) #TODO: Since there is no block device yet then we cannot terminate that instance - this COULD result in orphaned volumes - but they would be named at least...handle with a cloud watch if it becomes an issue - print 'Waiting 30 seconds to let spot fleet cancel and then shutting down due to getting too close to lambda timeout' + print('Waiting 30 seconds to let spot fleet cancel and then shutting down due to getting too close to lambda timeout') time.sleep(30) exit(123) else: - print 'Sleeping 30 seconds to let instance volumes spin up (most likely this will never occur)' + print('Sleeping 30 seconds to let instance volumes spin up (most likely this will never occur)') time.sleep(30) - print 'Instance up with block device ready' + print('Instance up with block device ready') volume_id = instance.get('BlockDeviceMappings')[0].get('Ebs').get('VolumeId') ec2.create_tags( Resources=[volume_id], @@ -575,20 +575,20 @@ def deploy_spot_fleet(context, script, instance_type, region_prefix, shutdown_be 'Key': 'DeployType', 'Value': deploy_type_tag }]) - print 'Created tags on volume' + print('Created tags on volume') while instance.get('State') == 'pending': instance = ec2.describe_instances(InstanceIds=[instance_id]).get('Reservations')[0].get('Instances')[0] state = instance.get('State') if state == 'pending': remaining_time = context.get_remaining_time_in_millis() - print 'Spot instance state now ' + state + ' and instance id is ' + instance_id + ' and Remaining Time (ms): ' + str(remaining_time) + print('Spot instance state now ' + state + ' and instance id is ' + instance_id + ' and Remaining Time (ms): ' + str(remaining_time)) if remaining_time <= 45000: - print 'Returning the instance id because about to timeout and the instance is spinning up - just not fully - no need to cancel' + print('Returning the instance id because about to timeout and the instance is spinning up - just not fully - no need to cancel') return instance_id else: - print 'Waiting for instance to leave pending' + print('Waiting for instance to leave pending') time.sleep(30) - print 'Spot instance ready to go!' + print('Spot instance ready to go!') return instance_id def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_name, volume_size, git_user_email, deploy_type_tag, budget_override): @@ -625,7 +625,7 @@ def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_na 'Value': deploy_type_tag }, { 'Key': 'BudgetOverride', - 'Value': budget_override + 'Value': str(budget_override) } ] } ]) return res['Instances'][0]['InstanceId'] @@ -759,7 +759,7 @@ def get_param(param_name): uid = str(uuid.uuid4())[:8] runName = titled if len(params) > 1: - runName += "-" + `runNum` + runName += "-" + str(runNum) script = initscript.replace('$RUN_SCRIPT',selected_script).replace('$REGION',region).replace('$S3_REGION', os.environ['REGION']) \ .replace('$BRANCH', branch).replace('$DATA_BRANCH', data_branch).replace('$COMMIT', commit_id).replace('$CONFIG', arg) \ .replace('$MAIN_CLASS', execute_class).replace('$UID', uid).replace('$SHUTDOWN_WAIT', shutdown_wait) \ diff --git a/aws/src/main/python/beam_lambda/simulateBeam.yaml b/aws/src/main/python/beam_lambda/simulateBeam.yaml index ba3df3b9739..b5390e8af3f 100755 --- a/aws/src/main/python/beam_lambda/simulateBeam.yaml +++ b/aws/src/main/python/beam_lambda/simulateBeam.yaml @@ -6,7 +6,7 @@ Resources: Type: 'AWS::Serverless::Function' Properties: Handler: lambda_function.lambda_handler - Runtime: python2.7 + Runtime: python3.8 CodeUri: . Description: BEAM Sim MemorySize: 128 diff --git a/aws/src/main/python/ec2StartStop_lambda/ec2StartStop.yaml b/aws/src/main/python/ec2StartStop_lambda/ec2StartStop.yaml index 03cb9c9ffa7..80d5a4ae12f 100755 --- a/aws/src/main/python/ec2StartStop_lambda/ec2StartStop.yaml +++ b/aws/src/main/python/ec2StartStop_lambda/ec2StartStop.yaml @@ -6,7 +6,7 @@ Resources: Type: 'AWS::Serverless::Function' Properties: Handler: lambda_function.lambda_handler - Runtime: python2.7 + Runtime: python3.8 CodeUri: . Description: BEAM Sim MemorySize: 128 diff --git a/aws/src/main/python/runPilates/lambda_function.py b/aws/src/main/python/runPilates/lambda_function.py index 13b3c134365..f22b33a921f 100644 --- a/aws/src/main/python/runPilates/lambda_function.py +++ b/aws/src/main/python/runPilates/lambda_function.py @@ -310,7 +310,7 @@ def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_na 'Value': instance_name }, { 'Key': 'BudgetOverride', - 'Value': budget_override + 'Value': str(budget_override) }] }]) return res['Instances'][0]['InstanceId'] From 855283442560db83d5bb7a7afda1faa0b11e953a Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 16 Jun 2022 23:02:18 -0700 Subject: [PATCH 148/307] update --- src/main/R/gemini/gemini-main.R | 2 +- src/main/R/gemini/gemini-processing.R | 34 --------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index d4baf5b8fc3..1228c0094cd 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -210,7 +210,7 @@ ggsave(pp(plotsDir,'/baseline-ev-charging-loads-by-space-time-in-oakland.png'),p ## ************************************** ## public charging by scenario #scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') -scenarioNames <- c('5b1', '5b2', '5b3', '5b5', '5b6', '5b7') +scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ theme_marain() + diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index b4ef83b8e1c..5037ae8caec 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -20,40 +20,6 @@ oaklandMap <- ggmap::get_googlemap("oakland california", zoom = 13, maptype = "r shpFile <- pp(workDir, "/shapefile/Oakland+Alameda+TAZ/Transportation_Analysis_Zones.shp") oaklandCbg <- st_read(shpFile) -infra5aBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/4a_output_2022_Apr_13_pubClust_withFees_aggregated.csv")) -infra5bBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/6_output_2022_Apr_13_pubClust_withFees.csv.gz")) -infra5bBase[startsWith(reservedFor,"household")]$reservedFor <- "Any" -infra5bBase_NH <- infra5bBase[ - ,.(parkingZoneId=first(parkingZoneId),feeInCents=mean(feeInCents),numStalls=sum(numStalls)) - ,b=.(taz,parkingType,chargingPointType,X,Y,reservedFor,pricingModel)] -write.csv( - infra5bBase_NH, - file = pp(workDir, "/2022-04-28/_models/infrastructure/6_output_2022_Apr_13_pubClust_withFees_noHousehold.csv"), - row.names=FALSE, - quote=FALSE) - -vehicles1 <- readCsv(pp(workDir, "/vehicles.4Base.csv")) -vehicles1$stateOfCharge <- as.double(vehicles1$stateOfCharge) -vehicles1[is.na(stateOfCharge)]$stateOfCharge <- 1.0 -vehicles1[is.infinite(stateOfCharge)]$stateOfCharge <- 1.0 - -vehicles2 <- readCsv(pp(workDir, "/2.final_vehicles.5bBase.csv")) -vehicles2$stateOfCharge <- as.double(vehicles2$stateOfCharge) -vehicles2[is.na(stateOfCharge)]$stateOfCharge <- 0.5 -vehicles2[is.infinite(stateOfCharge)]$stateOfCharge <- 0.5 -vehicles2$stateOfCharge <- abs(vehicles2$stateOfCharge) -vehicles2[stateOfCharge < 0.2]$stateOfCharge <- 0.2 -vehicles2[stateOfCharge > 1]$stateOfCharge <- 1.0 - -vehicles3 <- rbind(vehicles1, vehicles2)[ - ,.(stateOfCharge=min(stateOfCharge)) - ,by=.(vehicleId,vehicleTypeId,householdId)] - -write.csv( - vehicles3, - file = pp(workDir, "/new.vehicles.5bBase.csv"), - row.names=FALSE, - quote=FALSE) ### #eventsraw <- readCsv(pp(workDir, "/0.events.csv.gz")) From 76c1989b2186c928b50b2d694ea0af6d707a7f42 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Fri, 17 Jun 2022 15:00:02 +0600 Subject: [PATCH 149/307] Make lambda compatible with existing deployments --- aws/src/main/python/spreadsheetData/lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/spreadsheetData/lambda_function.py b/aws/src/main/python/spreadsheetData/lambda_function.py index ee9c594766c..a74eacead89 100644 --- a/aws/src/main/python/spreadsheetData/lambda_function.py +++ b/aws/src/main/python/spreadsheetData/lambda_function.py @@ -360,7 +360,7 @@ def add_beam_row(sheet_id, row_data, sheet_api): row_data.pop('branch'), row_data.pop('commit'), row_data.pop('data_branch'), - row_data.pop('data_commit'), + row_data.pop('data_commit', ''), row_data.pop('s3_link', ''), row_data.pop('config_file', ''), row_data.pop('max_ram', ''), From 1b540501940c86ac1330fa90caee48f652903ee6 Mon Sep 17 00:00:00 2001 From: Xuan-1998 Date: Fri, 17 Jun 2022 06:33:58 -0700 Subject: [PATCH 150/307] moving beam.agentsim.agents.vehicles.BeamVehicle#isSharedVehicle to BeamVehicleType class --- .../scala/beam/agentsim/agents/vehicles/BeamVehicleType.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicleType.scala b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicleType.scala index 95b187a8ab4..74e7496dd0e 100755 --- a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicleType.scala +++ b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicleType.scala @@ -31,6 +31,7 @@ case class BeamVehicleType( chargingCapability: Option[ChargingPointType] = None, payloadCapacityInKg: Option[Double] = None ) { + def isSharedVehicle: Boolean = id.toString.startsWith("sharedVehicle") def isCaccEnabled: Boolean = { automationLevel >= 3 From d32c14205ac056381aff8818d33a157479c70464 Mon Sep 17 00:00:00 2001 From: Xuan-1998 Date: Fri, 17 Jun 2022 06:35:05 -0700 Subject: [PATCH 151/307] assign right type to private bikes --- src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala index 4f3173a3aaf..cf4ff12ca57 100644 --- a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala +++ b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala @@ -150,6 +150,7 @@ class UrbanSimScenarioLoader( realDistribution.reseedRandomGenerator(beamScenario.beamConfig.matsim.modules.global.randomSeed) val bikeVehicleType = beamScenario.vehicleTypes.values + .filterNot(_.isSharedVehicle) .find(_.vehicleCategory == VehicleCategory.Bike) .getOrElse(throw new RuntimeException("Bike not found in vehicle types.")) From f57ca5e3e532d498f4d5559657d7d5f73e7dacec Mon Sep 17 00:00:00 2001 From: Xuan-1998 Date: Fri, 17 Jun 2022 08:33:39 -0700 Subject: [PATCH 152/307] adjust peer review --- src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala index 7ddaedcecf6..02ca4dd587e 100755 --- a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala +++ b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala @@ -401,11 +401,10 @@ class BeamVehicle( case Body => WALK } - val needsToCalculateCost = beamVehicleType.vehicleCategory == Car || isSharedVehicle + val needsToCalculateCost = beamVehicleType.vehicleCategory == Car || beamVehicleType.isSharedVehicle StreetVehicle(id, beamVehicleType.id, spaceTime, mode, asDriver = true, needsToCalculateCost = needsToCalculateCost) } - def isSharedVehicle: Boolean = beamVehicleType.id.toString.startsWith("sharedVehicle") def isCAV: Boolean = beamVehicleType.automationLevel >= 4 From 1e4b56d98154f07aa67d924e98655b52c078b954 Mon Sep 17 00:00:00 2001 From: Xuan-1998 Date: Fri, 17 Jun 2022 09:10:12 -0700 Subject: [PATCH 153/307] fmt --- src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala index 02ca4dd587e..b1f7e05d502 100755 --- a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala +++ b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala @@ -405,7 +405,6 @@ class BeamVehicle( StreetVehicle(id, beamVehicleType.id, spaceTime, mode, asDriver = true, needsToCalculateCost = needsToCalculateCost) } - def isCAV: Boolean = beamVehicleType.automationLevel >= 4 def isBEV: Boolean = From d54dbd9922ef04811f79a68b30fc9269913b7343 Mon Sep 17 00:00:00 2001 From: Xuan-1998 Date: Fri, 17 Jun 2022 10:02:01 -0700 Subject: [PATCH 154/307] fixing compilation error --- src/main/scala/beam/agentsim/agents/PersonAgent.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 9ee5e284d48..94874f39e36 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1155,7 +1155,7 @@ class PersonAgent( val (stateToGo, updatedData) = { if (needEnroute) { (ReadyToChooseParking, tempData.copy(enrouteData = tempData.enrouteData.copy(isInEnrouteState = true))) - } else if (nextLeg.beamLeg.mode == CAR || vehicle.isSharedVehicle) { + } else if (nextLeg.beamLeg.mode == CAR || vehicle.beamVehicleType.isSharedVehicle) { sendCompletionNoticeAndScheduleStartLegTrigger() (ReleasingParkingSpot, tempData) } else { From dddac2f04a6666b993eff6bad5795b861c57255f Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Tue, 21 Jun 2022 20:40:40 +0600 Subject: [PATCH 155/307] move `NetworkRelaxationScenarioGenerator` to scripts --- .../NetworkRelaxationScenarioGenerator.scala | 150 +++++++++++++++++ .../integration/NetworkRelaxationSpec.scala | 152 +----------------- 2 files changed, 152 insertions(+), 150 deletions(-) create mode 100644 src/main/scala/scripts/NetworkRelaxationScenarioGenerator.scala diff --git a/src/main/scala/scripts/NetworkRelaxationScenarioGenerator.scala b/src/main/scala/scripts/NetworkRelaxationScenarioGenerator.scala new file mode 100644 index 00000000000..9d2fba1cbd5 --- /dev/null +++ b/src/main/scala/scripts/NetworkRelaxationScenarioGenerator.scala @@ -0,0 +1,150 @@ +package scripts + +import beam.utils.csv.CsvWriter +import beam.utils.scenario.urbansim.censusblock.entities._ +import java.io.File +import scala.util.Random + +class NetworkRelaxationScenarioGenerator { + val scenarioDir = new File("test/input/network-relaxation-scenario/urbansim_v2") + + def generateBlocks() = { + println(s"Generating blocks") + val csvWriter = new CsvWriter( + scenarioDir + "/blocks.csv.gz", + Seq("block_id", "x", "y") + ) + csvWriter.write("1", "166648.21039213781", "998.9706301352383") + csvWriter.close() + } + + def generateHouseholds(count: Int = 2000) = { + println(s"Generating $count households") + val csvWriter = new CsvWriter( + scenarioDir + "/households.csv.gz", + Seq("household_id", "income", "cars", "block_id") + ) + try { + for (i <- 1 to count) { + csvWriter.write(i.toString, "0", "1", "1") + } + } finally { + csvWriter.close() + } + + } + + def generatePersons(count: Int = 2000) = { + println(s"Generating $count persons") + val persons = for (i <- 1 to count) yield { + InputPersonInfo( + personId = i.toString, + householdId = i.toString, + age = 20 + Random.nextInt(50), + sex = if (Random.nextBoolean()) Male else Female, + None + ) + } + val csvWriter = + new CsvWriter(scenarioDir.getPath + "/persons.csv.gz", Seq("person_id", "household_id", "age", "sex")) + try { + persons.foreach { person => + csvWriter.write( + person.personId, + person.householdId, + person.age, + person.sex match { + case Male => 1 + case Female => 2 + } + ) + } + } finally { + csvWriter.close() + } + } + + def generatePlans(count: Int = 2000) = { + println("Generating plans") + val headers = Seq( + "trip_id", + "person_id", + "PlanElementIndex", + "ActivityElement", + "trip_mode", + "ActivityType", + "x", + "y", + "departure_time" + ) + val plans = for (i <- 1 to count) yield { + // Home = -0.03763798759, 0.00975476975 + // Work = 0.04874384139, 0.01013286711 + Seq( + InputPlanElement( + tripId = Some(i.toString), + personId = i.toString, + planElementIndex = 1, + activityElement = Activity, + tripMode = None, + ActivityType = Some("Home"), + x = Some(161827.4228835071), + y = Some(1079.7224574150498), + departureTime = Some(8 + Random.nextDouble() * 4) + ), + InputPlanElement( + tripId = Some(i.toString), + personId = i.toString, + planElementIndex = 2, + activityElement = Leg, + tripMode = Some("CAR"), + ActivityType = None, + x = None, + y = None, + departureTime = None + ), + InputPlanElement( + tripId = Some(i.toString), + personId = i.toString, + planElementIndex = 3, + activityElement = Activity, + tripMode = None, + ActivityType = Some("Work"), + x = Some(171452.789949885), + y = Some(1121.4837267244413), + departureTime = None + ) + ) + } + val csvWriter = new CsvWriter(scenarioDir.getPath + "/plans.csv.gz", headers) + try { + plans.flatten.foreach { plan => + csvWriter.write( + plan.tripId.mkString, + plan.personId.mkString, + plan.planElementIndex, + plan.activityElement, + plan.tripMode, + plan.ActivityType, + plan.x, + plan.y, + plan.departureTime + ) + } + } finally { + csvWriter.close() + } + } + + def generate() = { + scenarioDir.mkdir() + generateBlocks() + generateHouseholds() + generatePersons() + generatePlans() + } +} + +object NetworkRelaxationScenarioGenerator extends App { + new NetworkRelaxationScenarioGenerator().generate() +} diff --git a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala index b605bd0441c..350cf2a8a06 100644 --- a/src/test/scala/beam/integration/NetworkRelaxationSpec.scala +++ b/src/test/scala/beam/integration/NetworkRelaxationSpec.scala @@ -3,164 +3,16 @@ package beam.integration import akka.actor.ActorSystem import beam.sim.config.{BeamConfig, MatSimBeamConfigBuilder} import beam.sim.{BeamHelper, BeamServices} -import beam.utils.csv.{CsvWriter, GenericCsvReader} -import beam.utils.scenario.VehicleInfo -import beam.utils.scenario.urbansim.censusblock.entities._ +import beam.utils.csv.GenericCsvReader import beam.utils.{FileUtils, LoggingUtil} import ch.qos.logback.classic.util.ContextInitializer import com.google.inject.Injector import com.typesafe.config.ConfigFactory import org.matsim.core.scenario.MutableScenario -import org.scalatest.wordspec.AnyWordSpecLike import org.scalatest.matchers.should.Matchers._ +import org.scalatest.wordspec.AnyWordSpecLike import java.io.{Closeable, File} -import scala.util.Random - -class NetworkRelaxationScenarioGenerator { - val scenarioDir = new File("test/input/network-relaxation-scenario/urbansim_v2") - - def generateBlocks() = { - println(s"Generating blocks") - val csvWriter = new CsvWriter( - scenarioDir + "/blocks.csv.gz", - Seq("block_id", "x", "y") - ) - csvWriter.write("1", "166648.21039213781", "998.9706301352383") - csvWriter.close() - } - - def generateHouseholds(count: Int = 2000) = { - println(s"Generating $count households") - val csvWriter = new CsvWriter( - scenarioDir + "/households.csv.gz", - Seq("household_id", "income", "cars", "block_id") - ) - try { - for (i <- 1 to count) { - csvWriter.write(i.toString, "0", "1", "1") - } - } finally { - csvWriter.close() - } - - } - - def generatePersons(count: Int = 2000) = { - println(s"Generating $count persons") - val persons = for (i <- 1 to count) yield { - InputPersonInfo( - personId = i.toString, - householdId = i.toString, - age = 20 + Random.nextInt(50), - sex = if (Random.nextBoolean()) Male else Female, - None - ) - } - val csvWriter = - new CsvWriter(scenarioDir.getPath + "/persons.csv.gz", Seq("person_id", "household_id", "age", "sex")) - try { - persons.foreach { person => - csvWriter.write( - person.personId, - person.householdId, - person.age, - person.sex match { - case Male => 1 - case Female => 2 - } - ) - } - } finally { - csvWriter.close() - } - } - - def generatePlans(count: Int = 2000) = { - println("Generating plans") - val headers = Seq( - "trip_id", - "person_id", - "PlanElementIndex", - "ActivityElement", - "trip_mode", - "ActivityType", - "x", - "y", - "departure_time" - ) - val plans = for (i <- 1 to count) yield { - // Home = -0.03763798759, 0.00975476975 - // Work = 0.04874384139, 0.01013286711 - Seq( - InputPlanElement( - tripId = Some(i.toString), - personId = i.toString, - planElementIndex = 1, - activityElement = Activity, - tripMode = None, - ActivityType = Some("Home"), - x = Some(161827.4228835071), - y = Some(1079.7224574150498), - departureTime = Some(8 + Random.nextDouble() * 4) - ), - InputPlanElement( - tripId = Some(i.toString), - personId = i.toString, - planElementIndex = 2, - activityElement = Leg, - tripMode = Some("CAR"), - ActivityType = None, - x = None, - y = None, - departureTime = None - ), - InputPlanElement( - tripId = Some(i.toString), - personId = i.toString, - planElementIndex = 3, - activityElement = Activity, - tripMode = None, - ActivityType = Some("Work"), - x = Some(171452.789949885), - y = Some(1121.4837267244413), - departureTime = None - ) - ) - } - val csvWriter = new CsvWriter(scenarioDir.getPath + "/plans.csv.gz", headers) - try { - plans.flatten.foreach { plan => - csvWriter.write( - plan.tripId.mkString, - plan.personId.mkString, - plan.planElementIndex, - plan.activityElement, - plan.tripMode, - plan.ActivityType, - plan.x, - plan.y, - plan.departureTime - ) - } - } finally { - csvWriter.close() - } - } - - def generate() = { - scenarioDir.mkdir() - - generateBlocks() - generateHouseholds() - generatePersons() - generatePlans() - } -} - -object NetworkRelaxationScenarioGenerator extends App { - new NetworkRelaxationScenarioGenerator().generate() -} case class LinkStatsCsvRow(link: Int, volume: Double) From 10dcc9142258da0349b9372e0d933ad5a74f769e Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Tue, 21 Jun 2022 20:41:28 +0600 Subject: [PATCH 156/307] Add explanation for `beam.physsim.network.removeIslands` setting --- src/main/resources/beam-template.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index b94faa7a78d..1dcc1b555cc 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -631,6 +631,8 @@ beam.physsim.network.maxSpeedInference { type = "String | MEAN" } +# For a small test OSM map (10-20 nodes) it might be possible that R5 TransportNetwork would incorrectly consider +# all nodes to be an island and will remove it. Set this to `false` to override that. beam.physsim.network.removeIslands = "boolean | true" # Replanning From d3954e0b283a97ebc4c67efefe0abd46fc57569e Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 21 Jun 2022 12:25:52 -0700 Subject: [PATCH 157/307] adding timeout --- src/main/python/gemini/beam_pydss_broker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/python/gemini/beam_pydss_broker.py b/src/main/python/gemini/beam_pydss_broker.py index 0ca73e96ac3..0467ba378c7 100644 --- a/src/main/python/gemini/beam_pydss_broker.py +++ b/src/main/python/gemini/beam_pydss_broker.py @@ -9,7 +9,7 @@ nbFed = 3 if len(sys.argv) > 1: nbFed = int(sys.argv[1]) -brokerSetting = "-f {} --name=BeamHelicsBroker".format(nbFed) +brokerSetting = "-f {} --name=BeamHelicsBroker --timeout=86400s".format(nbFed) print("broker setting: {}".format(brokerSetting)) broker = h.helicsCreateBroker("zmq", "", brokerSetting) isConnected = h.helicsBrokerIsConnected(broker) From 2a75f4d54b21ec8f1d4e35f2853334a9f933a921 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 21 Jun 2022 23:52:46 +0300 Subject: [PATCH 158/307] budget override functionality from develop --- aws/build.gradle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index 40195542042..a90abb4e17e 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -109,7 +109,8 @@ task deploy(type: AWSLambdaInvokeTask) { "min_cores": ${ext.getParameterValue('minCores') ?: 0}, "max_cores": ${ext.getParameterValue('maxCores') ?: 0}, "min_memory": ${ext.getParameterValue('minMemory') ?: 0}, - "max_memory": ${ext.getParameterValue('maxMemory') ?: 0} + "max_memory": ${ext.getParameterValue('maxMemory') ?: 0}, + "budget_override": ${ext.getParameterValue('budgetOverride') ?: false} }""" payload = pload println "Using data branch $dataBranch" @@ -148,6 +149,7 @@ task deployPilates(type: AWSLambdaInvokeTask) { defaultParamVals['dataRegion'] = defRegion defaultParamVals['beamBranch'] = getCurrentGitBranch() defaultParamVals['dataBranch'] = 'develop' + defaultParamVals['budgetOverride'] = False def paramMap = [:] def missing = [] @@ -155,7 +157,7 @@ task deployPilates(type: AWSLambdaInvokeTask) { // all possible parameters ['runName', 'pilatesScenarioName', 'beamBranch', 'dataBranch', 'beamCommit', - 'beamConfig', + 'beamConfig', 'budgetOverride', 'startYear', 'countOfYears', 'beamItLen', 'urbansimItLen', 'initialS3UrbansimInput', 'initialS3UrbansimOutput', 'initialSkimPath', 'pilatesImageVersion', 'pilatesImageName', @@ -174,6 +176,7 @@ task deployPilates(type: AWSLambdaInvokeTask) { } paramMap['runName'] = paramMap['runName'] + '_' + getCurrentGitUserEmail() + paramMap['budget_override'] = paramMap['budgetOverride'] println("parameters wasn't specified: " + missing.join(', ')) @@ -267,6 +270,7 @@ def buildPayload(command) { return """{ "instance_ids": "${project.findProperty('instanceIds')}", "region": "${project.findProperty('region') ?: defaultRegion}", + "budget_override": ${ext.getParameterValue('budgetOverride') ?: false} "command": "$command" }""" } From 9e9f65b4def1b8848ebe98140f942ed6e94fc1bd Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Wed, 22 Jun 2022 00:00:55 +0300 Subject: [PATCH 159/307] Update lambda_function.py the change I made today in order to make helics working again - does not worth creating yet another PR for lambda changes --- aws/src/main/python/beam_lambda/lambda_function.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 9546e00539e..c7dbd7cb0c6 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -99,6 +99,8 @@ path: /tmp/slack_notification - content: | #!/bin/bash + pip install setuptools + pip install strip-hints pip install helics==2.7.1 pip install helics-apps==2.7.1 cd /home/ubuntu/git/beam/src/main/python From f01f1314b1f0ef95f50d5bb255a5acb3857134ee Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Fri, 24 Jun 2022 20:43:04 +0600 Subject: [PATCH 160/307] Move commit detection into lambda --- aws/build.gradle | 8 ++------ aws/src/main/python/beam_lambda/lambda_function.py | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index c1bbcfad943..d603ab396a9 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -87,7 +87,7 @@ task deploy(type: AWSLambdaInvokeTask) { "git_user_email": "${getCurrentGitUserEmail()}", "deploy_type_tag": "${ext.getParameterValue('deployTypeTag')}", "branch": "${ext.getParameterValue('beamBranch') ?: getCurrentGitBranch()}", - "commit": "${ext.getParameterValue('beamCommit') ?: getCurrentGitCommit()}", + "commit": "${ext.getParameterValue('beamCommit') ?: 'HEAD'}", "data_branch": "$dataBranch", "data_commit": "$dataCommit", "deploy_mode": "${ext.getParameterValue('deployMode')}", @@ -150,7 +150,7 @@ task deployPilates(type: AWSLambdaInvokeTask) { defaultParamVals['region'] = defRegion defaultParamVals['dataRegion'] = defRegion defaultParamVals['beamBranch'] = getCurrentGitBranch() - defaultParamVals['beamCommit'] = getCurrentGitCommit() + defaultParamVals['beamCommit'] = 'HEAD' defaultParamVals['dataBranch'] = 'develop' defaultParamVals['dataCommit'] = 'HEAD' defaultParamVals['budgetOverride'] = False @@ -288,10 +288,6 @@ def getCurrentGitBranch() { return getGitResultFromWorkingDirUsing('git rev-parse --abbrev-ref HEAD', "$defaultBranch") } -def getCurrentGitCommit() { - return getGitResultFromWorkingDirUsing('git log -1 --pretty=format:%H', 'HEAD') -} - def getCurrentGitUserEmail() { def rawGitUserEmail = getGitResultFromWorkingDirUsing('git config user.email', "GitUserEmailNotFound") return rawGitUserEmail.replaceAll('@', "AT").replaceAll("\\.", "_") diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index c7dbd7cb0c6..dda5890434a 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -128,6 +128,10 @@ - echo "-------------------Starting Beam Sim----------------------" - echo $(date +%s) > /tmp/.starttime - cd /home/ubuntu/git/beam + - if [ "$COMMIT" = "HEAD" ] + - then + - COMMIT=$(git log -1 --pretty=format:%H) + - fi - rm -rf /home/ubuntu/git/beam/test/input/sf-light/r5/network.dat - hello_msg=$(printf "Run Started \\n Run Name** $TITLED** \\n Instance ID %s \\n Instance type **%s** \\n Host name **%s** \\n Web browser ** http://%s:8000 ** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname)) - start_json=$(printf "{ From 8b97f9a0ba3ee9fb428da21296040e1b087d77d3 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Fri, 24 Jun 2022 20:48:28 +0600 Subject: [PATCH 161/307] Detect data commit from HEAD --- .../python/beam_lambda/lambda_function.py | 58 +++++++++++-------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index dda5890434a..aa97966d5a3 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -132,6 +132,39 @@ - then - COMMIT=$(git log -1 --pretty=format:%H) - fi + + - 'echo "sudo git fetch"' + - sudo git fetch + - 'echo "GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH $(date)"' + - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH + - 'echo "sudo git pull"' + - sudo git pull + - 'echo "sudo git lfs pull"' + - sudo git lfs pull + - echo "sudo git checkout -qf ..." + - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout -qf $COMMIT + + - production_data_submodules=$(git submodule | awk '{ print $2 }') + - for i in $production_data_submodules + - do + - for cf in $CONFIG + - do + - case $cf in + - '*$i*)' + - echo "Loading remote production data for $i" + - git config submodule.$i.branch $DATA_BRANCH + - git submodule update --init --remote $i + - cd $i + - if [ "$DATA_COMMIT" = "HEAD" ] + - then + - DATA_COMMIT=$(git log -1 --pretty=format:%H) + - fi + - git checkout $DATA_COMMIT + - cd - + - esac + - done + - done + - rm -rf /home/ubuntu/git/beam/test/input/sf-light/r5/network.dat - hello_msg=$(printf "Run Started \\n Run Name** $TITLED** \\n Instance ID %s \\n Instance type **%s** \\n Host name **%s** \\n Web browser ** http://%s:8000 ** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname)) - start_json=$(printf "{ @@ -167,31 +200,6 @@ - crontab /tmp/slack_notification - crontab -l - echo "notification scheduled..." - - 'echo "sudo git fetch"' - - sudo git fetch - - 'echo "GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH $(date)"' - - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH - - 'echo "sudo git pull"' - - sudo git pull - - 'echo "sudo git lfs pull"' - - sudo git lfs pull - - echo "sudo git checkout -qf ..." - - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout -qf $COMMIT - - - production_data_submodules=$(git submodule | awk '{ print $2 }') - - for i in $production_data_submodules - - do - - for cf in $CONFIG - - do - - case $cf in - - '*$i*)' - - echo "Loading remote production data for $i" - - git config submodule.$i.branch $DATA_BRANCH - - git submodule update --init --remote $i - - cd $i; git checkout $DATA_COMMIT; cd - - - esac - - done - - done - 'echo "gradlew assemble: $(date)"' - ./gradlew assemble From 75f670efcb9637116dc941a2e83c62bfa8070770 Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Mon, 27 Jun 2022 00:24:14 -0400 Subject: [PATCH 162/307] More proactive and messaging tweaks to AWS (#3545) * More proactive and messaging tweaks * update beam dependencies * Split up the lambdas * Change the documentation * syntax fix * Fixes from actual event testing * sync yaml --- .../budgeted_instance_stopper.yaml | 19 +++ .../lambda_function.py | 155 ++++++++++++++++++ .../instanceNotifier/instance_notifier.py | 42 ++--- .../updateDependencies/lambda_function.py | 3 + .../updateDependencies.yaml | 2 +- docs/devops.rst | 7 +- 6 files changed, 198 insertions(+), 30 deletions(-) create mode 100644 aws/src/main/python/budget_instance_stopper/budgeted_instance_stopper.yaml create mode 100644 aws/src/main/python/budget_instance_stopper/lambda_function.py diff --git a/aws/src/main/python/budget_instance_stopper/budgeted_instance_stopper.yaml b/aws/src/main/python/budget_instance_stopper/budgeted_instance_stopper.yaml new file mode 100644 index 00000000000..a377cce3d11 --- /dev/null +++ b/aws/src/main/python/budget_instance_stopper/budgeted_instance_stopper.yaml @@ -0,0 +1,19 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: An AWS Serverless Specification template describing your function. +Resources: + budgetedinstancestopper: + Type: 'AWS::Serverless::Function' + Properties: + Handler: lambda_function.lambda_handler + Runtime: python3.9 + CodeUri: . + Description: '' + MemorySize: 128 + Timeout: 30 + Role: 'arn:aws:iam::340032650202:role/BeamLambdaExecution' + Environment: + Variables: + EXCLUDED_INSTANCES: '["i-0d7356ff7f3927e69","i-0b31829f99cc9a7ce","i-01dda95dee4c4714f"]' + MONITORED_REGIONS: '["us-east-1","us-east-2","us-west-1","us-west-2"]' + SLACK_HOOK: SENSITIVE_SO_REDACTED diff --git a/aws/src/main/python/budget_instance_stopper/lambda_function.py b/aws/src/main/python/budget_instance_stopper/lambda_function.py new file mode 100644 index 00000000000..cb46c18fbca --- /dev/null +++ b/aws/src/main/python/budget_instance_stopper/lambda_function.py @@ -0,0 +1,155 @@ +# coding=utf-8 +import os +import logging +import re +import json +import boto3 +import urllib.parse +import http.client +from datetime import datetime +from dateutil.relativedelta import relativedelta + +logger = logging.getLogger() +logger.setLevel(logging.INFO) + +class EC2Instance: + def __init__(self, instance_id, launch_datetime, owner_email, username, is_budget_overrode): + self.instance_id = instance_id + self.launch_datetime = launch_datetime + self.owner_email = owner_email + self.username = username + self.is_budget_overrode = is_budget_overrode + + def __str__(self): + return 'InstanceId: ' + self.instance_id + '; LaunchTime: ' + str(self.launch_datetime) + '; OwnerEmail: ' + str(self.owner_email) + '; UserName: ' + str(self.username) + '; IsBudgetOverrode: ' + str(self.is_budget_overrode) + +def shutdown_all_except_necessary_with(to_not_keep_filter, budget_threshold): + regions = json.loads(os.environ['MONITORED_REGIONS']) + excluded_instances = json.loads(os.environ['EXCLUDED_INSTANCES']) + excluded_instances_filter = lambda instance_details: instance_details.instance_id not in excluded_instances + if to_not_keep_filter: + logger.info("Shutting down all instances except necessary and budgeted override") + else: + logger.info("Shutting down all instances except necessary") + for region in regions: + logger.info(f"Region {region}") + ec2 = boto3.client('ec2', region_name=region) + instances = get_running_instance_for(region, ec2) + instances_to_stop = list(filter(excluded_instances_filter, filter(to_not_keep_filter, instances))) + instance_ids_being_stopped = list(map(lambda instance_details: instance_details.instance_id, instances_to_stop)) + if len(instance_ids_being_stopped) > 0: + notify_on_slack_using(instance_ids_being_stopped, budget_threshold, region) + stop(instance_ids_being_stopped, ec2) + else: + logger.info(f"No instances to be stopped in region {region}") + return + +def stop(instance_ids_to_stop, ec2): + logger.info(f"Stopping {instance_ids_to_stop}") + ec2.stop_instances(InstanceIds=instance_ids_to_stop) + +def notify_on_slack_using(instance_ids_being_stopped, budget_threshold_passed, region): + slack_message = f" Budget threshold of {str(budget_threshold_passed)}% passed, so, in region {region}, stopping instance ID's: {instance_ids_being_stopped}" + headers = {'Content-type': 'application/json'} + payload = { + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": slack_message + } + } + ] + } + slack_hook = os.environ['SLACK_HOOK'] + logger.info('Slack notification for budget alert: ' + str(payload)) + conn = http.client.HTTPSConnection('hooks.slack.com') + conn.request('POST', slack_hook, json.dumps(payload), headers) + response = conn.getresponse() + logger.info('Received response from slack notification: ' + response.read().decode()) + return + +def get_running_instance_for(region, ec2): + running_instances_response = ec2.describe_instances( + Filters=[ + { + 'Name': 'instance-state-name', + 'Values': [ + 'pending', + 'running' + ] + } + ] + ) + if len(safe_get(running_instances_response, 'Reservations')) > 0: + reservations = safe_get(running_instances_response, 'Reservations') + instance_list = [] + for reservation in reservations: + instances = safe_get(reservation, 'Instances') + instance_list += [convert_to_ec2_instance_from(instance, region) for instance in instances] + return instance_list + else: + logger.info('0 running instances found in ' + region) + return [] + +def convert_to_ec2_instance_from(response_instance, region): + # logger.info('Convert to EC2Instance from ' + str(response_instance)) + email = None + is_budget_overrode = False + tags = response_instance.get('Tags') + if tags: + for tag in tags: + if tag['Key'] == 'GitUserEmail': + email = tag['Value'] + elif tag['Key'] == 'BudgetOverride': + is_budget_overrode = tag.get('Value').lower() == 'true' + + instance_id = safe_get(response_instance, 'InstanceId') + #Email not found in tags, so now check for directly started instances + username=None + if email is None: + cloudtrail = boto3.client('cloudtrail', region_name=region) + today=datetime.now() + responses = cloudtrail.lookup_events(LookupAttributes=[ { 'AttributeKey': 'ResourceName','AttributeValue': instance_id }], + StartTime=today - relativedelta(months=1), + EndTime=today + ) + for event in responses['Events']: + if event['EventName'] == 'RunInstances': + username=event['Username'] + + logger.info("Email is " + str(email) + " and username is " + str(username) + " for instance with ID " + str(instance_id)) + return EC2Instance(instance_id, safe_get(response_instance, 'LaunchTime'), email, username, is_budget_overrode) + +def convert_to_float_from(budget_string): + number_extractor = "\$(.*)" + extracted_number_array = re.findall(number_extractor, budget_string) + cleaned_float_string = extracted_number_array[0].replace(',', '') + return float(cleaned_float_string) + +def lambda_handler(event, context): + logger.info(f"Received event: {event}") + budget_message = json.loads(str(event.get('Records')[0]).replace("'",'"')).get('Sns').get('Message') + budget_name = re.findall(".*Budget Name: (.*)", budget_message)[0] + budget_limit_as_str = re.findall("Budgeted Amount: (.*)", budget_message)[0] + budget_threshold_as_str = re.findall("Alert Threshold: (.*)", budget_message)[0] + budget_actual_as_str = re.findall("ACTUAL Amount: (.*)", budget_message)[0] + + budget_limit = convert_to_float_from(budget_limit_as_str) + budget_threshold = convert_to_float_from(budget_threshold_as_str) + budget_actual = convert_to_float_from(budget_actual_as_str) + budget_triggered_percentage = int((budget_threshold / budget_limit) * 100) + + if budget_triggered_percentage == 150: + budget_overrode_removal_filter = lambda instance_details: instance_details.is_budget_overrode != True + shutdown_all_except_necessary_with(budget_overrode_removal_filter, "150") + elif budget_triggered_percentage == 300: + shutdown_all_except_necessary_with(None, "300") + + return 'Done' + +def safe_get(dict_obj, key): + if dict_obj is not None: + return dict_obj.get(key) + return None \ No newline at end of file diff --git a/aws/src/main/python/instanceNotifier/instance_notifier.py b/aws/src/main/python/instanceNotifier/instance_notifier.py index bfb6a9a80c7..a0728dc838a 100644 --- a/aws/src/main/python/instanceNotifier/instance_notifier.py +++ b/aws/src/main/python/instanceNotifier/instance_notifier.py @@ -13,7 +13,6 @@ ec2_client = None budget_client = None pricing_client = None -sns_client = None logger = logging.getLogger() logger.setLevel(logging.INFO) @@ -53,10 +52,6 @@ def init_pricing_client(region): global pricing_client pricing_client = boto3.client('pricing', region_name=region) -def init_sns_client(): - global sns_client - sns_client = boto3.client('sns') - def convert_to_pricing_operating_system_from(ec2_operating_system): for pricing_os in PRODUCT_OPERATING_SYSTEMS: if pricing_os in ec2_operating_system: @@ -97,6 +92,7 @@ def get_instance_details_for_(instance_id): instance_name = "" budget_override = "" tags = instance.get("Tags") + logger.info(f"Tags from instance: {tags}") for tag in tags: key = tag.get("Key") if key == "GitUserEmail": @@ -107,12 +103,6 @@ def get_instance_details_for_(instance_id): budget_override = tag.get("Value") return EC2Instance(instance_id, instance_type, operating_system, instance_name, instance_git_user_email, budget_override) -def send_to_sns_notification(message, subject): - sns_client.publish( - TopicArn='arn:aws:sns:us-east-2:340032650202:instance_notifier', - Message=message, - Subject=subject) - def notify_slack_using_(message): logger.info('Notifying about attempted instance use') headers = {'Content-type': 'application/json'} @@ -138,26 +128,32 @@ def stop_instance(instance_id): logger.info(f"Stopping {instance_id}") ec2_client.stop_instances(InstanceIds=[instance_id]) -def set_override_tag_to_empty_for_(instance_id): - ec2_client.create_tags( +def delete_override_tag__for_(instance_id): + logger.info(f"Removing BudgetOverride tag for {instance_id}") + ec2_client.delete_tags( Resources=[instance_id], Tags=[ { - 'Key': 'BudgetOverride', - 'Value': '', + 'Key': 'BudgetOverride' }, ], ) # Expected format: {"instance-id": , "state": , "region": , "account-id": } def lambda_handler(event, context): + logger.info(f"Received event: {event}") state = event.get('state') - if state != "running": - return "Instance state change of {state} is not supported for this lambda - only 'running' is considered".format(state=state) + if state != "running" and state != "stopped": + return "Instance state change of {state} is not supported for this lambda - only 'running' or 'stopped' is considered".format(state=state) region = event.get('region') instance_id = event.get('instance-id') account_id = event.get('account-id') + init_ec2_client(region) + if state == "stopped": + delete_override_tag_for_(instance_id) + return "Stopped instance had any budget override tags removed" + allowed_instances = os.environ['ALLOWED_INSTANCES'] if instance_id in allowed_instances: logger.info(f"Allowing {instance_id} to run") @@ -189,9 +185,10 @@ def lambda_handler(event, context): # LATER TODO: Add an override option that is not emptied (true_always?) or for # of starts (true_3? - decrement and update tag) # LATER TODO: Add a link to trigger an automatic approval. Maybe link to instance is enough, since can tag there? # LATER TODO: Create a report of all usages and cost and send as a daily/weekly? email - init_ec2_client(region) instance_details = get_instance_details_for_(instance_id) + logger.info(f"Instance details: {instance_details}") + instance_stopped = False if percent_of_budget_used >= 300: stop_instance(instance_id) @@ -199,7 +196,6 @@ def lambda_handler(event, context): elif percent_of_budget_used >= 150 and instance_details.budget_override.lower() != "true": stop_instance(instance_id) instance_stopped = True - set_override_tag_to_empty_for_(instance_id) forecasted_spend_amount = Decimal(budget_details.get('CalculatedSpend').get('ForecastedSpend').get('Amount')) init_pricing_client("us-east-1") @@ -213,14 +209,8 @@ def lambda_handler(event, context): instance_cost_for_rest_of_month = price_per_day * number_of_days_left_in_month spend_amount_if_instance_rest_of_month = current_spent_amount + instance_cost_for_rest_of_month - # Temporarily keeping the email logic in case it is needed sometime soon - # email_message = "Instance with ID '" + instance_id + "' just started to run" + instance_stopped + " and the current amount spent this month ($" + str(current_spent_amount) + ") is " + str(round(percent_of_budget_used, 2)) + "% of the budgeted amount ($" + str(budget_limit_amount) + ").\r\nInstance Name: " + instance_name + "\r\nGit email of who created the instance: " + instance_git_user_email + "\r\nForecasted amount to be spent this month: $" + str(forecasted_spend_amount) + "\r\nPercent of month completed: " + str(round(percent_of_month, 2)) + "%\r\nInstance hourly cost: $" + str(price_per_hour) + "\r\nInstance daily cost: $" + str(price_per_day) + "\r\nInstance cost if ran through until the rest of the month: $" + str(round(instance_cost_for_rest_of_month, 2)) + "\r\nFinal AWS amount spent if instance is ran to the end of the month: $" + str(round(spend_amount_if_instance_rest_of_month, 2)) + "\r\nInstance link: " + instance_link + "\r\n*****If stopped then please verify it is allowed to run and add a tag 'BudgetOverride' set to 'True', then restart the instance.*****" - # subject = "Instance just started" + instance_stopped + " and BEAM is " + str(round(percent_of_budget_used, 2)) + "% of monthly budget" - # init_sns_client() - # logger.info(subject + "\r\n" + email_message) - # send_to_sns_notification(email_message, subject[:99]) if instance_stopped: - slack_message = f"*Instance with ID '{instance_id}' immediately stopped*\nThe current amount spent this month (${str(round(current_spent_amount, 2))}) is {str(round(percent_of_budget_used, 2))}% of the budgeted amount (${str(round(budget_limit_amount, 2))}).\n*Instance Name*:\n{instance_name}\n*Git email of who created the instance*:\n{instance_git_user_email}\n*Forecasted amount to be spent this month*: \n${str(round(forecasted_spend_amount, 2))}\n*Percent of month completed*:\n{str(round(percent_of_month, 2))}%\n*Instance hourly cost*:\n${str(round(price_per_hour, 2))}\n*Instance daily cost*:\n${str(round(price_per_day, 2))}\n*Instance cost if ran through until the rest of the month*:\n${str(round(instance_cost_for_rest_of_month, 2))}\n*Final AWS amount spent if instance is ran to the end of the month*:\n${str(round(spend_amount_if_instance_rest_of_month, 2))}\n*Instance link*:\n{instance_link}\n*****If stopped then please verify it is allowed to run and add a tag 'BudgetOverride' set to 'True', then restart the instance.*****" + slack_message = f"*Instance with ID '{instance_id}' immediately stopped*\nThe current amount spent this month (${str(round(current_spent_amount, 2))}) is {str(round(percent_of_budget_used, 2))}% of the budgeted amount (${str(round(budget_limit_amount, 2))}).\n*Instance Name*:\n{instance_name}\n*Git email of who created the instance*:\n{instance_git_user_email}\n*Forecasted amount to be spent this month*: \n${str(round(forecasted_spend_amount, 2))}\n*Percent of month completed*:\n{str(round(percent_of_month, 2))}%\n*Instance hourly cost*:\n${str(round(price_per_hour, 2))}\n*Instance daily cost*:\n${str(round(price_per_day, 2))}\n*Instance cost if ran through until the rest of the month*:\n${str(round(instance_cost_for_rest_of_month, 2))}\n*Final AWS amount spent if instance is ran to the end of the month*:\n${str(round(spend_amount_if_instance_rest_of_month, 2))}\n*Instance link*:\n{instance_link}\n*****If stopped then please verify it is allowed to run and add a tag `BudgetOverride` set to `True`, then restart the instance. Or terminate it and re-deploy through gradle using `-PbudgetOverride=true`*****" notify_slack_using_(slack_message) return "Done" \ No newline at end of file diff --git a/aws/src/main/python/updateDependencies/lambda_function.py b/aws/src/main/python/updateDependencies/lambda_function.py index 6c1642a92f8..882aa20f824 100644 --- a/aws/src/main/python/updateDependencies/lambda_function.py +++ b/aws/src/main/python/updateDependencies/lambda_function.py @@ -123,6 +123,9 @@ def deploy(script, instance_type, region_prefix, shutdown_behaviour, instance_na 'Tags': [ { 'Key': 'Name', 'Value': instance_name + }, { + 'Key': 'BudgetOverride', + 'Value': 'True' }] } ]) return res['Instances'][0]['InstanceId'] diff --git a/aws/src/main/python/updateDependencies/updateDependencies.yaml b/aws/src/main/python/updateDependencies/updateDependencies.yaml index 67f453043ef..205c456b692 100644 --- a/aws/src/main/python/updateDependencies/updateDependencies.yaml +++ b/aws/src/main/python/updateDependencies/updateDependencies.yaml @@ -6,7 +6,7 @@ Resources: Type: 'AWS::Serverless::Function' Properties: Handler: lambda_function.lambda_handler - Runtime: python2.7 + Runtime: python3.8 CodeUri: . Description: '' MemorySize: 128 diff --git a/docs/devops.rst b/docs/devops.rst index b5fabcd8b41..02846981fa6 100755 --- a/docs/devops.rst +++ b/docs/devops.rst @@ -597,11 +597,12 @@ There are a few levels of budget protection in place: * It is sent to the ``#aws-notifications`` using an ``@here`` notifier * This is possible as the budget alerts to the SNS topic ``budget_notifier`` with a subscription to the lambda ``budget_notifier`` 2. For the below regions [1]_ the `Eventbridge `_ ``instance_state_change_notifier`` is triggered on instance state change, which forwards to the `Lambda `_ ``instance_monitor`` that follows the below rules: - * At 150% of budget spent then any new instances can **only** be successfully started if they add the tag ``BudgetOverride`` with the value ``True``. + * Once 150% of budget spent then any new instances can **only** be successfully started if they add the tag ``BudgetOverride`` with the value ``True``. * The tag can be added to the EC2 instance manually * The tag can be added as part of the deploy command using the ``budgetOverride`` key - * **NOTE**: The tag will be removed upon successful start, so it will need set on each instance run - * At 300% of budget spent then all instances will automatically be stopped (unless it is the Jenkins instance) + * **NOTE**: The tag will be removed once the instance is stopped, so it will need set on each instance run + * At the 150% threshold another lambda (``budgeted_instance_stopper``) is triggered to immediately enact the above rules to the current instances + * Once 300% of budget is spent then all instances will automatically be stopped (unless it is the Jenkins instance). This will also affect the current instances immediately via the ``budgeted_instance_stopper`` lambda * If an instance is stopped then a slack notification will be made, so that it can be addressed * The regions for this setup are: * ``us-east-1`` From 59b5210e4008c5dd20fc575bd1d54a9855427921 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 27 Jun 2022 21:59:31 +0600 Subject: [PATCH 163/307] Fix error in lambda --- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- gradle.deploy.properties | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index aa97966d5a3..5732d24db4d 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -779,7 +779,7 @@ def get_param(param_name): uid = str(uuid.uuid4())[:8] runName = titled if len(params) > 1: - runName += "-" + str(`runNum`) + runName += "-" + str(runNum) script = initscript.replace('$RUN_SCRIPT',selected_script) \ .replace('$REGION',region) \ .replace('$S3_REGION', os.environ['REGION']) \ diff --git a/gradle.deploy.properties b/gradle.deploy.properties index c905d91beb4..154693a302b 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -4,7 +4,8 @@ beamBranch=develop beamConfigs=test/input/sf-light/sf-light-1k-with-PTE-duplicates-1.conf,test/input/sf-light/sf-light-1k-with-PTE-duplicates-2.conf instanceType=r5.8xlarge -dataCommit=HEAD +dataBranch=develop +#dataCommit=HEAD # shutdownBehaviour = stop | terminate shutdownBehaviour=terminate From b8e9752a7d71d8a0c7b76be90bd33613ffaf0a16 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 27 Jun 2022 22:45:18 +0600 Subject: [PATCH 164/307] Fixes --- .../python/beam_lambda/lambda_function.py | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 5732d24db4d..d6bd214d659 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -130,10 +130,13 @@ - cd /home/ubuntu/git/beam - if [ "$COMMIT" = "HEAD" ] - then - - COMMIT=$(git log -1 --pretty=format:%H) + - RESOLVED_COMMIT=$(git log -1 --pretty=format:%H) + - else + - RESOLVED_COMMIT=COMMIT - fi + - echo "Resolved commit is $RESOLVED_COMMIT" - - 'echo "sudo git fetch"' + - 'echo "sudo git fetch"' - sudo git fetch - 'echo "GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH $(date)"' - GIT_LFS_SKIP_SMUDGE=1 sudo git checkout $BRANCH @@ -157,8 +160,11 @@ - cd $i - if [ "$DATA_COMMIT" = "HEAD" ] - then - - DATA_COMMIT=$(git log -1 --pretty=format:%H) + - RESOLVED_DATA_COMMIT=$(git log -1 --pretty=format:%H) + - else + - RESOLVED_DATA_COMMIT=$DATA_COMMIT - fi + - echo "Resolved data commit is $RESOLVED_DATA_COMMIT" - git checkout $DATA_COMMIT - cd - - esac @@ -179,9 +185,9 @@ \\"host_name\\":\\"%s\\", \\"browser\\":\\"http://%s:8000\\", \\"branch\\":\\"$BRANCH\\", - \\"commit\\":\\"$COMMIT\\", + \\"commit\\":\\"$RESOLVED_COMMIT\\", \\"data_branch\\":\\"$DATA_BRANCH\\", - \\"data_commit\\":\\"$DATA_COMMIT\\", + \\"data_commit\\":\\"$RESOLVED_DATA_COMMIT\\", \\"region\\":\\"$REGION\\", \\"batch\\":\\"$UID\\", \\"s3_link\\":\\"%s\\", @@ -193,6 +199,7 @@ } }" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname)) - echo $start_json + - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$start_json" - chmod +x /tmp/slack.sh - chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - echo "notification sent..." @@ -213,7 +220,6 @@ - echo $MAXRAM - /tmp/slack.sh "$hello_msg" - - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$start_json" - s3p="" - for cf in $CONFIG - do @@ -247,9 +253,9 @@ \\"host_name\\":\\"%s\\", \\"browser\\":\\"http://%s:8000\\", \\"branch\\":\\"$BRANCH\\", - \\"commit\\":\\"$COMMIT\\", + \\"commit\\":\\"$RESOLVED_COMMIT\\", \\"data_branch\\":\\"$DATA_BRANCH\\", - \\"data_commit\\":\\"$DATA_COMMIT\\", + \\"data_commit\\":\\"$RESOLVED_DATA_COMMIT\\", \\"region\\":\\"$REGION\\", \\"batch\\":\\"$UID\\", \\"s3_link\\":\\"%s\\", From 90c74ee5234ccbe89002bb2f5a6911a6677241fe Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Mon, 27 Jun 2022 13:34:50 -0400 Subject: [PATCH 165/307] Force pushing simple lambda typo --- .../instanceNotifier/instance_notifier.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/aws/src/main/python/instanceNotifier/instance_notifier.py b/aws/src/main/python/instanceNotifier/instance_notifier.py index a0728dc838a..180ddc8a5b5 100644 --- a/aws/src/main/python/instanceNotifier/instance_notifier.py +++ b/aws/src/main/python/instanceNotifier/instance_notifier.py @@ -21,11 +21,11 @@ # Search product filter. This will reduce the amount of data returned by the # get_products function of the Pricing API -FLT = '[{{"Field": "tenancy", "Value": "shared", "Type": "TERM_MATCH"}},'\ - '{{"Field": "preInstalledSw", "Value": "NA", "Type": "TERM_MATCH"}},'\ - '{{"Field": "operatingSystem", "Value": "{o}", "Type": "TERM_MATCH"}},'\ - '{{"Field": "instanceType", "Value": "{t}", "Type": "TERM_MATCH"}},'\ - '{{"Field": "location", "Value": "{r}", "Type": "TERM_MATCH"}},'\ +FLT = '[{{"Field": "tenancy", "Value": "shared", "Type": "TERM_MATCH"}},' \ + '{{"Field": "preInstalledSw", "Value": "NA", "Type": "TERM_MATCH"}},' \ + '{{"Field": "operatingSystem", "Value": "{o}", "Type": "TERM_MATCH"}},' \ + '{{"Field": "instanceType", "Value": "{t}", "Type": "TERM_MATCH"}},' \ + '{{"Field": "location", "Value": "{r}", "Type": "TERM_MATCH"}},' \ '{{"Field": "capacitystatus", "Value": "Used", "Type": "TERM_MATCH"}}]' class EC2Instance: @@ -131,13 +131,13 @@ def stop_instance(instance_id): def delete_override_tag__for_(instance_id): logger.info(f"Removing BudgetOverride tag for {instance_id}") ec2_client.delete_tags( - Resources=[instance_id], - Tags=[ - { - 'Key': 'BudgetOverride' - }, - ], -) + Resources=[instance_id], + Tags=[ + { + 'Key': 'BudgetOverride' + } + ] + ) # Expected format: {"instance-id": , "state": , "region": , "account-id": } def lambda_handler(event, context): From bf3adc6750e0eae152c9e0597d1156261c03dc8a Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Mon, 27 Jun 2022 14:40:08 -0700 Subject: [PATCH 166/307] adding origin into populationAttributes --- .../sim/population/PopulationAttributes.scala | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index 7c330d896f3..23afc576809 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -72,11 +72,11 @@ case class AttributesOfIndividual( modeChoiceModel.situationMultipliers(beamMode), vehicleAutomationLevel, beamServices -<<<<<<< HEAD - ) * getModeVotMultiplier(Option(beamMode), modeChoiceModel.modeMultipliers) -======= +//<<<<<<< HEAD +// ) * getModeVotMultiplier(Option(beamMode), modeChoiceModel.modeMultipliers) +//======= ) * getModeVotMultiplier(Option(CAR), modeChoiceModel) ->>>>>>> origin/zn/more-bike-multipliers-epa +//>>>>>>> origin/zn/more-bike-multipliers-epa } case _ => getModeVotMultiplier(Option(beamMode), modeChoiceModel) @@ -90,11 +90,11 @@ case class AttributesOfIndividual( modeChoiceModel: ModeChoiceMultinomialLogit, beamServices: BeamServices, destinationActivity: Option[Activity], -<<<<<<< HEAD - transitCrowdingSkims: Option[TransitCrowdingSkims] -======= +//<<<<<<< HEAD + transitCrowdingSkims: Option[TransitCrowdingSkims], +//======= originActivity: Option[Activity] ->>>>>>> origin/zn/more-bike-multipliers-epa +//>>>>>>> origin/zn/more-bike-multipliers-epa ): Double = { //NOTE: This gives answers in hours embodiedBeamLeg.beamLeg.mode match { @@ -114,10 +114,10 @@ case class AttributesOfIndividual( embodiedBeamLeg.isPooledTrip ) ) -<<<<<<< HEAD +//<<<<<<< HEAD case BUS | SUBWAY | RAIL | TRAM | FERRY | FUNICULAR | CABLE_CAR | GONDOLA | TRANSIT => val uniqueModes = embodiedBeamTrip.beamLegs.map(_.mode).toSet - val modeMultiplier = getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel.modeMultipliers) + val modeMultiplier = getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel) val beamVehicleTypeId = TransitVehicleInitializer.transitModeToBeamVehicleType(embodiedBeamLeg.beamLeg.mode) val multiplier = if (uniqueModes == subwayTransit || uniqueModes == busTransit) { modeChoiceModel.transitVehicleTypeVOTMultipliers.getOrElse(beamVehicleTypeId, modeMultiplier) @@ -137,12 +137,12 @@ case class AttributesOfIndividual( multiplier * durationInHours } -======= +//======= case BIKE => val situation = getSituationForVOT(destinationActivity, originActivity) getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel, Some(situation)) * embodiedBeamLeg.beamLeg.duration / 3600 ->>>>>>> origin/zn/more-bike-multipliers-epa +//>>>>>>> origin/zn/more-bike-multipliers-epa case _ => getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel) * embodiedBeamLeg.beamLeg.duration / 3600 From 44e0b99366620bee1ea657c98c6c622d2980f17f Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Mon, 27 Jun 2022 14:41:58 -0700 Subject: [PATCH 167/307] adding originActivity into multinomial logit --- .../mode/ModeChoiceMultinomialLogit.scala | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala index 0b1f1224c99..a2d90ac8f52 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala @@ -1,9 +1,9 @@ package beam.agentsim.agents.choice.mode -<<<<<<< HEAD -======= +//<<<<<<< HEAD +//======= import scala.collection.mutable.ListBuffer ->>>>>>> origin/zn/more-bike-multipliers-epa +//>>>>>>> origin/zn/more-bike-multipliers-epa import beam.agentsim.agents.choice.logit import beam.agentsim.agents.choice.logit._ import beam.agentsim.agents.choice.mode.ModeChoiceMultinomialLogit.{ @@ -230,11 +230,11 @@ class ModeChoiceMultinomialLogit( } else { 1d } -<<<<<<< HEAD - getGeneralizedTimeOfLeg(embodiedBeamTrip, x, attributesOfIndividual, destinationActivity) * factor -======= - getGeneralizedTimeOfLeg(x, attributesOfIndividual, destinationActivity, originActivity) * factor ->>>>>>> origin/zn/more-bike-multipliers-epa +//<<<<<<< HEAD + getGeneralizedTimeOfLeg(embodiedBeamTrip, x, attributesOfIndividual, destinationActivity, originActivity) * factor +//======= +// getGeneralizedTimeOfLeg(x, attributesOfIndividual, destinationActivity, originActivity) * factor +//>>>>>>> origin/zn/more-bike-multipliers-epa }.sum + getGeneralizedTime(waitingTime, None, None) } @@ -253,11 +253,11 @@ class ModeChoiceMultinomialLogit( this, beamServices, destinationActivity, -<<<<<<< HEAD - Some(transitCrowding) -======= +//<<<<<<< HEAD + Some(transitCrowding), +//======= originActivity ->>>>>>> origin/zn/more-bike-multipliers-epa +//>>>>>>> origin/zn/more-bike-multipliers-epa ) case None => embodiedBeamLeg.beamLeg.duration * modeMultipliers.getOrElse(Some(embodiedBeamLeg.beamLeg.mode), 1.0) / 3600 @@ -336,14 +336,14 @@ class ModeChoiceMultinomialLogit( } } -<<<<<<< HEAD +//<<<<<<< HEAD lazy val modeMultipliers: mutable.Map[Option[BeamMode], Double] = mutable.Map[Option[BeamMode], Double]( // Some(WAITING) -> modalBehaviors.modeVotMultiplier.waiting, TODO think of alternative for waiting. For now assume "NONE" is waiting -======= - lazy val modeMultipliers: Map[Option[BeamMode], Double] = - Map[Option[BeamMode], Double]( ->>>>>>> origin/zn/more-bike-multipliers-epa +//======= +// lazy val modeMultipliers: Map[Option[BeamMode], Double] = +// Map[Option[BeamMode], Double]( +//>>>>>>> origin/zn/more-bike-multipliers-epa Some(TRANSIT) -> modalBehaviors.modeVotMultiplier.transit, Some(RIDE_HAIL) -> modalBehaviors.modeVotMultiplier.rideHail, Some(RIDE_HAIL_POOLED) -> modalBehaviors.modeVotMultiplier.rideHailPooled, From 4cc41cb45cdc59cafa337712286f4cac73ed750d Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Mon, 27 Jun 2022 14:47:31 -0700 Subject: [PATCH 168/307] fixing PersonAgent.scala --- .../beam/agentsim/agents/PersonAgent.scala | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 270aa86e81a..1b558623eed 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1377,10 +1377,10 @@ class PersonAgent( 0.0 // the cost as paid by person has already been accounted for, this event is just about the incentive ) ) -<<<<<<< HEAD +//<<<<<<< HEAD data.failedTrips.foreach(uncompletedTrip => - generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data)) -======= + generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data))) +//======= val correctedTrip = correctTripEndTime(data.currentTrip.get, tick, body.id, body.beamVehicleType.id) val generalizedTime = modeChoiceCalculator.getGeneralizedTimeOfTrip( @@ -1392,15 +1392,18 @@ class PersonAgent( val generalizedCost = modeChoiceCalculator.getNonTimeCost(correctedTrip) + attributes .getVOT(generalizedTime) // Correct the trip to deal with ride hail / disruptions and then register to skimmer - val (odSkimmerEvent, origCoord, destCoord) = ODSkimmerEvent.forTaz( - tick, - beamServices, - correctedTrip, - generalizedTime, - generalizedCost, - curFuelConsumed.primaryFuel + curFuelConsumed.secondaryFuel ->>>>>>> origin/zn/more-bike-multipliers-epa - ) + val maybePayloadWeightInKg = getPayloadWeightFromLeg(currentActivityIndex) +// val (odSkimmerEvent, origCoord, destCoord) = ODSkimmerEvent.forTaz( +// tick, +// beamServices, +// correctedTrip, +// generalizedTime, +// generalizedCost, +// maybePayloadWeightInKg, +// curFuelConsumed.primaryFuel + curFuelConsumed.secondaryFuel, +// data.failedTrips.foreach(), +////>>>>>>> origin/zn/more-bike-multipliers-epa +// ) generateSkimData(tick, data.currentTrip.get, failedTrip = false, currentActivityIndex, nextActivity(data)) resetFuelConsumed() From e11179026aacf5e6411c2e2ccae539b18ee375d2 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Mon, 27 Jun 2022 15:00:49 -0700 Subject: [PATCH 169/307] deleting useless comments --- .../scala/beam/agentsim/agents/PersonAgent.scala | 16 ++-------------- .../choice/mode/ModeChoiceMultinomialLogit.scala | 16 ---------------- .../sim/population/PopulationAttributes.scala | 10 +--------- 3 files changed, 3 insertions(+), 39 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 1b558623eed..206dd9ceb20 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1377,10 +1377,9 @@ class PersonAgent( 0.0 // the cost as paid by person has already been accounted for, this event is just about the incentive ) ) -//<<<<<<< HEAD data.failedTrips.foreach(uncompletedTrip => - generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data))) -//======= + generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data)) + ) val correctedTrip = correctTripEndTime(data.currentTrip.get, tick, body.id, body.beamVehicleType.id) val generalizedTime = modeChoiceCalculator.getGeneralizedTimeOfTrip( @@ -1393,17 +1392,6 @@ class PersonAgent( .getVOT(generalizedTime) // Correct the trip to deal with ride hail / disruptions and then register to skimmer val maybePayloadWeightInKg = getPayloadWeightFromLeg(currentActivityIndex) -// val (odSkimmerEvent, origCoord, destCoord) = ODSkimmerEvent.forTaz( -// tick, -// beamServices, -// correctedTrip, -// generalizedTime, -// generalizedCost, -// maybePayloadWeightInKg, -// curFuelConsumed.primaryFuel + curFuelConsumed.secondaryFuel, -// data.failedTrips.foreach(), -////>>>>>>> origin/zn/more-bike-multipliers-epa -// ) generateSkimData(tick, data.currentTrip.get, failedTrip = false, currentActivityIndex, nextActivity(data)) resetFuelConsumed() diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala index a2d90ac8f52..1048c128508 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala @@ -1,9 +1,5 @@ package beam.agentsim.agents.choice.mode -//<<<<<<< HEAD -//======= -import scala.collection.mutable.ListBuffer -//>>>>>>> origin/zn/more-bike-multipliers-epa import beam.agentsim.agents.choice.logit import beam.agentsim.agents.choice.logit._ import beam.agentsim.agents.choice.mode.ModeChoiceMultinomialLogit.{ @@ -230,11 +226,7 @@ class ModeChoiceMultinomialLogit( } else { 1d } -//<<<<<<< HEAD getGeneralizedTimeOfLeg(embodiedBeamTrip, x, attributesOfIndividual, destinationActivity, originActivity) * factor -//======= -// getGeneralizedTimeOfLeg(x, attributesOfIndividual, destinationActivity, originActivity) * factor -//>>>>>>> origin/zn/more-bike-multipliers-epa }.sum + getGeneralizedTime(waitingTime, None, None) } @@ -253,11 +245,8 @@ class ModeChoiceMultinomialLogit( this, beamServices, destinationActivity, -//<<<<<<< HEAD Some(transitCrowding), -//======= originActivity -//>>>>>>> origin/zn/more-bike-multipliers-epa ) case None => embodiedBeamLeg.beamLeg.duration * modeMultipliers.getOrElse(Some(embodiedBeamLeg.beamLeg.mode), 1.0) / 3600 @@ -336,14 +325,9 @@ class ModeChoiceMultinomialLogit( } } -//<<<<<<< HEAD lazy val modeMultipliers: mutable.Map[Option[BeamMode], Double] = mutable.Map[Option[BeamMode], Double]( // Some(WAITING) -> modalBehaviors.modeVotMultiplier.waiting, TODO think of alternative for waiting. For now assume "NONE" is waiting -//======= -// lazy val modeMultipliers: Map[Option[BeamMode], Double] = -// Map[Option[BeamMode], Double]( -//>>>>>>> origin/zn/more-bike-multipliers-epa Some(TRANSIT) -> modalBehaviors.modeVotMultiplier.transit, Some(RIDE_HAIL) -> modalBehaviors.modeVotMultiplier.rideHail, Some(RIDE_HAIL_POOLED) -> modalBehaviors.modeVotMultiplier.rideHailPooled, diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index 23afc576809..d7d60724d10 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -72,11 +72,8 @@ case class AttributesOfIndividual( modeChoiceModel.situationMultipliers(beamMode), vehicleAutomationLevel, beamServices -//<<<<<<< HEAD -// ) * getModeVotMultiplier(Option(beamMode), modeChoiceModel.modeMultipliers) -//======= + ) * getModeVotMultiplier(Option(CAR), modeChoiceModel) -//>>>>>>> origin/zn/more-bike-multipliers-epa } case _ => getModeVotMultiplier(Option(beamMode), modeChoiceModel) @@ -90,11 +87,8 @@ case class AttributesOfIndividual( modeChoiceModel: ModeChoiceMultinomialLogit, beamServices: BeamServices, destinationActivity: Option[Activity], -//<<<<<<< HEAD transitCrowdingSkims: Option[TransitCrowdingSkims], -//======= originActivity: Option[Activity] -//>>>>>>> origin/zn/more-bike-multipliers-epa ): Double = { //NOTE: This gives answers in hours embodiedBeamLeg.beamLeg.mode match { @@ -137,12 +131,10 @@ case class AttributesOfIndividual( multiplier * durationInHours } -//======= case BIKE => val situation = getSituationForVOT(destinationActivity, originActivity) getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel, Some(situation)) * embodiedBeamLeg.beamLeg.duration / 3600 -//>>>>>>> origin/zn/more-bike-multipliers-epa case _ => getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel) * embodiedBeamLeg.beamLeg.duration / 3600 From 9cdf7e89cfda06eab831e47d05930d9c9b276619 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Mon, 27 Jun 2022 15:02:04 -0700 Subject: [PATCH 170/307] fmt --- src/main/scala/beam/sim/population/PopulationAttributes.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index d7d60724d10..9b85f5e6b2b 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -72,7 +72,6 @@ case class AttributesOfIndividual( modeChoiceModel.situationMultipliers(beamMode), vehicleAutomationLevel, beamServices - ) * getModeVotMultiplier(Option(CAR), modeChoiceModel) } case _ => From 8c4dbc3d1d0a50498a454f2234c52587c25df1b2 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 02:39:02 -0700 Subject: [PATCH 171/307] delete unused parameter in PersonAgent --- src/main/scala/beam/agentsim/agents/PersonAgent.scala | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 206dd9ceb20..3ce3cc12086 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1388,11 +1388,6 @@ class PersonAgent( nextActivity(data), Some(currentActivity(data)) ) - val generalizedCost = modeChoiceCalculator.getNonTimeCost(correctedTrip) + attributes - .getVOT(generalizedTime) - // Correct the trip to deal with ride hail / disruptions and then register to skimmer - val maybePayloadWeightInKg = getPayloadWeightFromLeg(currentActivityIndex) - generateSkimData(tick, data.currentTrip.get, failedTrip = false, currentActivityIndex, nextActivity(data)) resetFuelConsumed() From 3015394fc922346f8960b218d6049b332447d9e4 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 02:47:45 -0700 Subject: [PATCH 172/307] using collect instead of filter + map --- src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index 56bb34a164a..ba93b882021 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -190,8 +190,7 @@ class BeamScoringFunctionFactory @Inject() ( .map(_.asInstanceOf[Activity]) .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala - .filter(_.isInstanceOf[Activity]) - .map(_.asInstanceOf[Activity]) + .collect{case Activity if isInstanceOf[Activity] => asInstanceOf[Activity]} .lift(tripIndex) val departureTime = trip.legs.headOption.map(_.beamLeg.startTime.toString).getOrElse("") val totalTravelTimeInSecs = trip.totalTravelTimeInSecs From 7b4bf9781f438e350349d56d40524b98ab7b2b4b Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 02:48:38 -0700 Subject: [PATCH 173/307] delete merging commit --- src/main/scala/beam/sim/population/PopulationAttributes.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index 9b85f5e6b2b..0080a99fef2 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -107,7 +107,6 @@ case class AttributesOfIndividual( embodiedBeamLeg.isPooledTrip ) ) -//<<<<<<< HEAD case BUS | SUBWAY | RAIL | TRAM | FERRY | FUNICULAR | CABLE_CAR | GONDOLA | TRANSIT => val uniqueModes = embodiedBeamTrip.beamLegs.map(_.mode).toSet val modeMultiplier = getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel) From 45b324f19559a945a07d513e04d617f6869954fd Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 02:50:16 -0700 Subject: [PATCH 174/307] swaping destination and origination --- .../scala/beam/sim/population/PopulationAttributes.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index 0080a99fef2..c40ce2dc69b 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -130,7 +130,7 @@ case class AttributesOfIndividual( } case BIKE => - val situation = getSituationForVOT(destinationActivity, originActivity) + val situation = getSituationForVOT(originActivity, destinationActivity) getModeVotMultiplier(Option(embodiedBeamLeg.beamLeg.mode), modeChoiceModel, Some(situation)) * embodiedBeamLeg.beamLeg.duration / 3600 case _ => @@ -144,8 +144,8 @@ case class AttributesOfIndividual( } private def getSituationForVOT( - destinationActivity: Option[Activity], - originActivity: Option[Activity] + originActivity: Option[Activity], + destinationActivity: Option[Activity] ): Set[SituationMultiplier] = { (destinationActivity, originActivity, age) match { case (Some(origin), Some(destination), Some(travelerAge)) => From 10d96faf2af4d6a9aade819547ce5f047cf92fe0 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 02:51:11 -0700 Subject: [PATCH 175/307] fmt --- src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala | 2 +- src/main/scala/beam/sim/population/PopulationAttributes.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index ba93b882021..12b8fa4dc9a 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -190,7 +190,7 @@ class BeamScoringFunctionFactory @Inject() ( .map(_.asInstanceOf[Activity]) .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala - .collect{case Activity if isInstanceOf[Activity] => asInstanceOf[Activity]} + .collect { case Activity if isInstanceOf[Activity] => asInstanceOf[Activity] } .lift(tripIndex) val departureTime = trip.legs.headOption.map(_.beamLeg.startTime.toString).getOrElse("") val totalTravelTimeInSecs = trip.totalTravelTimeInSecs diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index c40ce2dc69b..4d7a5a65c90 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -144,7 +144,7 @@ case class AttributesOfIndividual( } private def getSituationForVOT( - originActivity: Option[Activity], + originActivity: Option[Activity], destinationActivity: Option[Activity] ): Set[SituationMultiplier] = { (destinationActivity, originActivity, age) match { From 5a6de11230fc0d305ec172f4504fe3b2893abe00 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 03:17:03 -0700 Subject: [PATCH 176/307] fix bugs --- src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index 12b8fa4dc9a..13f5b5e9f22 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -190,7 +190,7 @@ class BeamScoringFunctionFactory @Inject() ( .map(_.asInstanceOf[Activity]) .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala - .collect { case Activity if isInstanceOf[Activity] => asInstanceOf[Activity] } + .collect { case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity] } .lift(tripIndex) val departureTime = trip.legs.headOption.map(_.beamLeg.startTime.toString).getOrElse("") val totalTravelTimeInSecs = trip.totalTravelTimeInSecs From c4cbe36b9930d40fa25f7f18627ff49c15b9e7de Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 03:19:10 -0700 Subject: [PATCH 177/307] using collect instead of filter + map again --- src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index 13f5b5e9f22..b8b18c88e27 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -186,8 +186,7 @@ class BeamScoringFunctionFactory @Inject() ( val (trip, tripIndex) = tripWithIndex val personId = person.getId.toString val tripPurpose = person.getSelectedPlan.getPlanElements.asScala - .filter(_.isInstanceOf[Activity]) - .map(_.asInstanceOf[Activity]) + .collect{case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity]} .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala .collect { case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity] } From 1611e0f1c80ec4237ac7a772a5c23a69b61aa99a Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 03:20:25 -0700 Subject: [PATCH 178/307] fmt --- src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index b8b18c88e27..d8d16cb8100 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -186,7 +186,7 @@ class BeamScoringFunctionFactory @Inject() ( val (trip, tripIndex) = tripWithIndex val personId = person.getId.toString val tripPurpose = person.getSelectedPlan.getPlanElements.asScala - .collect{case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity]} + .collect { case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity] } .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala .collect { case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity] } From f08e766c192ba77b7d14df06f2d8c1bfee0a614e Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 28 Jun 2022 16:04:56 +0300 Subject: [PATCH 179/307] Update gradle.deploy.properties safer defaults --- gradle.deploy.properties | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gradle.deploy.properties b/gradle.deploy.properties index 154693a302b..15607d177b0 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -1,17 +1,18 @@ -runName=inm/austin-100k-teleportation-ON-vs-OFF +runName=beamville beamBranch=develop -#beamCommit=dc4b0b05a3885357c7b5b65fb91181c8163aa9b6 -beamConfigs=test/input/sf-light/sf-light-1k-with-PTE-duplicates-1.conf,test/input/sf-light/sf-light-1k-with-PTE-duplicates-2.conf -instanceType=r5.8xlarge +# beamCommit=dc4b0b05a3885357c7b5b65fb91181c8163aa9b6 +beamConfigs=test/input/beamville/beam.conf +instanceType=r5.2xlarge dataBranch=develop -#dataCommit=HEAD +# dataCommit=HEAD # shutdownBehaviour = stop | terminate shutdownBehaviour=terminate s3Backup=true -maxRAM=230g -#storageSize (in GiB) = any number between 64 and 256 + +# forcedMaxRAM=700 +# storageSize (in GiB) = any number between 64 and 256 storageSize=128 #r5.8xlarge (32/256) From 6e79c6fddd3e4d4d0935539a24516171b2563c3d Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 06:42:49 -0700 Subject: [PATCH 180/307] simplify collect method --- src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index d8d16cb8100..bc1fda280c2 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -189,7 +189,7 @@ class BeamScoringFunctionFactory @Inject() ( .collect { case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity] } .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala - .collect { case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity] } + .collect { case x: Activity => asInstanceOf[Activity] } .lift(tripIndex) val departureTime = trip.legs.headOption.map(_.beamLeg.startTime.toString).getOrElse("") val totalTravelTimeInSecs = trip.totalTravelTimeInSecs From 584eae9cbbdef573389c909c4f692abba8a522ce Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 06:43:23 -0700 Subject: [PATCH 181/307] simplify from x to _ --- src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index bc1fda280c2..a1b070fd5a5 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -189,7 +189,7 @@ class BeamScoringFunctionFactory @Inject() ( .collect { case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity] } .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala - .collect { case x: Activity => asInstanceOf[Activity] } + .collect { case _: Activity => asInstanceOf[Activity] } .lift(tripIndex) val departureTime = trip.legs.headOption.map(_.beamLeg.startTime.toString).getOrElse("") val totalTravelTimeInSecs = trip.totalTravelTimeInSecs From ab3989372775ed262b1247d140c256079ac3327e Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 06:44:50 -0700 Subject: [PATCH 182/307] delete useless code --- src/main/scala/beam/agentsim/agents/PersonAgent.scala | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 3ce3cc12086..cbf72b86813 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1381,13 +1381,6 @@ class PersonAgent( generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data)) ) val correctedTrip = correctTripEndTime(data.currentTrip.get, tick, body.id, body.beamVehicleType.id) - val generalizedTime = - modeChoiceCalculator.getGeneralizedTimeOfTrip( - correctedTrip, - Some(attributes), - nextActivity(data), - Some(currentActivity(data)) - ) resetFuelConsumed() From a9f51599ca00a821f8c99cb1f221889772831d80 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 06:48:01 -0700 Subject: [PATCH 183/307] getting origin from origin and destination from destination --- src/main/scala/beam/sim/population/PopulationAttributes.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index 4d7a5a65c90..dd51fcc043b 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -147,7 +147,7 @@ case class AttributesOfIndividual( originActivity: Option[Activity], destinationActivity: Option[Activity] ): Set[SituationMultiplier] = { - (destinationActivity, originActivity, age) match { + (originActivity,destinationActivity, age) match { case (Some(origin), Some(destination), Some(travelerAge)) => val ageBin = if (travelerAge > 50) { ageGT50 } From 9b385f28b1d41d2b3ee1d0b07aeb3d74c446b772 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 06:49:12 -0700 Subject: [PATCH 184/307] fmt --- src/main/scala/beam/sim/population/PopulationAttributes.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index dd51fcc043b..5c0a7ff136a 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -147,7 +147,7 @@ case class AttributesOfIndividual( originActivity: Option[Activity], destinationActivity: Option[Activity] ): Set[SituationMultiplier] = { - (originActivity,destinationActivity, age) match { + (originActivity, destinationActivity, age) match { case (Some(origin), Some(destination), Some(travelerAge)) => val ageBin = if (travelerAge > 50) { ageGT50 } From ee5263535a2ddcf1b75fd97d2a1f85cf2c2960c2 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 06:55:49 -0700 Subject: [PATCH 185/307] make collect easier in a right way --- .../scala/beam/scoring/BeamScoringFunctionFactory.scala | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index a1b070fd5a5..d035ffe591a 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -186,10 +186,14 @@ class BeamScoringFunctionFactory @Inject() ( val (trip, tripIndex) = tripWithIndex val personId = person.getId.toString val tripPurpose = person.getSelectedPlan.getPlanElements.asScala - .collect { case x if x.isInstanceOf[Activity] => x.asInstanceOf[Activity] } + .collect { case activity: Activity => + activity + } .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala - .collect { case _: Activity => asInstanceOf[Activity] } + .collect { case activity: Activity => + activity + } .lift(tripIndex) val departureTime = trip.legs.headOption.map(_.beamLeg.startTime.toString).getOrElse("") val totalTravelTimeInSecs = trip.totalTravelTimeInSecs From 6e1854424fe81cb9c66be578dff0587bb87190ce Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 06:58:22 -0700 Subject: [PATCH 186/307] switching to faster and cleaner way --- src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index d035ffe591a..4356673a949 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -225,8 +225,9 @@ class BeamScoringFunctionFactory @Inject() ( val tripCost = trip.costEstimate val tripDistance = trip.legs.map(_.beamLeg.travelPath.distanceInM).sum val destinationActivity = person.getSelectedPlan.getPlanElements.asScala - .filter(_.isInstanceOf[Activity]) - .map(_.asInstanceOf[Activity]) + .collect { case activity: Activity => + activity + } .lift(tripIndex + 1) trip.legs.foreach { leg => val linksAndTravelTimes = leg.beamLeg.travelPath.linkIds.zip(leg.beamLeg.travelPath.linkTravelTime) From 0420a15516b213c2b34418ab852c6fa1ab248054 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 07:30:51 -0700 Subject: [PATCH 187/307] fix bugs --- .../scala/beam/scoring/BeamScoringFunctionFactory.scala | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index 4356673a949..c0839e88ae2 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -189,7 +189,6 @@ class BeamScoringFunctionFactory @Inject() ( .collect { case activity: Activity => activity } - .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala .collect { case activity: Activity => activity @@ -225,9 +224,8 @@ class BeamScoringFunctionFactory @Inject() ( val tripCost = trip.costEstimate val tripDistance = trip.legs.map(_.beamLeg.travelPath.distanceInM).sum val destinationActivity = person.getSelectedPlan.getPlanElements.asScala - .collect { case activity: Activity => - activity - } + .filter(_.isInstanceOf[Activity]) + .map(_.asInstanceOf[Activity]) .lift(tripIndex + 1) trip.legs.foreach { leg => val linksAndTravelTimes = leg.beamLeg.travelPath.linkIds.zip(leg.beamLeg.travelPath.linkTravelTime) From 936eb1ebf840269e4c6f164c9832d115fadb3604 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 07:38:43 -0700 Subject: [PATCH 188/307] lifting trip Index --- .../scala/beam/scoring/BeamScoringFunctionFactory.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala index c0839e88ae2..14007b58945 100755 --- a/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala +++ b/src/main/scala/beam/scoring/BeamScoringFunctionFactory.scala @@ -186,9 +186,9 @@ class BeamScoringFunctionFactory @Inject() ( val (trip, tripIndex) = tripWithIndex val personId = person.getId.toString val tripPurpose = person.getSelectedPlan.getPlanElements.asScala - .collect { case activity: Activity => - activity - } + .filter(_.isInstanceOf[Activity]) + .map(_.asInstanceOf[Activity]) + .lift(tripIndex + 1) val tripOrigin = person.getSelectedPlan.getPlanElements.asScala .collect { case activity: Activity => activity From 06727a487238361d7098892f3e684d122c7f0d37 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 08:22:46 -0700 Subject: [PATCH 189/307] delete ununsed value --- src/main/scala/beam/agentsim/agents/PersonAgent.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index cbf72b86813..7d0055cd7bc 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1380,7 +1380,6 @@ class PersonAgent( data.failedTrips.foreach(uncompletedTrip => generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data)) ) - val correctedTrip = correctTripEndTime(data.currentTrip.get, tick, body.id, body.beamVehicleType.id) resetFuelConsumed() From 7e43b8986c7b6c88fc87a20134ec768cf11d8066 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 08:52:27 -0700 Subject: [PATCH 190/307] fmt --- src/main/scala/beam/agentsim/agents/PersonAgent.scala | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 7d0055cd7bc..cede6f65e90 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1380,9 +1380,7 @@ class PersonAgent( data.failedTrips.foreach(uncompletedTrip => generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data)) ) - resetFuelConsumed() - val activityStartEvent = new ActivityStartEvent( tick, id, From 374034e2a231ea6deb94eaa333a20379cedcce53 Mon Sep 17 00:00:00 2001 From: Xuan Jiang Date: Tue, 28 Jun 2022 09:18:03 -0700 Subject: [PATCH 191/307] fix bugs --- src/main/scala/beam/agentsim/agents/PersonAgent.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index cede6f65e90..8cb3af04b35 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1380,6 +1380,7 @@ class PersonAgent( data.failedTrips.foreach(uncompletedTrip => generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data)) ) + val correctedTrip = correctTripEndTime(data.currentTrip.get, tick, body.id, body.beamVehicleType.id) resetFuelConsumed() val activityStartEvent = new ActivityStartEvent( tick, From ad7981811b12d8e352afdb8ee51d16e82eeba042 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 29 Jun 2022 20:33:46 +0600 Subject: [PATCH 192/307] Fix typo in deployment lambda --- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index d6bd214d659..d2be848a969 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -132,7 +132,7 @@ - then - RESOLVED_COMMIT=$(git log -1 --pretty=format:%H) - else - - RESOLVED_COMMIT=COMMIT + - RESOLVED_COMMIT=$COMMIT - fi - echo "Resolved commit is $RESOLVED_COMMIT" From ea2228296e4b5688995e62c39c7050a99ac5af53 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Mon, 4 Jul 2022 17:56:57 +0300 Subject: [PATCH 193/307] fix for permission issue with cloud-init log file --- aws/src/main/python/beam_lambda/lambda_function.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index d2be848a969..ac9231aef1a 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -125,6 +125,8 @@ - sudo rm -rf beam - sudo git clone https://github.com/LBNL-UCB-STI/beam.git - ln -sf /var/log/cloud-init-output.log /home/ubuntu/git/beam/cloud-init-output.log + - sudo chmod 644 /var/log/cloud-init-output.log + - sudo chmod 644 /home/ubuntu/git/beam/cloud-init-output.log - echo "-------------------Starting Beam Sim----------------------" - echo $(date +%s) > /tmp/.starttime - cd /home/ubuntu/git/beam @@ -797,7 +799,7 @@ def get_param(param_name): .replace('$MAIN_CLASS', execute_class) \ .replace('$UID', uid) \ .replace('$SHUTDOWN_WAIT', shutdown_wait) \ - .replace('$TITLED', runName)\ + .replace('$TITLED', runName) \ .replace('$MAX_RAM', str(max_ram)) \ .replace('$S3_PUBLISH', str(s3_publish)) \ .replace('$SIGOPT_CLIENT_ID', sigopt_client_id).replace('$SIGOPT_DEV_ID', sigopt_dev_id) \ From 1d49ba979f27bb2bf2ffe55021adf68d853fc9f1 Mon Sep 17 00:00:00 2001 From: Justin Pihony Date: Mon, 4 Jul 2022 16:43:50 -0400 Subject: [PATCH 194/307] force push aws tweak --- aws/src/main/python/instanceNotifier/instance_notifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/instanceNotifier/instance_notifier.py b/aws/src/main/python/instanceNotifier/instance_notifier.py index 180ddc8a5b5..876d48a8d00 100644 --- a/aws/src/main/python/instanceNotifier/instance_notifier.py +++ b/aws/src/main/python/instanceNotifier/instance_notifier.py @@ -128,7 +128,7 @@ def stop_instance(instance_id): logger.info(f"Stopping {instance_id}") ec2_client.stop_instances(InstanceIds=[instance_id]) -def delete_override_tag__for_(instance_id): +def delete_override_tag_for_(instance_id): logger.info(f"Removing BudgetOverride tag for {instance_id}") ec2_client.delete_tags( Resources=[instance_id], From 7837b9bab0b5a8d7e835d6f369de344cef38c2a9 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 5 Jul 2022 10:57:06 +0300 Subject: [PATCH 195/307] cpu and ram logging --- .../main/python/beam_lambda/lambda_function.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index ac9231aef1a..2d66c622cc2 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -58,6 +58,7 @@ - done; - sudo cp /home/ubuntu/git/beam/gc_* "$finalPath" - sudo cp /var/log/cloud-init-output.log "$finalPath" + - sudo cp /home/ubuntu/cpu_ram_usage.csv "$finalPath" - sudo aws --region "$S3_REGION" s3 cp "$finalPath" s3://beam-outputs/"$finalPath" --recursive; - s3p="$s3p, https://s3.us-east-2.amazonaws.com/beam-outputs/index.html#$finalPath"''' @@ -119,8 +120,23 @@ sleep 5s cd - path: /home/ubuntu/install-and-run-helics-scripts.sh + - content: | + #!/bin/bash + timeout=$1 + echo "date,time,CPU usage,RAM used,RAM available" + while sleep $timeout + do + timestamp_CPU=$(vmstat 1 2 -SM -a -w -t | python3 -c 'import sys; ll=sys.stdin.readlines()[-1].split(); print(ll[-2] + ", " + ll[-1] + ", " + str(100 - int(ll[-5])))') + ram_used_available=$(free -g | python3 -c 'import sys; ll=sys.stdin.readlines()[-2].split(); print(ll[2] + ", " + ll[-1])') + echo $timestamp_CPU, $ram_used_available + done + path: /home/ubuntu/write-cpu-ram-usage.sh runcmd: + - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh + - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh + - cd /home/ubuntu + - ./write-cpu-ram-usage.sh 30 > cpu_ram_usage.csv & - cd /home/ubuntu/git - sudo rm -rf beam - sudo git clone https://github.com/LBNL-UCB-STI/beam.git @@ -203,7 +219,6 @@ - echo $start_json - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$start_json" - chmod +x /tmp/slack.sh - - chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - echo "notification sent..." - echo "notification saved..." - crontab /tmp/slack_notification From 3a630ea395d85674b35e7116103a1d831a370af1 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 5 Jul 2022 11:07:37 +0300 Subject: [PATCH 196/307] better timeout for cpu/ram log --- aws/src/main/python/beam_lambda/lambda_function.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 2d66c622cc2..8c09afc2205 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -126,7 +126,7 @@ echo "date,time,CPU usage,RAM used,RAM available" while sleep $timeout do - timestamp_CPU=$(vmstat 1 2 -SM -a -w -t | python3 -c 'import sys; ll=sys.stdin.readlines()[-1].split(); print(ll[-2] + ", " + ll[-1] + ", " + str(100 - int(ll[-5])))') + timestamp_CPU=$(vmstat 1 3 -SM -a -w -t | python3 -c 'import sys; ll=sys.stdin.readlines()[-1].split(); print(ll[-2] + ", " + ll[-1] + ", " + str(100 - int(ll[-5])))') ram_used_available=$(free -g | python3 -c 'import sys; ll=sys.stdin.readlines()[-2].split(); print(ll[2] + ", " + ll[-1])') echo $timestamp_CPU, $ram_used_available done @@ -136,7 +136,7 @@ - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh - cd /home/ubuntu - - ./write-cpu-ram-usage.sh 30 > cpu_ram_usage.csv & + - ./write-cpu-ram-usage.sh 28 > cpu_ram_usage.csv & - cd /home/ubuntu/git - sudo rm -rf beam - sudo git clone https://github.com/LBNL-UCB-STI/beam.git From 5bc073c26847a5d37c471300008a8b1cdbc257ca Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 5 Jul 2022 11:15:44 +0300 Subject: [PATCH 197/307] better timeout for cpu/ram log --- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 8c09afc2205..95b538713ea 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -136,7 +136,7 @@ - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh - cd /home/ubuntu - - ./write-cpu-ram-usage.sh 28 > cpu_ram_usage.csv & + - ./write-cpu-ram-usage.sh 20 > cpu_ram_usage.csv & - cd /home/ubuntu/git - sudo rm -rf beam - sudo git clone https://github.com/LBNL-UCB-STI/beam.git From 2bf0d2bf69afc4cce1c05442a804f96e551c8510 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 5 Jul 2022 11:52:01 +0300 Subject: [PATCH 198/307] zipping the cpu/ram log --- aws/src/main/python/beam_lambda/lambda_function.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 95b538713ea..7c41bd3463c 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -58,7 +58,8 @@ - done; - sudo cp /home/ubuntu/git/beam/gc_* "$finalPath" - sudo cp /var/log/cloud-init-output.log "$finalPath" - - sudo cp /home/ubuntu/cpu_ram_usage.csv "$finalPath" + - sudo gzip /home/ubuntu/cpu_ram_usage.csv + - sudo cp /home/ubuntu/cpu_ram_usage* "$finalPath" - sudo aws --region "$S3_REGION" s3 cp "$finalPath" s3://beam-outputs/"$finalPath" --recursive; - s3p="$s3p, https://s3.us-east-2.amazonaws.com/beam-outputs/index.html#$finalPath"''' From bb2713c8d06e20e41d1ac3ce80e6a54f33818978 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 5 Jul 2022 12:44:49 +0300 Subject: [PATCH 199/307] more iterations --- ...light-1k-warmstart.conf => sf-light-1k-warmstart_50_it.conf} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/input/sf-light/{sf-light-1k-warmstart.conf => sf-light-1k-warmstart_50_it.conf} (95%) diff --git a/test/input/sf-light/sf-light-1k-warmstart.conf b/test/input/sf-light/sf-light-1k-warmstart_50_it.conf similarity index 95% rename from test/input/sf-light/sf-light-1k-warmstart.conf rename to test/input/sf-light/sf-light-1k-warmstart_50_it.conf index fde1102cfbe..bbf64fc5be9 100644 --- a/test/input/sf-light/sf-light-1k-warmstart.conf +++ b/test/input/sf-light/sf-light-1k-warmstart_50_it.conf @@ -11,7 +11,7 @@ include "sf-light-1k.conf" beam.agentsim.simulationName = "sf-light-1k-xml-warmstart" beam.agentsim.agentSampleSizeAsFractionOfPopulation = 1.0 beam.agentsim.firstIteration = 0 -beam.agentsim.lastIteration = 5 +beam.agentsim.lastIteration = 50 beam.agentsim.thresholdForWalkingInMeters = 100 beam.agentsim.timeBinSize = 3600 beam.agentsim.endTime = "30:00:00" From 746d03a6eff6fed45983ab47c260d05c4f99dcf9 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 5 Jul 2022 13:37:39 +0300 Subject: [PATCH 200/307] + link --- aws/src/main/python/beam_lambda/lambda_function.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 7c41bd3463c..4a2958f657e 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -141,6 +141,7 @@ - cd /home/ubuntu/git - sudo rm -rf beam - sudo git clone https://github.com/LBNL-UCB-STI/beam.git + - ln -sf /home/ubuntu/cpu_ram_usage.csv /home/ubuntu/git/beam/cpu_ram_usage.csv - ln -sf /var/log/cloud-init-output.log /home/ubuntu/git/beam/cloud-init-output.log - sudo chmod 644 /var/log/cloud-init-output.log - sudo chmod 644 /home/ubuntu/git/beam/cloud-init-output.log From 13774114838b5a67c03f2fcef58ac089ae35f314 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 29 Jun 2022 20:23:54 +0600 Subject: [PATCH 201/307] Add Jupyter AWS lambda --- aws/build.gradle | 20 +++ .../main/python/jupyter/lambda_function.py | 144 ++++++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 aws/src/main/python/jupyter/lambda_function.py diff --git a/aws/build.gradle b/aws/build.gradle index d603ab396a9..0b3b3433de9 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -242,6 +242,26 @@ task terminateEC2(type: AWSLambdaInvokeTask) { } } +task jupyterEC2(type: AWSLambdaInvokeTask) { + doFirst { + functionName = "start-jupyter-on-instance" + invocationType = InvocationType.RequestResponse + payload = """ + { + "budget_override": "false", + "instance_type": "t2.nano", + "title": "alex-vv/jupyter-test", + "region": "us-east-2", + "storage_size": 128, + "token": "e948224a-fbb3-11ec-8714-abc11d9f8dd6" + } + """ + } + doLast { + printResult(payload, invokeResult) + } +} + task listS3Bucket(type: AWSLambdaInvokeTask) { doFirst { functionName = "s3BucketList" diff --git a/aws/src/main/python/jupyter/lambda_function.py b/aws/src/main/python/jupyter/lambda_function.py new file mode 100644 index 00000000000..aa124b5b5ba --- /dev/null +++ b/aws/src/main/python/jupyter/lambda_function.py @@ -0,0 +1,144 @@ +# coding=utf-8 +import boto3 +import time +import logging +import os +from botocore.errorfactory import ClientError + +logger = logging.getLogger() +logger.setLevel(logging.INFO) + +regions = ['us-east-1', 'us-east-2', 'us-west-2'] + +s3 = boto3.client('s3') +ec2 = None + +initscript = ((''' +#cloud-config +runcmd: + - pip install setuptools + - pip install jupyter + - JUPYTER_TOKEN=$TOKEN jupyter-notebook --allow-root --no-browser --ip=$(ec2metadata --public-hostname) + - sudo shutdown -h +30 +''')) + +instance_types = ['t2.nano', 't2.micro', 't2.small', 't2.medium', 't2.large', 't2.xlarge', 't2.2xlarge', + 'm4.large', 'm4.xlarge', 'm4.2xlarge', 'm4.4xlarge', 'm4.10xlarge', 'm4.16xlarge', + 'm5.large', 'm5.xlarge', 'm5.2xlarge', 'm5.4xlarge', 'm5.12xlarge', 'm5.24xlarge', + 'c4.large', 'c4.xlarge', 'c4.2xlarge', 'c4.4xlarge', 'c4.8xlarge', + 'f1.2xlarge', 'f1.16xlarge', + 'g2.2xlarge', 'g2.8xlarge', + 'g3.4xlarge', 'g3.8xlarge', 'g3.16xlarge', + 'p2.xlarge', 'p2.8xlarge', 'p2.16xlarge', + 'p3.2xlarge', 'p3.8xlarge', 'p3.16xlarge', + 'r4.large', 'r4.xlarge', 'r4.2xlarge', 'r4.4xlarge', 'r4.8xlarge', 'r4.16xlarge', + 'r3.large', 'r3.xlarge', 'r3.2xlarge', 'r3.4xlarge', 'r3.8xlarge', + 'x1.16xlarge', 'x1.32xlarge', + 'x1e.xlarge', 'x1e.2xlarge', 'x1e.4xlarge', 'x1e.8xlarge', 'x1e.16xlarge', 'x1e.32xlarge', + 'd2.xlarge', 'd2.2xlarge', 'd2.4xlarge', 'd2.8xlarge', + 'i2.xlarge', 'i2.2xlarge', 'i2.4xlarge', 'i2.8xlarge', + 'h1.2xlarge', 'h1.4xlarge', 'h1.8xlarge', 'h1.16xlarge', + 'i3.large', 'i3.xlarge', 'i3.2xlarge', 'i3.4xlarge', 'i3.8xlarge', 'i3.16xlarge', 'i3.metal', + 'c5.large', 'c5.xlarge', 'c5.2xlarge', 'c5.4xlarge', 'c5.9xlarge', 'c5.18xlarge', + 'c5d.large', 'c5d.xlarge', 'c5d.2xlarge', 'c5d.4xlarge', 'c5d.9xlarge', 'c5d.18xlarge', 'c5d.24xlarge', + 'r5.large', 'r5.xlarge', 'r5.2xlarge', 'r5.4xlarge', 'r5.8xlarge', 'r5.12xlarge', 'r5.24xlarge', + 'r5d.large', 'r5d.xlarge', 'r5d.2xlarge', 'r5d.4xlarge', 'r5d.12xlarge', 'r5d.24xlarge', + 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', + 'z1d.large', 'z1d.xlarge', 'z1d.2xlarge', 'z1d.3xlarge', 'z1d.6xlarge', 'z1d.12xlarge', + 'x2gd.metal', 'x2gd.16xlarge'] + +def init_ec2(region): + global ec2 + ec2 = boto3.client('ec2', region_name=region) + +def get_dns(instance_id): + host = None + while host is None: + time.sleep(2) + instances = ec2.describe_instances(InstanceIds=[instance_id]) + for r in instances['Reservations']: + for i in r['Instances']: + dns = i['PublicDnsName'] + if dns != '': + host = dns + return host + +def deploy(script, instance_type, region_prefix, instance_name, volume_size, budget_override): + res = ec2.run_instances(BlockDeviceMappings=[ + { + 'DeviceName': '/dev/sda1', + 'Ebs': { + 'VolumeSize': volume_size, + 'VolumeType': 'gp2' + } + } + ], + ImageId=os.environ[region_prefix + 'IMAGE_ID'], + InstanceType=instance_type, + UserData=script, + KeyName=os.environ[region_prefix + 'KEY_NAME'], + MinCount=1, + MaxCount=1, + SecurityGroupIds=[os.environ[region_prefix + 'SECURITY_GROUP']], + IamInstanceProfile={'Name': os.environ['IAM_ROLE'] }, + InstanceInitiatedShutdownBehavior='terminate', + TagSpecifications=[ + { + 'ResourceType': 'instance', + 'Tags': [ + { + 'Key': 'Name', + 'Value': instance_name + }, { + 'Key': 'BudgetOverride', + 'Value': str(budget_override) + } ] + } ]) + return res['Instances'][0]['InstanceId'] + +def deploy_handler(event, context): + missing_parameters = [] + + def parameter_wasnt_specified(parameter_value): + # in gradle if parameter wasn't specified then project.findProperty return 'null' + return parameter_value is None or parameter_value == 'null' + + def get_param(param_name): + param_value = event.get(param_name) + if parameter_wasnt_specified(param_value): + missing_parameters.append(param_name) + return param_value + + budget_override = event.get('budget_override', False) + runName = get_param('title') + instance_type = get_param('instance_type') + region = get_param('region') + volume_size = event.get('storage_size', 64) + token = event.get('token') + + if missing_parameters: + return "Unable to start, missing parameters: " + ", ".join(missing_parameters) + + if region not in regions: + return "Unable to start run, {region} region not supported.".format(region=region) + + if instance_type not in instance_types: + return "Unable to start run, {instance_type} instance type not supported.".format(instance_type=instance_type) + + if volume_size < 64 or volume_size > 256: + volume_size = 64 + + init_ec2(region) + + script = initscript.replace("$TOKEN", token) + + instance_id = deploy(script, instance_type, region.replace("-", "_")+'_', runName, volume_size, budget_override) + host = get_dns(instance_id) + txt = 'Started Jupyter with run name: {titled} (InstanceID: {instance_id}), url: http://{dns}:8888/?token={token}'.format(titled=runName, dns=host, instance_id=instance_id, token=token) + + return txt + +def lambda_handler(event, context): + logger.info("Incoming event: " + str(event)) + + return deploy_handler(event, context) From 018ab5188972c9a2dd9dc1e6d8738bdaecbe944b Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Tue, 5 Jul 2022 18:35:18 +0600 Subject: [PATCH 202/307] Add gradle task parameters --- aws/build.gradle | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index 0b3b3433de9..f87c8dd7fc9 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -248,12 +248,12 @@ task jupyterEC2(type: AWSLambdaInvokeTask) { invocationType = InvocationType.RequestResponse payload = """ { - "budget_override": "false", - "instance_type": "t2.nano", - "title": "alex-vv/jupyter-test", - "region": "us-east-2", - "storage_size": 128, - "token": "e948224a-fbb3-11ec-8714-abc11d9f8dd6" + "budget_override": "${project.findProperty('budgetOverride') ?: false}", + "instance_type": "${project.findProperty('instanceType') ?: 't2.nano'}", + "title": "${project.findProperty('title') ?: 'jupyter-notebook'}", + "region": "${project.findProperty('region') ?: defaultRegion}", + "storage_size": ${project.findProperty('storageSize') ?: 128}, + "token": "${project.findProperty("jupyterToken") ?: UUID.randomUUID().toString()}" } """ } From a444bf7a5255fddddb2d2f875564689e6c230b9c Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Tue, 5 Jul 2022 18:46:20 +0600 Subject: [PATCH 203/307] Renamed function dir based on AWS lambda name --- .../{jupyter => start-jupyter-on-instance}/lambda_function.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename aws/src/main/python/{jupyter => start-jupyter-on-instance}/lambda_function.py (100%) diff --git a/aws/src/main/python/jupyter/lambda_function.py b/aws/src/main/python/start-jupyter-on-instance/lambda_function.py similarity index 100% rename from aws/src/main/python/jupyter/lambda_function.py rename to aws/src/main/python/start-jupyter-on-instance/lambda_function.py From 8a8a1b80d2819f275072b1cea451e16a7fa0a1d3 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Tue, 5 Jul 2022 18:59:14 +0600 Subject: [PATCH 204/307] Allow to run Jupyter together with BEAM via deploy task --- aws/build.gradle | 2 ++ .../python/beam_lambda/lambda_function.py | 23 +++++++++++++++++-- gradle.deploy.properties | 3 +++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index f87c8dd7fc9..0d1c1348872 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -107,6 +107,8 @@ task deploy(type: AWSLambdaInvokeTask) { "command": "deploy", "run_grafana" : ${ext.getParameterValue('runGrafana') ?: false}, "run_helics" : ${ext.getParameterValue('runHelics') ?: false}, + "run_jupyter" : ${ext.getParameterValue('runJupyter') ?: false}, + "jupyter_token" : ${ext.getParameterValue('jupyterToken') ?: UUID.randomUUID().toString()}, "is_spot" : ${ext.getParameterValue('isSpot') ?: false}, "min_cores": ${ext.getParameterValue('minCores') ?: 0}, "max_cores": ${ext.getParameterValue('maxCores') ?: 0}, diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index d6bd214d659..774b23617c0 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -15,6 +15,8 @@ - cd /home/ubuntu/git/beam - ''' +JUPYTER_RUN = 'sudo /home/ubuntu/install-and-run-jupyter.sh' + HELICS_OUTPUT_MOVE_TO_BEAM_OUTPUT = ''' - opth="output" - echo $opth @@ -119,7 +121,13 @@ sleep 5s cd - path: /home/ubuntu/install-and-run-helics-scripts.sh - + - content: | + #!/bin/bash + - pip install setuptools + - pip install jupyter + - JUPYTER_TOKEN=$JUPYTER_TOKEN jupyter-notebook --allow-root --no-browser --ip=$(ec2metadata --public-hostname) + path: /home/ubuntu/install-and-run-jupyter.sh + runcmd: - cd /home/ubuntu/git - sudo rm -rf beam @@ -202,6 +210,7 @@ - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$start_json" - chmod +x /tmp/slack.sh - chmod +x /home/ubuntu/install-and-run-helics-scripts.sh + - chmod +x /home/ubuntu/install-and-run-jupyter.sh - echo "notification sent..." - echo "notification saved..." - crontab /tmp/slack_notification @@ -715,6 +724,9 @@ def get_param(param_name): end_script = event.get('end_script', END_SCRIPT_DEFAULT) run_grafana = event.get('run_grafana', False) run_helics = event.get('run_helics', False) + run_jupyter = event.get('run_jupyter', False) + jupyter_token = event.get('jupyter_token', '') + profiler_type = event.get('profiler_type', 'null') budget_override = event.get('budget_override', False) @@ -755,6 +767,9 @@ def get_param(param_name): if run_helics: selected_script = HELICS_RUN + selected_script + HELICS_OUTPUT_MOVE_TO_BEAM_OUTPUT + if run_jupyter: + selected_script = JUPYTER_RUN + selected_script + params = configs if s3_publish: selected_script += S3_PUBLISH_SCRIPT @@ -807,7 +822,8 @@ def get_param(param_name): .replace('$SLACK_HOOK_WITH_TOKEN', os.environ['SLACK_HOOK_WITH_TOKEN']) \ .replace('$SLACK_TOKEN', os.environ['SLACK_TOKEN']) \ .replace('$SLACK_CHANNEL', os.environ['SLACK_CHANNEL']) \ - .replace('$SHEET_ID', os.environ['SHEET_ID']) + .replace('$SHEET_ID', os.environ['SHEET_ID']) \ + .replace('$JUPYTER_TOKEN', jupyter_token) if is_spot: min_cores = event.get('min_cores', 0) max_cores = event.get('max_cores', 0) @@ -825,6 +841,9 @@ def get_param(param_name): if run_helics: txt += ' Helics scripts with recorder will be run in parallel with BEAM.' + if run_jupyter: + txt += ' Jupyter will be run in parallel with BEAM. Url: http://{dns}:8888/?token={token}'.format(dns=host, token=jupyter_token) + runNum += 1 else: txt = 'Unable to start bach for branch/commit {branch}/{commit}. '.format(branch=branch, commit=commit_id) diff --git a/gradle.deploy.properties b/gradle.deploy.properties index 15607d177b0..f6cdd83d639 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -11,6 +11,9 @@ dataBranch=develop shutdownBehaviour=terminate s3Backup=true +# Run Jupyter Notebook together with BEAM +runJupyter = false + # forcedMaxRAM=700 # storageSize (in GiB) = any number between 64 and 256 storageSize=128 From 6c1585301741af5dfe6ff9953556aa10a253008f Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 5 Jul 2022 16:00:21 +0300 Subject: [PATCH 205/307] a script to display cpu and ram usage collected during simulation on AWS --- jupyter/utility/cpu_ram_display.ipynb | 205 ++++++++++++++++++++++++++ jupyter/utility/cpu_ram_display.py | 51 +++++++ 2 files changed, 256 insertions(+) create mode 100644 jupyter/utility/cpu_ram_display.ipynb create mode 100644 jupyter/utility/cpu_ram_display.py diff --git a/jupyter/utility/cpu_ram_display.ipynb b/jupyter/utility/cpu_ram_display.ipynb new file mode 100644 index 00000000000..2bba7d111f2 --- /dev/null +++ b/jupyter/utility/cpu_ram_display.ipynb @@ -0,0 +1,205 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "3346f4cd-f751-48c4-b49e-1e44b8f0bad5", + "metadata": {}, + "outputs": [], + "source": [ + "import matplotlib.pyplot as plt\n", + "import pandas as pd\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "pd.set_option('display.max_rows', 500)\n", + "pd.set_option('display.max_columns', 500)\n", + "pd.set_option('display.width', 1000)" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "8b7a6a9d-c112-4b92-bb7c-944c61b02096", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(392, 5)\n" + ] + }, + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
datetimeCPU usageRAM usedRAM available
02022-07-0509:47:574061
12022-07-0509:48:206061
22022-07-0509:48:428061
32022-07-0509:49:0426160
42022-07-0509:49:2620160
\n", + "
" + ], + "text/plain": [ + " date time CPU usage RAM used RAM available\n", + "0 2022-07-05 09:47:57 4 0 61\n", + "1 2022-07-05 09:48:20 6 0 61\n", + "2 2022-07-05 09:48:42 8 0 61\n", + "3 2022-07-05 09:49:04 26 1 60\n", + "4 2022-07-05 09:49:26 20 1 60" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "log_url = \"https://beam-outputs.s3.amazonaws.com/output/sf-light/sf-light-1k-xml-warmstart__2022-07-05_09-52-48_gsw/cpu_ram_usage.csv.gz\"\n", + "cpu_ram_log = pd.read_csv(log_url)\n", + "print(cpu_ram_log.shape)\n", + "cpu_ram_log.head()" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "id": "109228bc-bce3-4e4a-abe9-6b46e8f989c0", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 27, + "metadata": {}, + "output_type": "execute_result" + }, + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAABM8AAAHICAYAAABZKs3RAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAEAAElEQVR4nOydd5gUVdrFT03OkRniIDkjKoIEI+YcEHPOYQVBcF1d3fVb18AgKKYVI4qowKoouuZVV4xElSAoQXIcJjGpe+r7486drq6p6q6qrp6uGc7vefqZ6VR9u7rqhlPnfV9FVVUQQgghhBBCCCGEEEKaEhfrBhBCCCGEEEIIIYQQ4lUonhFCCCGEEEIIIYQQYgLFM0IIIYQQQgghhBBCTKB4RgghhBBCCCGEEEKICRTPCCGEEEIIIYQQQggxgeIZIYQQQgghhBBCCCEmJMS6AYQQQgghhBBCCCGtlcWLFxcmJCQ8D2AAaGLyIvUAfvH5fNcNHjx4p9ELKJ4RQgghhBBCCCGERImEhITn27Vr17egoKAkLi5OjXV7SDD19fXKrl27+m3fvv15AGcZvYaKJyGEEEIIIYQQQkj0GFBQUFBG4cybxMXFqQUFBaUQzkDj1zRjewghhBBCCCGEEEIONOIonHmbht/HVCOjeEYIIYQQQgghhBDSivnjjz8SzjjjjG5FRUUDunfv3v+YY47p8dNPPyX/+uuvSSkpKYf16dOnX/fu3ftfcsklnf1+PxYsWJB53HHH9dBuY/To0V1eeuml3Fh9h1jCnGeEEEIIIYQQQgghrZT6+nqcddZZPS655JI9CxYsWAcA33zzTerWrVsTu3btWltUVFSzevXqlXV1dRg+fHjvWbNm5eTn5/tj3W4vQecZIYQQQgghhBBCSCtlwYIFmQkJCeqdd965Sz42YsSIqlNOOaVC+7rExEQMHTq0Yu3atcl2tj906NDeX331VRoAbNu2LaFjx44DAWDRokUpAwcO7NunT59+vXr16vfzzz8nA8AJJ5zQvX///n179OjRf8qUKW3kdqZNm9amS5cuA4YOHdr7oosuOuiKK67oDABbt25NOPnkk7sPGDCg74ABA/p+/PHH6c73hjPoPCOEEEIIIYQQQghppfz000+pgwYN2h/udeXl5XFfffVV1n333bfFjc994oknCm655ZYdN998897q6mrF5/MBAF577bUNbdu29VdUVCiHHnpov8suu6ykuro6bsqUKe2XLFmyMicnp37EiBG9+vfvXwUAN954Y9GECRN2nHzyyRVr165NOvnkk3uuW7duhRtttArFM0IIIYQQQgghhJBm4JprUPTLL0hzc5sDBmD/iy9ik9P3b9q0KblPnz79FEXBqaeeuu+CCy4oe//99zOMXqsoiuXCB8OHD6+cMmVK+82bNydddNFFJQMHDqwBgEceeaTt+++/nwMA27dvT1yxYkXK1q1bE4844ojytm3b+gHg3HPPLVmzZk0KACxcuDBr7dq1qXK7FRUV8SUlJXG5ubn1Tr+zXSieEUIIIYQQQgghhLRSBg4cWPXOO++YJvqXOc+0jxUWFvpKS0uDNKOSkpKEgoICn/79CQkJqt8vUqTt379fkY/fdNNNe4866qjKt99+O/vUU0/t9fTTT2+Ii4vDl19+mblo0aLVmZmZ9UOHDu1dVVUVp6rmmpyqqli0aNGqjIyMmFUspXhGCCGEEEIIIYQQ0gxE4hBzyplnnll+7733Ko8++mibO+64YzcAfPnll2kVFRVxPXr0qDV6z4ABA2p27NiRuGTJkpTDDjuses2aNUmrV69OHTZsWJX+tUVFRTU//PBD+nHHHbf/tddeaxTpVq5cmdS3b9+a/v3771y3bl3ysmXLUrt161abnZ3tz8zMrF+6dGnK8uXL0wHgqKOOqvzLX/5StGvXrvicnBz//Pnzc/v27VsFAEceeWTZI488UviPf/xjByCKHYwYMaJJO6IJxTNCCCGEEEIIIYSQVkpcXBzefffd32+55Zaixx57rF1ycrLaqVOnmieeeMJUyEtNTVVfeumldVdffXWXmpqauISEBPWpp57aaFSF86677tpx4YUXdnvjjTfyjzrqqDL5+Kuvvpo3d+7c/ISEBLWgoKDuoYce2pqVlVU/Y8aMgl69evXr3r179aBBgyoBoGvXrnXjx4/fNmTIkL6FhYV1vXr1qsrOzvYDwIwZMzZdd911nXv16tXP7/crRxxxRPmIESP+iMa+MkMJZY0jhBBCCCGEEEIIIc5Zvnz5hkGDBu2OdTu8TmlpaVx2dnZ9XV0dTj755B5XXXXV7iuuuGJfc33+8uXL2wwaNKiL0XNxzdUIQgghhBBCCCGEEEKMmDRpUoc+ffr069WrV//OnTvXXHbZZfti3SYJwzYJIYQQQgghhBBCSEyZMWPG5li3wQw6zwghhBBCCCGEEEIIMYHiGSGEEEIIIYQQQgghJlA8I4QQQgghhBBCCCHEBIpnhBBCCCGEEEIIIYSYQPGMEEIIIYQQQgghpBUTHx8/uE+fPv169uzZf9SoUT12794dr32+d+/e/c4888yu2sdGjx7dJTU19dCSkpJG7ejqq68uUhRl8LZt25qlAOXo0aO7vPTSS7nN8VmhoHhGCCGEEEIIIYQQ0opJTk6uX7169cq1a9euyMnJ8RUXFxfI55YsWZKiqiq+//77zLKysiCdqKioqOb111/PAQC/34+FCxdmFhYW1jVz82MOxTNCCCGEEEIIIYSQA4Rhw4ZVbtmyJUnenzlzZt4FF1yw5+ijjy6TQplk9OjRe+fNm5cHAO+//37mkCFDKhISElSj7aalpR0q/3/ppZdyR48e3QUAXnzxxdyePXv27927d7/DDz+8NwD4fD7ceOONnQYMGNC3V69e/YqLi9sAQH19Pa644orO3bt373/sscf22L17d7M43MJB8YwQQgghhBBCCCHkAMDn8+G///1v5jnnnLNPPjZ//vy8K664ouSSSy7Z++abb+ZpX9+rV6+aPXv2JOzatSt+9uzZeZdccsleu5/58MMPt//444/X/Prrrys//PDD3wDgsccea5Odne3/5ZdfVi1fvnzVzJkzC1avXp306quv5vz222/Jv/7664qXX35545IlSzIi/tIu4AkFjxBCCCGEEEIIIaTVc801RfjllzRXtzlgwH68+OKmUC+pqamJ69OnT78tW7YkDRgwYP8555xTBgBffvllWl5enq9Xr1613bp1q7355pu77Nq1K76goMAv33vmmWeWvPjii3lLlixJf+211zbabd7hhx9ecemll3YZPXp0yaWXXloCAJ9++mnW6tWr0959991cACgvL49fuXJlypdffpl5wQUX7E1ISECXLl3qhg8fXm7386IBnWeEEEIIIYQQQgghrRiZ82zDhg0/19bWKg8//HAhALz66qt569atS+nYsePAgw46aGBlZWX8q6++GpSg/8orryx5+OGHOxxzzDFl8fHxxh8AQFGUxv+rqqoa78yePfuPBx54YOumTZuSDjnkkP7bt2+PV1VVefTRR/9YvXr1ytWrV6/csmXLz+edd16Zfjtegc4zQgghhBBCCCGEkOYgjEMs2uTn5/unT5/+x/nnn9/jjjvu2LVgwYK8pUuXrujatWsdALz33nuZDz74YPsJEybslu/p2bNn7d13373ltNNOC+kCy8/Pr1uyZEnKoEGDqufPn5+bkZHhB4AVK1Ykjxo1qnLUqFGVH330Uc66deuSTjzxxNJnnnmm4IwzzihPTk5Wf/rpp+QuXbrUHXPMMeXPPfdcwa233rpny5Ytid99913mxRdfbDtU1G0onhFCCCGEEEIIIYQcIIwcObKqb9++VS+++GJu27Zta6VwBgCnnnpq+TXXXNN148aNidr3TJo0aXfTLQVz//33bzn77LN7tG/fvq5Pnz5VlZWVcQAwfvz4Ths2bEhWVVU58sgjy4YNG1Z1xBFHVG3YsCF54MCBfVVVVfLy8uo++OCD3y+//PJ9n332WVbv3r37d+3atXro0KGeCNtUVNWwSAIhhBBCCCGEEEIIiZDly5dvGDRoUFjxicSW5cuXtxk0aFAXo+eY84wQQgghhBBCCCGEEBMonhFCCCGEEEIIIYQQYkKLyHkWFxenpqamxroZhBBCCCGEEEIIIbZ466234Pf7D4p1O4yor6/H4YcfvjjW7fA6LUI8S01NRWVlZaybQQghhBBCCCGEEGKLVatWoW/fvrFuhiGLFy+uj3UbWgIM2ySEEEIIIYQQQgghxASKZ4QQQgghhBBCCCGEmEDxjBBCCCGEEEIIIaQVEx8fj0MOOQQDBgzAmWeeiX379gU937t3735nnnlmV+1jo0eP7pKamnpoSUlJo3Z09dVXFymKMnjbtm1RSwN24YUXHrR48eIUAOjYsePAcJ+VlpZ2qNHjo0eP7vLSSy/lutEmimeEEEIIIYQQQgghrZjU1FQsW7YMv/zyC/Ly8vDUU081PrdkyZIUVVXx/fffZ5aVlQXpREVFRTWvv/56DgD4/X4sXLgws7CwsC6abX3zzTc3Dh48uDqan2EXimeEEEIIIYQQQgghBwjDhw/Hli1bGu/PnDkz74ILLthz9NFHl0mhTDJ69Oi98+bNywOA999/P3PIkCEVCQkJqtF2L7300s4DBgzo26NHj/7jx4/vAABz5szJOu2007rJ1yxYsCBz1KhRPcxeDwBDhw7t/dVXX6Xpt3/CCSd079+/f98ePXr0nzJlShvtc9dff32nfv369R0+fHivrVu3NnGq/e9//0sbMmRI7/79+/c98sgje27cuDHR2t4SUDwjhBBCCCGEEEIIOQDw+/347LPPcNZZZzU+Nn/+/Lwrrrii5JJLLtn75ptv5mlf36tXr5o9e/Yk7Nq1K3727Nl5l1xyyV6zbU+dOnXLL7/8smr16tUrFi5cmPn999+nnnvuuWVLly5Nl462119/Pff888/fa/b6UG1/7bXXNqxYsWLVsmXLVj777LNtt2/fHg8AVVVVcYcddtj+lStXrho5cmT5XXfd1UH7vpqaGmXs2LGd58+f//uKFStWXXnllbsnTpzY0c5+i1qMKiGEEEIIIYQQQggJcPuHt2PZ9mWubvOQdofgsVMeC/maqqoqHHLIIdiwYQMGDx6ME088EQCwYsUK5OXl+Xr16lXbrVu32ptvvrnLrl274gsKCvzyvWeeeWbJiy++mLdkyZL01157baPZZ8ycOTPv5ZdfbuPz+ZRdu3YlLl++POWII46oOvbYY8veeOON7Kuvvrrk888/z37yySc3h3q92fYfeeSRtu+//34OAGzfvj1xxYoVKe3atauMi4vDddddtxcArrnmmj3nnXdeD+37fvrpp+S1a9emjho1qhcA1NfXo6CgwFboKcUzQgghhBBCCCGEkFaMzHlWWlqKM844A0899RTGjh2Ljz76SFm3bl1Kx44dBwJAZWVl/Kuvvpo7YcKE3fK9V155ZcnQoUP7nn/++Xvi4+MNt7969eqkJ598su3ixYtXFRQU+EePHt2luro6DgAuuuiivU899VRhmzZt/AcffPD+3Nzc+lCvN2LBggWZX375ZeaiRYtWZ2Zm1g8dOrR3VVWV4esVRQm6r6qq0qNHj6ply5attr/nBBTPCCGEEEIIIYQQQpqBcA6xaJOdnY3p06fj7LPPxo033ohPP/1UWbp06YquXbvWAcB7772X+eCDD7bXimc9e/asvfvuu7ecdtpp5WbbLSkpiU9NTa3Py8vzb9q0KeGLL77IPuaYY8oB4PTTTy+/5ZZbujz33HNtxowZszfc643Yt29ffHZ2tj8zM7N+6dKlKcuXL0+Xz9XX1+Oll17KveGGG0pefvnl/KFDhwZt5+CDD67eu3dvwqeffpp+wgknVNbU1Cg///xz8uGHH265KAHFM0IIIYQQQgghhJADhEMPPRSDBg3CnDlzUFhYCCmcAcCpp55afs0113TVJ9SfNGnS7qZbCjB8+PCqAQMG7O/Zs2f/zp071wwePLhCPpeQkIDjjz++dN68eflz5szZEO71RowePbp0xowZBb169erXvXv36kGDBlXK51JTU+tXrFiR2r9//3aZmZn+t956a532vSkpKeobb7zx+9ixYzuXl5fH+/1+5eabb95hRzxTVNWwSIKnSE9PVysrK8O/kBBCCCGEEEIIIcRDrFq1Cn379o11MwxZvHhx/eDBg5fGuh1eYPny5W0GDRrUxeg5VtskhBBCCCGEEEIIIcQEimeEEEIIIYQQQgghhJhA8YwQQgghhBBCCCGEEBNYMKCZ8NX7sHq3cVXUnnk9kZyQ3MwtIoQQQgghhBBCvEd9PVBRAWRlxbol7qGqKhRFiXUziAn19fUKgHqz5ymeNROl1aUY+MxAw+cuHXgpZp03q5lbRAghhBBCCCGEeI/Zs4HbbgO2bweSW4HPJCUlBXv27EF+fj4FNA9SX1+v7Nq1KxvAL2avoXjWTGQkZWDumLlNHn9n9Tt4/ZfX8Y/j/oGuuV1j0DJCCCGEEEIIIcQ7bN0K7NsH7N/fOsSzTp06YfPmzdi1a1esm9KE3bt3K8uXL28T63bEmHoAv/h8vuvMXkDxrJlITkjG+f3Ob/L48E7DMWfFHEz7bhqmnzo9Bi0jhBBCCCGEEEK8Q31D8JzPF9t2uEViYiK6dvWmWaZfv35Vqqp2CfUaRVFyADwPYAAAFcA1AH4F8CaALgA2ALhAVdWSKDY1prBgQIzpmNURlx58KV5Y+gL27N8T6+YQYovaWuC332LdCkIIIYQQQkhrorWJZ62AxwF8qKpqHwCDAKwCcBeAz1RV7Qngs4b7rRaKZx5g4vCJ2F+3H88seibWTSHEFq++CgwcKOzUhBBCCCGEEOIGFM+8g6IoWQCOBvACAKiqWquq6j4AZwOY2fCymQDOiUX7mguGbXqA/oX9cVrP0zD9++mo89fZem9WchbGHjEWifGJUWodIeaUlADV1UI8S0uLdWsIIYQQQgghrQEpntXZWx6T6NANwC4ALymKMgjAYgDjALRVVXUbAKiquk1RlMIYtjHqUDzzCH896q8Y9coo/N9X/2f7vflp+bjqkKvcbxQhYZCDWm1tbNtBCCGEEEIIaT3QedasJCiKskhzf4aqqjO0zwM4DMBtqqp+ryjK42jlIZpGUDzzCMOLhqPqnipb71FVFYc8ewimfDMFVw66kiVvSbPjxStCX3wBDBsGpKTEuiWEEEIIIYQQJ1A8a1Z8qqoeHuL5zQA2q6r6fcP9eRDi2Q5FUdo3uM7aA9gZ7YbGEuY8a8EoioKJwydixa4V+M9v/4l1c8gBiNfEsx07gOOOA+bNi3VLCCGEEEIIIU7x+8Vfr6wzDmRUVd0OYJOiKL0bHjoewEoA7wK4suGxKwHMj0Hzmg2KZy2ciwZchE5ZnTB54eRYN4UcgHhNPKtqMG+Wl8e2HYQQQgghhBDn0HnmOW4D8JqiKD8BOATAgwAeBnCioihrAZzYcL/VwrDNFk5ifCJuP+J2TPxkIn7c8iOGdBwS6yaRAwiviWdeaw8hhBBCCCHEPhTPvIWqqssAGIV2Ht/MTYkZdJ61Aq4ffD2ykrNQ/E1xrJtCDjC8ZqeW7WEBA0IIIYQQQlouFM+I16B41grISs7CTYNvwr9X/RvrStbFujnkAMJr1TbpPCOEEEIIIaTlw3k98RoUz1oJ44aNQ7wSj6nfTo11U8gBhNcGNa+1hxBCCCGEEGIfOs+I16B41krokNkBlx18GV5c+iJ2798d6+aQAwSviVVec8IRQgghhBBC7EPxjHgNimetiIkjJqLKV4Wnf3w61k0hBwheFc+80h5CCCGEEEKIfSieEa/BaputiH4F/XB6z9PxxA9P4Nw+5yIhzvjnzU7JRofMDs3cOtIa8ZpY5bX2EEIIIYQQQuzjtcJkhFA8a2XcOfJOHPPyMTj4XwebviZOicOGcRtQlF3UjC0jrRGviVWstkkIIYQQQkjLh84z4jUonrUyjj7oaHxy+SfYs3+P4fNr9qzBfV/ch1/3/ErxjESM18Qqr4l5hBBCCCGEEPtQPCNeg+JZK+SEbieYPreuZB3u++I+bCrd1IwtIq0Vr4lVXmsPIYQQQgghxD6c1xOvwYIBBxgdMzsCAP4o/SPGLSGtAa8Naqy2SQghhBBCSMuHzjPiNSieHWAkJySjXUY7bCqj84xEjlfFM6+0hxBCCCGEEGIfimfEa1A8OwApyiqieEZcwWtiFavyEEIIIYQQ0vKheEa8BsWzA5Ci7CLmPCOu4LUwSa+1hxBCCCGEEGIfXhQnXoPi2QFI56zO+KP0D6iqGuumkBaO15xnXmsPIYQQQgghxD50nhGvQfHsAKQouwiVdZXYV70v1k0hLRyviVVeaw8hhBBCCCHEPhTPiNegeHYAUpRVBADMe0Yixmt2aoZtEkIIIYQQ0vKheEa8BsWzA5CibCGe/VH6R4xbQlo6XnN6eU3MI4QQQgghhNjHa+sMQiieHYB0zu4MACwaQCLGa4Oa19pDCCGEEEIIsQ+dZ8RrUDw7AGmb3hYJcQkM2yQR47UwSa+1hxBCCCGEEGIfimfEa1A8OwCJj4tHx8yODNskEeM1p5fX2kMIIYQQQgixD+f1xGtQPDtA6Zzdmc4zEjFeG9ToPCOEEEIIIaTlI3MZ03lGvALFswOUouwi5jwjEeM18YwFAwghhBBCCGn5MGyTeA2KZwcoRVlF2Fy2GfVqfaybQlowXhOrvCbmEUIIIYQQQuxD8Yx4DYpnByidszujrr4OOyp2xLoppAXjtTBJr7WHEEIIIYQQYh9eFCdeg+LZAUpRVhEAMO8ZiQivDWpeaw8hhBBCCCHEPnSeEa9B8ewApSi7QTxj3jMSAV4Tq7zWHkIIIYQQQoh9KJ4Rr0Hx7ABFOs/+KP0jxi0hLRmviVXasE1VjW1bCCGEEEIIIc6geEa8BsWzA5S81DykJaYxbJNEhNfEM1nAQP8/IYQQQgghpOXgtcJkhFA8O0BRFAVFWUUUz0hEeE08q9cUj/VKmwghhBBCCCH2oPOMeA2KZwcw/Qr64X8b/4caX02sm0JaKF6rbqkVz7zSJkIIIYQQQog9KJ4Rr0Hx7ADmliG3YEflDsz6aVasm0JaKF6zU9N5RgghhBBCSMvHaxEuhFA8O4A5vuvxOLTdoSj+phj1an34NxCiw2uDGsUzQgghhBBCWj50nhGvQfHsAEZRFEwaMQm/7vkVC9YsiHVzSAvEa+KZtkgAwzYJIYQQQghpmVA8I16D4tkBzpj+Y3BQ9kEo/qY41k0hLRCviWd0nhFCCCGEENLyoXhGvAbFswOchLgEjB82Hl//8TV+3PJjrJtDWhgUzwghhBBCCCFu47XcyoRQPCM4p885AICfdvwU24aQFgerbRJCCCGEEELchs4z4jWiKp4pijJeUZQViqL8oijK64qipCiKkqcoyieKoqxt+JsbzTaQ8OSmip+gpLokxi0hLQ06zwghhBBCCCFuQ/GMeI2oiWeKonQEMBbA4aqqDgAQD+AiAHcB+ExV1Z4APmu4T2JIZlIm4pV47KveF+umkBaG1+zU2oIBXmkTIYQQQgghxB4Uz4jXiHbYZgKAVEVREgCkAdgK4GwAMxuenwngnCi3gYRBURTkpOSgpIrOM2IPLzvPGLZJCCGEEEJIy8Rr6wxCoiaeqaq6BcAUAH8A2AagVFXVjwG0VVV1W8NrtgEojFYbiHVyUnIYtkls47VBjWGbhBBCCCGEtHzoPCNeI5phm7kQLrOuADoASFcU5TIb779BUZRFiqIs8vGMiTq5qbkUz4ht5KBWXx8cMhkrKJ4RQgghhBDS8qF4RrxGNMM2TwCwXlXVXaqq1gF4C8AIADsURWkPAA1/dxq9WVXVGaqqHq6q6uEJCQlRbCYBgNyUXOY8I7bxmljFsE1CCCGEEEJaPl6LcCEkmuLZHwCGKYqSpiiKAuB4AKsAvAvgyobXXAlgfhTbQCzCnGfECV4Tz1gwgBBCCCGEkJaPnNfTeUa8QtQsXaqqfq8oyjwASwD4ACwFMANABoA5iqJcCyGwjYlWG4h1clMYtkns4zXxzGvtIYQQQgghhNiHYZvEa0Q1HlJV1b8B+Jvu4RoIFxrxELmpuSipKoGqqhBGQULC4zWximGbhBBCCCGEtHwonhGvEc2wTdKCyE3JRV19Hap8VbFuCmlBeC1M0mtiHiGEEEIIIcQ+zHlGvAbFMwJA5DwDwLxnxBb19UB8vPjfC04vimeEEEIIIYS0fOS83u8HVDW2bSEEoHhGGshNzQUA5j3zOA89BDz6aKxbEaC+HkhOFv97QazSOuG8IOYRQkhzs3IlcPLJQBWN5IQQQlow2ovi2jk+IbGC4hkBIMI2ATrPvM78+cC778a6FQG8Jp7ReUYIOdD5/nvg44+BjRtj3RJCCCHEOdp5PfOexR5FUTYoivKzoijLFEVZ1PBYnqIonyiKsrbhb26s2xlNKJ4RAIGwzX3V+2LaDhKa2lqgpibWrQjgRfHMS+0hhJDmRi426DwjhBDSkvFabmUCADhOVdVDVFU9vOH+XQA+U1W1J4DPGu63WiieEQAM22wpeFE8S0kR/3thUNOKZwzbJIQciMjFBsUzQgghLZn6eiApSfxP55lnORvAzIb/ZwI4J3ZNiT4UzwgAhm22FLwonnlJrKqvBxITgbg4b4h5hBDS3FA8s05lJdC/P/Dtt7FuCSGEED0UzzyHCuBjRVEWK4pyQ8NjbVVV3QYADX8LY9a6ZiAh1g0g3iA7JRsAnWdep7bWWwkz/X7vOc/i44WA5oX2EEJIc8OwTevs3CkKLCxeDAwfHuvWEEII0aIVzzivjzoJMo9ZAzNUVZ2he81IVVW3KopSCOATRVFWN2P7PAHFMwIASIhLQGZSJnOeeZzaWuGq8gpeyzHm94v9k5TkDSccIYQ0N3SeWUcKjeXlsW0HIYSQptB51qz4NHnMDFFVdWvD352KorwNYCiAHYqitFdVdZuiKO0B7GyGtsYMDy3DSazJTc2l88zjeDls0wviWX29EM/oPLOGqoobIaT1QPHMOnJfUTwjhBDvoV1nUDyLLYqipCuKkin/B3ASgF8AvAvgyoaXXQlgfmxa2DzQeUYayU3JZc4zj+M1N5UXCwZQPLPOqFHAyJHAAw/EuiWEELdg2KZ1KJ4RQog3kRd46TzzDG0BvK0oCiA0pNmqqn6oKMqPAOYoinItgD8AjIlhG6MOxTPSSE5KDp1nHqe21ltOIa86zxi2aY1164C2bWPdCkKIm9B5Zh25r8rKYtsOQgghwcgLQV5aZxzIqKq6DsAgg8f3ADi++VsUGxi2SRrJTc1lzjOPU1cnRCE5oMQaL1bbpPPMOn4/UF0d61YQQtyE4pl1mPOMEEK8iV48o/OMeAGKZ6QRhm16G78/MJB4QagCvOc88/tZbdMOFM8IaX0wbNM6DNskhBBvIscyhm0SL0HxjDSSm8KCAV5GK5h5pWiA3+8t8Yxhm/aor6d4Rkhrg84z61A8I4QQb0LxjHgRimekkZyUHOyv249aP1UHL+I18UzmXmPBgJaL3++NY4kQ4h4Uz6zDsE1CCPEmevGM83riBSiekUZyU3MBgHnPPIrXxDM5qFE8a7kwbJOQ1gfDNq1D5xkhhHgT5jwjXoTiGWkkN0WIZ8x75k28Kp4xbLPlwrBNQlofdJ5Zh+IZIYR4E4ZtEi9C8Yw0kpOSAwDMe+ZRvC6eeUGsYsEAe9B5Rkjrg+KZdeQ4VlYWSEVACCEk9jBsk3gRimekEYZtehuvi2deGNQYtmkPimeEtD4YtmkdKTTW13N/EUKIl5D9M8M2iZegeEYaYdimt/GqeJaQIAQrL4hVDNu0BwsGENL6oPPMOnJfAQzdJIQQL8GcZ8SLUDwjjUjnGcM2vYlWDPKCW0gOalKs8pJ4RueZNZjzjJDWB8Uz68hxDKB4RgghXoI5z4gXoXhGGmnMeUbnmSfRikFecAvJBZqXxCqKZ/aQYZvM9UNI64Fhm9ah84wQQrwJc54RL0LxjDSSkpCClIQU5jzzKF4N25QJ+r0QJikLBjBsMzzy91NVTkgIaU3QeWYdimeEEOJN6DwjXoTiGQkiNyWXYZsexavimZecXnSeWUcbruSF44kQ4g4Uz6zDsE1CCPEmzHlGvAjFMxJEbirFM69C8Sw8FM+so3VcMO8ZIa0Hhm1ah84zQgjxJnSeES9C8YwEkZOSw5xnHsXL4pnXCgYwbDM8FM8IaZ3QeWYdbT9YVha7dhBCCAlG9s/SeeaFdQYhFM9IELkpucx55lG8LJ55xelF55l1KJ4R0jqR5zaLgYSHYZuEEOJNGLZJvAjFMxIEwza9C8Wz8GidZ15oj5dhzjNCWifac5vCeGgYtkkIId6EYZvEi1A8I0HkpuRiz/49UHm52nN4TTyTiw4pnnkhTFJW25Tt4WFsDp1nhLROtOc2QzdDQ/GMEEK8iV4840Vx4gUonpEguuZ0RXltOXbt3xXrphAdWnHKC2KHHNSkWOWFQU0btgkEL4xIMBTPCGmdUDyzDsM2CSHEm9B5RrwIxTMSRO82vQEAv+7+NcYtIXq04pQXnGdeD9sEvOGG8yoM7SKkdaI9tymehUYKjUlJFM8IIcRLUDwjXoTiGQmiT5s+AIBf91A88xpSCFIU74lnXskxpneeeaFNXkXrTvHC8UQIcQc6z6wj91VODsUzQgjxEtoIl/h4imfEG1A8I0H8tvggxKvJdJ55ECmeZWR4Q+zwsvOM4ll4GLZJSOuE4pl15DiWnU3xjBBCvIR2nZGQwDk98QYJsW4A8RbvzY+Hv74HVu2ieOY1pHiWmelN8cwLIZKyYADDNsND8YyQ1gnDNq2jdZ6VlcW0KYQQQjRoC5MlJHjEeaaqwGuvAbt3i/vx8cBtt8W2TaRZoXhGgqipAVDaGyt2/BLrphAdtbVi8EhJ8aZ45oUrQnSeWYc5zwhpndB5Zh2teLZuXUybQgghRIO+MJknxLMPPwQuvzxwPymJ4tkBBsM2SRC1tQD29MaminWo81N58BK1taKPTk6meGYGxTPr0HlGSOvE7xfjBEDxLBxyHGPOM0II8Rb6sE1PiGeTJwMdOwK7dgElJcCOHbFuEWlmKJ6RIGpqAOzuDb/qw7oSXob1El4Tz7R2aq8VDGDYZnhYMICQ1kl9PZCeLv6neBYaFgwghLhBXR1wyinAd9/FuiWtB8/lPFu0CPjiC2D8eKBNGzFw5OTEuFGkuaF4RoKoqQGwpzcAVtz0GrW1wlGVkuINp5DeTh3zQQ10ntmBYZuEtE78flFYBqB4Fg6teFZV5RFnAyGkxbFjB/DRR8D338e6Ja0HfYRLzPvn4mIgKwu4/voYN4TEEopnJAjpPAPAipsew2vOMy+GbcqCARTPwsOwTUJaJxTPrKOttgkAFRWxawshpOUi+w7t3IpEhqfCNtetA+bNA266SQho5ICFBQNIEDU1AKpzEV9dQOeZx9CKZ6WlsW6NN6ttMmzTOhTPCGmdMGzTOlrnGSBCNxmFQwixC8Uz94l52OZvvwE33CAWx9u3i6vz48Y1cyOI16DzjAQhHU3q7t50nnmMujo6z8LBsE3rMOcZIa0Tv5/imVWMxDNCSOvn8suBf/zD3nsuvBB45BHj5yieuY82t3JMnGcPPAB8+y2QlgZ06yZ+/A4dmrkRxGvQeUaCkE6d+p29sWrXu7FtDAnCy2GbXisYQPEsPMx5RkjrRFbbTEigeBYObbVNACgri1lTCCHNyLff2j/ff/gBUFXj56TwTvHMPfS5lZtVPNuyBZg9W4RpTp/ejB9MvA6dZySImpqGEve7e2NP9S6UVJXEukmkAS+LZ15znjFsMzwM2ySkdVJfLxYbqakUz8Ih+0GZ84zOM0IODGpq7M+l/X7zPpXOM/eJac6zxx8XP+b48c34oaQlQPGMBFFTA/TqBWB3HwCsuOklvCaeae3U8oqQ2RW55mwTnWfWoHhGSOtE9oMUz8Ij91VmprhP8Sx2qKoHqumRAwYn4pnPR/GsOYlZzrPSUuBf/wLGjAG6dm2mDyUtBYpnJIiaGqB3bwB7RMXNH7f8iG3l24JuvnrObmKB18QzvZ0aiP3EVzouKJ6FRxu26YXjiRDiDrLqMMWz8Mgxg+JZ7PnXv4AePWLdCnKgUF1t/8Kh32/+Hopn7tMszrPycmDbtuDb9Oni8UmTovCBpKXDnGckiJoaEb7QPqUrdqjJGPvhWIz9cGzQa07tcSo+uPSDGLXwwKW2FsjI8J54pnV61dYG/o9Vmxi2aQ06zwhpnTBs0zp0nnmHDRuAjRvFeJSSEuvWkNaO22GbzHnmPvp1huvi2caNQN++xj/qqFHA4MEufyBpDVA8I0HInGfduyaiYOl/cMu9a4Ke/3bzt5i5fCaWbFuCw9ofFqNWHphI51lKijfEDiPxLNZOLxYMsI6c4CmKN44nQog7MGzTOtKlR/Es9siFcVkZxTMSXerrxZyazjNvo3eeuT5XnTZNLBSmTw9cdZeceqrLH0ZaCxTPSBC1tQ3iWXfgs8+Ow42HHxf0/IUDLsRbq97ClG+mYPbo2TFq5YGJdHUlJ4u+XgpFsUJfbROIvVgVDfFMVYGtW4GOHSPflpeQE7y0NIpnhLQmGLZpHenSk9VJKZ7FDq14VlgY27aQ1o2MSvBCwYAtW4D27WM7n/cq2tzKruc8KykBnn8euPhi4LbbXNwwae3wVCVBSOdZt26iQ9cvqnNScnDD4BswZ8UcbNy3MTaNPEDR5jyT92OJF51n0nHhZtjmhx8CXbqINAitCfn7pad7IwyYEOIODNu0jhwzFAXIyqJ4FkvkQrmsLLbtIK0fubaJtfNs3z5hVvj3v+2140BBm1vZ9ZxnzzwDVFYCEye6uFFyIEDxjDSiqgHnWbdu4v6GDU1fN+6IcVAUBdO+m9bsbTyQ0YtnsRY8vCieRaNgwM6dYsBubeIZnWeEtE4Ytmkd6dIDROgmhZvYIRfGpaWxbQdp/cj5czScZ3YEnn37RBs20otgSNRynlVXi1DNk08GDj7YpY2SAwWGbZJGpEtHimcAsG4d0KdP8OuKsotw8YCL8fyS5/G3Y/6G3NTc5m3oAUpdnffFMy+44dwW86TI1NocCfJ7paeLi2+EkNYBwzatIy+4AEI8a239fEtCG7ZJSDSJRDyrroaY7L7ySlAHO2oF0BHAkcsAPGFte2k7gT8B6PspgGR7bTkQ6L5Y7J/82cAZG4DtO2B534ZkxQpgxw5W0ySOoHhGGpGDSFJSsHhmxMQRE/HqT6/imUXP4O6j7m6eBobh99/F5Le15srwmvNMii9uO70iIRrVNs1CSX74QRTikQuvloYUP9PSgD17YtsWQoh7MGzTOtKlB1A8izUUz6yjqsB33wHDh8e6Jd5l926R1qpnz6bPRRK26fMB6rMzoIwNzpP1J/nPwoabBQrRoAV91HAjQQxuuOGfwLXywbEubXz4cFFRkxCbUDwjjUgxJjkZaNtWLKrNxLOD2x6Mk7ufjOnfT8eE4ROQkhD70kijRwOHHQa8+GKsWxIdvCaeHSgFA+SEXruo+u034IgjgPfeA844I/LPiAVa5xnDNglpPTBs0zr6sE2GDMYOimfWWbgQOOoo4McfgcMPj3VrvMnf/w58/DGwZk3T5+T82ecL7gNCUV8vRMt4+KBOnQpl2DBgwYLG5488Eli1Grj0EhERaIWffwaOPQ64+CLgySetvSeW1NYKc8WkScC4cdH/vDlzgJtvAX78AZgyRQjGS5a4tPHsbJHskhCbUDwjjWjFM0URHaSZeAYAk0ZMwgmvnoBZP83CdYdd1zyNDMG+fcD27bFuRfTwsnjmNeeZvEUrbHPHDvG3JTu2tDnPYn0sEULcg2Gb1tGHbW7eHNv2HMjIMYkCZnjk3GPzZopnZpSVma8JtBcMa2rEPCgc8vg8D28hbsN6YOqjQH5+4/NbqoG9AMoSAeQbbqIJVWniPdtqrb8nlmxcK77nTj+apb3V6WL/IF/8v1ttns8lJBQsGEAa0eY8A8KLZ6O6jsKh7Q7FlG+moF6tj34Dw1BX17qvWErxLKXB5BdrwcNr4pmqBi+EkpLcDdvUimfyOGvJC1Nt2GZ1tdh/hJCWD8M2raMN22S1zdhC55l15Hndki/gRRufT5zP9QbLE+382epcWswFVdyJyfB17QmcdVbQ806qbco5c0s55uWa0NWqlyHQrjMSEmJ/gZ4QgOIZ0aB1ngEB8cxsUa0oCiaNmIRf9/yK9359r3kaGQKfr+UMQHaprxffT+s8i3WonRfFM9keQLQpWs6z1iCeacM2VZWTEkJaC9qwTb+f53Yo9GGbFM8i4913ne/DA008W7gQWLnS2Xvl/M+L4llVFfDWW7FuRWCOI0UtLdr5s9W5tN8PHIsvcDgWo+SaO5rEesrj3ol41lLclr//Lv7a+Y6RID9HimfNJdoREgqKZ6QRI/GsshLYudP8PWP6j8FB2QfhpvdvwjEvHxN0O3/O+dhftz/6DW+gNTvP5ADr9bDNWFbb1LYHoHgWDq14BsRejCWEuIM2bBNo2f1UtNG6lXNzxSI21lWjWyq7dgFnnw3MmOHs/QeaeHb99cBJJ4mUI3bxsvPsvfdEDuKff45tO8yKPQE2nWcLFwKjRiH55GPwCq7AThRg16lXBL2kri6wHTvCkuxrWsoxL51nzSWeyXm9LExG8Yx4AYpnpBFttU0A6N5d/A0VupkQl4DHTnkMfdv0RZwS13jz1/vx71X/xsvLXo5qm7X4fC3n6o1d5ACbmOht8SyWDge9eBbNsE15nLXkRak25xkQ++OJEOIOUhCS53ZL7qeijTZss2tX4cL944/YtqmlIgUAp6LJgZbzrKQE2LIFmDDB/nu97DyTx8Fvv8W2HVJoMTqebIlnf/4zsGwZVCUOv6EHbsdjqEJq0EsqKwP/M2zTPfRhmxTPiBdgwQDSiJHzDBCdZahy2Of0OQfn9Dkn6DFVVTHshWGY+u1U3Dj4RsTHWShlEyF1dWIAU9XWV0BFikBecp5p7dReqLYZLeeZ0dXw1uA80+Y8A+g8I6S1oA3bBFp2PxVttGGb2jlPjx6xa1NLZX9DoIHTUMQDzXlWXi7y7L30EnD++cBpp1l/r5edZ3IuEerCe3MQynlmOWzz22+F8+yxx1B66TiMKhAP36LrU7WhoQeCeNbczjPmPCNegs4z0ohePOvSRfzVDoAffwx8/nn4bSmKgjtH3InfS37H26vfdrWdZtTViY52f/NFijYbocSzlSuBf//b3vZ+/hl4553I2qS3UwOxHdjkYC4XQgzbDA3DNglpnTBs0zrasE3ptpd5fYg9tOKZUZL2cBxI4pnfLy723nor0L+/COG0870jFc+++Qb46CNn7w2HnEvE+jxyJWyzuFjEc197bZBgpJ8vORXP5Ny+srL5BCmnqKpz8WzmTGeOXjrPvIeiKPGKoixVFGVBw/08RVE+URRlbcPf3Fi3MdpQPCON6KttpqQAHTsGi2c33wxce621ynzn9DkHPfJ6oPibYqhRLuWnqqEHypZOqJxnjz0G3HCDve09/rj99+g5kMM2KZ4RQryKttom0LL7qWijDdts107Me2LtmGmpSPGsstLZQvlAEs+k2NKmDfDQQ8DWrcCiRdbfH2nY5oMPAtdd5+y94Wg1zrM1a8RV5ltuATIyggQjfZ+qnR86cZ6ZtdNL7NnjrChCbS1w1VXAyy/b/0z9OsPvZ2V4DzAOwCrN/bsAfKaqak8AnzXcb9UwbJM0oneeASKMQV492rkzMBguWgQMGRJ6e/Fx8ZgwbAJu+eAW/Oe3/2BIh+A3ZKdkIyk+KWy7ymrKUOMzvzSUnpSORKQ13i8tBdq3D7vZFkUo59nu3fYXRzU1wN69kYW4HsgFA1pDzjN92Gasw4AJIe7AsE3raMM24+JE3rNYL/pbKlrX/4oVgegFq4TKUdXakPOJzEwgL0/8b8lVU1sLlJYifi/QBgB2NdyskpICZGairg7YvFncOuVWuhqyEbdHtK1kjc22uUz6ftGOms1N2yHbCAD1O5o+DwCYPFlMum+7DUDw7+OW80wvnuV62LOjdRLacYBp3XV20TvP5GfLNQdpXhRF6QTgdAD/BCCzNZ4N4NiG/2cC+ALAn5u7bc0JxTPSiJF41r078Mkn4v9vvw08PnduePEMAK465Crc98V9OH326U2e65XfCytuWYGEOPPD8LvN32HkiyNRr5rHAGQlZ+Gn69YCKATg/as3Tgglnu3ZIwZyO0JYXZ0Y4CsqxOTNCV53njFsMzR0nhHS+lBVcaPzzBrasE1AXDCkeOYMvXh2etNpX0i0TqHWmLtWi1Y8k8dfWEHC7wcOOwxYsQIPA3gYEKJPoY0Pjo8HfvgBPt9hAIDl8zeg0539XRXP7m64Yb3NtrnMW/KfCQgs8xu4seEGALggxEauvx5o2xYAQjrPpHgm3VFW0V5w9vraRdsvOhEInYhn2tzKFM88wWMA7gSgXTm2VVV1GwCoqrpNUZQYnvXNA8Uz0oi+2iYgJpJbtoiF9bffig7ryCOBOXOARx4JP7lJTUzFB5d8gB+2/BD0+MbSjSj+phhzV8zFxQMvbvK+mTPFePXMvoeQm5KL+4+933D7Vb4q3PnJnXh60ZMA/g+A9wcgJ2jFs5QU8b9WPFNVMUAlhTfyBW1v7153xDMvFgxg2GZo9NU2W4J4NneumPufd16sW9KyePJJseYaMcL+e7dtE2lfHnmEE1Y7LFsGzJ8P3Hdf84oA2lyUFM/Cow3bBMSc53//i6548/XXwOLFwLhx0dl+c1BWBvz978A//xk4zqT+EhfnrGiAFI/q6sT8Rs51WgMPPACMHg307Svuy/lEVlZAFAgrSLzzjlAlx4/Hy//rjh8bwjynTAFSrewrVQXuuQd45BH4/W8CADKfnyYmStOmudbBz5kDfPmV+P8f/xdw1jU3U6cCv68DTju1qZD7wQfA+x+I/6+7Fjj0UIMNxMcDY8Y03rUinmVnt/ywzTlzxPz5nHOCH5fiWceOzSeeGeVWZt6zqJKgKIo2gHyGqqozAEBRlDMA7FRVdbGiKMfGonFegeIZacQsbBMANmwQCUYPPRS44grg6quthW4CwJCOQzCkY/AL69V6vLfmPRR/U4yLBlwERTdL/cc/gM6HrcZ/+7+L+46+D7cOvdV0+1//8TWeW/YUkPhnoC7dMwOQmxg5z/Q5L2pqrItncjArKQEOOshZm7RilVx8eKFgQLSqbbZW8awlOc8eeUQsqCie2eMvfwEuvdSZePbKK2JdddllQoAj1njzTeDhh4FzzwUOPrj5PlfbD1I8C482bBMQc56yMnFhKT8/Op85ebIQ6FqyeLZwoegXzj4bOOYY8ZgUz/r3FxqPXbSL4rKy1iOeVVUB994rvt/f/y4es+08U1VxFaN7d6C4GO9dEI+3Gpa4E88T4caW2LQJmDIFhYeuQx6yMeSn54HLLgFuv93+FzPhoyXAiw3i2flHAscd59qmbTF3FvDdOiC5D3C6bgnx9Rbg6QbxbMRxwKGXht+elYIBOTnOxTOvhCtPnSqOSSPxrH17cczaEbDkd3RibjQL2yRRw6eq6uEmz40EcJaiKKcBSAGQpSjKLAA7FEVp3+A6aw9gZ3M1NlawYABpJJR49uuvQiwbPlxMlhIThQvEKXFKHO4YfgeWbl+Kz9c3Ld9ZUgKsyX8UKQkp+NPQP4Xc1qQRk1BSsxc49CUA3hmA3EQrnkmBrKZGzKekeGZH/NCKZ07xathmtKptVlcHtsecZ7Fh505nVy8PZGprxcTe6YRThuvvimHumpaIXBxHMk46QVt1mOJZePRhm9GuuKmq4pzyemW9cMj+RNsfy8Xx4Yc7q7ip7aNa0zzOKJebvACXmWnRefb118D33wMTJgDx8UHntK2iAePGAfHxGLN5Gm7GM0it34/asRNtbCA81dWBeWosQ6Dl/jQ6liwVDDDZHmBeMMCueObFsE2fD9i+venj69aJNWF8fPM7z7TiWSzXGQcyqqr+RVXVTqqqdgFwEYDPVVW9DMC7AK5seNmVAObHqInNBsUz0kgo8eztt8VgMXy4SGh54onC2htJ1ZPLDr4MbdPbYvI3k4Mer68HSnzbsLXwFVw16CoUpBeE3M7IziMxuHA4MPxRIM7nmQHITbTimaKIvzU1YlEsBxI74pncXiTimXaR5iXxLFphm0BggkTnWfOjqkLAoXhmD7mwciKeyYU+QPHMLrKviHSctAvDNu1hFLYJRG/R//vvoshPSxfPZPuNxLMhQ8T/Gzfa26bPFzhmW9M8zkjEMXKehTwmiotFac6rrgIgxmspJtgSzzp0AC69FGfuegFjMR3/wSlYXDvQxgbCU10tnHAJCd4Qz4yOJe3FQqsXDq04z1pD2KbfL9I16MctKZ4lJMRWPKPzzHM8DOBERVHWAjix4X6rhuJZK+HFF4EnnohsG1Jo0IpnhYVicf1WQ+bN4cPF3zFjxMRo4ULnn5eSkIJxR4zDx79/jIe/fhhP//g0nv7xaUz7+mmoJ4+DqtThjhF3WNrW9f3uBHI3AH3/7ZkByE3kbyNFquRkMeBrJ02ROs9+/lmE5FodmA60apuAmPD6/YFJQEtelIbLeeb3A1deKY4LL1BZKdpI8cwekYhn69cLtx8QPfHsT38SIWyR8tBDwGuv2XvPP//Z1Bn2+usiPDhS5Di0Zg3w00+Rb88qDNu0hz5sU4a/RWvRL8VoNxaAK1bYG7PdxMx5lpQUCFO2m/fM7w/kx2pN8zi5r/btCzxmK2xz5UrgvfeAW29tHLCrqgJV5W2JZwAwcSJS6qtQiF2YjDuDioG5QXU1kJEhUoJ4VTyTbZT/29keYJzzLCVFHP8tXTzz+cT306YqqakREb/SeRaLsE3mPPMOqqp+oarqGQ3/71FV9XhVVXs2/N0b6/ZFm6iKZ4qi5CiKMk9RlNWKoqxSFGW4oih5iqJ8oijK2oa/Hi7M23J4/XWRmyYSamqEqylBkwlPUURnWV4uLlgVFYnHzztPDNy33hqZYHLT4TchLzUPf/nsL7j1g1tx6we3YuJ/bwX6z0XWHxehR14PS9s5tv1ZwO5ewMhilJY142X+ZkLrPAOMxTM7YXdG4tkHHwCvvgps3WptG9pBLT5eHCtecp5FSzzTTiha8qJUH7apn0Bu3y76lI8/bt52mSFFHG1JeBIe2Uc4ORe0i6qdUchiUV0NPPUU8NFHkW9r2jT7IZLPP9/0PW++CTz7bOTtKS8HevYUfWNzhm4ybNMe+rDNtDSgXbvoi2duOM8++kiM2bFwhcr2a/vj/fvF/uvXT9y3m/fM52ud4lk451nYsM1HHxXKzK2BxF3V1UCnTuJ/2+JZ//74OPt8rMw/Eus7HxsV8Sw1NfaVa6XIYuY8y84O/G+FcM6zjAz7IY21tYH5s1dClWX7t20LPLZxo3Cide8e+7BNimck1kTbefY4gA9VVe0DYBCAVQDuAvCZqqo9AXzWcJ9EiN8fuVAgE87rK0zJMIbhwwPPZWWJBcZPP4mr907JTc3FpvGbsGPijsbbJyftAIp3IO+LWZa34/fFAd/eAXRYjF+rv3DeII9iRTyLNGxTTsCtTlq1g5qiuCdWOUVfMCBaYZtygpOe3rIXpeGcZ/K+ViyMJfL4rKxs3jC4lk4kzrNvvxXHeWFhdBbo8lyKVEgoLxftsxt6XFvb9Gr4/v3uLGLKy8XYeeyxzRu6qQ3blON5S+6noo0+bBOI7qJfK55FekzIvjkWjm8z51lamkjt0b59ZOKZV4QENzBznsXHC00spPNs2zZg1ixRpasgkMIkIucZgDs6vIG/H/1fDB+hREU8S0kR51G0cgdaIVzOs6yswP92tgcYO8+ki9CuKyspSbTFK4KxbL8275nsD5s7bFN+jtbYwZxnJNZETTxTFCULwNEAXgAAVVVrVVXdB+BsADMbXjYTwDnRasOBhM8X+QSqpiY4ZFOiFc+0nHkmcPnlwIMPAkuXOv/ctMQ0FKYXNt6U/YVAZSGqq6wfnj4fgOVXABWFWJQyOezrWxpysHBLPDNynklniRPxDIi9eBatggHaiVB5eWD/tGvXshelctEoK5rpr77K7+Y18czvbxnFDbxCJOLZd98BQ4eKYz0azjO5mIz0SvL69eKvW+LZvn3uCBuZmcAFFwBr1zZf6Kb2IoKiCAdIS+6noo0+bBOI3qK/slIcB3Ict5tQX08sxTMj51llZeBijJOKmwea8ywzM1gUMBQkpk8XO2bChKCHq6qE0yknx5l4VlcfDyUxAcOHA1u2iJA8t6iqCohne/bETggNl/NMhlm64TwrL3fmPPOieGbkPNOKZ83tPFOU4POEzjMSa6LpPOsGYBeAlxRFWaooyvOKoqQDaKuq6jYAaPhbGMU2HDC45TyzI54BwGOPiRymN90U2WdrkYKOnQl/XR0AXwrw/Vhsz/gQP+9wN1HTggXAySfHrtN223lmJJ5JccLqRMer4lm0wzblBKdtW/EbRLoAcputW4EjjggffisXjYmJYmLideeZVryJNO/ZSy8Bl10W2Taizc6dwIgRwFdfRbYdp+LZ/v3A8uWi3/e680xO7O2KqkbiWWWlOKcjDQ+Wi+NzzxXn2b//Hdn2rKIN2wQC4tlvvwGDBwO//NI87bDD5s1CpLWaMsBNjMSz7t2FmOC2KPXjj+LYGjJE3I90PuFF55ksQNO/P7BqlT0RurWKZ0bOs7KygPPJtGBAeTnwzDMiT0qP4BQmMjQyP9+ZeObzCTFCzusjyV+sR+s8AwIXN5qbcGGbKSniZnXc0J6vRs4zp2GbiYnuime//AIMGxZ8vNnBzHmWkiIupDV3zjPtBXHZvs2bxTxXK/DZYepU4A5rKbUJaUI0xbMEAIcBeEZV1UMBVMJGiKaiKDcoirJIUZRFPsrMYfH5oieeXXQRMHmy6Kj05OUBN98M/PCDe4m8HYtnALDoZsT50jHl2ynuNKaBL74QuZ8iXcg6RS+epaSICYrTnGduh20C3hPP3AzblIN2WVmweAZ4r0rlTz+J8zHcIrm+PuBOkceTFq86z4DI+5r584HZs51N5poDVQVuuUWEeC1bFtm2nOY8W7RIjCvDh4tooWiIZ245z6R4ZvdcrKszdp4BkbslpHhWUCBu2oVINNE7cFNTxfly9dXAkiXuLpLd4scfxW3x4ub/bNkPaunWTZyDdqtFhkOGx40cKf66Ea4MxNZ5ZhS2CQhRZ/9+e9/R7xfvT05uXeKZ3AdaR6vsH4AQjprnnxcd0aRJTbZZVRWZeCZF40MPFf3T/Pn2t2GGXjyLVd4zud/Ly5te5KyuFsdZcrKzsE23cp7V1QXEM7ccel99BXz/vZgHOkG2Xy+edesm5otOnWf799t3dGv7Z23Y5nffie/ntKDV55+LOSAhTkgI/xLHbAawWVXV7xvuz4MQz3YoitJeVdVtiqK0B2AYDKKq6gwAMwAgPT2dGW7C4PdHPoGqrTUWz9q0MRy7GxkwQPxdtQo4/PDI2gAEBJ3aWuOrwkbISUdGfB6SN1yL2UlPY1Op8KEf2+VY3HfMfY2v/fqPr/H3L/6OejV4NM1IysALZ72AgvQC6JFtmjMHGDXK/neKlOZwntkN29TnGEtMbL3VNnNzxf4pLw8k4ZbiWVVVYMHgBaRjJpyYqj23jMQzLzvPInUF/f67mMStXg0cdlhk24oGc+YEnEqRCktOnWdyoT9sGPDpp94O25Qhdk7CNvVCrBTP9u0LJOS2i6o2XRw31zVAfb+cmgrMmxf4nps3N0877CCPrWgcY+EwC9sExIKxZ0/3Puvbb4HevYWTE2hBzrOFC4G//S1IgThti0ha3HY+gLXisYeWNBx3o4DLNwIjASgnwPwy/SmnAHfe2XhXuqHcFBIss3KlKLP7zDOBAX3vXuCaa+wreSkpIilwQ4Ut+Tv7/UD1Vz8g9YF7cO9iP3x+AKOAnDqxL3tOB/CWZjvLlgFHHy1smTqkQJWf7+y88fvFvk5IEMa2WbMCglyk6MWzWOU900cNyAIBgJgf5eUF5tJ2t2fkPGvf3nnYZna2MxHUCCl6rVgBnHSS/ffL41Xr6vr998DvmZBg78KjnIerqv35spF45vMFvqPT+ancRmVlwC1LiFWi5jxTVXU7gE2KovRueOh4ACsBvAvgyobHrgTg4vWOA5doOs/C0b+/+Gs3v4UZWkHH6mJIfvf8fCB50Z0Y1XUUfPU+bC3fir9/8Xes2bMGAKCqKiZ9MglLti2Br97XeKurr8OCNQvw+PePh2zTW2/FJnQzlHgmizg4Ec/2NhQUVtXInWdJSd5ynrktngFNc54B3ssnJIWlcMeDXjxrKTnPgMicZ6oauBLuVp/lJjt2iKJqBx8s7kfqTolEPOvZU1w8KSgQx4HbuebcDtu00wf6/eIWDefZ/v2iP5JhWXYTLEeCUdhmZSVwxhlAx47u5jZyC3lux6pqZCjxzC1UVZxTw4eHCNOzieybo54D8s47hW3R5wvc/D4kwBf0mOLzIUkR/8erDc/XBb+m8bZ5M3DPPUEHpFY8a3bn2T33iPLSL70UeOyJJ4Qlq67O+DuY3T79FHj44cbNaH9n5Z6/AD/+CNXnQ3Jcw35r2JeKfjuDBgEPPdSkqTJNS6Rhm/I4HDNG9BH/+Y/97RghxbOcHDF3iqXzTH5H/fEknWdGFw5DbQ8Q7wlVMCDWYZta8cwJeueZnDN17y7uOw3bBOy7/aMlnsnvGKuQYtKyiabzDABuA/CaoihJANYBuBpCsJujKMq1AP4AMCbKbWgVvP46MGWKeViDm9U27dK9u3jfypWRfb5EK55VVVm7KqAVz9at64iPLvsIADD+3h1YG3cQpn47Ff86419YuGkhvtv8HZ489UncOvTWoG2c9+Z5ePrHp3HXkXchIymjSZvi48Xk/ssvgeOPj+gr2sZIPCstFZOmtm3FQBJJtc3KysD77eQ804a72Em8apc33hBz0aVLm1aDlegXjW61x+8Xk9TERDFQS4FZ6zzzElYXVNrfzyh0Qd73SviMdmEdifNs587ABM6tPssp550n3Lp33x147P/+T/yGL78sXHFuOc/sjg8//ACccIL4XxZ527XLuRvLCLfDNu2c72Z5WLTOM6vcfbfQAl55RdyX56B0ntldbJhxa8OQ9dRT5q/Rh21mZopF7LPPAqNHO3eePfoo8MknwIcfOnt/KGIpnhmFbbZrJ/r81avd+5wNG4Ddu4WTUx57kR4Tsm+24zx7/31g/HiRz9CSy+ibb8Rt+nTgttsaH577mNjO8YcIrQgALukDHHKIGK/nNuQU2vdBsOOnkY0bxeTxscfEwYUYimdr1giRLD5eJEO68UaxU598UqjO773X+NLqahHqeM89IfJmXnutEOHuvx9o06bxdz4US5Cy8HNg8mRcPnMSevcWDuOaSuCYDOCRm4KMeKbIsVk6z5yGbUox4phjxEWSuXPFmBQpMh8bEN3KteHw+QIFFfTHkzQLOHGeZWSYFwyoqnIetunWMS8dY07FM73zbPduMeeSFxWchm0CYq3Rpo3192r7Z23OM9k2p/tMfsd16wLRU4RYJZo5z6Cq6jJVVQ9XVfVgVVXPUVW1RFXVPaqqHq+qas+Gv3uj2YbWwi+/iAt/ZsnJo1ltMxwJCSIUIRrOM6vChOwI8/NFZyrj6pd81RbKT1fg5WUvY0fFDhR/U4z81HxcfejVTbYxacQklFSX4MWlLxq2adQoIeTNnWv3G0VOKOdZx47iMSfOM5mDQ2v7t+M80y462rUTVZuiwZIlYrIfapKjd55lZorjItKcZPIKbWZmwHmmKIEJgNfEM6fOM6/nPNu5MyDiROI8007kY+08W7JE5BbT8vvvYgE6cKC4H6uwzX37AgKxDDNzO6zODeeZ3y+ECcDZBQSteFZfb/8iAiD6pm++CdzXi2duhW1+9VX4HHj6sM1HHxX5Ojt0EMKnU+fZsmUiT0w0CqR4LWwzLk4ICu+9F3nVVYn8bp07u+88szP3++UXUf3V8oWD4mIR33bNNUEPh8t5FrYy3kEHARdeCMyY0ahUS/EsO7uZxbNHHxWTqyeeEAPEW28BM2cK1UCXs+Tjj4Wo+v33JtsCgIkTxQDaoHLLfTUJxfClZQI33BAU1i2PB6t9hBybpfOsvNz+/F/rPEtIEML6e+9FPp9R1YDzDBA/c6zcrn6/eQEK2UYnzjMpkmmJJOeZDNt023m2cqWz/kvvPNNW2gTsO6n14pkdzHKeuRG2CcRO2CUtm6iKZ8Q9ZOdj1mFFs9qmFZyUJTfDiXimdZ7V1wcWRJs2Af7/3YFafy3GfjgW7/76Lm4dcivSEpsG3Q8vGo6RRSMx9dup8NUHz2L27hWLjzPPFFcKmzt0s7Y2kKgTMBbP7Lou5ABYXh58xd+peNa9e/QGItmmUJMcvXgmr3ZHmjtFLq6keFZaKq4SykWCV8WzSHOeeU0827UL6NpV/O+GeDZwYOzFM7+/6fkmq7C5tcB2Kp7JK+JAsPPMTdxwnm3dKvrHzExn4pk25YH2XLbjPPP7g8ctI+eZG2Gb27aF31d6B+4RRwSqOxYVCeeZkwVVTY3YT9EQuLwWtgmIULb1690rYiDP86wsC8KSRZyIZ3JcsNT3/fqrcGTdckuTEACzapt68SzkcT9pkhiwnn02yDHZrDnPduwQQtmVVwI33CCqWk6eLBxoQ4cCRx0V9HJ58TRklb++fYVj7YkngP374fMBB2EDxmAu/jj1RiA7G2VlTQsGWO0j9M4zIJCCwyr6496t0M3aWtG/SPFMCvZuidB20Ipn+uMpEudZenrwWFNXJ7YRabXNykp31hbbtoljqqzM2QVt2Ybdu8V304tnkTjP7IZt+v3GYZvy/Is0bJPiGXECxbMWguzMzDpWmSIhkgEqUvFswwZ3Km5G6jwDxEBZX98wcOzpjSFZZ2HOijlISUjBn4b+yXQ7k0ZMwsbSjZi7ItheVlIicjeMGSMGlC++sP593KC2NjikViuedeggHrO7cJQL4pISd5xn3bqJhWw0xCQ58bHjPMvJCX6vU/TimRQ3ZFhCaxHP9K/3UsEAmZOvSxdxP5KwTTlZOv10sTiOZcVNn6/p8SnFWSmWRzKZVtXAosrOdlRVvF6KZ9J55ra44YbzTP6e/fqJY9bqGKgVHOQxoD0W7PQbPp8Q22QfFA3nWW2t6O/DXSTTh21q6dRJfEftGGsV2T9Eo+BANMSz+npri2KjsE0AOOcc8bu55TSXx5ObwnhY8UxVm1gFq6uBLJRi/eK9onMIdZs8WUw8/tR0ziTbru2LteKZJTfVIYeI2PDHH4dv607kYi8yaveiffJeKCUW2mfzVr3V4PGpU8UOvOMO0eg77hCK6W+/CXFPkyeiujpQlTJs9dxJk8QJ++yzUEr2YhKKoULBT8eOaywoInMi2j0e9M4zwH7opjZsEwiEbs6ZY287erTCHiAE+4qKyF1VPp/9uZbPF8hXaxS2KZ1nTsI2tW2R6x4nOc+0YZtA5POt+nqhB8saE04uEPr9Yv4so1LkGCsvXkaS88yJ80yeH9qwTTrPWiCKMt3C7YFYN9MKFM9aCOHEM9lZR+I+M6u2aYV+/cTfVaucf75EClWAfeeZ1qK9a1dgUnlIpbDeXzXoKsNqmpIze5+J3vm9UfxNMdSGVVhdnRj8c3OBU08VE5b337f9tSLCSDyrrBTfs317Mb+zYz1X1cCCuKQksGhp3955zjN5VSoaCTgjcZ7ZcZAYISeZMidFWZnYttfFs3DHQ7icZ/J7VVXFpkiGlooK0T43nGe//y7cmoMHBypuxgoz55k8diMVz0pLnY0N8rWyz5FCu9uuIzecZ7KSW//+AdHPCuHEMzv9hs8nzic5kY+GeLZjh/gb7nfUh21qaSj+50gAkwvMaIRgRSNs87nnRH8RTkw1c57l5QldZ84cd1wz8jzPznbHeaYtdmEqnv3pTyJBl2Y1f9gP/0IpcvC36flCeQl1e/FF4ciS8dsa9M6z+vrgSnqWv+OkScC2bUgqaou9yMcdD+bjX3PzsfQPC+2zeUvpaPD45MnA2WcDvXqJ9lx5pejwuncHzj03qKkffyzO7bZtwzjPAOFYO+IIYMIEDD01H7fiaczGJdie0AnV1eInkf2Dooib1ePByHlmVzzThm0CgdDNBQsiu6CkF89kjsxI+40//1lorXbORW2xJ7OCAUZzn1DbA5o6z2R/H0nYphTPIhUZ9+4Vv63My+xEPPP5Ar/b9u1ijO3QITDnjTTnmR2MwjZragLjYaTiWawqwR6gnA1gcZjb6Ji1zgbRLhhAXCJc2KbsCGRH7IRInWeA6KgPP9zZNiQlJaKjLilxFrYJiAFI20lXrBqJd+97F0cddFTTN2uIU+IwccREXP/e9fh8/ec4vtvxjYuo3FwxeOTlNX8Zdf3vmpISWGjk59vL2yD3lZwPa8Wz7t0jc54B4kqOFFPdwop4pl80uu08S0sTE5O4OG87z6wWDNA7z/RigXZfV1QE9mcskMenFM8idZ517x7cZx12WGTtc4rPZx62CURepVG7oHJypVhe6c3OFv971XkWHy8qgwLiuJXtDoWbzjPZ/pKS4Nw1boZtyivtVsUzM+cZIBayspqrVaLlPFNV4eYGxPGlquZFYeywapUQOMJdFDQTzwDgggtEqq/FiyOf12jDNt1wnmn7QEPxbMsWoSDW1QHvvCOUkbo6jPr+ISzFIXg372r87W9hPiQ+HrjoIsOn9M4zOV7YCtsEgBNPBGbPRvWmXbjzz8A5Z4u52+efC1OYG8cCICIjpk4DLrlYFG1oJC4uWCRLTRVVMVJSmhwYc+aIeeAFFwAvvBDmWFUUYNYs4IMPsGYt8PiT8ZiLMZiwr6m4Dtjr66PhPANEZMWzz4rQzdEOl7BGzjNA9BtOE7P7fKIYy+7dos6EdKCHwyznmaoGnGd2wjblGKp3nslzwGnYZnp64IJZpOKZFHUHDhQasN2iSNKs2qmTyI+4bZsYY+X8Hogs55kb1Ta3bWvq8raLttqmmfuYuM40qOrMkK9QlNxmaktEmIpnigIry4k6VcXPLraHmNAczjOn1TaBQMXNSHMI1deLBcjgwWJbTsM2y8oCA1rbtmJbZ/Y+09K2Ljv4Mvz187+i+JtiHN/t+MYQF3kFKzEx8vxydjFynskrcPn59iYAcqKtdZ7t3Ckmve3bAz9bPKP1iw6teOY2dpxnsk1S7HHDeZaYKCa6GzeKx/LzvSueuV0wABATFC+IZ506iTZHmvPsxBNFapvExNjmPfP5gs9b6V7SimeRuFPkgio/39529AVKFEVMxL2Y82zdOpGEPaOhQHJ1dfCi1AyjCX0kzjNA9KVdugQm9G79jkBAPLOb80yLF51n+/aJ79Sxo9B7tMd/JMhxO5x4FmrhdPbZ4rebM8c98Swz0x3nmXaRbSiePf64OBg6dBBJ/887D5g7F3kVf+BKPIn3S87ExGutVTM3QrZ9//7gPLO2wjYB0blcfDH27wWe+DPQ/Tgx9jz2KfDgDRYrglrgt0+BJ6YBPYcDw24L82KDqynV1cC77wqBqahIfN+KijB9TY8ewNix2PgJ8PST4qHSUmPxzI7LOBrOM0CEbhYUiFDlSMUz+bu54Tz78suAwP7tt/bEMzlv0Z4v0imcnOysYEB6uugPpXgaiXimD9uM9GKvHCfatXOWi1q2Xes8W7cOOO64wGuaO2xTL55pj6VIq23W1AgxTuaOJlFEVR9z5TUeIJTW+iWAKQAeDXF7L9oNJAIrOc+AyCpuRuI8S0gA+vSxf5VDj6yUKfN4ReI8kwuEk04SoVlWB7SUhBSMPWIsPvr9I/y04yfPimcSt5xnBQX2ymXrFx0FBWJSEQ3xzEnOM7cKBhhV2/Sy88xqzjPt72d0/GjvO5mgVFe7V31VuiwLC8Ux5lQ8k23q1k2cx716Rd5nRYIMvZLnZEWF6P+0uXDcEM/atYvMeQaI8zta1TYjFc+6dQs4Haz2g26HbQKB/HJGYZuROs+ko8BqzjMjQahdO/F4JOKZ284zeUxJt7JbAq0ct+04cPXI0M25cyMP3SwtFX1XfLw7zjOt46LJvK+sTFiILrgAuOceURry66+B4mJsyeqD93F6xCHr2rZXVTUVz+wKhFrR160QNi1yfzl1LcuQzQsuEBcZAQuhmw1o99W+fbF3ntXXi+NZf9wnJAiNNZLQTb3zrEMHITBF0m/MmSPOnbQ04LvvrL1Hfkd54VM7D5R9gl3nmTbnGRD4rpGKZ26Gbcpjsn17IZ7Zrbgp2y7FpI0bxW+ndZ7FKmxTzkfksZSVFZnzTAqrRmuWHTtimw+3VaMo3aAo70FRdkNRdkJR5kNRuoV/o3cIJZ79qKoYpao4zuwGgKn2mgnZ+UTbeeZUPAPE5DdSF4ec8NoVz4wKBmzaJAalY48V382OqHPz4TcjPTEdU76Z0kQ8S0pqveKZnXLZevFMUaJXcdNJzjM3nWctUTyz6zzTTyD1zjO7TJ0qwjTcyJcmF9QFBWKC6nQBtGGD+Csngm5WCXaC3Ddy/2rzIgHuhW22bess55lePIuW8yzSsE23xbOMDPsFA4DA+CV/T+nqiVQEBdwJ20xIEGOrExdItJxn8piSYdRui2fhLiiGEs8AEdG3YQOwdm1k7dHmMrRbXdEIbZ/cZPE/Y4b4wEmTgKuuEpngr7oKWLYM7/aciKRkMUhG0vdpj+eKCnPnmdXvKLcn84sC3hLPPvhA/H6jRgkRGrBQNKAB7b4yE8/sCBJa8SwtTcwH7Yhn8nP0YZtA5FU39eJZYqLYX077DZ8PeOstUel+6FDhPLOCXozVHkuyjdJ55qTaJhD4HeQx5aRggLbaJhD5Ma93nmmNBFaQx2pamrh48N13QnzzUtimPJZ69Yos55lMc2i0ZjnqKOAf/3C2bRKW2QDmAGgHoAOAuQBej2mLbGIqnqkqRoV7s5XXEHeQHZqVnGdOiVQ8kxU3I8lH5FQ8M3OedewYyLNgZ6KYm5qL6w67Dq//8jreWPckMHgGVtV+DKDlO8/kYiI3Vwz0MmyzsFAM4BUV1gZGo3CXbt3cT8Cpqs7Es4wM8b+b4llFhVhUt4SCAXYcF0ZJc40S4trhp5/EvnfDqaIVzyJxnulLrvfvH9uKm7Lflse3Ni8S4F7YZtu2kYVtAqJ/cNN5pk2w7/Q7lpeLY6Nbt0CfaDd8HWgqnnXoYK/f0OY8k+2S/Q/gTtimVedZKPEMEOE4Ts5J2R+47TzTi2eWj7G6OpEIacYMcVu8OOhpq86zcPluDjpI/JVhY07R5jK0HNIYgvJyIBNluBovov/CGYH9MGMG8NhjQuU57DCxCr71VtH5tWuHT9pehl69Ig9Z184RKisjd54ZiWdu5paVfavTxfbateICsRSDAPvOs4QE8Z30ORHlc07CNhVFzAGdiGdGfYQ2dNMJcj4kxTPAeZ8DiMr2u3cLUW/4cGDpUmtzLu0+14tnsk9wWjBA7zzTFgxwIiwlJrqb8yw9XbRFunntnOfaY6Ndu4DTL1bOM7/fXDzr2TMy8axbN7FtvXhWXy/WMZH2+cQUBar6KlTV13CbBcCFsjzNh+UUeYqCAkXBA4qCRxUFPaLZKNIUq86zWIVtAoHJbyShAJGKZ9rkoJs2idwUffuKx+yGZ40fNh6JcYmYues24Mwbcf2Xp+DX3b96UjyzYz3XVtLLzRWhRtqwTcDagGQmnq1b5051MklVVeD4tlMwQFHEhMSNggEJCWKiK3O7eNl55rRgQLicZ3aRExI3nIgyJ5+cFDoV6KWwqxXPYlVxUybmBQLHqF48izTR/J49gXxlboRtuuk8kyH6gPPvqBVD3XSe2ak6DBg7z5yGZJlhNedZqLBNQIyJkTjPtmwJfIYbOA7bfOYZURnxxhvF7eSTg1RwN8I2AffC/0tLg0Vx+dlOKS8H7sff8CKuxWnzbwzshxtvFD/S3XcHXnzrrWKw//OfUVGXjIwMoHfvyELWtW03cp7Z/Y5a8cwtIUFLpM4zbdJ0GbZp13mWl+e+8wxwLp4ZOc9k6OZ77zm7qKR3ngGiz3Eqns2dK8b9U08V4pnP10QnN0Tu8/j4phEV2rBNJ84zKZ7pnWcybFNVrc+B9WGbbuQ8k8enXJPZOc+152H79oHv1r174DVOcp7FxYl97SRsU/bP8njdskXsr8LCyMI209LEsamfo+7dKz431lXmWx2KkgdFyQPwXyjKXVCULlCUg6AodwJ4P9bNs4Od+hKPAvgKwIdoYfa61kBzFAwIl1g3HNrqdU6JNGxT2til86xTJzFB6dzZfrsOyjkI2ydux6S4LcCTK5GckIxHv30UiYn2RcpffrGf0FWLmXiWlCQmFk7CNhMTxXxa7zwDrE1azcSz6mrrk0orGOWqMGsPELwQys4OdpD4/cDChfY+Xy6utEmss7LEd09Kilw8W7LE3UWC1bBNKznPZKhyrMUzKe4CkTvP0tMDxTKcXJl1C+1CKZrOs9xc0V9EGrYpJ6pW+5lwaM9Lp98xWuKZXeeZXjwrK3OeDNwMN8I2gYALxO4Fjpoa0V/U1bnrQJRimS3xzOcDpk0DRowQK6kFC8TB/vLLjS9xK2zTrfB/t51nNdtLcD2ewxu4EA/eukXsB3nbvRs4/vjAiwsKgK1bgXHjGi+SakPW/X7gv/+1J4pq227kPLP7Hb0ctllXB/zxR0A8y8sTfaPVeY48J/PzgwsGaOcUTgsGyO3amV9qhSUjxowRv6eT0E0j8axTJyHY2+1ztCGbqamBKqlWQjf1YZvaeaQ2bFM6z6y0zWrOM+1rwyHDNtPTxYUuN8I2pTOyTRsxbkfiPAPEvpdpXuRzTkJTnczdjHKe+XxC2JOpVJxcrPf5RF9jFC0jx6BIL3iRJiwGsAjAhQBuBPBfAF8AuBnA1bFrln1MxTNFwYeKgqM0DyUB2NBwi0BiIU6IdtimrD7jtNomELDARpIbJFLnmZx4yXAxWV3MaW6jrOQs+Pd1QNr+vrhy0JV4ZfkrUNO3297PJ54IPPSQ/c+XyMFHIsWz/Hwx4DoJ25TOs02bxMJI5jwDIhPPAHfznhnlqjBrDxDcppyc4EnTu+8CRx5p7xjVhm1K5KQ3NTUy8ay0VEwIp01zvg0t9fWByYld55msHiWpqgoIVnbFs9LSwGTejTDeXbsCglek4lm3buKcAUQxtEj7LKdoF0ryGJfHqpsFA/Lz7YtwRmGb8lhwy32mPS+dTlJl9dsuXdwRz+Rx1b69OP6tXiQxCtt0GpJlhlthm7JSoGyrVWpqAiGMbuY927VLHO85OeLctiTMzZsnckTceaeYLJx2GnDEEcCjjwJ+P2pqAv1ypGGbckx0Uzxzw3l20H/+hQxU4iH8BXuSO4j9IG8yf4WWhhi/6uqAeLZ+vTjmH35YRHlaTcaub7sbYZteLhiwcaM4TuT8RlGEsGA1bFObk9ftggGASE+ydq118TOU8wwQoZtZWcBnn1nbnhYz51lFhf3fc9UqoQOfcYa4X1Agxmwn4pmZ80zOpa3M6cPlPHMinsmwTUWxV7DLjG3bAqIXIPJ6/fab9fdrRWy5He2cST7nJDQ1Pd2dnGeAaFtmppizOpkPykJgMlpGixyDKJ65jKp2hap2a/irv7WaggEXAjhbUTBbUdAdwL0A7gPwMIBbmqNxJECosE1t+I/TsE1tDgCnGOUWsIuc0Ofn23P1yP0jB8rffhOPyXLL/fvbq7ipb1NuLnDH8DtQ66/Fts5P2BbP9uyJrPKgmfNMzpEjcZ79+qu4rw3btGIdN7pi7zXxTO88k4s+OwKAttqmdrtA5OLZ99+L30P+BpFSVRUQwOwUDEhOFu/THtdVVQHByq54pv393QrblOJNJGGb2tAbQJwDOTmBKonNSSjnmZsFA5yIZ2Zhm4B74pk8L5OTnQtLu3eL8z0vL7BYcyvnGWA9hMYobFPvKonkd1RV686zcGGbcky0G0ZVUxMI3XEz75n23LYUGqyqwOTJIu7wzDPFY4oikuOvWwe89VaQMOiW8yzScCptwYCInWfV1Rj438fxEU7Cb2mDbM37amrEuSIjBebOBe6/X/xvR1ANVzAgkrDNaOQ8i0Q80+fKBMTiPVLnmXQwAZE5z04/XVQHtOqqD+c8kyF7Tvp62TYp7AGBPseu6C6PKZmOBRAXG7/9NrzbKFTOM33BAO1jVrZp5DxLTXVWSVeGbQL2CnaZoQ3bBMS+s3MeaUVHuZ1uOlnDSdhmYqLoGyJxnhmJZ4CzyAiZjqVbN3HuaNslj3uGbbqMomRBUXpq7o+BolzRcGsb4p2eI1TBgFJVxUQAfwXwAITF7lZVxWhVxdfN1UAiCBW2qe2knTrP3BDPgICN1iklJYFO1o4wIS24Ms+VdJlJ51m/fvYrbmrblJsL9MzviXP6nIMt7Z9Bdb31GVhdnbi5GbaptevL+3ZznknxTLbLjbDNLl3Eb+Bm0QA3nWdyULRzjEbTeSav9LslNmoXBnYcF0YTyOpqcS4lJNif0MnvU1jonbBNVW0qngGB0OXmRtuXm+U8cyNsU4pn2oss4TAL2wTcd57l5zv/jjIsNS4uMHZFGrYZFxf4rpGIZ246z/btE+dzTk7439GK8wywt5BVVfH5PXrYf284tK5SS0UpPv9cZA2/447gzv6cc0QDi4uxd09gZR1pzrOUFHEeROo8czXn2axZyKjYgalxk5CZae+iqTZsEwBuuinwnB1XSDjnmVfDNiNJQaDN++TUeVZZKS7WpKUFH3d2nWeKEpgTnnGG+E2tJvkP10fItjqZs5o5zwD7oruRA3r4cCEQSdexGVZzntkpNCO3qXeeyQIx8vO0rw2HNqokUvNBVZXoZ7TOM7vbNHOeaXFSMMDNsE0gELYJODun5UVxeU6vXx94jmGbUWMKgJGa+w8BGALgaAD3x6RFDjEx7QKKgm4Qcah1AO4A0B3AHEXBAgBPqyp4WDUjrU08W7tWdFYnnRT8uBSqFMWeMCE7Z0AMFrLz0zrPACGq9ezZ9P2hkG0CgDtH3om3V7+N1SOOxomvGoRG6Oid3xv/HPkEAKXJRGT5crEoOeSQ8G3QXp0CmjrP7FQM0odtSmQlQ8C5eJacLPZ5JILJqlXiGBo6VNy3mvNMXzAAaOo885p4JsMP3BLPtN/LjvNMK57J71ZVJb6fE0Fcfp/jjwc++sjee/WoavAC26nzbOdOscCLlnj23XdiW717W3t9KOeZPNachG3OmQOccor4HffsAQYODPSNdXXW+vhQYZtu5buS52V+vvNJ6t69wRcQAPsOXCBYPEtLs5/nKtrimXS4FBWJNoX6Ha3kPAPsLWTlvurYURwTbjrPdu0SF12AQGquJnzzjbBH1dcDa9aIBDyXXx78mvh4IajdfDM6XnYsPoY4eA+eCMBkqFZPORXAhMCY8dlnwCOPBNlaFACfACicBZGxxQGqCswrA7q9C2AF0L8U+BjAoXcCaONgg8uXY1PBofix7nhkJtsTz6qrxbnSvbv4LWtqhJHvzjvtiWc+X8DxXlERGJvdqLYpc1F5JWxz3TrRHq2jp3174Ry3gtZ5BojzR9s/APYECfkbylC6zEwRuTxvnii0GioMWdses7BN2dZwApVZ24CmOc8A+6K7mXgGiLmT7DeM0IdtlpcH5jxGzjMr4lko55lePLMbtgk0zc1mFzlOaI9Tu242I+eZVjQGYhe2qR3T2rUzLnD27rvAUUcFr22M0OY8A8Q5PmCA+F/Oceg8c50hEEYsSTlU9TYAgKK0KFNWqC72dYjiAN8BeFVV8T9VxckAyiDGfdKMyMmrUYelPcFjGbYJWF9oT5kiquf8+GPw41qhyq7zTDsASeQVL9n5b9hgbXtmbRrWaRh67LkNSl0q9tftD3nbUbEDT/34FD5c+ymAplfxxo0Dxo+31oZohm1KtGGbTsUzwDiHgB3++lfgmmsC9+06z7QDrN55JgdFu5OJaIhn9fVCcImPFwvISBybErkwiIuzn/MMCH5PdbX4fnLiaYd168SxeeihQuCIxLVRUSHaEqnzTIZNd+wY/Lhb4tm114pj1ypmOc/S04OrS9mZpG7ZAlx4oVgMA8HOM/1nhqIlOc+cimdmzjMn4pn8jWT4r148izRsUzpc5HgW6iJZuLDN9u1Fe+wsZLVODZn82y1ksRogRNjmpEnADz+IH6hTJ5HbTLs6l1x5JXDuufDX+JCG/UjDfihV+8X79Ld164C/3IUO2CLON1UVA/KSJU1emxG/H3E1JtuxcKuvEG1JqRf3E2rEfcfb7N0bsw8tRmaWgqQkZ86zhARxcePqqwM6pF3nmQxDDZXzzEnYJiDmbO+84141a9nHOhXPunYNPqfatRPHqpW+S+s8A8T5oxfP7Ajs8sKWljFjRD9hJXQzXNimbKsT55n8vbSnZ4cOQuhzEioOBK9LBg4U21q1KvR79WGbQOC3N3Ke2Qnb1DvP9u1rGpJt5bhXVfFbuBW2KcUzvfOstNR6Un3tedivn9jWyJHBr5Hf0Y6TPSnJWdim3x847xQl8NlGzrNdu4CzzwZmz7a23YQEcV4DdJ41EwlQg45E7RWwnGZuS0SEuO6AFADrAaQDSJMPqipmKgrmRLthJJhoO8/k5MsN8cxK519VJTreq64SZaflQOtUPKurC0y65ECZlCSqzQCB7TsRF0tKhAggGbJ7OtQfgIVPhn5fja8GXR/viieXFAM4sclEZNu2wCItHM0lnsnB0MrVr1Di2YcfWmuLEeXlwblEIg3bLCsLtNWp80w7AQPcyXn2669i0nXaacAHH4gJ+qBBzrYlkZPDvDxrzjO5r4wmkJE6z7p1C1zVW78++Byyg/zNtOJZdXX4cCs98rulpQU/npsrKqlFSlmZ/Vx62vfKv/LYAuw7lqR4M3cucO+9YqLqlniWlSXuu53zLD/fxG1kgT17Aq4GpznPkpKaimfyN3Aatqmvtumm8wwIPc6Hc55JR4Gdhax2EVtU5J7zTFVF3jp5bsuwTVXVJKj+5htxmz4duO220BtMTQXeegvvvwpccYV46M37gQsuMHjt+vVAjx4Yh8fhi58sLLI//ywqdl55ZdBLbxoi2vjBB86+5/YtwJGdgBn3ANdfD6xdChx5GPD2gyLa1Ak/jA4kzHbiPAPE91HVQP9u13mWlRXIF1RXJ34zOZbYDV/TH7ePPy4KLd17r7jYGimROs/0juX27cW+27kzkCPRDCPnmVbgAJw5z7RoQzePOspae8I5zyIJ29SuJRITxfd1w3mWkGBt3qUVCLUXhbOzg/szN5xn2gqXdsQz/TiblRXZhWd5kUUvnvl8gYuh4dBX2zQKTdae21aKzGmdZ3bnWvp1hrygaJTzTI6TVvoxGbaZny+OAe2YRudZ1KiHorSDqopfSlV/AQAoSkcANmo9x55QzrObARQDuBvATdonVBUuXQsiVglVMED7WKRhm5FU2wSsL7Rlp7tyZSBZLSAWf07FMzkAyYVPp06BTld+Lyf7RyvoAeJzrGwnOSEZY48Yi6+3fQK0W4aKiuBJ7s6d1tvjpnhmFLaZliYGNjvlskOJZ9u22bdnS6qrxaRNHteyLYmJzgoGaBcHXgrblCGbl14q/roRuikXBm3aWMt5ZhS2KZETdCfi2e+/B4tnkeTAk7+ZNmwTsH8F08xd65bzrKrK3na0k2ttzjN9onk7Ezh5rqxZA3zxhfjfiXhmtGhRFCEguBW2WVoayG3phvPMac6znBz3wjZlbrKaGueV9IzQi2eh9peVfEZ2BTBtKFZRkXvOs337xHfRFgyordX1N8XF4mqA1o4cBksFA7p2hf+8MbgRzyKltkwoNB07Ahdf3OSl+vB/uxhV0QUiOyakuzE52bpgDAScZxJFCVxQsOs8S0kRfURFheiP09IComckYZsAcMIJwI03AlOnCu00UuQxVVlp3TEDiPmDHM+0SIHCStEAvXi2fXtwPw/Y6+uNnGfa0M1w38+q86y62v48TlZz1VZnBJyJ7mbrEivzXW0/qK8irxX4nDjP5BxEzv3cFM/ccJ5pwzbt5g+0Iqw6DU11GrapPU7lvtKKZ/K7yblJuHWVzBsq82Tr3dR0nkWNYgDvQVGOhqJkNtyOAfBOw3MthlAFA75pKA5wsapieXM2ijRFDnZGJ7P2sZYStunzCVv+NdeIEKNFi8TjkYRt6p1n0pEABJ6zu3/q6sTEUCueJSVZF71uOvwmpMVnACPEpVN5Ja+uTkzGrbYnnHhmZwKtHbBlFSMpTMTFWXcPhhLPAOdikJzEyH1VWhpwQIX6jmbOMyCw8JGDqx0xSF6hklZ9RQn8H6l4lpsr8lMB7opn+fnOwjbdcJ75fCJXilY8i+S7yd9M6zwD7ItnRrlYgIB4ZjWswYz9+51Xq9M6z7SLKruii/a8feYZ8Tc/PzjnmRWMnGeAxYTuFpGhLpGENLoRtmkkntl1nvn9Yl+pasBFpw/bjOQq9rZtoo+XTupIwjYB+6GX2vlBp04iPFi/QH/zTeBrm1lL5LGkDdsENO7GNWuA+fOBW24JnPgGLFwIvP9+4L72PAzVD9aOnYRslOGUd28R+c7GjTO8gqgP/7eLUSEQILJjQlZ0tRu2KcUNLQkJwQ5MK8hxMSMjELapdfXaXWDrxTNA6KadO4vQUjsCoRFyDFNVe99z717x+5mJZ1aKBujDNlXVOGzTjvPMyEVkNXTTasEAwL77zMgVBzgL9zaLiLErnumrtzotGCDd+nLfywgabYVLJ+KZ7HLshljq2bZNtE/2o0BT4TAcVoRVuyHZblXb1H62WdgmYK3CsnZbnToFC7sUz6KEqs4CcC9EEcoNENGN/wfgPqjqqzFsmW1Mp1eKghnh3mzlNcQdQoVtuuk8i1Q8s5ofSYpdU6eKzv3xx8XjkYRt6nOeyav0gBA8EhPti2dyEu7EeQYAOSk5OK3d9cCAN4DsPxonIrt3B9ptBb141r07cMQRgeSpcjJhZdA1CtvUDrZWr35pw/60yNBDq2XT9chJkRzApKAQriiCmfMMCCTZ1ib0tooUmeLixEIhKytwVdW2eCbLIZWW4uevSzFqcCny4kvROacUW1aWNj4XdLMx05ffq00bewUD5GRQflR9vTjmwjrP9u8PtLNhprF5c0Acz84Wk/BIxDMZiiiFXnnV1274TSjnWV2dc6ckIM47W84zVbUsnjXp832+wD7XHXxyO506Ae+9J/635DzTdRxm4tmhhwKffKLLN6Oq4oONjt0Qt7rdpeiUWYrM+lKk1oZ4rckPI10RcpEn+8eg415VA9vRHcRyLMjObiqeZWaKczzIbVRe3rRtDfvf5wsIWzIsJezvaAO5ODMUQbX7v6zM0sK4Y0eTUNmKCtPfKgulyPCXonubUqT5SrFzbeD5Hz8txU0Xl+Jfj4T4HQ06kV3b/chCKdqnidd0SBefs2ddw3smTxY/7J/+FHL//N//AbffHrhvyXkGoO7gwfgcx6Hf0tfEj37DDYavy8mJzHmmF8/ccJ7J0GA74pnPJ/p2I3EjLc2+8ywhQWiaFRVNxbNInWeA+H733y801NWrrbdNj3Sfy/mOnbFDjl1GYZuAM+cZEFnBgKoq49/w+OPF36VLQ7/faF/riUQ8MxL2pGPVjjBk5IAG7IlnRtVbjQoGWHWexccHv2fvXrE/nTjP5PeT/frAgeI8etWhjLB9u7gQoe379cJhOOw4z+ykgXCj2qZslwy3dCqe6QVCvZuaYZtRRFU/hKoeDVXNh6q2gaoeA1X9T6ybZZdQYZvnKAqmh7g9AeC45mrogU6osE0vVtsMN0BK8Sw7Gzj3XFEhpapKTFDdKhigdZ4B9q/QApGLZwBwev7t4p9hjzVORGTn7NR5lp0tks336SPup6SIfW6lXUZhm/orVVadZ0YLtH79gF69RNU/J8hJjDa5f1ZW+AmT0aJROs9KS4MngU7EM0Ac39qcVLbEs59/Fg1quH23OgfzPhX/b9yXg6kv5gQ933jLzAS+/NLSR9gN25STEv0kRO7nkM6zTz8VSpZs56hRgKo2WWxEWkBCfrY8r6PhPAMiC93UVt0Kew4++yxQWAh1d+CA1BYM0B5fTRZUPp9Qp+U+z84Gli1rfFpOkK++OiAmhxXP1q0T2/n3vxsfMlu0PPSQ+MmvvlrTrnvvFe83OnZD3GbOz8EPa3LwxKs5WLUtxGszMoDPP2/SbHk+y0WeoojfNui4v/nmwHaysgJ2vIbvKMOx5bG0f784vuLidJXPHn9cPKBvW3Y21CVLg0IPpXjmZtjmtm1icWYont13X2D/Z2ej31yRByGUeFZQECjE0cjs2aLRBr9Bn2E5KEUOzrsmB9dNFP+36xN4fsiJOShRczBrQdP3Bu3/p54KfF59PfpfMxSlyMGo88RrThwjtj30pIb3vPCCyD/Wtm3Y/bN5c2DeUVIS6C/CuZWLMUncufHG4JNPQ6Rhm/L8lpt3y3lmVzwLNc+zK56Fc55FWjBAIn/6SC5uyByZMjeZE/FMX3FQtsuJ8wxwv2AA0DSc0IxYOc8qK+05OCMJ2zTLeabdrhPnmVY8q6pqGioZSdjm5ZeLfHXjxjnLAyrHCS12wzatOM8iDdu0I6AaiWdt24rH5FxQzhGtrquMnGdbt4rH/f7AMU/nmcsoivHVKbuv8QChCgZMsvD+/7nVEBIaq84zL4Rt+nxie0YDqEQbZjlmDPDiiyLRqapGXjBATlC1zjPAvugFBBbU0vUit2NnP2f4OwM/Xwwc9hz+2HkfgJzGKyR2nGd6F4gW7ZWwcHnrjJxnMmwGsF4u2yxsU1FEguYHHwyupGYVI+dZdraYeEXiPNOGm0Uinmn3ry3x7JFHxJsfegir1yh49lng5puE0DhzpgiFuvtug/dNnix25jHHhP0IfdhmUOLtMN8LaCqeSeeZ4cTrn/8UM8aJE4FffhEn8f/+h3XrjgYQLJ7JsGwnyDbJNjoVz0I5zwBxBVkvuFtFewzs2xcsRgdRVyf22+7dyH7taQD3IiHBPOdZkwXVW2+JRJHjxol4pr//XRxXr7/e+H5AFGL55z/FORFWPJs6Vezk//s/4LzzAEUxdZ61bQs8+aRIC/Xoo8CdN+wTwtKxxwJnnRV6J+mYNg1ISxftW7YMeOAfJi8sLhbH/6hRQQ/rxTNA507dvFmIL6efLiwZr7wi1L/rrgMSExsvSKSlBfp5rQDQ6DaqqQEefhg4/HDgkksCH6aqwP33Q33kEQBvNP7mGzeKv26GbW7fLvoJ+Xs0bqu0VOz/Y44RZcbefht9P5qGDExAXFym6fa0lVOLiiAOlAceEFdjDNxXGzYAj08HbrhefK9HpwJXXwUcfLBwOH7+XyA1RRySN93U5O2CWbPEfrzhBvFFPvgAueuW4GncjEv+1hM52eIc/McDwIUXAMOGQew47T43Ydu2QK7MNm3E79munTgfQo3Vfj/wIU7BB9fMw2n3nWT6Ohnaq3W42yGaOc+SkqwvjM0uIACRO8+0i1kg8oIBEm2InFPkGNK+PbBihTPxTFblk6SkiLHDjvNMexE2EudZdXXT98s2AdbFs2g5z4yOLzkf37zZXqEsIPKwzVA5z+wWDIiPDxTGqK5umqQ/krDNuDgxjTr4YNFNvvee+fzNCG3uNUk0cp5FErYJiONTX7jJDP06IzGxaZoZvfMs3LpKL9QXFYnHdu4Uj8m1BJ1nrnMXFGV3iOcVAOMA70c1mp4eqoqZzdkQEhrZGYTLeeYF5xkgOjOr4tnxx4tJxYyG08WtsE2vOM/27wfwzURg0Cy8velfuBx32XKeyWpaoUQxO1fPtAtjeaVSH7ZpxYVjJp4BQhB94AHg7bfFBX07yN9cDoSlpaJNfr+zaptyG3J7cXH2krLKRQIQSNAssXyM/vEH8MYbwNixwIQJePN+4HEFuP8RAFnA6p1CjPjzWIMrfjU1wF/+AixfHrYcZ0VFcJhCba35Oa0Vz+Tr5SREfiet8yxIiFu0SGSknzIFGD9evOHdd4HiYqwbeDQSEgLnX7duwtSkPeftUF4u3ie/h9OwTaMqYIA7zjPtorOkJIR49uabIj6gUyfkzX4CKZiIrLxUa2GbqiqEpJ49xcESHy9m7tOmCVGoSxeUlYnfqEsX4LjjRBqnkDnPdu8Ws/VOnYCffhIxmSedZCqeAcCFF4oLHffdB1yz61m0qagQbTjkEFv77JlngMMGiYnwqyuAB8abvLCuDvjzn4ElS4DDDmt82Eg8C1pUPf642GdPPil2SM+ewJlnCkvspZc2XpDQigZa8Sw7u0H0eO01sSp55RVR/k/L9u1QHn0UXfAQCgrE6trMeWZ3Iv7PfwJDh4qP3L4dOPpog9/x2WfFCTJtmoipHTkSSUccgevwPOLjzXZo4PjcubNhUfvBByIWd9asQAUTDRu/BB6bDpx5EdBmIPDYVOCzxUDnXcB/vgSuvR5Yugb4BsBNZh/buzdw+unYPOUNTNlxOaYunozy7CKMK30c1/4lEUgGUvYDjz0AFB4CDDNvfhB1dYE0CJs3B8Sztm1FuF+oMVHMnRRsGDwaMNcag3LgyfBcO7id80yGIXrBeSZDseLj3Q/blO0C7LVt2zZxzWnyZHHOyP0v3UF2xbO2bY1T7plVI9Qjv1tSUmA8NRLPrOZrrKoyvigZFyd+WzuVKM1wKp6ZhZTK+cCmTcCAAda2FSps045AaJTzLC4ueF5hZd/LYx4IzP2keOpG2CYA9OghhvPbbxfXxCxcO2hk+3YhvGmJRs4zJ84zWZAMCBQXef55cU6efrr5e42cZ1qB0Eg8sxu2qT025fwSoPMsCnwJ4Mwwr/mkORoSKaHCNomHiHbOM7NByi766idmaBfSiYkidFPmyJIuL6dhm0OHiu0deWTwa9wUz3w+69bjykoAOwYBv52ET8sfR42vxpbzTDvxMsNO3gbtb52RIcSts88OPG8151ko8WzgQLFWchK6aRa2Ga4oQjjnmdznnTs7d55dfTVwxRWB5+QxGvZYeOwx8bchMc+CBcLIIid13bqJY2HLFoP33nST+KGmTAnb1ooK8VIrx4M2Z53eeSbPO+k8q6/XnYvFxaLx118v7qemirxECxageslKdOkS2Gfdu4tj2GmFPpnbRwp3kTrPohG2qd03ptuR4le/fsArryCxZBeuwCvIyxPfsb4+kARcEuRG+PJLIVrecUdg544bJ3bMtGkAAvsqLk7orddfL34a04Xs00+Lxr/3npjFFouCR6HGA0UReYjUmhqkPf+4KItnUzgDxEImJ8dCSOONN4ovpTv+Q4pnpaVCWBozRghngChF17ev+I6qirq6gPPMSDzLyQFKS+rF5x5yiPieesaNA+LjMR7TmuQ80zvP7E7EH34YuOgisb09e8TPI3/HujqIA/rxx8XVp0MPFU8MHYptvY7GeExDfL354NIkMX9xsVDRLrjA8PVa0aVNG9GuxEQhHJx1lthFYcfXU08F+vdH8vRifPf4d4j7+n/4/ODxSMtKbFzAyqrPje2ygNZRLPsYKWAriv0xwwjtRRgnyPFUHhOROs9kGKJd8Syc88xOnyovKkU7bNOJ8+yTT8SQu2KFuK91nmnvW8Go0qakXTvrzrO4OHE8ymMp0oIBZhenrcybY+E8k9uzE/5sFraZmmovbDMjQ/yV+VNlxVkZ6q/9rFDoiyxpnWduhG1KbrtNiKOffRZ+G1rkmKrFaznPgEA/c//9AdNEqPZo++drrhHhrRJtZITTsE2tK1KOPWlpdJ65jqpebeF2e6ybaQWKZy2EUOKZ16ptAuEnJ3oXinbOHmnYZps2IrpJu6gCIgvb1FfbBKx3rI1XTL+ZhHJsx6yfZlm+QgI0tXYbYUc80w7YigL861/AyJGB590QzxRFrFu/+MJ+dT6zggHhrPqhxLPS0kA7une3PnmWJa3lZOHWW4OddKmp4vmQx1VJiZghXHQR0Lkz1q8XGsiYMYGXyMn5778bvD8nR6ggr78eWJmbUF4eLJ6FWzjK7yUnNfqwhtTUpq40rFsHzJsnRD2t0nPrrUBqKo5dNCVosRFpxU29oBSNggGAu84zQz7+WLi7Jk4Ejj0WFX0Px0RMQX6OvzHfo6oGp10KcixNniwUAa1626mTuDT9/PPAnj1BzrXjjw9MTA3Fs/37gSeeEJd9DzlECEGffgosXRrSeQaIfv5SvIa0fduASVYyPASjquL75uRYCGnMzhYxLHPmiPjBBkKKZ9KRpW1bXJzY98uXA598EhS2aeY8G7ipwZE1caJx/EzHjqgbcwmuxQvonC4aZBS2KRfGdnK9yGTUF14o7jfJeTZ7tkjUotv/y0+chM7YhPQFb5puWxu2ie+/B776SjhITX5w7bmjKKIrWrxY3N5+22LVR0UBJk5EwfafMQuXYR+y8cie65o4aAoK7I0ZWuePrJgmCw8lJ4cP2wRCuyyA4IswTigrCyzggcidZ9pQdi84z4wKBthdYLvpPJP7Q84h9OKZXeeZmXjWvr018Uw735XHkpHzLNKcZ4C1ebMVd1Fysvht3RLPnBzztbUBh5gWu2GbcXFiXSCPB23FWTvOM32RJek8S08PzEsiCduUxMUJE4EdkRcwjjSwamiQRDPnmfZc9vlE3x3uWNXnVv7rXwNjIhBZ2KaR80yOPe3b03lGzLEcRKMoSFdV2LzWT9wiVNiml6pt2hHPtAPsqFFisNi7t6l4Fipvk8RKLhI3nWdWPxMITPoKK4+Hr/YQPLLwEbSrAHAoUBMPvLAk+PU983vi6IOObrxftr8a6P4lEhNPgggJb4oT55lZ2xvDlcIQSjwDhCAaFLr5wQfGMQ4nnAAcdBAAcVwc5PsNx+BLDPwBwAvAWbuAYZuBHbuBygrxmBE9vgKuAZDxJoAc8VgSgJuSgF7/E9/3OgUYUQ38st18O0Hf0S+2OXiZ8euH/CSe9z0LJJnlcPj6a3GprWGRO3euePj88wMv0QpMxxmVYbn9dmD6dGDCBOHgMGHIz0AHHzDwB9GuhJkA8oxfe84eoGij+F5xAG5JBvp9K+6nrxfv7/kV0KlK/I8XARRCuJTi44XYoqVNG+Dqq3HK08+homoo8II4wA7eI96f+ApEcWojEhPFDjFIhKEPcRFCn4q2X78F1O0z3Rdo00bYYho6DzPXRcFPn+EabEDHDwHUm28uFBm/N+wjALlvATByED73nJiRXXIJoCjYcvEk9L7vQozbdQ96oycqp4ttDPkJjcfaCRuB3rsBTCsD/vMfkZdMv2qaOFGEFE6YgMN/ORqd6tHkWO3acJxm/xuA7G+WLBHxblJ8ufFGccLeeSf6ZVyEawAkz4LhLCF7H/BnTMbuToPQRh/KaIHqatEPyeIkYSep48YJl9WECY0xHp0+Et+p8D0ADX3ZRZVAmzUAvn5cDCqaME8AIiTxr38F7rsPw+I2Ia8GGPw7UF8GqM8DF1YAR61BY78zZMu/QjqyAKDqlonInj0TZ3w2Hmvjj0H8OmAEgDbz0RgKePhy0Vb1eUAx6jMTE4HRoxtVbJ9P3IqKRGEYQIhnOVtX4hp8i7x3ALxdLGJ0TgrO1bW+72lYib7o9eSDQLqxet5hv2bf7ZolfojrrjP9jmYhz1osja+XXIKysfegR/nveCL9Lny/MrOxYrSksNCe80wrXmidZ7m5ok3hwzbDi2eROs9k6gFJpM4zp+JZqN9Rm/vPCnrnmc8XnbBNJ84zOQ/Wi2d2CwbU1opjKpTzbNu28HNUregijyXt8QDExnkW7rjPz3cmnhmFNjfJ12gBs3QldsUzQIjy8njQ5mR2UjBA2wZZCVkSadimJGSVcwPM0rskJ4ubF3KeaZ1n27eL94cTxcOtM5yEbeq/Y36++D03bw78Fu3bB5yKhOgJK54pCkYAeB5ABoDOioJBAG5UVdwS7caRAFadZ7EWz5q4VEzQO89k6OYLLwSLZ3JACNcuK/mUrE4yX3xRTJj+9jcxmUxLCx6QTPMHmbB/v3hPu7YKkjbfg0VJY7A29zrgbMAP4Lr3gl+fEJeA9ePWo1OWuBzy6PcPA5ffj9+VDwGcbPgZdqzn4ZxsWVlicNNOFIwIN6gNGCBCN+fNA24cvMg8scHIkUJgAlBTreItnIeD8bNY5F8HTAcAbbE9kzXesQ03TAx+/BkA+Fj8fy4ALAy9HS3xaNAh5jfcdJzUcMPYMBs6/fTGfGVz5wJDhgQnIC4qEsevqTurc2fhOHrppaCqiHpulv+8AhwNAHeaN+mfALADjfvhKUBkG/gE6IqG7/2keG44AGiLGdxwQ2AloqH8+glIfPoFXPK/mxvLyeTLbb3ScDPj99+Fj1+/TQPx7AwswMnPnQ88F2J7gHBSHX88gOA8J42sWYP0c0/EC1CBORA3B3SHRq96Dubtmjq1sTPbMfI8qOiNMb8/gjEAcH/T/dSYe30ChMBxi8GwO3CgEAlfeQW3yDfqju2DZfv+qXvvyJEimRYgVnV/+hPw8MM4A5/ijKAGBJPTcPvPCW/iVDsZjRuQIoRMxB52QVVUJKouvvCCUOMBnN5wCxz0wN8BoMF9hFcMDrbkZCE23nEHrsX34rGPgAsA4PqGn+19cWvchXc+EfIqSW2vAXgHZ+OcRa9iBl4VnToAaHJ2ndlwQ6g6UmvWCPESgX785puFVv3tt0D7Ah/633A6XsAG4OGG97zxRpNVu1+Nw4O4G7PWXm4qiKWh4XhoEPJx333GGcgbMAt51mJpfE1Kwtcj78LID/+KPk+PBa5smh+woMAkfN0EeT0mKUksfqqrhXhgxXlmNWzTDeeZPpch4Nx5ps2hFu47agn1O0bqPPP7IwvbNBN0nDjP5BxHukicimd//CGOkVDOs6qqQFEjM6w6z6zuq0idZ1YEEsC5eOaW86ymJnLxTH5uYWHgeNA6z+xceNbmv5X7effu4BxcboRtAvbFs1DpXeRFKjvbseI8iyRsU7qEw4WKWxHPNmwQnyHFLqs5z+RvqSjCfbZpU6CNbdvaj5ohBw5WnGfTIFbs7wKAqmK5ouDo0G8hbtOSqm0C9sUzQOSEzssDOnYU97VXHMO1q64u9MQeEIOKFcHr7beBjz4Sud3lFWwtcqCzuq9lOEN+PlD7+/nY/tR2nHF2bWMFwt/XAYkN+2JH5Q4Me34YHv/ucRSfVIz9dfvxws9Cwfi8uhhm4pkd63ldnRgszAZHrQAaqipSOHFNUYTxY9EiBHJk/fhj8Kxv1ixRYvLbb4Hhw+H/4CMcjJ/xJzyBFd3PxvvvA737AHf/RRR0/OUXkfrJiJkzgb/eCyxbGhzKNWqUqFTn9wPr1wOnnCJMXBs2hF80VVUBvXoDf7nLWLeYMwe4YyKw8Guhb5nSMLtat07sj8mTg59OSBDmu5Chjc89ZyguaTn/fPGbXH45cPMtwKefCAHTiCOPFL/P9Oni/jHHCMHzqafEPr7scuCtf4u+4eJLgHlzgSOOaHizPEl17M3tjkHYjhlTyoPMOkcdJTSep582afhNN4kP/vOfm7jPysuDFyZpacCdmIx92Z2Rs/wr4x/R5wOGDxfHXYN4Zjipf/RRKElJODL5Rxx7To7ULmzz2WfAVVeL/ydNFH1HE+Ljgy5R+5CAQ7EUf75mN154EXjoQeAvdwOvzAy4D8ePF1F133wDsRP0dgXJvHnA9u0480zxslmzgp9euBC46GLdbwiIFYVWfPnnP4Fbb8UjD6v417/E+WJERQXQvV8S7hzQFuY+SHOkCJGdDezYISbIYR3Gzz4rrmg0MGGC+F7ffx94yfnni23MfS/FvGrD+PHARRfhhmv9WLdOGL4efAj48QdgyFDgb/cJzam4GHjsyQRsurldyPwWPh9wPubh5Qe34fnnRX+elBgcgv3MM+Izfl1tUmXs1lvFyXHXXUBGRuN4nJ4ufstp04BDfpuHhO0bcAVm4rpZx+HoE5LEDF9HfT3wGi7D9BUnIC/TfMAbMkTopo9OizMUwrVYmR9YvTj19SF/wkWfXIuyK9Lw6G6Rhk5LVhbw66/htyORzrODDxaLH61b3CvOM7145rbzzMpFMyC888xJtU3pPFPV6IRtOnGeuRW2KfspsyIRclzSj1F6jJxnRjnPrO6rSJ1nVgQSQHxvt8UzOxf4zS6cWxHP9N+xoECYrQH3nGcybHPgwMBr3AjbBMTxIQuhWCGUiy0rKzo5zyIJ25TnplvOM+1xajdsExDX5zZvFmuHvDxxXDBsM0ooSlsADwLoAFU9FYrSD8BwqKqFeCBvYClsU1WxSX9xMyqtIYaoastxnkUinvXsGSwqaCdN4UpbawsGmJGYaG1y7/OJ/Th/fnAYqXY7gD3nmRTPfvkFaJvRFqWbADRcCWqbErjaUZRdhAv6X4BnFz+Lvx79V8z6aRZKavYAq87Bqr7vYMm2JTis/WFNPsNu2GaofaUtbR1qv4cb1IAGx93+hhxZEycKFUvLbbeJVWpxMfDWW0iaXowt6ICXEm5A6r4klGYJI4nSGajcCmzwAygy/qyy7AbTSRGE3amBqjbA77Vi3yR0ANROwCYAlXkhzRYAAF+52GZVG+PPVTuJ5ytyzdulZd488Veb70zSrZtJzjNJfHwgs6kJ6+qATm2B+o6iXeU55u3arADdswLPV+YF9q/c73EHAUl+8f+uFPNtSerqgFLkoKYwJ+i1ab2BH7eHeP9f/iIUtpdeEkKChvLy4Mq58T9+h6PwNeYf9hjObgj3NWTsWOCee0SesYMPbkwS3MiOHUJxvfJKbP9sINb7wn8/M/amBwxPG+utbcfvB6qRiriDirAZwK/7xTaSugfeX5oljtWw20tMBIqK8FsNMLBt09f7O4htV+aF2VZcHNCpE3alADuSzF+bWAPshPOLNVrnmdahEtIJoTv+11YDtbrvWp7TsG2zaqeAUNc6dMC2BKAkI7BvdiSJv/UdxTaVzsBWFaioNNcsATFe+JGAmsIi1BQCm9cB+ZrzChD9x2YAvvYAjLb1l78AI0YI2/PYsUEiR7duwBPTVeDwYlR17oVZf1yGi3LjgKa6GYDAfCCuQ7vG8HXDdrcH1lQBMNbBg7AyP7A8vvoV1CWKVdSECU2fD1cYRs/27WKx0727yMGmFc+8lPPMTedZpDnP3Hae+XyiTdEI20xMFJ/jhvOsTRuxfauOHrkds35Jih5WnC5uOc/8ftGu5nKemV1AMcPtnGfRCNvUOs8SEsRr7Ipn2pxn2swFsQrbDFXkx2oeY8CasOpG2KZ0nkUqnmVlif2kDfW3G7YJiDnml1+K60gFBc4qZBPLvAzgJQD3NNxfA+BNWEqm4w2sFAzY1BC6qSoKkhQFEwGsinK7iAZtBxWtnGduV9t0Ip7psXPFUVswwAyrk0y5D+fONXaeyX3kRDyTV0d27Qq4LPTbmTRiEspry/HMomcw9bupGJQ/DHjnZaTGZWLKN8EV5yR2CwaE+p21SfZDYUU8S0gArt43zThHFiAuW99yC/DOO8AbbyBl4ed4DLejbVES9uwJ2LCzs50VDAAaquaVin1eWGg9tBgIv7iye1V8zhzh+JAFALV06+Y8qb5EX20znOtC+73kJAQIfJ/UVOvnNGC+AOrePYwwOHIkMGyYCGvUdXKygmQjxcUoUXLx327Xhm7MzTeL2VpDlUbthBkA8OSTokO44w7k5jZDtU0dcl/J6sIyX5O+YICdq5+lpcYOCLuCf7g+wq77Vo/WeWbXoSLZs6dpUZiUFOvCi7ZgABC4yq+ttgmE7we1fYQcK4wWxkCI7zh8uDgHpk0DfL6m+fn++19gyRLsvHwiVMSF3FdWBSE7ucXcdJ6Fu9BlVzzbtk0Ye6VzQI4Z0j3gRrVNuxXr9OjPy1jlPHOzYIAUu+WC2Mx5Fmm1TUWxVzwKaJrzTAoHGRniZtV5ZtYmiVXxzIrzzGrBgFAVUwF3nWdOwjarqozb5iTnWaiwTbsCYWGhGHdqa4OdZ4A4H+wWDEhJEWP9vn3BYZt2hKVQYZva+ZgV3BLPouk804pncr7jhvOsrCwglMfF2Q/bBMT4sXWrEEMLCpxVyCaWaQNVnQOZZVhVfWhhpiwr4tlNAG6FuD65GcAhDfdJM6Fd8ESz2mZCQvhJZDhkxZlwHbUVp5hd8cxKwQAri0e5jz/5RIT2uek827tX7Ot9+wIVz/S/2aHtD8XxXY/Hff+9D+tK1uGK7pOAmmycmHcD5qyYg437Njb5DLs5z6w6z0JhRTzL9u3BhftfFIm6zUKDbrtN/DhXXAF/eiZm4IbGEEh51dNKtc1Gx4WuTdnZYn/v3CkGRSdikBvi2aZNwhlh5DoDhHi2Z4/1SY4RstqmlTBe/e+nvdKpnaA72V/646tbNzHRNBWWFEUkrl+3TpTK1X2nxoXG2rXA229jdtbN2FubEboxubki/u7114FNm4InzJWVIkzu7LOBXr1cE8/y8yMXz/QOFTuLDb3DRbsd7WeGI1wfIXPHWRlv7rxTRGZrMXOe2cFIPLO6CALCi2dW3UbaibiZeGZp/0+aJAacefOaLpCLi4G2bVF+zuUAQo89VgUhO1UtrYpnVsbEcBe67PyGQCBhd6dO4n2//SYedzNsMz5enFduOc+cCsYSvXjm8wV+91CEEl7S0kQ/ZmU7QMB5lqHphqMRtim3G2m1zbS0QHvtimdmfaE8H+w4z2Qf4bRggPbClhFuFwzYt89e39ycYZuhqhcbhW0Cop/Xu9CtCvZ655ks/uy0YEC4sE23xDOv5DzThm1adZ75/eHFs9raQJ7Mdu2chW126iQe/+UXsTaze+GS2KISipIPQJzBijIMgMNLU7EhbNimqmI3gEuboS3EBG0HFS7nWSRhm5GGbAKiw0lNDd/pW3GK2REmrDjZ7IRtyituf/zRtPphJOKZ3x9wF3XsKCLHjLYzacQkfLb+M/TI64GRbc4GAJzdbhw+2Ps4Tpt9GjpnByfYqqwEcCnwj3UK2mz4M47pckyTbe6r3ocJH01Aje//kJjYqcnzElPx7O23gdWrRYgRxCS7V8Vi4Iy/mY4y4xdtR5q6X4RsmtG2rUiG/9xz2HXhOJTNym6MzpILISmeWXER6Af9nBwxYSopsS+euek8k7l5+vUzfl5eka6oCB0mFopInGfyCh4QPEGXEx4r+8sszEUmXF6/vqkY3cjZZwM9eojKoi++CECMrG+UAt3eB7AWwMaNQGIi5rS9DW2s1H4eP144zE47DeN3d8J15QBOBRptjQ2VJnNzxbnuFDkB7NDBungmjy0pnsnJpH6RbSfhdqVJiKFd8SxcaDdgPVH5f/8LrFoF3Htv4HyRIkROjvvOMzvimfb4duo8syOehfwtzzxTJCicMAGdus7EBwAOmwzgxXrg44+BBx5AfLo4sUONPVYXxtowpnC47TwLJ57ZdZ6NHBmI6P35Z/HXzbBNIHARxgl68UxRxILQLecZII6JcHO4cM4zQJw/hnn5dOidZ9ptAOL7xcVZP69D/RZOnWfasE15TtoRz6yGbYY7XrVj7aWXimNBn5LRqvPMDfEsnKNOkp8vBKqSEvO8b3qaI2wzNVXM90JdhDcK2wTEMVFdHSz6Wh03pGAs3yP3s9OCAeHCNmtqzPeB2bZamvOsujr0hXgrzjMgeF3lJGxTjh9ynaAoDNuMIhMg8uh3h6IshEi0cX5sm2SPsD4jRcF0g9s/FAVnN0cDSfAJbNRZuZXzzA3xDLB2xSQaYZtWnGdWJ/eDBwdC69woGJCeHljorWoIepY51422c1L3k3DDYTdg2snT4K8TI1XHjCLcf+z9yEjKwN6qvUG38rq9QOperK36DuM/Gg/V4JLcE98/gZeWvYTF6f8MORgbimc1NSIX1d13AytXAhCD2rVr7wK++koIEQa3+vgkPJZ0J9C/f+iddM89wDnnYOP5dwAIJN/XimdyUWV2tdHMcZGdHRA0CgtjJ56Fm7A6CWvQUl8vJiWZmdaS4BqJZ0bOMznJjCRsU4pnIcNS4+OBRx8Vsxh5/Ozei1zsRUZdwzGVmQk88ABqcttZWwAddJBIMp+WhvTqvchVG7ajKCKsc8QIAHDNedaxo33nmexf5GRSK7zYcZ7J38cobNOJ8yzchN1Of1pZCfznP4HHpCCVne3MeVZfL/ZzpOKZm86ziMI2AdFxTZkCdO4MZd9e5GEvkiv3igacfDJwyy2WLtzYCdusqLDWd1lxprstnoVylUhUNdh5BogUh4A155lVlx4QCP+3S329ODeNnEaROs8yMqyHDgLhCwYA1h1e4ZxngD3x303nmT5sU7v/MzObP2xTe8y3by+KVeux6nRxI2zTjvMMsB666fOJm5Gw53a1TcBaJIL8jjLSY9cu95xnkkidZ2biGWA/P5+ZeGa174pmzjPZP2hzngGhj9f6+tBt0YpncXFCyLQatql3nknoPIsyqroEwDEARgC4EUB/qOpPsW2UPawUDEgB0AeBouajAawAcK2i4DhVxe1RahtpIFzYplvVNimeBbaVlCTC64qLA84QiRPnWU5OYCKyerX4K8Uzo+0oioJnz3wWAPDF1kD77z7qbtx91N1NXr9rF1D4J+CcKc9j9vbr8fn6z3F8t+Mbn6+qq8ITPzyBOCUOv6W/jI6Z9wMoNGyvYX6X2bPFJf64OCFwvPACelQsxWF7PgUeflhUSTTgiYmi0tzths9qOOgg4O23Uf6puCvFM5knS+Y8A5rmq5CEynkmiaXzLNRECXAW1qClqkosJrXOs3CTSzPxTHt1WyaFtuM8MwrbBCzkdDvrLHFrYPcOYFg74CldtdP0D8OXOG/k3nuBe+/F2FOE4KKtzijJzRWaWtiKjybs3y+Ou7ZtgRUrrL1H9ttZWWIfV1WJ3077m9hZYMvz1ch55iTnmZv9KSDy/Z13nvh/377AceXEebZvnzjfI8l5Jvt5t3KeaZ1nRkIJYOE7nnEGcMYZWPRfUSX4v/8Cjj028HRiWfjt2AnbBMTYEbJSMKzND7Thg6E+O1zKBtl3WRFwS0tFHydzngEB51lOjmhzqL65OZxnFRWiX9GL2pHk1CkrC5w7dsSzUAUDpCvEqkgVznkG2Ou/QglVdp1ncl+Ulor/9c4zu4JEpGGb4SqTA9aPBzfDNq04zwDr4lmo48uuExEIHbYJiHPfrOiT/jtq+zt9/lOrF130Oc8kRs4zK98zXNgmII5V/ThnhBXnmZX5jR3nmd2wzbg4sd/KysRyIidH9KnSYGCEVefZ778Ld6QVR7xZzjNJQYFoI51nUUJRztM90guKUgrgZ6iqxWQSscVKhqseAEapKp5QVTwB4AQAfQGcC+CkaDaOCMKFbXrNeWYl0aXb4pnVsE2rOc8SEoALLhD39Xb1SMI2gabiWbiOPtQAK5ED+UD1MrRNb4vib4qDnn9l+SvYtX8Xnjn9GfjjqlHR7ynTbclJfqPzrL5eOCIGDQJuugmYNQvYuhWXbpuC/fEZwI03mm4rMdHeACQnMGZhm9rX6AnlPJNoxTMrNvZwEwkvOc/k1XRtzrNwrgt9zrPqavH5eoeC1fwbZt8xK0ucR3YLImjDk7TYCb2RmIWTAEL0kA6pcPj9QN++QgySVFWJY8GOg00eW4mJAbFFL7rYWWDL47m5wjbDuXok8jMXLAgszNesEftKUZw5z+RirqXkPLMb5mLmLrHjPLMjnllpjxXxLFzb5PPhnGeAtWNLhsK3bx9wC+zYERCk3cp5Bjh3npmdl5E6z+QxFmvnWTjxzK7zzOi3cOo8A8Tx7TRs06rzLNyxamV+avV4aO6CAYB18Sxc2xIS7Oc8c+o8M8t5tnOnccEAp86zuLjgEFw3wzYB60JvuJxn2nldKOzkPLPyHevrxU1+x/R0MQ/0+0WWAiD0uW2l2iYgxLOCAmu5N43m9Xl5gWOCBQOizrUAnodICXYpgOcgQjkXQlEuj2XDrGJFPOsIQKsJpwPooKrwA7CRmYI4JVzYplvVNuk8C27b4MEizdcllzTdjvxMK+jFM33YZrjtWKmEKn+7+toUjD1iLD76/SMs374cAOCv92PKt1MwpMMQXH/Y9WhXehZKez2FylpjpSA9XSxqG8Wl//xHhGpOnAjccYfYQRMn4qSSN/FJlxuCrV067C4Q5ODesaNog0zImpkZPo+X2aJR27xYhm1G23mmDeWxUjDAyHkmtyMrZsmrlNp8aKEIlWC5W7cwFTcNMBPP0tNtOM8aCHWBQIoeVoSv6mohgC9fHnhMnuN5eWJhZqcwiUxGDkS2wHZTPHMzbLOuTpzPMnTzo4+AefOAa6911jbAXDyzkkhaEk48s3puu1YwQIOZg8NKHyETLIdzGGjDmKy0x2xBLHESwmaEE/GsXTtxHskxVf4O4VwIdsI2nTrPzM7LSBZnTsWzUM4gu+KZdJ6FC9u04zyT7iQ9TnOeAeL41lZsdrNggJNqm2a47TwL1QfadZ7JCrZW2xZKPItV2GZurvjfzHlmVTyT+0y2obAw+LeNVdhmOOcZ4M4FY+1zTr5jenrAQNCrl/gbiXgm99OOHeK3sDIvMRIIFSVw0V5eiKHzLGrUA+gLVR0NVR0NoB+EnnQEAOMwJo9hRTybDGCZouAlRcHLAJYCmKIoSAfwaTQbRwRWq22mpEQWtmklKaUVYiGeWaneaWexl5AgOtNzzmkabuGG8yw+3rzaph4r4lliomhvdTVw8+E3Iz0xHZO/mYyK2grMWzkPv+39DZNGTIKiKOi2bRL8yXvw0rKXDLcVF6cTSyZPFqPKhRcKBWT0aOD116FCwYIet4dse2Ji4MqTFeRkSOaIk/kzEhPDC0KhCgZICgoCE4nmrrbZnM4zpwUDgGDxTPtcJAUDAHHo2HWeyWPQDfEslHvGjngmfx/t/tA6zwBri2zt8RDOeWZFDJL7KlTOs1iEbfp8ouhKQYGoA3HddcK59/e/i+fturKA0OKZqlr7nmbimXTS2AnJAkLnPLPrrovEeRYuR4xE68QIh9WwTcDawiXUsWVHPNu2TfyVYVMyb41WPGvtzjOrxykg9oXW7aklWs4zOwUDzH4Hp9U2gcicZ+EKBjiptmmGVaHRivNMVUO3KVbOM7uRCFbCNs3Qi0BxccL9LnOe6Z1ndsM25dxPG7IJuFdt0848FbAmnlnpv9x2nunFs7S0wEVUN5xn2rG2oMBaYTgzgVCOH3SeRZ0uUNUdmvs7AfSCqu4F4NA+0LyEFc9UFS9AJHV7p+F2pKrieVVFpapiUnSbRwDr1TZTU70Rthkr51m47Vmx88q2hZrcOxXPcnLExLWiIhCbb2U7VsQzRQm4LnJTc3H9Yddj9s+zkflQJi7690XoltsN5/UVYebpe0civWQYpn47Fb5645lMY3WeH34QBQFuvz3wxRsqFP4n+2KUZBQZvl9i13GhvXIpF3dSDLAatql3XMj3x8UJZ1Bamvi/tTnP5IJAWzAg1IRQPynRXp2srg6+sh1p2CYgxLONG+1Nnt0M2wzlnrEjnsnfR7s/5DluZzvaY0vue73wJfejFfHZSs4zt8M2rV6MSEkR+c4++ADYuhV4+eXAb+G28wywJryEc57ZCckCrIVtWv2OZuF1Vn5H6TwLh13nmZviWTTCNoGAc0D+Dm6GbWZni3PMaiEDKZppi2Nocdt5ZmV/ydB1I1diNJxndsM2Q6VHsOs8k+fAzp3B+ysaBQPsVNs0w+q+suI8077OrD1A+DZlZYl2uRm26Ua1Tbn9UN/RSAQqLAyEbbpVMEBbLED7eW6FbVqtkhlqW247z5zkddM6z+T73HSeAdbDNs3Oazl+FBSwYECU+R8UZQEU5UooypUA5gP4CoqSDmBfbJtmDSvOMwCoBrANwF4APRQFR0evSUSPHeeZV8SzcJ10LMI2rVyRsNI2O9U2VTWwsNY6EwoLrW8n1KCoRZv09L5j7sO0k6eh+MRiFJ9YjHlj5iE+Tox4vjoFRX9Mwvp96/HWqrcMt9VYnae4WMz6r78+8OSQIcDbb+ORwkfDLtLsLoy1ky+5uJMDvxXxzKg90nnWpk0gnMlq0uBwk0yZBNVrzjOn1TaBgPMsEvHMLGzT7w9UlbSC/Ey9ICSdZ1YWshK3wjatOM/sbCchIbCwdpxoHt4N25T96YUXivuTJgFDhwaed1IwIFTOM8Cai0AvnkkRSR73imItr5v2d2zXLlA4Qksk/aAWqznPrIhBmZni+7nlPLM6nlnNeWblN9y2Tbxe9vFGzjO3wjZzcsS+teJ4/fhjMX799pu3cp6F+h2j4TyzG7YZSjyzm/NMOoKk80zuf3nhxcoFCbfCNq06z9yqtglYE5bCtUlRxAXHWOU8czNsExCiiAzb1LYxkoIBbjjPmiPnGWAv9YZb1TaNxDNA9BUyzD7UuR3uYpBWPIskbBMAevQQ50+bNuI5VbUeNUNscSuAlwEcAuBQAK8AuBWqWglVPS6G7bJM2GqbioLrAIwD0AnAMgDDAHwLYFRUW0YasZrzLDW1ZVTbVNXYFAywu9gzw47zTA7IclKZny/yR8grJFa2E86xJNHmbchNzcXtw2433V67fWfDn9cTxd8UY0y/MVB0l6JTUoCcPb8D/3sLuPPOplaKc87BnruAojCLDrsuPe3kSzrP9OKZ2WLWTDyTEwdtUlerYlA48UxRrF8Vby7nWUaG2FZ8vHPxTD+5dCtsExChm127ht+WbIu2bZKMDPF76x1yoQhVMEBW1HXLeWYlR4z2Cm+osE1A9Enh+me3xTOz6lcSO86zxERRNfKLL4CRI43bZjdsMy6uqZvHyqJKIsWz5GRxHktnorYPseJI0E7ECwtFNdeBA4Nf41bYppU+wmrYpqIEFpPhsOM8s3LV303nWbt2ASdVtJ1ngAjJ1rqtjNiyRXzum28GFtdu5jwrKwP69BH/2y0Y4JZ4Jp1n0smmqpFX2zQ7LtLS7FfbbNtW5EHatk28Vxu2CYjvGe53dCts06rzzMq+ak7nGSDmrHbFM7O2OXGeGR2vcvtOxLNFi8Tv6tR5Js+35nKeeTHnWSQCoZxXdOpkrcJvuPFM7zyrrHQetnn77cDZZwfmz/K1Vi6uEBuoqgpgXsOtRWLlkBgHYAiAjaqK4yBUQgvTLeIWVqtteilsc/9+845VKvlWqmNacfXInEBWwozq6sK7VcK52OwUDJCDglY8AwKx+YD1apvhvp/VvA21tUBSYjzuGH4HFm1dhC83fmm4rbN+myp+pLFjDbcTzk4NROa4MBPPzL6j2SAnXQl68czORCLU4G1VPIu280xbMAAIfTVVVcXNqvPMSgVdIPR37N5d/LWT9yxUwQDAXt4zt5xnRuJZJM6zcAUDAGuT1LKygKtSj10R20rYppWS8EBgUawowDHHND02nDrP8vKanu92xTOZK1L2z/rFvxXnmX4ifvjhTY8zu9/RLLF7fLxor5WCAVYoLIxN2KZbOc+keCax6zyzm/MMsJbPUH7mnDmhnWexKBhgdgHBqfNM2+cYOc/cCtu06zxLShIOkvXrxWN68cxK6Kab1TatFAwAwjtd3HCeWS0YADgTz9zMeRap80z7HQsLgc2bm7bRqvNM+zu65TyTY6OeaIhnbuc8cxK2KfuIoiJrfU64dUZSUuA7Rxq2mZkJHHxw8HMsGhCMoigpiqL8oCjKckVRViiKcn/D43mKonyiKMrahr+5ITYyDIryIxSlAopSC0XxQ1EsBih7AytTrGpVRTUAKAqSVRWrAfSObrOIlnBhm17LeSY7arPJiR3LuJ2y21bCNlU1/KDmpvPMTDyT9mIr27HjPLMyAZATyysGXYGCtAIUf1Pc5DWFcbtx8raXgMsua3pprQEr4pkT51lCgrjpwzatFAwwak96enCBBsC+8yzU8eBF5xkQ+mqqUbiSm84zo+/YsaN43E7FTb0gKJHimZ28Z6GcZ5mZYl/YEb204quTnGdWCgbYDdvMyjKeiMe62maovsup80wfsglYF89kUQH5Hc3EMzvOMyvVySLNeQaEX4BaDdsExGKjuQsGWA3btFowQLt4tes8sxu2CVhbgMp+8KefgB9/FP8b5cGL5EKJ7Cti4TzTXwCV/bHeceRmwYDqaushVPLcLiwMjDdOxLNwY7adaptWwjaB8PvLDeeZ1YIBgLviWXOGbRp9x4KCQH/ghZxnocZGWSTLqnhmpfiAnQvGofrESNx1WueZG+IZEPh+cl1VXx+6bW4XRTjAqAEwSlXVQRBhl6coijIMwF0APlNVtSeAzxrum/EkgIsBrAWQCuA6AE9Es9FuY+G6AzYrCnIgigV8oigoAbA1mo0iwYQL29Q6z+xWoJOYXeFxgnYRblT5zap4BlgTJsJZ6yXaiU6o1zaHeGbHeWZVHLQjnrX1bUHqa5/gtsQjcd/atzF9+qXIigvMxnomrsLW7Cp0mzjRdDtWQxG03yEcWoHDScEAo/YoCnDQQSKfgcRuDq+W4DwzEs9CufSA0M4zbdheRoZ4LNy5Eeo7xscDXbrYc56VlYl26CdP8ju65TyLixOL4+Z0nmmFWXmMGyUVB6wdE6WlxiGb8jOsbgdwv9qmW8mHJeHEM6uClxXxzGr/bEU8sxO2KZ3XehIT3QnbBEQfu3attfbI0GYz7DjPQglxdoo+bN8OHHlk4H63bmLbMiw8OTngNjcSlZ2GbYZDuw/eekv0V/rPcOo827NH9Dfy94iF80y/3zIyRDv054BbYZvaMD39OWqEDPcrKAAWLxaPaQsGAO44z+xU2wwnPlvtI8KFRkYjbHPRovCv036mmwUDIq22qRfPJNrtalOehEI75+3QQfzt2TP4NXaFpVDrLqvzVLktIHLxTOsoNcONnGduOc8AsZ927w5Oh1Nba36OWLkoTueZMaoIuZS9Z2LDTQVwNoBjGx6fCeALAH8OsaHfoCjxUFU/gJegKN9EqclRIax8oao4t+HfvysK/gsgG8CHUW0VCaKlOc/C2Y2jJZ5ZWexpX29Gc4lndp1n4faX1QlAbS0wbskVwIef45ZU4NFxwLiS2cEvOhZ4u1821vbpA7MxNFphm3Ji5FbBAAD47rtg91JWlrVwJTfDNpvDeZaQEDiPQx0P4cSz6upgcUJOQmpqrIlnZt+xWzf7YZt6xwZgP2zT7w+/gMnNdV4wQDrPZAL6WIVtmolnslBGc1fblE7faDjPOndu+rjVZPP6hUYkzjMrfYSTaptO3RvRCts0a4+kuatt1taKBZPWeZafL5L0SzeIVtwwOvedhG1acZ7JfTB4sBBvjIRep86zt98Wf085Rfx1y3kmc/9Z6VP1F5XS041FLbfCNuW2q6qsiWd1dWK8z8kJ/F5651mkBXC0j1vpI9x0nimKeZu87DzzQtimfhuA9ZQnWvFs8GBRPVw/DrnlPAM0Ve8tEEo8S0oS39eq88zqsepEPJPnr52cZ1bEMyDYlFBXZy6e0XkWkgRFUbRy+QxVVWdoX6AoSjyAxQB6AHhKVdXvFUVpq6rqNgBQVXWboiiFMGc/FCUJwDIoymSIgpRhsux6CysFA7oD2KyqqAGgAOgCIA2Aw9T0xC5Wc555qdom0HzimdXt2ckxFmpAs1NtU05EQ4VtNnfOs14VSzBw5+fA3/6G/KuuwobaMuyrDR5VL5/2Cb7u/H/4dN2nOLH7iYbbiVbYpt55FmnBAO22JG4VDAC85TzLyAhcMQx1PBiFKyUni2OyrKxpzjPtZDVUIvlwQm+3bsAPP4T/LhJteJIWO6E3gHkOKS1WxTOt80w6WrT7y64IZ0U8sxq2aeT0lYRzLGmxGrYZi5BGQCzmDj206eNWwzbdFM+i4TwLJVaF+x3thm1WVDQ9343a47WcZzLcVB82JfOeadtk1n7ZD7rtPJO/z6WXCvHMrIiHk4XZ3Lkif+Qhh4j7bjnPZO4/O84zbdimkajltvNs/35jIVKPNmxToq22CdgL2zRrlxSxrBzzVl364Y4Jea6aOYOsOs8UxZrInp8v+lN5gSgUVsI2rR4P9fXitaHEM7sCoZnzzEnYJmB8AcdN8cwt5xkgjn+rOc+s5udzkvNM6zxLTBTbckM8i4sTblwr/WE0xuxWhE9V1cNDvUAVbrFDFEXJAfC2oigDbH7G5RBpw/4EYDyAIgCjHbQ1Zli5PvlvAH5FQQ8ALwDoCmB26LcQNwknnnmx2iZgfpXDqhgERMd5FmofSadEc4ZtNnfOs+tKilGVmAmMHw906YKcXgejy4Ajg26d6+5G/P72hvnQJNFwnlVVmYtnTnOeGeG2eGY1XBaInvOsvDzYXWfXeQYE9otRKXcgciGhe3chLFkRlwD3nGdGeU702BXPfL7AdrULi7w862GbMjwiXLXNSJ1ngL2Fi1thm1b6rmiEbXpNPHPTeRbOvWEnbFOKC+HcZ17MebZ9u/irT9httC2zNlnJ7yOx6zyLjwfGjBH3jc5LJ86z3buBzz4T29VeJJGfGY5wv6NV8UwvTGRkmItnVhefoeZdWueZFaRzVl8kSLYVsB62GU5kshLa7aabJ1TfAFgXz6xcvAYC/awV95mbOc/kPo00bFP722mPB/38xucLv+/ddmU1V9gmYN3FZuU7uhG22amTNcHeipM6M1MUB4mLszYO2akoyrBNc1RV3QcRnnkKgB2KorQHgIa/5tlUVXUjVLUaqloGYDqAl6Gqv0W9wS5iZalZr6rwATgXwGOqivEAjDOIk6igHWzC5Tw7EJ1nbopnVjrVSKpt9u8vBuoePexdqY+LCz+AWBLP1q/HGVVz8L++N4a0qaQlJyPt57H4ZN0nWLptqeFroh22WVQkmti7oTyJ02qbRnjReRZpjgXpPJPYzXkGBPaL3oliNRwuXJiLTOgtK16Fw0w8k+eTVfEs3KQeEOLZ3r3ht6X9faT7zKnzTO7/Xr3E76/NywfYOyZC5TyT27ITtulGwYBoXOGVx6feTQpYF3mtimd23HWh+ggn/aDZeGzFeWa1H5T7sDnFM7fCNmWb27QJ3ya7FxGMSEkR27Oa8ywpSSwQTzmlaV4kwJnz7J13xHsuuCDwmNWKj0Do4wpw7jzr2bNp3wXYEwhDOV60zjMrSPE/UvHM6kUEN6ptWu0jwrlErYZtWhXY7eTxDJePze4YBEQWtqn/jlonot55BlgLv7XqyvKa8yw7217Os1A4CduU7erRQ1yIkHkp09JCz+OsXAzq3RsYOFD8byUyiGGbzlEUpaDBcQZFUVIBnABgNYB3AVzZ8LIrAcwPsZEvoChZUJQ8AMshcp5NjWa73cbKFKtOUXAxxM5Y0PCYBc8QcQt5opvlrDnQc55Z3Z4V0ctKfrFInGdHHSUWue3b23OeWdlXlnKeTZuGesThf4eNC/my5GQgbslNyEjKwJRvpxi+JtphmzIv2VlniftOCwYYkZkpBler+Yyao9qm3X2lRy+eReI80zoA5baA8OJZuPPHSo4LLWbimR0BG4iO80y2T+4TeY7bEc/kfhowQEwgzZIP26m2aYadq/5edp6tXy/+ysm3lljmPHO7YEAkOc/shG0C4StuxiJs0+pvGKpd4VxZdsI2geAcWqHQnj/z5wMzZzZ9jRPnmT5kE3AvbBNw7jybPh1YsKDp69wK27TrPDMK23RaMMDKvLI1O8/sOBtDVQkG7OU8k/2ukRgkHUb/z955h1lSlG3/VxN2dmcjG2CXnJMkBQkLIopiRBRBMAHCa8CMsArmV8DAElQUFRXkMyFgwvBiREWWnKOSWdISNsfZmenvj5ra06dPh6rqp8/p3a37uuaamXP61Knurq5w130/TxF5ljzHSZMa19lnfrM2kGdZ91VSeVbGtvmWt8C8eY3nsKjPsVlnnHsuXDUSid1mbhgSBpTCDOBqpdSdwE3AX6Io+j3wVeDVSqkHgFeP/J+FiSOqs8OBi4miPdEk3FoDm+7zPcAHgDOjiEeUYivgJ9VWKyCOODmWF/PM17aZF1vAB9LkWdFk1VZ55rIjYRPg2oc8g8Z1drG55J7bVVfBt7/NqbdFvDAfeGPOsX//O5f3vINlG2yac9BIlrIlk3j/S97LN2/4JgtXLkQlUgcseD383wbwvt9tzAVvuICertYb6qO4iO9axs+7TMyzJOJtNG/xVUW2zaw6SijP4kRTX1/2s5MW8wyabZtZMc/yUPT8xLOm5SGKIj5/9eeZ1/8Kdh7/ypb3fUhZsIt5lpWZzyBJnhk7V1x5duutxXVKTsTT+l/XhAFFMc/abdusQnlmEk5svXXre1XYNouURlXYNsvEPOuUbdP2mZRSntmM+0Vludg2QT9fLsozyJ5XuSrPjGXzk59s7p+kEgaA3tzwUZ7ljWkSCQNsCKE4bGybtgkDbGLNSsQ8c0kY0E7lmSt51tOTr663XaMUkeNFTou0c+zq0krVefPqoTyTtm329mbPXSZMgEcfLS6nKuWZeY6Uaj5nCfIs7syRinkWlGfpiKLoTqAl4mwURS8AB1sW04O2dr4N+Ixg9dqGQvoiirgX+Gjs/0fIZxQDhGE6n9Gj0x9k0xGYtOyusNnBdYFRP7RbeSZh27Spm1L2k4A08sxAJIHB0BB85COwYAEbqC1Rq4Fncgp78Yv58k2f4Y0FRKlRLZ0y8xRuffpW5i2d13LM8BhY2r2K79/6B1651Ss5epejW47xITni6qk4enr0ACkV8wx0G82z/Uhn28yb3Egoz+LBskeP1pPENOQpz55/vjXNt60dztQ963rZBPoFuHbutZxxzRl07/VLxq26m6RI2vVa2SrPBge1AiyrDULz4mbx4tZn3Ed5lgVbQnVoSNe7brbNKpRnhjzbZpvW91zJs2QcljIxz6Rtm74xz3xsm3nKsyiqZ8wzm3G/qE4utk2wV57ZPD/d3W59vbFsmjhqBnVQnmWhu9ueLLFRnrnaNg05HM9CPWqU/t/WtmmjPJPItmm7iSClPLNt8y624KRiPYmeHvtQC0U2xCLyLOscN9xQz4t8YrraXDfXeGBFyjOXbJt5fY5twoCqY54lIUGexSFl21yPEwa0A18C/gT8myi6CaW2Bh7ocJ2cUEhfKMUjQJR8PYpI2fcNqALmQTdBLZMwnd2oUfr9IuVEEjYLSxeMHq07pXbHPJOwbbpk7vRVnhl0ddlNoHN3P3/7W3jwQbjsMs7995H8v/8HC27OL+/eLniLxW7q0BBs1L8x/zjuH6nHTJoE7zxumKu23YnZc2Zz1IuOQiUans+iMY/MypswuQyyRQSvgc3iymXBUaVMfN482G23xv95C/888uy++/TfyVTuYKc8y4vPZ6s8mz1nNgrF0OT7eG7FH0nKKatSnoFWluSRZ0nlmemf4sqzpUuLJ8aS9ggzwZYgz0zSFFvFRd54U5XybNKkxv2KQzrmWSdtm1mZ7SSzbY4fr4/NI3vNd9Ut5pmE8szVtmlrfTIqkDz09NglmgHdn5x5po6ZGrdsgqzyrL/fLu6jTZs379uOZ3n9oavyzNg240mHTB+llO7f22nblFTzFCnPTAbDIuWZrW3TtX0VkWcStk2wI8/SztG0iTTlmc38RlqVVaQ8W7rUbm5bRJ51OuZZu8gzKdtmSBhQIaLocuDy2P8Psw5m29wLeOnIz8vQmRGCbbONiCvPsmKedXf7K1ekyTOl8uXGnUoYYLMjYUvEuZJneSoC7536KILZs7V/6fDDrRIGDA3pj9ksjCF/ATM8DN1dXZyyn1anXf3o1S3HSCouIH/C5JowANpLnhWRKWWUZwsXwlNPwc47N17LSxiQZds0cebA37aZd442i6D7n7+fK/9zJbNmfgoWbcatY1ozvlahPDPEU9EEM5kwIE15BnZ2P6ldbBvyzLbPck3AkvdsV6U8S7Nsgv0iKBnEuI7ZNrPaalHMMxfbplLF2YKL4hgZSMU86+7W5yhBntkmDLAdN2wzWhctisEt5tknPwmPPQbf+14rUW3aXV2VZy62zazyXJVnhrw0Ma6ScTNdyDMJ+7qLmqeoTRTNkaB43uxCsLvaNvPq5hI6wMa26WNNzSPPJJRnpi+xtW3mtS8zntuo9Yr6HEP8Ry1SmGZUHfMsiarIs2DbrDGUuhilLmr5WYtQ2CSjiBdiP09GEV8HWoPQBFQGW+VZXcgzyJcbdzphQNmYZ6YsW/Ksvz9bmWFTTibpcu21cP31cPLJ0N29xmqZNzgWSeENbMmzri549+7vZqOxGzF7TnmSo0j2nxcE3zVhAMiQZ2PH6vMrG+unjPLs3nv17xe9qPGab8IA87z5JgzIO0ebcs6Zcw6je0Zzws4nwXUn8Rj/4sYnb2w6pgryzMQLKyLPbJRnUKzgkLRtmjrnxTyz3fW37SOkJqmuqqyHHsomz0ydfGOeGftmvDwJ8sz12S4T88xlEwGKCSFz/kULdinbJtiRli7KMynbpi15ZmPbtI0H9ve/w3e+AyedBPvv3/q+iSEkpTzziXmWBamEAT7Ks95e/RxMm9ZKnhlFj005Em21ncozsCPPXJVnttlc8+rmkrSmStum+Xy8LJBJGAD2pLGNbRPs4p7Z2DYHB2XUde20bbqOZy7zEslQCwFO+D3wh5GfvwETAIseuT6wsW2+JPZvF1qJlpL/LKAqxMmztM7KdOiuGegMqiLP6qY865RtM8t+Y8pp6eQNA6YU9PU1D7AmAA3AWWdpj+NxxwH6/kVR/g6U7bVyIc9G94zmI3t/hM9e/VluffpWdp7WkD8NKaAHlg/AwFAXo7qzR/fVQ6tZsXqIntGwMmPAGtUPy1YBtK7kfGKeFRElNosEc3+XLWsEj09Dlcqze+7Rv22VZ3nkmYFPzLMiQii+CIqiiFVDzQU+u+xZ/t+d/4/j9zie0UMbwq3/w5jX/S9nXXsWPzm8IXiOt6uVgzCqexRdqvnmDwwNMBxpid3i5fp41ZvdtvrG6mOeW6CP6evua7EhQyt5lqU8K4p7Vlfbpmt/OjDQSjq5lOUySR0a0kGP3/zm9PeVsiM4JG2bEvFTBocHGRxuXIDlA9A7Jr2t9vT2MTiYHZfBRVUC9uRZu2yb5rvaoTxztW0WqfQMbGOe2QSHP/542H57OOOM7ONsyLPhYX3NJMgzW+WZK3mW1Y+4KM+iqPn6T5vWasMfN84+YUC7sm26KM/KkmcuCQPWZttmJ5Rn4EaeFdk2QY48Ax33LK/9SGaGhXLkmREC+MQ8s9lgygtvFJRnFSKKftn0v1I/B/7amcr4wWbv4ZzY34PAI+gMCQFtQty2mdYhmAHeNgB9EkWDlA8kybPVq/MHLVu1mEsgSUnyLGtCCCnKs9NPh89/vvH/GWcwOPiZxrkdeij84Q+N97/whTUzy/juWTvJM4ATX3oiX/n3V9jzwj1bD/wsvPU24Da46E0X8Z4Xv6flkH8//m9ecckrGHzvIBcDF5+Z8aXvgkeBzf7ySb726q9l1qcItpOSwUFguz/w0suP4dYP3MxWG2zVcoy5v0XkWdFE3NS9aHK5cOVCdv3OrnzuwM/xvj3fB2jyrL8fttiicVyh8kwN879PzeTWq/bjvNeeBzSTZ77Ks7y2FS/nqCuO4vJ7L285RqH4xH6fYMkzwMB4Dpl8Ir+876v88szm8ZbPwv8Owf+eCdtP2Z67TrxrDTn7q/t+xRGXHUEUD9f5WTjgKuCqnBP4LLzpRuBGOHb3Y/nRm3/UckjStplUntkq2Npt26yKPMvrI6QtjU89pfvvLOUZ5Ld7AxfyzGZhDP7n+Piix9n1O7uyeFWswbxTT7QuTekHp+12GNvd8pvM73JR4EIxIbQ2k2e2yrMqbJs2Mc+Knut77tF2zUsvzV/w2rRT876EbdNWeeZq25RQnpnvM9f/rW9tvRe2tk3brMNFtjpJ5VmRehDWH9umT8yzgw+Gf/8bJk9uLguK25etYs/Wkl1k25Qkz+LzkunTs4+zaatK6Z+qbZuumxtgrzyznXsF5VlbsB2weacr4YLCbiCKeEU7KhKQjbjyLK1zNwNhWdtm0W6WCyTJM9DnnRXE2zVhgE3MMxsizjbbprXybMkSOOcc7c144xvhyivhnHPoPuBj9PSMg5tv1sTZ0UfD7rvrE3rf+9aUFScmshbRVdg2ASaPmcxvjv4NNz/VnK1g3jz4+tfhHe+AO6KfcOY1Z3LM7sfQ3dU8cp15zZlMHjOZ+X84iZkz4XWvS//Ob54PA5v+mfNvPJ9Z+89ian8ju0A15FkEB32RhQPzOfe6czn/9ee3HGPIs6JFR9FEXCk7UvZ7N3+PJxY/wRn/OoP37PEeert7ufderTqLn3/eAnR4GNjuDzy08gYuuPk2Prn/J5kxfkam8swloK6N8uzR5fdw+b2X89ad3speG+/VdMwOU3Zguynbcd1/9f/v3vI0DtxzGgNDzQ/cpz8NL3857L7/M3zjhm9w6d2XcszuxxBFEV/655fYeoOt+Z+X/A8At90Gl12mHc5ZCSkWLoSvfQ0OPxwGZ1zHj+/8MZ878HNsM7k5rWOR8sw2KYKkbdNk0ZKIeSZp23RRntkssvMybRp0SnmW1/fkneN5153H8tXLOf0Vp9PTpQ88/XSd/OOww5qPve2Z27jsnsuYNuY2UrLFr/kOV9tm3qLRljzr7tbfWzbmmfku27h1ZZIPdNK2abPANtcyLTlGHDbqJ5vYdZ1UnuUREyYIvm1sUfMZ0PuLSYwbB3PnFpdlS/QWWfQlVcY2hJ6N8qwq26aU8qxoHBozJj+uaBZBMnMm/OlPrWXBum/bBDu3hS1BWLXyLCs2bx5syTNJdV2AI5RaQnMiymeAT3WoNl6w7D4DOom48iztQTYdga9t0yYTnSsmTICnn05/ryryzMVmlIV22zablGff/75eBZ93Hrz0pXDQQbDffhz00A+5v+9jOjnAhAk6anDKKtnGWueqPMubTCQVDq/a+lW8autXNR3zn//A1/8Nb/wgHL77dhxx+RH8+v5fc8TOR6w55q55d3HVg1dx+ivO4HOzTuWgA+HUA9K/88pPAivfxHUveREX3HQBn395Q6VXRcKA+1b8Eza5mY36N+ai2y/iiwd9kSn9U5qOiSvP8mBLluRNLlcNruIbN3yDjcdvzNzFc/nFPb/gXbu9i3vugVe/uvlY01+kfe/QELD/bCZ2b8TioWc5/8bz+fLBXy6tPCtaGPf2apLwn6vPpr+vn++98Xst19PA3JuNJk3grft9ouX9/70JXrovfO01EX975G+cPeds3r3bu/nrw3/ljnl38MM3/ZDjX3w8AD/8D1z2b/joT2HzjP2tRYvga4fCAYfD0W94mi0f3JJzrzuXb7/h2y3nCLqtLV7cqjxziZ8iNYGTjHnW7v7URXlmyLM85ZkN8eJCng0NFSufu7vtLCDJc1ywYgHfv/X7HL3L0Xz2wM+uef2Ma2HmLq394MKVC/nlnX/k6S3PBn6a+l2dsm1CMYkzPKx/2m3blIx5ZqN+kop5Zupt8ywWXS+b2HX9/bqN2mQKBvmYZ1n3wSS2sL32kH/9250wQFJlbNO2JJVnLrbNFSta48vF4RLzrCrbZlZZ0BnyzMa2aZvhV4I8s7X02sZstCXP0rJ2+5BnNg4jFxt1IM8qQBSt9aG/HJpkQKdgkzAgrjxztW3aZtNyQRXKsyy4EF4gE/PMNWFAXp0GBkYqdd55Wkrz0pfqN/fdFw44gMMePo+tB/8LV1wBH/hAprzEhvCyXRjbEHE2ZFX8mr95xzez7eRtOevas4hiWQ3Ovu5sxvaO5YTdTmz67qx69SzYmTds9wbOv/F8VqxuNAwX5Vlvry6riDz709LZsGwal7z2SpavXs4FN13Qckw85lkebHaMi0jZn931M55e+jQXH3YxO0/bmdlzZrNgQdSSaRPyVRe3PXc9bHENh294GofvdDjfufk7LFm1pHTMs6IAy0pB37QnuVv9lOP3OD6TOIPGvcmajJtrpZTilP1O4a5n7+JPD/2Js+acxYxxM3jnru9cc6zNBoEh5xctghnjZ/CuXd/FxbdfzHPLnms5R9BqkDzlmU2iEynrQKdjnpUpy1V51t0Nm22WfYy08gyK+0FfBeF3b/4uy1Yv45T9Tml6PSthwKTRk9hq/vtYsMkveGzhY6nf5WrblCTPihTZtuOrtG2zKOaZq22zKGOdTV9vozxLZoXNgqTyDIoVXlVl2yyKLeqjPEtD3vw0WVa7Yp7ZbpRIKM9cEgZI2jZ9lGfSts002I7Z0uSZtG3TJnOnUalnoRPKs6Gh9HlvGeVZ0TrP1kYdbJsBaQjk2VqAwUHdeWTFC0jGPKuD8qyd5FkVi722K88uvRSeeAJmzWo+YNYsNlr5GOc8+Cbdm3/sY5ll2eyeSdk2bQN5xheN3V3dfGLfT3DTUzfxr8f+BcDcRXP52V0/44QXn0C/mtx0Hln1WrkSZs2cxfPLn+dHt/9ozXuui8aiCfTdz97NPQN/hBs+wkum75lK2IG9bbOs8mw4Gmb2nNnsMX0PXr31qzllv1O4c96dXHzNn4HmTJuQT6b+6IHZsGIDXj3lBGbNnMXClQv5wa0/aCJf4vdByrYJwD7fIGKIT6SoyeIw9yaLEIo/g2/f9e1sMn4TPnbVx/jrw3/lo/t8lL6exqzbhgDo7tYEmiGiTpl5CisGV/Dtm5qVZ+Y7J09Oj3nmotKTzLbZ1ZUfX9F217/d2TZdlWebb14cV8+WPDPl7L03HHUUvOQlzcfZxnXz2cVeObiSb9zwDQ7Z5hB2n757U3mDg9n94E4LPw4ozrv+vNT3q8q2aas8s9mcslE+29hlu7ryz7Xo/vkoz0xSnjxIKc9c5jZF5Iat8gyKx7J2Z9sEe+WZzTVzsae2K9umbV8vZdt0VZ5J2DZ9Yp75Ks9cztFmzI4i+zmmlG3TzH0kbJtmc7BIcWl73WzjutmQZ5D+PFZl25ROihCw/iGz+SjF4YmXIuB54PYowuJRDpCC2f3KmohIZduUJs8WL06X4taZPHNJPmBLnm28MXDjjdrDmMCbFsOER4CvflWzH8lgX298I4+N2ZEtVtwP73nPSGHpsJkASCUMsB3UkhPC4/Y4ji/84wt87urP8d6XvJffP/B7oijipP1OWnOPi5RnK1fCgVscyN6b7M3Z153NuFF6VvDYJFi4Bfz4jvw6rcHucEeUffyl91zKKPoZuOmD9PRowu6gSw7iU3/9FC/d+KVrjntsPrAb/GEuPJPz3Y+Mh8Vb5ddv8EVwT0/6MQ8teIj7nr+Pn7zlJyileMeu7+CzV3+Wb939BdjtWf4zGubHPnd7pOv107thg0mN15etXsbVT/8abjqNcfuPY59N9+HALQ7kvOvP43+2mgq76eP+8izcGyuv+8Vw80B+/R8aB8u2zT4mImLVrt9jy+VHpiZfiMNWeQY62+bH9/04s/4yi3GjxvGBvT7QdKwtATBhQoM822naThy6/aF868ZvsfUGW6PQHdlNq4DdYGgbeLAX+pbq/3/9kG7vy5br//+1CPpzrtXjG8CSjHttMPdJXdbfn4cNHt2cl2/58vSyljzM6L2v5Sd3Zpf13Ma6H41/314b78VO03Za8//zy5/nNw9fBbtFXLsEVubU7Y7Fum6/eQRWTt2OfTfdt+WYssqzKIr47X9+y5JVujFcvwLG7Jt/zZZsDY/05x9zzUjdf/soTByJV/SG0+B3jwExQdedUTeMehOrVrXGDBgcHuTX9/2au7pWMrxr/vcNjzyLtww2jrv16VuZt2wen5z5yaZji8bjCWzGuEfezg/6fsCLp7+4Jcvs0xvqa2rbDz63MSyYn338nXN13a+eD08WlDn4IrinO7usFSt0WQ+zMXBwZjk2SR9sSATbhAE+i+y8hap0zLO1VXlma+0yZUooz2yumQsRV5a4HB7W82CpxbqUbdNWleXiaCnKBCqdbVPKmmqzznDpKzqVbTMvbIOLus6mbUjaNkE/28mEW1XZNiU3LgPWT+Q1n0NTXpsM7KYUJ0QRf6+oTgEJmLgLWZ1V2WybVSnPhobSB1NbAgfsAnm6WC3j31+mLBfybPzo1TrFT8qWz5fi//z4x62jRFcXP9rkM5z20AmMOqXZ2pNEFTHPypJnSTXkmN4xnLTvSXz675/mmsevAeDdu72bLSdtyaOP6mOKyLNVq7RV79MHfJo3/+LNHPObY/SbW+qfY36TX6c1OACeA67LOf7A3pP414opdHdrwm7mZjM5/8bWpAEcDt+YC+QFIR6J05Rbv4PhauDqjGO23mBr3vYiney4r6ePU/Y7hU/8+RNw+A2c/O+UDxwOH/tH68tjusey4saPrJkInnbAabzup6/jC3ccg9k2Oe3GxIcOg98Dv8+r/6b6J/cce7rY/qlP5hyg4UKeAbxvz/dx1rVnccKLT2DS6ElNx9pa0ydObI4JcuoBp7L/Rftz7G+ObT7wcBgJv8X9w/r/43/f/P7PVsDPfpPzZSNB7wvb6+Fw/pPwrUsU933oPnaYukPT21EUcWX/m1n+2rvyy9qu9fs2m7AZD330IXq79YP6oT9+iMvuucyuPY/U7X/vhK/cM4pHP/YoM8bPaHq7rPLs8nsv56grjmq8sHvrObTA5hiAw+EjNrOYV5zEwMC5LS9feMuFfOiPH4KxwGvtvu/XwK9jx+29yd68cqtXNh1W1FZ7e2HsrbN4ftufcdxvj2s9YBf9y7of3Er/5B5/OJxxD3BPQVmvhH8A/ygo63sr4APP3MYe0/dIPaSvT8YGX6Sa8bFtQn5SHii2UIHdArsK5ZkEeeaSbVMiYQDIKs/GjGkoPPO+c3CwOJFW0bW3JV1sFLhRZBeHTVJ5ppRd+wI726bt5r6EbVNSeVYFeVbUT/T3677J1mJcRBiDXTgJG5WxC0GYFxM0r89xzYYM8rbNoDwThFKTc9+PooLUK/VB5rARRbwn7XWl2AK4DNinqkoFNMMM8EXKsyRR8ec/w69+Bd/9bn75VcU8A93pJycfPsqzvMmcS4ZMkEsYYJN1a/ly2H7F7Zo4+/a34TWvaXr/He/QE6KfX9GbGcjn95PexV0HH8oVO+dsK9Fe26av8gzgUwd8iqN3OZrhSBey+UQdwd2GxI1PmA7b8TDmnjSXVYO6ksefoLNe/ebX+XUyOOpo6OmGn6bH3UYpxWUXbsG/MIO/4q/v/itPLXmq6bhn5sEB+8MZZ8LRR6WXBfDuY/T1vOwX2ce8/CDY+6U6N0QaNhy7Id2qlyOPhOOOg4+//uP88sy3sGjJUMt5//738PGPw1V/gm0T2Qn/e+ckXv+5KWsmCK/d9rU8cdITPPbUSvafqV+bcx1sOK3xmb33hte8Fk7/Epn4n/fC88/Bb36TfcwbDhlL/+bTsw8YweLF+jnLIxHiE6QJfRN4+GMPM6andbWzapVu83lB3UEviOMxQWZuNpOnPvEUy1c3OqBzz4MLLoA3vAHuvhte+Ur4xaVw54jqK4pgu+3gwx+Bj2e7rHnXu/VzcenPs4955BGdCOLMs5dw+tP7cc5153DhoRc2HXPVg1exYNRdTL/tG/z7ojdklvX+98NTT8Hvfqf/nzN3Dsf85pg1SSceXvAwV9x7BW/d9CP8ctbH+NElul1n4aab4O1vh6//8GlOuvPANUkn4nBRniXHtiiKOOvas9h+yvb84R1/YNkyxR67wymz4APvzy7vuONgyVL45RXZx3z/+zqz6p13QX/O4vidF32aG17yfZ5b8nk2Z9Ka14eGhzjnunPYZ5N92Pr2n/KnP8GNN2SXA7DjjvA//wPxPZAZ42egEo2ySHnW2wtdz+3Kk594kqUDrRsyh78VJk6Aiy/Or4/BrFlw083wj6vT3//j/8FHPwJ//CNsv31+WQe/CnbdFb6e7ijl+edh35etoO9D+3H2nLP5yeE/ST3OJoNhJ5Rntln5ihayYKfCqatts4psm0ULWsmYZ3EiIS/AvW1m2KKYiCAToNzWGSGZMADsElKAfi7y1hGS2TYlY56ZOndCeVaUgX3cOBnbprTyzMW2WUQQQr5t07WtglzCgKA8E8XzwBOAuarxyU/EGolB/WHZtTQQRTymFBaaoQApGNtmVmeVlW3zj3+EH/7QnjyTVJ6ZDjFtcHMhz0w5NgkD2h3zzGZAW74cdpo/R/9z2GGwySZN7z8/cUSQlpEBEPT5DYzJJ85ANmGANHkWJzm6VFeqZc+mHSYz6W06YdM1f49ZAf0rYZv8vY01mNoF81/IPz5KDN5jesewzeRmJmpKF7AAxq7KL2vUUhhF/jFjVsCYgnNYulTnjrj6arjnHsXDt27JIYe0fmbz8bpeG/W2vvf0yH2J379NJmzCBKU/A7DTRs0y+rEDMHp58TmOHcg/ZkKXnYJgyZL8hU2a+tNYeJMo2hFfU7cJrdmokmqqCYP6PDceDbc8DX3LWs959Ap9L4uu1eiu/GPUQmABbNoDx+5+LD+6/Uec/orT2WjcRmuOmT1nNn0Dm7DJ0x9gm8nZs+eJw/DMosb3bbXBVnz12q8ye85s3rnrOzn3unPpVt0ctcmp/HLBxmwxPr9uz0/SddthzDZrkk6cdsBpjO9r3DSbvj5r0fiPR//BLU/fwvfe+D22nbwtdz6hv2/vbfPrNVnBkvn5x4wf1GXtuGF+X/jWjT7NDcsu48f3f5c9X3Tqmtd/dd+veHjBw8x+9Wz+74ZtCp8LgJ4l+nuLjivqB02732jcRmzERq3vL4Hx/fb94LQeGHou+/gNImABbDuluMxxA/p5yDpu9ArgWXhZ/3u59O5v8uWDv7xm8yQO24QBReNYT4/u44pinvkoz/Jga9u0zbZpY9ssqpOkbdNFeSZl2xwzxp5EAHsiIW+MkUgY4JJcAfKvl217sFGe2RJL5vtslGdZiU4MTMyztHAuaWWZ707DmDG6TlmJolzVdTZkHLTXtgmNEDhFKOpzzH2RSGQEcgRhJ2Ke2bT/oDyrBOcDBwHXAj8H/t2UPW4tgnPCAKXYAbDYgwiQQpFtMyvb5tKl+rOmA8pCFTHP8lReVcU8s91JkAho7JJtc7tnr4Uttmghzsz3FE1KbBYJUM+YZ+Z7bHZvTL3zbBJ5ExzXhAH9/Xa7cFC8Iw7tybYJjfbywgvwrnfB00+3ZtqE/PaQdV7xgPPJ/sAmELvNpMSmHPAjz7KwapWdsjaNPEvCLKhMwom0pCBjxsgnDDh5v5MZGBposg3f8tQtXP3o1Wz2xMcZ3Zs/C08Ga+5SXWuSTlx696VcdNtFvGu3dzGxa+M1x+chPkk1SSd+eNsPm46x6W9MH5LsI2bPmc2GYzfkmN21LfvhEZ/s1gV7kzbxsswzVHT9d5i4Ozz0an7ywDfWKFyjKGL2nNlsO3lbDtvhMOvFhq3qoog8K7I++WTbzOsHXRMG2BAJr5n4cQC+fv3XU4+zJc9s5hB5dXLJ0Az2C1Ab22YdlWem/y8ay6pSnrUr26aLhc2WPMtaAroqz/Kul217qEJ5ZkOeFbV7l8zKNrZNyCfGXc7R5pqBXCZKWwuubWbYIvLMEISdiHmWd455Cbd8yDPbdV6wbXYAUfQxYA/gcuDdwG0odRZK5QdAriEym6RS/E4prkz8/Bv4I5CfJi1AFEUJA7KybZoO1zaQrCR5lsf++yjPJGybShWTVZIxz1avhtWrI7Z48lqYOTP1GBsSTpI8c7VtZpVluwvnIn22tW3mEXoug+yYMfY77HnnOWqUPs+qs20amPay447w17/qv5OZNiGfAM06r66uRlam5KQ1qfpLg0Q8FgNJ8sxWeZaMeZYGc47jx+tF5tKlrYSv1CQ1Hgdnuynb8eYd38wFN12wxq43e85sJvRNYMO57/NarL9j13cwY9wMjvvtcawYXMEpM09xzra5ahXss+k+vGzzl3He9eexeqhxU2z6U6VaFxt3P3s3//fg//GRvT/C6B5942zJM5t2ahYaReqHUaOAa2fxwqpn+Old2t/9r8f+xU1P3cTJ+51Md1e3tYrDdrFhE/Msr913OtumjbJ7o9Gbc/QuR/P9W7/PwpULW46zuYe242IeEee6wLZVntkoSiRjnvX1tTdhwNqebdOFPLPdaMx6Jl1jnuW1CRfybPXq7LJcLI1gR2YPD+ty89q9y3wwmRE5iaJn0fUc2608s72XUuQZ2D1Dtn1iXZVnNuu8YNvsIKIoIoquBj4JfBd4D/CqzlbKHXnN5+zE/xHwAvBAFOEYkj6gDMwAnmXbzMq2aeLTDwzkLxzNgFHU8bogL2ijtPLMpTzbnXFn8uxnP9Mr6fe+d81Ly5fD5jzOhCVPwf7pwYOqUJ5JJAwoKst2UDODsA3J4UKepcn+XckzW+WZUsXljh3bfuXZxz+u4xrdcEM+eZY2Icy7f+PH6+cgeX1tFGOrVzer19IwejTMm5d/DOgJY15Q7qqUZ/GYZ2mIK88AnnvOX3lmSz6bSeqsmbP49f2/5tU/fjXT+qfxhwf+wMn7ncw1v53AqJxrZcpKjh99PX18bJ+PcerfTuUN272BnaftzH88sxfPmjmLN136Jl7141etSdjw2DPA0fCBf8KYZAKKGIaPgl90wV2X6v8feOEB+nv7OXGvE9cc8/DDmtzcYIP8etm0U5uFBoy0mYdfxbZj9+Azf/8Mv/3Pb7nn2XuY1j+NY3fXSSSkY8TYxDzLK8eHEFq5MttKVYXyzGQv/uldP+WQHx/SYo2+Yzo8ezAc/otuvvDyL7D79N1byrIdF/PiNQ0NQdeolZzw2w/x/IrnM8uYNHoS3379txk9Wu8sSLQvG2Jp0apF8IZTeWHgc2xIdqbtusY8MwtsG5te0XMknW0Tisd/W9um+d6077SdU9os1l1sm6DPz2yGJeskrTxbk/laiDxbtUo/31ntpog8sw18b2CrPJMmz2xsm+0kz1xsm+2KeeYyrwe7cSgozzoApcYChwFHAdOAXwEvIYqKUlPVDnkJA/6pFG8GtgXuiiL+1LZaBTShKGFAVrZNQ54V7RiZtOuuHVQepGybksozKFZ6ucQ8W3NuixfDiSfqC3nooTB9+po6z2Qk3lkJ5ZmtsqGOMc+UkrMrxd9Li61RhfLMdiLR329ndZHYqTftbswYuOwynRhgiy1aj8sjQPMmghMmpLchGzuczTm6KM/yiJKqyLMlS/LbkpkMGvJs3jyYNq35GBvlmU+69P0224/3veR93PjUjcxdPJeZm83kpH1P4u8liNkP7PUBrp17Lf970P+uOT9zfB6S5Nkbtn8DR+9yNPc/fz+LV2n53guDwER4ahn05i2+JsJi4PER4rKvp48zXnEGU/qnrDlk8eJi4gwqIM9QvGezr/HLRafx+KLHGd83ns+87DOM6dUr1KqUZ0Uxz7LgY9sEfU3SnhFX8swmM3ZvL+w+fXc+uvdH+dfj/+LxRY83HbesBwbHwp8feoCVgyv54zv/mFqWrfIsz7YZ7fb/uOj2i9hlw13o6Wq9kcPRMHfOu5M9NtqDfUafBNi1L4lsm/9a8W146Xf5+i3dfG/Tb2UeZxPQvVPKM7Brk0VjbaeUZy7kWRo6pTyDbPKsCttmkVIs/p6t8iyvrRZZqKuybUqRZzbXC/Sc5Lnnir9TUnnWTttmXtgTX/LMRp0dlGcdwbPAA+h4Zw+iRVkvRamXAhBFv+pc1dyQ2XyU4gLgRcAc4HSl2DuKOL1tNQtYg7ht0ybmWZryLA+2liYXSNk2JWOegb1t02kh+v3v65WdUnD++XDmmYCegO7PtawePY7eXXf1qg901rZZljwDe/LM3OOihAGQ3maHhuyuk4Gt8sxmstQJ5dmoUbD55vDBD6Yfl0em5k0EswLUjh5tRzbaqBptY55tnpNIowrbplG6LV2arXoz52jef/bZVvLSRnnmYtuM9/vfO/R7LceVUbpMHD2RK99+ZVNZYG/bNMd3qS5+/tbm1KHnnw8f/R784zmYOjW7rAkT4B0nwHk5WTRtCS/bmGe2xAvALmMO4dNHHZJ6jPROvU3MsyjK7pt8bJvme8uSZ0WJdJJj9Tde943U4z71KfjGD+HUP5/B567+HHc/eze7bLhLS1lllWeDQ8Osfuk57DljT256700tmU8NXv6jl3Pe9edx+cs+DPTmPts29jVo3Mcson7l4Er+vfqbECl+fPdFnPnqLzK1P/0hclGeSZBnLjHPzPE25FndYp65ZHTNbGOW8924RT+vPuBGnmXVSdq2aTNu2MSjipdnEwA/z7bpo8DNwtpg25QImVGnhAGuCV0MbJRnIWFAR3A5mjDbceQnjgitRFsrkNckDwReGUWchs6O8OZ2VCigFfGEAS7ZNm3Js6IMOT6Qsm0aRVzepGlwUB9j08FK2TbXKMYGBuDrX4dXvALe8ha44II1F96QZ/O32yezwHbHPLMdsHt6NBcoQZ7ZkhwuyrMsK6LrTuPAQP7g6EKetTvmWRnrbRF5lpa0wTYOkZTybPHi9icMmDix8d1ZSNo2Fy5svV5Sk1Tb3U/bzIO2NguQyV7sYlmy2am3Jc+MDbFsWUULY3DbqZcgz5KbZGn1kYzjtXJlI2tlEaTGV7NY/8CeJ9Lf28/Zc5JRRNxinmXV6YGuK4km/5dZM2dlEmegLaZzF8/ln89fBtiNsTYxzyC73f/kzp+wlHnwf99gxeAKLrjpgsyybMgzm/HV9GOS2Tbjx2dheFj/FMU8W7myOAGWpG2zncozm2D6PrbNrDqtDbbNsuSZC0Fok6EUOmPblMi2CbLKs3XdtumS3CLAElF0HFH0ntQfOK3T1XNBXpMciCKGAKKI5UBBxIKAqmAG8O7uxk5lHHnZNsFOzu8SG8AGUrZNpYo7fNtJNNgHNLaOeXbppfDEEzBrlv5ZuBB+8AMAVj63hN24k8W7pMc7M+VIKc/MAkeCPFMqf7exCuWZq20zrU6uMc9AJiuVjW2zCuVZHvIW/nn3b8qUdNWVbbZNG1LPhjxburT9CQPMeefFPUvaNqE15plUZlLbxYat8szmerlau236UxsLmw1BaEt4RVGxPV+KPJO2bRYphIqsTz6bCJDdXl0212zJM9u2NaF3Cie8+AR+etdPeWLxE03HSCQMuHXMWXQt2pK37vzW3DJev93r2WnqTlz837OASETdnfdsD0fDnD3nbDYafjHdt36YN2z3Bs6/8XyWr05ntaSUZ93d+v0qlGd5sCHjTB9rs4ED7UsYUESeucSHA3nbZhpciaU62zbzYp51SnlmuxkEMsqzoSHd77c75pmE8iyPsDfzVJf7CDIJA2yUoAElodRElDoepf4K3Nrp6rggb6m5o1LcOfJzV+z/u5TiTtsvUEp1K6VuU0r9fuT/yUqpvyilHhj5bRHFZP1G3LYJrR2WRLbNuto2odheZxv7xNSrKIUxZJQ3OGhSaNLXtVqf3Nlnwy67wGtfC/vuCwccAOedBytWMOrmOXQzzPI90uOd2dTHfK0t0VhkbbCd2IMseeaiPEtTPRkUKc9cY55B/vWStG1Kxzwruod51ypvIviVr8BFF6WXV0TE2yrPbGybRf1SVTHPIH+nN55t08BHeWbTtmyVG7bErEuWM1fbZhpclGcSBCHY29dtyopnFM1Cu22bNsozH9tmVnu1fXZAVnlmvvukfU9iOBrm69d/ndVDq9f8rBpcTfeo1U2vpf309K1m5erW16957Bqe6b2O/js+kRrrLI4u1cUpM0/h/gV3wrZXsXR59vctX7kaulbT1ZNfL7r0z8qB1vd+e/9v+c8L/+GlA7MY1auYNXMWzy9/notvuzi1rO5R+nrkwdZ+a2OPdI15VtR/2ZTnYrUEOdumS1tNg+u1srFtllWeuRJL0rZN23HIRj0oZdvsVMIAG/Js9Wq7RGBrY8yzrq7skCBllGdF67xg2+wQlBqDUkeh1G+Bu4FzgTOAzTpbMTfkNZ+dhL7jY8B9gNEynAr8LYqiryqlTh35/1NC37VOIm7bjP9vkJZtM4rqEfMsz7Zp2yEWBXa3meAY2MY8aynv/PPhox9d8+/ZIz/cBfzoR42UQLNmwWGHQX8/uwNDdDG4176Z32crh7clB4smvi7JFWzIM5uJhO2i3UZ5VpRBslPKs7Fji4O6SinPJJI+5E0Et902vTwpNdXo0fq4vGOjqHjyXKXyzMW2CenKMwlLkO3up1R2P7BvX3nqYteypG2boO95Vtw6Sdumi/JMKuYZtM+2KUme2Sq749d9q6lbceTOR3LOdedwznXnNA56+ch3nlFQqddlH9c3PJn+/x5fUIDGO3d9J5/522d55l2v58PPwofzvvfz8ImF8Imiun0eJn89/a0tJm7BVguOZNQoOHCLA3npxi/lw//3YT78fx9uPXgccAq898r/4ftv+n5qeStX6uewaIy0Ic9c1VRF7d6mvLi9a8qU7OPqZtuUVJ7ZqpU6oTxzsW3ajNvttm12KuaZjW0TtBgiqx92sfM+9VT+Me1WnkF2n1OlbTNvkx5CwoBKoNRP0SHB/gx8C/g78CBR9I9OVssHeV1LL7BRFHFt/EWleBlQ8PiZY9WmwBuAM4FPjLx8GDqGGsAlwD8I5FkuzGItayKSlm1zxYpGzJeiHaMqY55lKc9MTC0bFCnPJG2bqeTZqlXw5S/DS14Chx8OwF/+Av/8J5zxzQnwznc2jn3jG+G734Xnn+euu+F/L92BL244MfP7iggAYz+yPb8iBZQLeZanNHIJ5Om6aPSdMLkqLmyUZ7YL405k27S1bWYRjeCuUJGwbcZ3jNMygYG+l1EkR551QnkmkTCgq0v3k3WMeaaU3WaEUsXtzEaVNTDQSlKmIc/aHS/LhTwrawEB2WybkN32fbNttoM8c1WemTqdc8g57DF9D4aGGxfwu9/VdT/uuPyyLrpYX6v3v6/1vTm/OIDbh8fmF2Dq1NPHz9/8S15x/N855BA48MD04xYugrNnw1sOhz1fkl3eddfBH/4An/4M9Kcs5A7Z5hB+9OUeentBKcUlb76EX92XHk/571fD3/87h4vVxXzmwM+w5aQtW46xnedVoTyzJc/qpjyTsG1WoTyTSBjQiWybrsqzdto2bZVntvHAJG2boMmzrKQ7LuRZu2Oe2SQyaDd55pusKaA0dgEWoAVV9xNFQyiVE522vshrPl8HPp3y+oqR9w61KP/rwCeBeOSajaIoehogiqKnlVIb2lR0fcbgoO5csgaetGybRnUGdsqzdsc8cw3kKUFwQLGcN3Vn/Cc/gWeegR//GF71KgDmDMKZ/4T//WBigO7qgvfrlHG3XgK/vBTOylnwjRrVyM6VlTkN5MgzV9tm1sSkqoQBo0fnk6pFMc9cJkvSyrO6xTzLs5y57KIaSCYMAH3ds8gzc455/VKVCQOKYp5JKc8k46fYZvcratMufUReJkNwi9doc44Ts/ch1iCPNI6XJak8syElXG2bvjHPymTbTEMV5JmranaTCZtw6gGnNh3zy4/DxhvDZzJILIM5X4N589KPe8/Fbn3ggVvvB9fsx36vzP7eBx+Es6+Bt7wX3p1Ttwvuhj9cAx97MWyYMQv+fuz52WnaTnxm2mdSj+ueA3///VzUjltz3nXnpWYxtZ3nVaE8K3q2bcgz20ygdbNtVhHzrN0JA6Rsm64xz2w2UqXOUVp5JuUgMBt6eXHPJMkzyXkJ6PPMmucZSJNnRXNDyXizAQ6Iot1RakfgHcBfUepZYDxKTSeKnulw7ZyQ1yS3jKLW2GZRxM3AlkUFK6XeCDwbRdEtPhVTSr1PKXWzUurmwfW89ZoH3SXmmSt51m7bpgt5Jqk8s7VtrilveFjHNdtjDzj44DXH5Z2fgRkM8tQSRSoCn/hw7bRtSirPVqwobod1jnlWt2ybJumDa8yzLNjEPLO1bUIxuQH1tW329ur2Y66fj/JM0u5nS8ya7y0qy3xvESRSwoO98qzdMc9syTPJxYZtwoC10bbpE/MsC7bjfh7B63qturp0eZLZNvPavVNsvsWbceSO7+AHt/2A+Svmtxxjex/XduWZzdjR16fHx7yyhof1ZoNUtk0JpYuUbdN1Dr622jY7GfPMdpwter7Hjghj42u6JDqlPKvatunicIlDIttmUJ5VhCi6nyj6PFG0A3AS8GPgRpSa0+GaOSGvSeYtNQrcwgDsD7xJKfUocCnwSqXUT4B5SqkZACO/n037cBRFF0ZRtFcURXv1uPTy6yCSCQOylGdK6WMGBpp3KWyybbbTtulCdoGd8kzatrmmY/3DH+D++3Uss5gkqmgBA406m8Evqz6QXScXsst8V5FtUym7CUAnEga0kzxb17NtQjbh5ZPFKB6rLAs252izCLIlz4om9Aa2C0ezQ2pj21SqoT7zUZ5J2iNslWdgN6m3tdXbxLiSVJ61mzzr7tY/eWOoi23TVnk2alR2X1a0AK2zbdOWmLWx3tqO+3192XVyHTNM3SSzbRYpjWwJQoATdzuF5auX852bvtNyjO08T1J5VkW2TQnlmVLFfbTt3Esq5lk7bZuuxJKLbVMyYUAZ22bdY57ZEqFmTiLhKJHOtmkbBiLYNgNSEUU3E0WfALYFLuh0dVyQ13xuUor3RhFN0UeV4gSgUE0WRdFpwGn6M+og4JQoit6llJoNHAt8deT3b/2qvv7ATBKLYp5BY/HtojyrIuaZpG2zvx+efz77fZeEAaNGwcKF2e+bgWPNwnH2bNh8czjyyKbjXMizvMCUReX4kGd5AUFtF40gR565JAwoaoeSCQNsSBwX5dngYPb1jaL2xzyDYuWZj71r1ars81jblWfd3XqyWqQ8Mwu58eN1f5KmPBsYyG+TUoolEx/OJuaZ+d48uPQRdVaeFcU8c9lwkUgY4GLbLMoyC3LZNouy1rmEdTBhEaIonXzthPIsbxxzJRGgWFVquyi2UZ65kmfbjN+V1277Wr554zfZaoOtUDRuwoOju+gZ+zoaubvS0d8P81uFa02QVFOBHcHkGvOsLJEg1VYlr5WkbdNlDu5i25SMeVZGeeYT82xgoDiESruzbZrNd0nyLKt/hvZn24Ri8sy1j7axbRaVaWK1rufGN1koNQH4ELAJcCXwl5H/TwHuAH7Sucq5Ie8R+Tjwa6V4Jw2ybC9gFPCWEt/5VeAypdQJwOPAkQXHr/dIKs+SHVa8szeT17rYNtsR80zSttlExN1wA1xzDXz96y1fYJNpbvny5iypaZBWnhUpoFyuVbttmytXFmfAyVsYuy4abXayXcgzU1baBMY2dp1Lts0yyjPfmGeg71OWmtIlYYCE8syGPIsiN/XMxIn5Mc/i55inPAN9rbJs21K2TVeli037klLyuijPpMmzovYlsYkA8rZNW/IsL+aZj/Is63qtWtUc3y8Pvb2NuHppbds35lkaXIilPEud68KsSKFi2z/bKM+cbJsjx5+6/6kcdMlBvPNX72w+aHOYOnQiRRv8NvE7bccPSdumrfLMxdpoQ561S3lma+O1qVMnEwZIxTzrhG3TfG/amG17H80xUtk2XWybtu0iTzBRRbbNonPMEkh0UnkG9ucYYI0foxMGXAf8DzALzSm9mSi6vYP1ckZm84ki5gEzleIV6AwJAH+IIv7u+iWRTkP6j5G/XwAOzjs+oBlmsZY1EYl3doYcine0NrZN6YQB7Yx55powoEgpsWYAmj0bNtgATjih5Tgb5ZnNgl065llR7C1X8ixrwF4XbJs2JI5Ltk3Qi45Jk9LLAVnlWRnVhW/MM8ierJrMsHVTnpmybDcIJkwoVp6ZczSkQpryDPLJMynbpi3B7hLzTNIGL7WLbTMJh4bNJW+xYVsW5Nv+wE15VjQWQ/G40Ylsm1lZ3pKIEwlp18TWttku5ZmvbbMs8Q/VKM8GBuDl27+cxz/+OMtXN08EDvrC6czb/GKeW/a/TBs7LbOscePynx1TZ5MJOA+dyrbZ1VV8X4vIM9u2KhXzzChdbJRnRW1COph+J2KeFdk2e3v19ZK0bYK+Zmljdp1tmz6KxLT5kJnXSyqp62jblIw3G+CErYmiXQFQ6gfA88DmRFFOOox6orD5RBFXA1e3oS4BGUgmDEiLeVbGtlmF8qyd2TYrWew98AD86ldw2mmpqWJsEgbY7Bq3O+aZlOLCZSIhadssIs98sm1KKs+yrr0LwSEZ8yzLtukzKSmyw9lOvGwWQeY7JMizogDsSdiQZ0XKs6JzNDZeCcWSq/JM0rZZRCzZ9s2Stk0b8kxSeeZicylS9EBxP1i0AO10tk3Q1zdPvbG2JgwA+5hntjZqyZhn5rs3m7hZyzGbPPQZntnwp3z7pm/zxYO+mFmWDXlme906lW3T5tmWtm2WVZ6ZY2w2SorOryimm+sc3PSBeXa/dts2zTlK2jYhn3CEztk2pRIGgD7HDTZofV9aXQf1Jc8kzzHAGo1ZSxQNodQjayNxBvkJAwJqAqN0yIt5lrRtxhMGdCLmWVeXrpNUzDPJbJt5C+41qpJzz9UHf+QjmeWY47MgoTzrpG0zL7tiVbbNtTnmGWRf+yqUZ+22bdrEGIHyu+JgrzwzFrE8SJNnabbNpPKs6BxddniL2oSrTWxtVZ7VlTyTPEeQiXnWyYQBUEwkSNk2ba57HsHbSdumeLZN8p/Frvk7MW3+oXzrxm+1qNLiMORZFGWX5UL8m+PzYKPOcsm2adN/2SrPbG2bZWOemWMksm1C/vn5KM+gfPgASdsm5D+L0v1gVeSZrW1TKuYZFBOEdYt55kqeFa3zpJP8BFhjd5RaPPKzBNhtzd9K5cy664dAnq0FSNo202KexZVnPrZNafIMGkReEr7Ks6zJnLRtc3rXs/CjH8Exx8D06anH2ZBnRbJzUx9zbBp8lGerVmUPaq62zayJhGvCAGnbZlYGSR/yTEJ5VrQrLqk8c2kTRQkDJCeXtjaXogDl4DYRL7pe5nts+7iimGdpts0s5Vk7JuK2Cyrb69WJmGdrs/JMOjtZ2Zhnrgpccx3aSZ7ZqnmKSCrbPnD16saYFce6lm0z71lctQp2eH4WL6x4gYtvuzjzuHHj9HUpyjxou/gEe9tmXrt1UZ5JkGe2bVUq5pk5RsK2CdnnNzys59Iuc3Cb9uVi25TItgn56jrfmGftUp65KFT7+tpDnq1PyrMQ86wDiKJuomjCyM94oqgn9nd+JpuawaH7DOgUimybyZhnLrbNwUHdOUjHPIPsDsxHeQbZCrnVq3MCzf/61/DjH6/594N3wBvnA4enH/7+W+BDC+bC4Co45ZTMOtkqz4oGsypinoEeiNKCPHci26bt7k1WHIZkWd3d2YSQyyDb06Ovfx2VZzb2CFvlWdYEGvwTBqShE8oz0M9OXrup0rY5YWS4d1WeuTzX0gkD6phts6cnf7Fu4unZLBr7+/WzI0WeFWXblN7FLhPzLIr0j0s/WGR/kiTPOhHzLB5iIXkevsqzBQuy3+9EzLMi6yDo+7vj0AHsu+m+fOlfX+Jvj/wt9biHh4Gj4IjLs+/7naNh5WFw+C/y6/Xss7qsU2+HqXOzj1uwQB/3tUfhkrwyj4Yfr4Zbc465bRwse2Nx3e7fHVYNZB+3dKmu07efhytzyhoa0sf9cClck3LcU0/p90+9tYuvzjiNPTfeM7MsKZUxZJNnZZIFrVqVnSzIxbZpG/OsrPLMJ+ZZ0YaXFOniQoSOHStv20yD6zlKxjxbubJ1M8MnKzwE22ZA9Qjk2VqAIttmfJCIZ9s0i8CiCRVUozzLymzpozwDTQil1TMzw9/KlXDiifoCzZgBwLTF0D0EPJj+XdMWw3KAk0+GHXbIrJNNtk2bRUcV2TZBkzhp5Fmnsm1KKc8ge8LkoyLI2vEy6ETMM/O9Wc/IwEDDFl2Evr70hZ7PpKQo5lkVyrMygdMNXPs4Cdtm0Tm6kGdSCQOqsm0WBeaXUJ65LBq7uvTzGA9dkETdbZtZSSZMOZDe7n0WxqDbax2VZ1nX3YVMjZclQZ6NGQNPP539vmTMM0nb5qpVMLpP8eVXfplP/PkTPDg/fRK0IAImw0MLsr97YRdEG8CD8/PrtWyVLuvJ5bAwJ7nA8uX6uKcHYGlOmV1TYH6U/72LumF4UnHdVoyBVV3Zx60aqfuzg7CqoCwmw/PD0JVy3KKRcuY8+wif/OsC/nZMOmkJcipjKCbPpJVnNgSOi/KsrG1zbYl5ZqumrpvyTNK2aebPK1Y0k7M+m7wQbJsB1SOQZ2sBimybWdk2x4/XnVHexL9K8kzKtmkWElkdfmbskx//GObNg7/9DV75SgC+eSqcdx6sujO9rE+9HW65Bf47O79OtrbNssozH9sm5NsH2608k0wYYOr1z3/C5z6nM1t+/OO6/bvalcDOuuGSbTPrursoz4q+VyJuXZUxzyQSBkjaNn2UZ0uWZJOxNrZNm2xn0JmEATYJKeoW88xFbQnFQc8lkyJUYducPDn7/bx277vYaJfyzFWdWjT+lLU0VmHblIx5JmnbNOPrK7Z6Bbe9/7bM4371K3jrZ+CyO2C33dKP+cAHtKj/znn59brmGjhwFnzvL/CqV2Uf969/wctPgR/8FQ4+OPu4jTaCt7wFvvul7GPe9S647jq48xv5dXvnO+GGG+DOjI3UO++E3U+Cc6+At741v6zubvif0+CME1vfu/RSePtp8OFfn8NZd5zCLU/dkqk+s1WelSHPXAgSAynbpm3Msyiyt23mJUSqc8wzFyK0rsozSdsm6PlzGnkWbJsBdUOIebYWwCzW0nZtTMDsZLbNJUv0AqKoEzGT06rIM2nlWRpSO+fhYTjnHHjJS+AVr2ipU178NFcrSBYklGe2iw2DIgWUy8K43bbNlStz7LcxvOQlcOutcOaZ2ll7xx2NOq0ryrOypKzBlClaJZFs73VIGFA2bpDNMxj/HpeYZ5CtXIr3EXvtBbvv3kp2SCrPpBZUtgsXF4K9XTHPJMmzoSHdV0j0g9C5hAFp18vX5pJl744iP/KsbBiCIuWZa9zHrLJ8bZtliX+wV565zEfy2qntfbSJGSgd88x20V40XoN8tk3bNlY0hzt6+/cyoW8Cs+dk78zaxDzr6ckO6RBHVbbNLLgoz4rGbHPNfJVnPuq6umbbhHoqz2w2g4aG9BjiQp7F0elsm0F5FpCFQJ6tBUgqz+IPc3KHJW7bHDeueNfcDDxVxDyTsm0WKc9Sy/vd7+A//4FZs5pmGmZwyRrYbOsmlTDAVnlme73its2s8lwWjUND6dfKZWdP2rb5l7/oOv3pT/p/0y58yLOiCXQnYp7Fj0+DC3m2994wfz488EDz6z6TkqKYZ7ZttbdXf2+dlWeQbd2MK89e/Wq4/fbWsm2VZxK2TemYZ53Kttku8sy1rCLyTNoCUibbpq9tM2sRaq6VLfFsG4agqN+RJM/yiKUqsm3aKkpslWeitk2L+2hDnkln27RdtBeN1yCfbdPm2c6Li2ieyUljJvD+Pd/P5fdeziMLHkk91sa2ads3FynPqrJt2sQ8K2oP5lrakEFpz6KPus52c7ATts2xY+uXbVOSIMxat5TJtpmXid12zA7Ks4AsBPKs5ohnxkmbbCU7u6RtsyjYcdW2TSvyLIr0iZqTTcBLeTZ7Nmy5JRxxRNPLRbHKJMkzm5gNVWTbhOxr5WpXgnzbXydsm1n1c00YAHLKM8lsm/Hjs8qybQ/77qt/X3dd8+tllGdZ/YntpLwoQDnUnzwruv62yjMJ26Z0zDPJhAG2bVXatjl+fPvIMxcLiETCgCpinmU9j67Pju34WqSc6erSx0kqz+pm22xnts0o0nVut/LMtMOiBaiL5b9u2TYhvx+M9/Uf2+djdKtuzr3uXIaj4Zaf7p5hVg82v+ZzbiCrPLO1bXZ35z9PLmMQ+Ns2fc6xU9k2bdpXkW3Ttj9sd8wzV/JMUnkG+c9kSBgQUAaBPKs54rtfaZOtZGcXz7ZpY9vseMyzJUs0ydXdrX+mT4fnnms63kZ51tQ5X3cdXHstnHRSy8hkQ1ZJkmdSyjMp26ZrvCxIX8BIJwwYHNQ/ZcizTirPRo3S51k35dnOO2syKI08U8rO/mFQtDMrEY/FwGbnucqEAZBOnkWRnbW7ztk2i65XJ5RnkgkDQI99WbZb17KKNqBcVDiSts28mGdShJAreWazaJGwy3batlmW+Ac75ZmrbTPvukeR3X00cRzzEm5UpTyzsW0WKc9cbJsrV2aH8HBtY1nXPr7BvcmETXjHru/gWzd9i+4vdbf8PHpsNz/dtvF/z5d6uOT2S5zPzZyfVMIAm2yuLjF+bckzG9umFEHY7phnLhbcdtk2O608awd5ZsoMCQMCyiAkDKg54nEX0iYiyc7OLGZWrrSzbXY85tkPfwiPP66zW/b1wZe/DN/+Nnzxi2uOt1GeNXWEs2fDBhvA8cen1sl8Jg22k3ubbJs2kwnpmGfStk0oT57ZKM98SNw08sx1IdTfDy+8kP2+y+IqT1rfqZhnXV2wzz6t5JnPtZJKGGDKqqvyzMQ8W7So9T3byWU7U8JXEfPMpY+oo/Js3Dh4JN0ZJao8S8YczYO0bTMv5lmnlGdSm1PmO8taxIvq5EuerV6d/VnJbJtStk2X8BydiHlmO3aMGwfPP59/jIttE7Jjrboqz4oU2aatfOXgr7Dd5O0Yilpv/Pnn66QIb3ub/v/Suy/l9H+dzrt2exfdXd2itk0f5VlRzDPbNm87Zq+tMc9sVVm2Y1C7EgZIxzyznZuYTf8kYe8bwzNvneea6TwozwLSEMizmiP+oKftVGYpz+IJA2xsm+2MebZmQbV6tU59+bKXwdln6zfvugu+9S345CfXMEE22TbXdM7//S/85jfwmc80ZoGJOkF526ZUwoCi+rjGPKvCtpmXzUgqYUAZ8sx8tgrlmUt8vjzyrFPKM4D99oMzztB9glEV+FhcpRIGQPF1lyTPJJVnUkkRXO0REkqXTtg2pZRnnY55lnWOLrvYLtk2OxHzLI2UqEJ55kKeVa088x0zTHnJLLumbkX2NWhvtk1z7jYJeSRjntnaNm3JjokT4aGH8o9ZvdquvcaJhDzyzPb62yjPAGaMn8FnDvxM6rGXfQh2iODzL9f/7zxtZ468/Eh+c/9veOvOb621bdNm3GiXbdOHIOyEbdP2Xtoqz8raNl1IR0nb5qRJ+ndyw7JMzDPIFm9ASBgQUA7BtllzFNk202KerTW2zcsu06qzWbMab86apaVAP/rRmpeKlGdNE/JzztFf/OEPZ9YJ2mPbdFGe1dG2KaU8s7FtSinPOhXzrKisTsU8A02eDQ/DjTc2XvNRXBTtPrsQvXVWnuWRZ7bn2Nen7RjtsG1KxzyTtG2u6zHPpGPEDA7qY3xjnvkuNrICb68Lts0qEgZAdv9lSz5XkW2zSHlmM76OHq3bTyeUZ0X3YtKkdEVwHC62TcjflAW787TJtumzWH/Ljm9hmw224aw5ZxFFkYht0ydhgI1t06ZuVdg2pWKejRqlx+wi26akpdFlXr9sWbbFeGCgEfkmD2YdKaU8axd55jtXzVIbQ1CeBZRDIM9qjiLbZrKzM0oz12ybbbdtdkfaXrnjjvCGNzTePOAA7TM755w1vZa18mzePLjkEjj2WK19z6gTtC9hgJTybH2xbdrsjGfVr5Mxz6C+yrN99tG/49ZNn0VjV5f+Xgnb5tqqPLN9HouSIkjuYtch5lnWpF5aeeayU790aXq9qiDPpJRnNmEUqlKepT2PnVSejR5dfN3LJgyoijyzqVeR8szEV7Rpp0XkhovDQKl85SZ0LubZxImwcGH+Ma62TYkNDptsmz6L9e6ubj6x3ye48ckbuebxa7xsm8k+sIzyrKxt00ZtGf+edto2zZjdLuWZq21zcDD7o51j4AAAgRpJREFU+XaZE+bNvXzaatbYD/bzJRMqI/lsVxHzTHLjMmD9RbBt1hxpyrOibJuLF+sOzSbbZpUxz1psm1EEV13FqxcsYb8HHoE77oAf/KC5Z1RKq8+OOAJ+9Ss48kj7bJvf+pb+wpNPzqyTdMyzIuVZ0WTVpj7x7yvC6NH6EladbdNlR6gq22YyoUEns21CPWOegQ7/t9NOzeSZD9EI+YSQS1vNm6SC3U5qVcozY21NUzhInWMnlGcuu/4utk1Th7TPuCjPpG2bg4P63if7FF/bZhS1Bnd2tblI9IPtjHnmGtZBOuZZ1coz32ybkL+ZJ6E8c+lrurt125RQnoHuA/MSBnQq2+akSY2Yvlnn4pJtE4qVZ2Vtm2XVPMftcRxf+McX+PzVn2fZ2A+ybEt4esnLmDF+Rm5ZZhxbtqw5gompz4LoMS6754biSgGL5k8EDmFgIDu6vc240dWlf4rG7IcWPAAvuo0blsKqe7KPe3gMrNhoQ6LooKa+Oe2az5k7hycWP5Ffv13hrmG4+9md2WXDXZrecyXPoii/f3G1bYK+l2l9sRR55tpWIT9+ru0zNHq0Pi9p22ZezLOQbTOgDAJ5VnPEJ1C2Mc9MB2Rsm3le+bbaNn/9a3jrW/kmwDxg003hXe9q/eCb3wzbbquVaUccQX+/HhXzOvwxw8vgggvgsMNg++0z6yQV88wmYcCqVfYydqmYZ0oVkzgSyjOXQJ5m0Zi2+DTolG1TUnnW398e5ZmrbRO0dfM3v2ncAx/FBeSTZy5tdcyYfPuNS+YuafKsq0svPMrYNiHbCgedzbYpbds0dUj7fhflmXTCANDqmSzyzOcck21I2rZp0w/mLUCryrZpqwiuc8yzdirPbNppkQrHpZ0qlU/guI6vdVaegVaoTJ+efoyUbdOlj7bNtlmEtL6+v7efj+3zMT539edgq3/CVvCOXx3E1cdenVvWBhvo3wsWNJNnuj4Rs594E489eGdxpQy2+wMDA6/PfNuFNM6d3wyt5iM3vQqOfJyvPAg8mFcYcCzMeex69t9ynzUvJ4mu/77wXw646AAicmRSAK+HPwE3/Wgyj338McaNalw4V/LMfCarL3a1bYKeX06e3Pp+J5RncfK/LHkG6arSKpRnwbYZIIFAntUc8QHcJuZZvAM1ts0FC7LLrzJhQNNkLorgrLNg6605eNmV7DdTccYPpqd/cXc3fOIT8MEPwr/+Re+BL6erK10hZLKd7X33RTB/fnP8tIw6QfUxz6LIzrYpHfMM8kmcTtk2IX+3uix5FkX6xyfb5sBA9gTAVXn27LPp70krz8wiwhb77QcXXaTzaeywgz95lpcBz9W2+cwz2e9LkmcrV+pzdbFwTJhQzrYJ7bOAuMY8k7ZtQn5/2inlGWgCYOrUcmXF+5ks8sx2Il6kRrBVgmfFkaxKeWbbL0spu6E9CQPqHPPMnKOLCjTrerk6DIrIM2nlme2CNh4bKYs865RtM0upJ6F0Oe2A0zhy5yM57vgh5k66lH9wOjc9eRMv3eSlmWXFybPNNmu8PjQEbPNnHlt5J2e/+mxet93rcusURRGv/n+v5en9z2LVqmzyzPa6F4XxuOyey5i36nH47Q/5f1/elz33zD72hxev5tz5B3HWtbP57ZZXrHk92Q+eM+ccRnWP4p/H/ZPxfeMzy3vNa2Crl97PNRu/lYtuu4iP7vPRNe/5qLKGhrKviattE/LjeHZKeSYxN4H0eIZV2jZtyf+8zfWA9ReBPKs5imybacozA5dsm5XbNv/9b7jhBvj2t7n39Bex7TQgZQdlDY47Dr7wBZg9G/Xyl9Pfnx38tJtBZl5/LsycqX9yIDW5LyrHxAIoGtDMfZOKeQZ6oJWwbSZtkXG4JgyAfGLSpx329Ogdd0Oe2dYnjvgEOiU56zqRbRM0eQZw/fWaPMuT2uchLw6RK7FUlDBAUnnmujkwYUJ522bdlGdV2jbLKo2qSBgA6YsNX/JMIn4K5KsRbDezTGKgJOpu23RVnpW1wRfVqYxts+qYZ65jv43yzPY+dkp5VlRmVmykOOpm2xwa0vOUMpnJu7u62WHqDvQthi2XncLSnb/J7DmzuezIyzLLipNncQwOAvvPZnLvxnx47w/T11PcKD6w+0l8YdnJPLDsJiCdsHMhjbM3nSNmz5nNZqN3Yu7tx7HjlC52npZd1tZjgT+fyO/GfJUH5z/ItpO3BZrJ2HlL53HJHZdw7O7Hss+m+2QXBkwcgGnP78z+++zPedefxwdf+kF6unqaypQilnxtm2mQSCQB7qoskAkpAenKMxeHSxw2cUGD8swPSqnNgP8HTAeGgQujKPqGUmoy8AtgS+BR4G1RFOVId9ZuhIQBNUeRbbNIeVabbJuzZ2sJwHHH2U2gx4zRGTP/8Ae4917GjEknhFavhiO4gkkLH4VPfrKwTtK2zaxJgK1VzNgtpGKeQXtsmz7Ks7xB1gzmLu1QqYY6wXeHyiRYyCIb14VsmwBbbaV/G7WXT3w4sIt5JpUwQFJ55tq/ZRHQrhlFpSapdc62CeWVZ7bn6KM8K1uWjX1dKvOg7Xicpd4oY9scHGwt03V+YBOGQNK2aWupg/Ypz6RinvnYi9tl26wq26aL8iwLdbNt2hKNYGdfH9M1gQ/s9QF+ed8veXjBw5nHZpFn9y64Fbb+G4dN/5gVcQZw/B7vhZUT+dOy2ZnHSNg2//rwX7lj3h28aeopEHUVljdhAnDDR+jp6uXc685d83qcjP3Wjd9iYGiAk2dmx0I2MPObWTNn8ejCR7ni3mw1Wx5syDOXTT0b5ZlrIok0uKqyYO1VnoWEAd4YBE6OomgnYF/gQ0qpnYFTgb9FUbQd8LeR/9dZBPKs5khTnqXZNtOUZ+PHF2fbdI0H5II1k7n77oPf/Q4+9CHo77ffff7gB3VPf/bZmcqz1QMRs5jN/Gk7wKGHWtUJypNnRYFPXdQNeZNe15hnkG3bjCI/8ixtkeCjPJNYNCZhbIS+O1RFE+h1IdsmtN7LKmKeuQbTz1OeucQLrEJ5lqWwc1WeSU1SJbNt5rWt4eF8q0kSRVn+OqU8M+RZmpWqjG0zCR+bixR5Jqk8M/1g8hxd7X5Sm1OQbxGXShjg0w+aa1V1zDMf22a7EgbYEkJVJAyAfOWZtG3Tto3lZduUIs/M/O2j+3yUbtXdRBglYciz+fObX//Jw2fDqvG8acb77SoFTBk3Hm7+AHeuzibsXJRnWW1+9pzZzBg3g33GvBMoLm/KFGDpDF47491cfPvFPLfsOaBxDVerZVxw8wUctuNhbD8lOxaygRmzD93hUHaYsgOz58wmGrE1SJNnLpt6RcqzTmXbjH8mDVIxz1z7aCnbZlCetSKKoqejKLp15O8lwH3AJsBhwCUjh10CvLkjFWwTgm2z5kiLeZZm24xn2zSwtW2OGpUdyN0JUQSf+Qw8qCN8vvd2eNVC4Kj79SjxoQ+tqbPVBHrqVDj+eLjwQr4zeimT/ga8rfmQMYtWsCe38rdXXsjBFsyJTYwx28l91gIG3EjJvHIkbZu2VlIDKeWZTaylMuRZXZRnhjxLS4zQyWyboM+ht7da8sw1mH6dlWd9fRlkvaPyrCyZao4pUmUpVXw/bZ5DnwU7yCjPhoezk4qUiXlWtiwb8szVtpmFTsY8A/2sGJWD+d+mPgZKpWTZjqGTMc/qZtu0jXkmoTzrVMyzqhIGFCnPJG2btjHPJAhjm75+1CjYePzGvGu3d3HRbRfx7LL0QKurVwNHwjeehqsu169FRPx93q/hlo8z4VX2gVNHjQJu+ChdB5zLWy97K9tN3q7lmHtfpK/72y7PL2vxa+DPE1uPGxwe5C8P/4WvHPwVoof1Q1s0f54yRf9+/aST+d2TP+TQnx/K5hM312q7I+GMR59h/or5zJqZHwvZwIzZXaqLk/c7mff9/n0c+vND6e/tZ+7QpqDOpru7uMOwJc9sY9fGEwakwZU8SxKqBtKbQZ1WngXbZrVQSm0JvBi4AdgoiqKnQRNsSqkNO1m3qhHIs5ojvvuVNhFJTpZ9bJtils2rr4avfAW23BLGjGHGfOgbQos8v/hFmDZtTf2tlVSf/CTccAM73H03PQuBu5vf7hqEv/AqHpn5bg62KM5mZ9x2spq3SDCv25BnRcozo3Kzxdix8NRT6WVBPW2bZiFim9XNIEme+aoIJJRn/f36+DT7QqeVZ9BMfPksGkFf7yyi0YVIqHvMs9Gj0xOtuDxDY8bA88+nvydp27RtDzbPoc+C3dQhieFh/eNKLKUd38mYZ0XKJeiMbVM62ya09oM+CYWKxrN2Z9uUVp5lXat43dqdbRPyN0rrnm3TNWFAUcyzOtk2JZVncWL2tANO4455d3D3s3dnf2BDeGo1rI7xa9uP35P7r/uEk5uhuxu6l2/MAUOf49nBn6d+57Kxum53ZyRNMhicDAsyjnvZ5i/jA3t9gCvu1/9bKc+A/uU7cdK+J3HVg1dx97N363u6ISwZhPfs8R5mbpYfC9kgPma/e/d3c/m9l/PwgodZNbSKh9XlsMPL6eo6rLAcW/IsK+lFEu1KGFBX5ZlvzLNg2/RCj1Lq5tj/F0ZRdGHyIKXUOOCXwMejKFqsRBQ4aw8CeVZzxHe/0iZbRcqzItumKHk2ezZstJG2aY4ezfmfha9+FQbvbT7MiTzbfHO46SaOOUCfy9/+1vz203PhkM3h+/12xUkGNM6LVWYmsbaLWonsZAZZts0qyDOpCbSv8szY6+qiPAN97ZP3vdMxz6CZsCqjPCvatbQllkyMpSyypNPkWRq5J2VNlbRtumS0jH93VlkgQ565XKv42JZHnrkGWG6X8kzatmmTMCCtHAnlWVp9XPplKRVOXnISl7bV06PHhbQ6rUvZNjfYIDuzum/CgCwlqK3yzIzHtrbNonsxdqw+Jos8iyI526YrQZvXViWVZ6Y+203Zjlved0tueVOmwNuOhm9/sfHan/8Mr1niZ4Xbe+XnOOtDn0t9f5ddYMcd4Yqv5pez3Xbw0pfCz87MPsZ2/mzIsxdegHOPOZdzX6NtrHPmwP6z4PtX6QyatojHKR3dM5o/v/vPgFbFTf3SdizafzbanZaPtdW22emYZ8uXN7fxTmfbXE+VZ4NRFO2Vd4BSqhdNnP00iqJfjbw8Tyk1Y0R1NgMooNHXboSYZzVHmvLMNuaZjW1z1Soh8uyuu+Cqq+AjH1lT4KhRun7x+kaRI3k2grxsm+BGeEG9bJtSO/UGWbZNyUWjS4wxG5KjU7ZNm91nH/IsrRyoj/Ks07ZNiQVolbbNrIW7lDVVOtumy2JdInOngWRg3ry61cG2KZltMwudinlWRJ5JKc9cY55JKM/yyqpDtk0p2+a0afDcc+nv+SjPhodlxkUb9YZ5v+heKKUVKlm2TXMtJWOelbVtSsc8cxn70whV3z6iyMVi2+6ziP9kWVDc70ycqNvMCy80v14m9mPac93T1cNeq0+Cza5lztw5heVIk2fri/IMmp/tTts211PlWS6Ulpj9ELgviqJ40MUrgWNH/j4W+G2769ZOBPKs5ogP4DbKM9NpdHfrjtkMeCMxL1uwcqVQsoCzz9Y9/IknrnkpbXFrOkNXQigv22b8u4ogqTzLI89cFmhFMc9cVUZZgetdr5UZ2KVinkkoLpIwiyLfhAE2yjPb9mDKKnPtq4p5Bq22zU4mDChauAwM2KlvoBrlWVawctdzzLpWrsGHbdUIeejq0otPm5hnrv1pHtEoQSS4El5jxuhzzUsYIKHAdVlgSyYMyIp5Vta2mWyvq1Y1Z/q2QRF51u6YZ3l16mS2TWnb5rRp8GzGXr9rzLM82zO4jYu25FlPj13s3TR7l4GLWs/EAZVQ4RRl25S6Vi5ZFQEmT24lz1w3nA2KXCwSCQPiZUFxeV1d+hyzyDOfdUZWe9h51fGwYgNmz8nOOGogTZ6NHq3PtU7KM5vxzKUPS7Nkd9q2uZ4qz4qwP/Bu4JVKqdtHfl4PfBV4tVLqAeDVI/+vswi2zZojrnRQSncieTHPTKcxbpw+3kz8syatIrbNuXPhZz/T2TEnT17zcpz9N9/hO3BLKc+kY561Q3nWKdumsbu0I2HAihXNSTFsUbXyzMe2mUbESSrPfG2b8UnT0JB/zLOiBa2L8iyPPJswIb8MF+VZUVlp9UtbHLueo5TyrCgOju3EuWjXvwrbpqTyzLZ/6OrSz2PVtk2fmGcSCQPaqTxzJZ7zwhn4xDwrk4DFIOtZ7KRt05DZUrbNDTfUJEKams7U1Ue5uWFK2GcX5ZnNAtSFjEsLLG7gSjjmEQmmrdoQenGXRfK6VJFt0xbSyrM8F4staZxF/MfhEvZkypRW8syFBIojb3Owa3Aco+7+EL8dcyb/feG/udk7bcizFSvcErHkZXPvhPJM2raZpjzz3RSXsm0G5Vkroij6N5DVK9qEHl8nEJRnNUdS6ZBcSGXFPDOTnzxlAAiRZ9/4hp7hnnRS08tpHZhP9khoj/IsitwmcTbKs7LZNn1ino0d26zGStbJRbWUZ3cB2YQBPu2wbMKAPOVZFOkfCdumbUbEIkJoeFhfxzraNl3IEkNatsO2uWKFeyKKIvKsrPJMOtumCyHeLtumy7Uqmoib9uASk3b8+HTyzNXCJhXzTFKBKx3zLOt59OmXJW2bkP58u477U6akJ+/wsW0aJV5Z2ybkq0p9bJtDQ+lxzwwJavv85NmeoTrlmQ1slGcS5Jlr/FvIXqzbltMO26bvBraUbdNWedbdbdePpZFnZfrBPGJp9F0fZlT3KM6Zc05uOdLKM8jeDAK3dhGPN5uEj/JMMuYZpCvPfIheyFYbQ1CeBZRDIM9qjqTSITnwZGXbTJJneSnMS5FnixbBhRfC296ms2zGkKbyklae+ZJnaRNyHxVbUWp4mwGtiphn0EoI+RCXEuSZ7aLRlzxbubIa5ZnrBCzPtmk7gS66Vq5qhDjaRZ5J2TaLztGQkVWRZ3lkiW3CgIGB9MmXq21TSnlWtOvfKeWZjYXNtc1nZQxcsUL3ExLW1E7ZNqvKttkO8kzCLuuiAAWYMQOeeab19Sr6Qdfnsciq7EKeQbp10/U+FpFnrsozG/LMtjwb5ZmECsdlUyIvLqJLG5O2bUoqz6RsmzYxz1atsr+HeeSZ69x59Gh937PG7N5VG3Hs7sdyyR2XMG/pvMxyioil4WF9vVyfSQnlWZ7q3yfmmZSSXTLmWd7GakgYECCBQJ7VHMnJeXJwLVKe5Q3qIBDz7Hvf04FlZs1qeSuNqPIlz7KUZ5K2TZeFMdhl2yyrPPO1bULrQOtLnqUtEqRtmytXuhMcpn5VZdt0nWTm2TZt72ORmspXuQmtMc98bJvtShhgO3nOe3YMfMizvr703VnXhAGQHzvNllCNokYbT0JSeSZJnkkqz1wVF5BNnhkiwVaF007bpq3yLIsELWvbTC6ofDbX8jaVfJRnZRWgANOnw9NPt75ehjzLI11s26qN8szFtgnpSQNc76OZP6bFDAR35ZlNts11QXmWRbBLKs9cybP585tjHvsSS+20bbqQQZK2zbwx2/QVJ888mYGhAc6/8fzMcorIM3MdXeYlecozF1I1b+OyrsozSdtmSBgQIIFAntUcSUInOdnKinlmAr5WatscGNCWzYMPhhe/uOXttA6srPIsmfjAJ45Xsk6+dZNKGCAd8yzLPui6kw3FyjObQbYdtk3f2AhSEwkozrbZiayDcUgpz4aG8iX/NvdAQnkG1ZFnWckyXPqbPIJQcodXMuZZpzJRVqU8S1v8u7YHm3OUtG3a2FPrHvNMQkltozyzHcuM8iw5f6hiE8FlIZtHLPnYNiGdPHMdX4sSBlSRbVMi5lmnybMqlWcmU72rbXNoqPk++hJLNrZNyYQBtv2OpG2zaMzu7obtp2zPm3d8MxfcdAFLB9IfkCJiySe7vGTMMyivPJOOeWbIMwnlmdQ6LyjPArIQyLOaI822mRfzzNW2WYo8+9nP4KmnUlVnWd9dRnkGrYOaq1pMqWzFmCR5JqU88415Bq0KKDNYGrWVDbLIMxeyylZ5JhHzzHWQ7e7W7SFPeSaVbVNCedZp8qxoQdvba6fokQq6XTV5Vqa/kSJmbeKBrevKM0nbpmtf085sm7ZtNYsEXRtsm7b9aV62Zx/l2cqVraRLp22becoz176+yLbpQoJKxjyrImHA4sXpZdbRtimlPPNRnW+wgf4dt25WYdscHh6xNQrFPHO1ba5Y0Xwfy8Z+zCKWzH2cNXMWC1Yu4KLbLkotp2g88yHPpGybnVCe2dRt/Hg9d5RQntms80LCgIAycKQwAtqNtIQBttk2odi26WzLePhhuO02/fdZZ8Fuu8Ehh6QeKh3zDFoXF66xT0y98hZ7dVOe+cY8Sw60ZrB0VV3UOWGAiU3lG1gUsifQkrbNusU8Gx72XzSCLsecr4HLIqFdyrMoqkZ5VtaaKpmJ0sUmtjbHPHPdRBg/Hh55pPV1X+VZWfLMZqfehTxrl/LMhzxbvDj9PamYZ67qmRkz9O9nnmkoHMqMGUX2dYmYZ67P4tSp+reE8syGPOuU8szERlqypHEvDXyUZ1mEhJRt0/VaVUWebb65/rtMwoCiTNtSMc9cbZug1Webbqr/LhPzDPKVZwD7bbYf+2+2P+dedy6bjN+k5dhbFgM7wV+egEdSnrt5z+r37xqCX95rV7eFG8PTpB+/fEt4tN+urNsH9Hf//iG4JxEK4raV+r0/PAL9KTEim8pZqI/965PwRMb33rlaH/PbB7LTM8Yx5iVw8/LGedw5OPL5/7rfS/UiuHu49ZpcP1+X+Y958MjIez1dPbxm29cwuqf5ZgXlWUAWAnlWcyQXa8mdyrZm2xwchFe9qnlF8tOfZkpNpGOegSYmJk9uvO4zocgiq1xVbL292Yv/OsY8M6SOi/IsK3B6nRIGlFGegb4ekjHPyijPurv141REyvrEPItnfxwa8rcrQTYhZFuvdinPBgY0gVY35Zm0bdP2/KRtm9LKs3YkDJBUnvnYXCSUZ1XFPEu2d5+YZ+2ybdqqXEErz0CTZzvuqP8uM2a0U3nmMh/ZYIP2JQyQzrbpkjAAtEJFgjxLy8Jq6iSxieCq0pPcOJNUno0alR9zy7ZutjHPXGyb0EyelY15ljVmx8s77YDTeOPP38gRlx+RXthRcOptwG0ZX3YUfPs5+PbllpXbUv8ckXb8YfA74He2ZR0Fs24Gbk5/75jf25fz2buAuzLe79LHHGlbr0Phj8Af48cfBUf/2vLzceRdk6Pg5BuBGxsvffZln+X0V57edJhNspOA9ROBPKs50hIGxJnwstk2neT8v/ylJs6++12YOVMXvv32mYdLxzyD1kHNpzwp22ZewgBzzjbXtqqYZ1m2zXYrz2xsmytWNOKsuECCPJNSnvX26nMtE/MM8hcbZW2b5jyHhvwSheSRXi4LY0nlWV4cFp82D9nByqWVZxK2zdWrG2oMm7LaZdv0UZ5J2zYlYp6Za1FWASVt22xXts0kQVEEKdumDXlmC0OexZMG+JIIkE2eudjXwE5p5NLup02TSRgwerRuQ3kJA1yybUonDID0uGfStk3XtprVD0pcK5+NszzyzEd5lvVcu9StCtsmNMc9qzLmmcEbtn8DD3zkAVasbm1A110H738/XPL/4MV7tJZ1731w9FHw9W/AK19hV7fTz4C//gX++c/m16MIdt8dPnAifPDE4nJuvhmOPx4u/D7su0/zez/4AXzzm/qYoutvyvnBD2Hvl6Yfc865cOnP4aabiusF8NYjNAH6ja/r/7/zXfjOBXD77e5j2kGv0OG4P/fZ5tf/8Ec47VT47ZWw1Zb6tVP/dioX3HwBpx5wKmNHNSwVNslOAtZPBPKs5iiybUpk27SaVEURzJ6tybL3vteqJ5O0bcaVZ3H4KM/aYds0E/6y6pkyMc8klGfttG2amC0ukCLPJJRnoK992mTcZbEnZQdOouqYZz7xjNImqVFkv/NcpDzzJc+y6ufS39jEFpFKItGpmGd5xFJdlGdR1KxQcs3sa+Kn1M22mXatfBeN3d26TKmEAXnjWSfIs7ht06AMeZY1ZrgSXjZKI5fz3HDDbNumy+aUUvr4dirPXGKeQXrGTddrlpc1VdK2KXGtpGKe+aqysuaC4DYvqdK2aVBVzLNkedtO3ja1nOcmAM/ClmNg141a31/ykH5/p8np76dh8z5Y+Xjr8QMDuqzNRtmVtWKaPn5GV+vx0yL93u4zitvsoon62M37sr930iroW2R/jtMVRM80jp823KiPK/qXwPjlrd99e48u80VTYZuR9z7zss+w/0X7c9FtF/GRfT6y5lhzv30TywSsuwjNoeZISxjQkWybV18Nt9wCJ59s3YtI2jazlGdV2DbbnTBAOuZZlm2z08qzqmybg4ON6+dr25TItmnKKhPzDOQn0AajR+vrNDxcLssclLdtFk1So0jGtilNnvnYNvOybUooliRjnrmSs0plb0ZIEks+5Nn48bq8ZP+1YoV7X5MVLFvSfmvq1omYZ5CupqoiYYBEzDPXcXHSJF1eXHlWhW3T9fnJUzb4KI2mTZOxbUK27TmK3GJm2pBnLgRTnvJMMtumC0FbpMB1VZ4ls8Ka+sS/ywbSts28eapt3arItgnN5FnZTfqs+aDLfYzXIwnfhAErVrT2F67tol2JjEzdXPqvZCbdMqSVyzpv5mYzmbnZTM69/lwGhxs3zWbtErB+IpBnNUfyQS+KeeZi2xwc1J2TVQc+e7be1jzmGOu6V5FtM0lM+No2pWKeScSmko55lmXb9FWeZdlTwG2QLcq26UpwmPpBYyJQhfLMpW3195eLeQbVKs9AL0bLZJmD8rbNvHJcd7GrJM8kEgZkTVKVciOfJbJtFu36S25GuJRlE9fNR3kGrQSAT1+TtYkgvdgoG/OsLCGUbKvS5JmPFS6rr3Fpo0pp66aU8ixLseRKeEnHuMqybUqSZ67XTdq2mac8k7Rt+ijPysY8M8cND7e+50Omjh+v+4I05VknbZtFMc/WBttmHorCEPiQZ1nzep82D9kbl11ddrEkbbNturTXiRNbs21WRZ4l7+WsmbN4dOGjXHHvFWtesznHgPUTwbZZcyQf9KKYZxtuqCcXO+2k/8+zbZoOPHOH58wz4e679ZdcdRWcfrpTb9+OmGe+iz2JmGdFyrNRo+wGoapinlWpPDPtrtPZNpPkmc9CqL+/eeJl4DMBq1p5JkGerVxZDXnmco69vbrt5C1AO0meScQ8y1OeubYH85k0uCrP2kWeSSrPVq9uze5ahDh5ZjIRgr/yTMq2WaQ823DD4rLapTyTTBgwPKwVNZ2wbYImz6qOeeZKeNnEPHOZK224oQ6An1x0+tzHIvKsUwkDjPJMwrYpRZ4VhTPwIV2Sn/Hpm7u6tPps/vzGa77tXsq2aRvzzNZm3Nenx4ZO2DazUAV5ZsazZcuar40keebS5m2IJddNr0mT5MizojEyeZ5v2uFNbD9lez7110/x2//8FoCJ6r3AK4PyLKAFgTyrOcxOrSFhimKeTZzYvMuUZ9vM7cCffx4++1nYaCNd6H77wQc/6FR3M8hLZ9uMw6c8yZhneTtxtrLzophnrteqr0+3l7SYZ319boNRuxIGSJFnnY55lkWeSSnPyto2QV9rF9tNWhllF7RKZS9cpOIFQjW2TZMR1baMqifirjHPJG2b5tg6K8+SQc9dEwaADHkmbduUjHkG2bZN15hnRTZe14y8UuTZjBnw4ION/102gNLqJmHbLMq2GZ/72WDaNN23z5/fTBj7Ks/SEga4hjOwyVgnlTDAhzwbGkpvT1K2Tddsm+YzSfgoEUGTZ1Urz1zqZhPzbNky2GIL+7pNmZJOnrme49qgPEvO610VidIEYd69XLbMzekycaJ+rk2c0nYqz7pUF189+Kt8+u+f5tanb+WZpc/Qt/pWUPcxNBRMegHNCC2i5kjGCElORIomy3mDem4HPmeO/n355fCf/+j/J092qnudlWcSMc/yAiO7yM6llWdK6YE2Ldum1KLRkGc2E/sqlWdJgkIy5tm6pjyLK6GMPN8VeVYqV6JXYgHaiYQBEpPUdUl5lhUPTDopgqRt00dNlafA7UTCgCpsm1XGPHMdX4vUPD7Ks7ht0yX0QBJFfZdUtk3XNm+S7iStmz4kaFbCAB/lmaRts7dXz2+kbJtQvo+WinmW1w/62DahlTyrIuaZtG1z+XI3pXGSPPNNitAu5Zkp34c8Sz6TnWrzNuOZ632cNEn3y+YcqyDP8vqvt+z0Fu770H3858P/4Xtv/B7PDf8Xdrgy2DYDWhDIs5ojGSMkOREpmpDm2TbNpDSTPOvthb32cq6zQdqEwseKALLZNotsm1KxqVyUZ4OD2UFifVRGY8emK89cdoFAt40s8sx2UCtaGEdRUJ7FUXXMMxN0tgrbpktbzVKe1Yk8S7Z9l3OUsrhKZtuse8wz6YQB0LrYqEJ55hLzTEJ5lrUAlVSeDQ3pukqRZ65jfxW2zeefb9StCtumpPLM5xyN5TeNPJOybboSE9IJA6ChUEnCR3kG5TNk57XVuinPXOJaxdFO2+ayZeXIs6pinklZGsvaNuNw7XPapYgH9/uYVJX6bvJC+fA8R+x8BFO6toSZs4NtM6AFgTyrOZKLrKJsm0nY2DZTSZ5rr4U99/SL4j4CSdtmlvKsMG5bRr3akW3TRXkG6WX5kmdpgeullWeu5FlRZtIy5JkhrNaXbJt1jHnmmgGvzsqzvJhntufYrl1sSeWZpG1TWnnm2g9KKs8k1HVVZNtMbriUIYTGjGlu77798qhRuh7J9uo6vuYt8nxtm9DIRlnGtmmuVfL6S8Y882nzRnkWz7gZRZ2NeSadMABaYyMZSJJndVOe+YZsSLNt+vQPWc91vG6S5JnLRq8UedbumGcu8xIp5ZlS2QlPfGKeSdo2k8lAfMOLQPE6r6jcnq4eXjX2E7D5HK5/ao5fJQLWWQTyrOZIKh2KYp4l4WXbXLUKbroJZs70qnPed7uquwyylGcLFujvcRmEpHbGi8gzF+VZ/Pvj8Il5Bum2TR/lmQR5VmTb9NmFi9cPyiUMkM622Q7lmUTMM19rF2SrcFyu1dqgPCtj2zQJQ+qkPCuyzKxLyrM08mxwUP9IbSJI2jajyI08g9asfJK2TZ+NKcjeDHId+7Ni/JiyfZRn0EgaUNa2GUWt5yidbVPCtumUVT2GdirPXMeOLOVZHW2bUoolSdumL3kG6eOH65id1x6Gh/X9kLBt+sR1yxqzOx3zTEp5BtlzL5dzrMK2mVSetdu2mcSB44+H5ZP5zu2z/SoRsM4iJAyoOZJKh6yYZ1kdjE22zZYO/Lbb9Eph//296mwgGfOst1efe7LDX7BAh2JzkaBL2jaN3TL5/S6Lvfh1Sg40krZNX+WZ2W2MD6qStk2fXbh4/aC88mz16tbJ8roW80xCeVYU88ylrRYpz2wW7Z1IGOCSFCFrh1cqMO/wsC7Ltj3Y2jZd+ud2Kc8kEgb49jV9fekkjqRtc/VqfT9dyLPVq5u/u6wVMa5Y8t3UiC+y4591bVs9PdnXvYzyzMQ9K3utQD/b8Xbp2j8XxTxzPUeTJCDtPrqSoIY8S85vOp1tE7RCJWlNhXraNn2UZ1XYNs199N2QjZ9jsk9wjXmWNW+Gxr1wJc8WLGiMq77PtvSYnUeedXW53YeihAES5Jl0tk1X22aa8qxTtk2A/t6xcNMH+VP/GfSent24R3WPYtmnUwaqgHUWgTyrOdJsm8mYZ3nZ3/Jsm5m2jGuv1b9LKs/MQCpBnpnsfEliYv58PTlwrZdUwgBI3yGWUp5J2jZ9lWegzyf+WRc5dZFtU1J55mvBMWXEU4CvqzHPqrRtuizQ6qw8y1oMSVlTpQLzui4WbWybvb3umxFZcals61a0iy0V88wnUDPo9jB/fuvrkrZNl7Ya71Pj5yIZx6sseZYcY33G/rFj09VPrs8hNJRnSfKsjAJ35cqGWsLUC9xinuUFYXcd+3t79XwoTiz53sfx4xsqoPjY75NtU9q2OXFic+ZUgzraNn2UZ9K2zaEh/RyNH19eeZZ2jq4xzyD7uph5q6ttM4o06TJlSjWZdF1IUBvybPRot3E2y7bpQ6pKKM9syTPXbJsgozwrWufZlNvdDcyZxUc/3Mu4iRkB/4DuLk9vacBai0Ce1RxFts2izq67W3cSecqzlgXvtdfC1ls3ZpuekIx5BumxqRYscCfPJG2b5nPJgcslYUDepKSM8uypp5pfW7GiYeuwRVxpFB8EXQJ5dnXpn3bYNn2VZ6YMKfIsuasqHfNMwrZZhfLMqH1s0N+vA3gnUQfyrKtLl11GeWa+t8psmz4xloqy3vrY9KqOB+ZDno0Zo5/B+GLDV3mWRRC6TMSLCEKXtpq14SJp2ywT8wxkyLNx47KVZy59DcBGG+nfUrZNaO0fpJVnPpskG27YTJ753se47Tk59oOs8sw1YUBWzDNp26bLhlf8+5PlSBASZWyboOfK48f7K8+K5qnxY/IQD+ORVg+z+eiqPANt3TTkmc85QnuIpRUr/J/HuinP8p5tn2ybIKc8K0tm9/QAqyZw4s6fZ8cd/eoRsG4ixDyrOYpsmzadXVYnkkpaRJHOtFnSsgkNWbKE8gzSlWe+5FlZOS/kK8akEgaUiXkmrTyLw3VQy4u1JEGelbFtZsXT8yXPoFysrKqUZ+Y8jfLM51oplR3/yVUNkrUwdjnHrGfZYMWKBhHmirQdaCnlmZRt02exnne9jDrBBRIxz4qIJR8iQanWuE1llGd5mfRsFASSyrOsOJJVKM98Y55lkWcuz2LaOAZ+m0qjRumFtaRtM4s8k4p55tNvTZsmY7/NSrjhozyrKuZZVsIGKdumbZ2UElysI7NRYmDmx0Y5WzZkQ1o/6GrbhOw2YZ53X/LMlO0baL5dtk3X51EqYQC0J+bZ8HDnY56VXVPZqOsC1k8E8qzmSFOexR9km84ua+KfOql6+GGYN6+0ZdMgOaGos/LMJ+YZZJNnrrbNZJ1MQOJOZ9uE8uRZXqylMuRZMiObz4QpK5Orb7ZNaCXi1pWYZ6acslZEyA5IbdqalPLMKJBckUWedUp5JmHbLIp5tnSpu6KnauXZ0JDub3zafLKNlYl5JpVJr0rlWZ1tmz7x9LL6CN9xcfr0hvJMyraZrBd0LtsmaPIszbbpE/MMWq+/j/KsimybAwPp198o3W0gZduEfHWqBOlSxrYJjaQBdbFtZo3bvrZNaJBnZeY3yazDBp0mz7q702NAdlp5VjSeudzH0aP1ORrlme8mL+ST2RLZbwPWbwTyrCZ47jl497ubgxtD6+5XWrZNUeXZnJGUvALKM2hd3NZBeSYV8yyPPPNJGJC1EPK1bUpk28zKruijPCtSXHQ65pmk8ixZlpTyTMK2uWJFuRTgfX3lbS6QvTCWtm36JKKAdPKsbrZNH+WZNHmWRSz5KM8kzjGOceOax1Rp5Zlk1lTfmGdxlLFtJheNvuRZ1maQb8yzrEQNPn3gjBkN5VkZ22ZcxRuHa1uVzrYJrbbNssqz5Jy0qmybLvchqVAxcLV3SyUMgOqVZxK2TVN2J22bRf1gWdsmlCfP2qE885mXpKn1fdqF5DlK3kfQxHjVMc+C8iygLAJ5VhNcey385Cdw3XXNr6clDHCJeQbZg7pZDDTtSN52m2YAdt7Zqf623y2pPBsa0p1sp2OeZV3bssqzMkSJZLZNqL9tUyrmWRyuO+zxsqpUnnV1lbcaldnRy0uK4HKtxo/XC7Ok9aZO5FlVCQOkJuI+CQPyrteSJXK2TR/lWV6sHx8iYfz4dNumTz9YljyrwrZZhfLMPI9VJQzolG0T0pVnnbRtSmfbBK08e/75BjnoG/MsLeEGuI+LVdg2k7GRDHyUwSCjPJNQp9r09a794OTJ+ndZ5ZmUbTPLcm4gZdv0jXmWN2ZLkS4+yjNIT6DSKeVZkZLa5z6CJsbjMc98SdC8eUlQngWURSDPagLTkT3xRPPryR3WZOYim87Oyba5YIEeiXx7rAQkybOk8szsTnQq5llerDIf5ZnETr1Bf7++5/G2ksyaZYO62zbrFvPMTBSqUp75BE43kLJtGtIrCR/b5uBga7uvC3nW11cv22ZdlWd5mxG2FqoqFBeQbduUjHnWSdumdMwzaFzvuiQMkLRtGuVZFFVj25RUnpWxbQ4PN2JcdTrmmY1t0ydhALQqzzpJnmXZNqU2SuqsPOu0bXPiRH3t6qI8K+rrfcmzPOVZ3bJt+txHkFOeZa3zJEnQgPUXgTyrCcxiO0meFdk2yyjPUidVixY1514vCUnbZlJ5ZiYDvrbNpOKl0zHPkuWUVZ5Bo10NDuryJJVnLpMTG+WZD8khQZ4VKc/qFPPM18oDuh0pVZ48mzAhnTxzXbhkLc7qQp5l2TYllGfS2TbrGvNMYpJa1rYpoTzLi2dke46mb6pSeWbURr4x/uL1kE4Y4BPzrArl2apVepojkW0zOWZIxjwrY9uEhnWzDjHPqkgYAK3KszraNjvV1xuMH6/beJUxzzpt21RKK+wkyLOq1eKwbijPis7R17aZVJ6VtW2mrfMkM4oGrJ8I5FlNYDqyuXObX09LGCAd86xpUrV4sV4dC0FaeRafSPuSZ1mKMd+YZ1k7cbaT1aLFRhnyzFwvn+Cd0DiH5GTC1faXN4HutG1zbYp55qtGAD3BNBPDMnJ4SeUZlCfP4iqSJKTJMynlmbQawUd59rWvwZe+1Py+L3mWlX3Vxb4G1cc8K5MwYHi4tX4ubV6pfKWRb8yzX/wCjjlG/2/6ZUnyrK7KM585xIwZ+vfTT8uo9JLPdl2ybUIj42anY57V2bbZ16eflbQwBD62zSqVZ762TaX09YqTZz7PTp2zbYI2zMTJM1/bZhVj9kc/qsPyGKxY4U+e1U15Jn0fJ02SIc9GjUqfG5ZJ8vP1r8Ppp/vVJ2DdQiDPagJb5VlyIlIm26ZRRzVNtIWVZ5Lk2eTJDSsCNCYDJqaDLfKsdS51yyoH9LW1HcyqUJ6ZeCVm4mvq6LpozDrHutg2e3p0+y2TbTMrtktds236Ks+gERS8TMyz8eM1x56EaxDvrOtu+gsb8jlP/QnyMc9czzFtp9iU0wk1glGARhF861vw6183v+9DnuUFdZeIn1I25plEwoCsftB1kZanNPJVnn3ta/CznzUWCr6kuLnv5l769svJjRuDOsQ8i8d/KmPbTF4rAx8yWzrbZjLGle99TM4hDKrKtumTMCA5Drm2C6Vgo40acfAMzLNUtq2aciQt+j5z57gVzvVaGxTZNru77Z4l25hnrhu9G2xQ/hwhf8z2Jc9+9jP44x8b7/sqz9I2Ln1IVRMLNE2VZXuOSun7XUXMM/NclyHPsubiZWybV14JV1zhV5+AdQuBPKsJ8pRnSdtmMuZZGdtmywJ18eLa2jZnzNDkmVnQ+irPjLAuOfFyndxnlQNuts0qYp4l6+arPDMT6OQ51iVhgFLN2R99Btqs+yilPIsiN9KlKNtmGfLMqKmqiHnmqgbJUja4Ks/Md6ehiphnPkkRkpDa4fVZrAM8/rjeqIm3+SjySxgwYYKuR1pyBRcFDsgrz5LX31d5ltUPui7SbLIOu5Bn99+vc/wMDenFSpnFRrIf9I15ltWf+to20+Ii+pJncdKljG2z6Bw7mW0zqcryvY99ffpetSvbpku7yLr+PptLW28NDz/cWh9wr1PaPAnklGdms9AV8bpVZdt0HYOyxmwzd3Kdq0qcI8iO2UNDelxdvLi5bUiSZz7j44QJ+vonx2zXzaBkDO44pO5jmU1eSB+zfcnsFSvS13sB6x8CeVYTZCnPimybNp1dHnnW0oEvWlSpbdMMmD4d4vTp+ve8efp3VeSZbceaVU4UuU3iqlCembqZnThf5VnW7rOk8sxXDWJQljwzJE4WeeaTbTO+Ay0ZI6aMbRPWLtumS+auqpRnZW2beTu8Eqosn5hnANdco3/HA26bduGqPMvrTzuRFCGO5PX37Wuy+kHXNp+32PAhz37+88ZrixaVj2UIjfvoGytLanyF7D7ClzyLj4tlbJtZY0Ydsm0agtA8276bU0ql9/U+2TalEwaMHavrVzZhAMA221RHnrmWU9TX+26cxevmmzCgyLbpSp7lKc/GjHGfy02Y0GgPZcmztDHblzxbuVLfuyR55jMvySLPTEgAW+T10S7l5JH/vsqzCRP09R8aKrcZlDdm+5LZy5cH8ixAI5BnNYGZOC9a1PywFyUMsOkI8rJtppJnFds2fXfPDHn2zDP6t7FwupJnycmlgVmI2nasSYLKYHBQD7yuyrM05QaUWyRIKc/Kkmc2Mc/KZJEskzCgq0ufZ/I+SinPfAiOKrJtQvlrBfmEkFTCgO5uu+vebvLMx5o6PFzexms+k4Sv8syQZ4sXN+6juQ++5FmZhaxpi5KxfkBf/yhqtSJKbSK4LkSllGfmO//618ZYunChDHmWJF18ybO0cRHcSRJotcOVJc8WLy5n2+zu1s9J8hxd7GumHGnbpjlHozzzvY+QvliXVp4ZZbZLuzBjdlnbJmjl2dy56Zu8LmVNnFh+DlGkwPXdOJMglopsm64bOHmkiyvhAjIEIWSP2S7XLZ4cxtQpuVElpTxbtaqRDMoWWX20ZBiCMuQZ6PMsu8lryomjjI16xQp9zZJz34D1D4E8qwniHXVcfZYcBJKTrTLKs1WrEh34wIDu1Ssmz3wnAPFgv6CVZ3197guhol0X20EoK+6GS8wmaJCCTz7ZWh8ob08Bf+VZf7+eCEiQZ3m2zdGj/QhVKK88g+Y4CwZS5JnP7nNVMc9Gj26QJGUmJWmTS1/bZpI8k4gXaCAd88zHtgnpEzhJ26ZrYH5DnsWtG77kWVY/KBVMv6zyDBrXf8UK3Ue4Lqwk7iMUJwzo6nJTXA4Pw6tfrf82GSTL9IHQrDzr7XXvJ0aP1veqbFgESO8jhof1T1nyrIxtE9LHDFd1UBWZlXt6mom9MmERpJRnUdS43kmY112fybTr72vbjCJ49NHGa51SnhXZNn3nzvFr5UssFZFnUsqz5cvdN3lB1rYJMn390FCjTlK2zZUrm6/dsmWyY7bPOabB17aZtNZXoTzzfR6XL9d/pyVbCFi/EMizmiD+MMbjntlk2xSLeWZ6UkHbZlrMM98doaTybMECd9UZ5JNnPhP7ZDlmMWo7mZg4UQf5TVoHfGLEGEgpz7KsG647QkUJA3wJDtBt2LTvMqoLCfLMTIiqUp6VmUCb+pkdwbIKlXib8FnQZk1uJCzPBtIxz1z7iLRrZcqRtG26Xq/77mvtI8oqz8qqQLIm4pLkmelrXIl6ifsIxQkDbOsWv67/8z/6t5TyLE6e+Vrp0/pT35hn0Kw8K7OpNG6cvr5x5ZnkmOFK3lShPIPmjHWu85E4pJRnkH2ePol5ILuN+SjPoHn+5dPGJkxoqGUMXNtYUXIYCdumbx+RZ9uUjHnmqzybOLFh95PoB8soliCbPIsi/741rW4+ZqG8OL9SYQh8Ez8kNzjKxvCU2Lg052jWUcG6GRDIs5pg+fLGRD+uPEuzbcZ38Ww6O2vbptmqbINt0wcbbqgnvnHlmTR5JmEdcFWeQXrQWolsm2Vjnpmy2qE880X8OpcZaLN2jV0mYUrpyUKdlWembpI7s5LxjMqQZ1HULKmvIuaZhPJM2rbpqjwDOPhg/dv0EaaOPgkDoHx/mtXuXc8xrW5x5Znvjn+8HANp26ZtWzXXYt99YZdd9N/SMc9ckt6klSUR8yyNPCszLsYt+mVsm5BNnrnUq0h5VkZpFFee+Sq7DSEUh08MT8g+T9/ESHErooEUeeZD9JrnJz6elVWexcezsrZNY9HvtG3TJuaZr20TdHt1JYHikFaemTZqrv/q1Xr+LDUOLV7srndoV8wz39h1UF5JXcXcy8ydA3kWEMizmmDFCh24VKl85VnSwlNGedaykKhAeSZJnvX2wtSp5ZVneTHPJCZwPju9aUFryywS+vr0T1nlGaQThK5ZcIpinnWaPJOIV2KQJM98lGcmbl4SZcmzMWMaC1HJLEY+CyDTFiXJs+22gwsu0H8PDenXO50wAKqzbboqz+L35zWv0b+llGdlF7JVKs/i/aDvBgLIqBEkyDOzuHzb2xrZFcsuNvr69DVOki4+SBsXpWybZcZFUzcp22Zam5dSnpVRGsWVZ6lZ1S2RNva7birl9V/gl5gHZJR/oMOBjB6drjxzqVPavLKM8mzlSthoI7jiCv1aGTI1nl2x07bNophnZWyboNuEKwkUR1aWxrK2zcFB3ceXtVEn61aGPKsy5pnEfZQgz8oQhHEye3i4ce+S1y1g/UMgz2qC5cv1hGejjYqVZ9DosMrEPGuR+1agPJO0bYK2bpYlz0ymprJKCUiPu2HIM1fl2aOPNg9EZewpybp1WnlWZNvsNHmWZ9t0bRMSyrP498dRZkEFMrbNPOWZS1vt6tLPohR5tnIlPPQQ3HOPfs0lAHsaRo/W9yBpk/chzyQyUeYRS667/ltsATvs0Fy3TsY8M3WrOuZZmSxnUH6n3sa2aYOttoL/+z/40Ica17+sbROax4wy/XLauCitPPOdR5i+vg62TdMekhslJoh+mbE/Tp753keJmGe2tk0J8syHYFKqVfnvQ9CmqXnKKM+ee07/3H13o05lbJtQTp1qrkVdbZvJZCCS8xsfxV6SPDN1kyDPyirP2hHzTOI+VqE8800YEN9IDcqzgECe1QRm4rzppq3KszTyzAzKNh16lm2zhXyquW0T9C5hWdtmlt3SZ7KaNYEGt4nO1lvr708Sp1B+kQDllWdV2jZ9rVQGVZNnnVCexT8XRxnrBlRn2/RtqyZzZxy+5NmCBfpv81uCPIPmvrNutk3fmGf77dc6ge50zLMsYkk6YYBPX2PsJ3WxbQK89rX6mowZo69zWdsmNPeDdYh5VoXyzBB7dbBtmnuVDKZf9hwnTWpM51oSQzlAMuaZtG0zK2GDzzVLkme+CQOguU6+yrOhodbxrMzYH+/rfefgSmVvxNfBthk/R2nyzEelWkSeSSmgOx3zrOr76Ns/jx6t6yeVMCAelzyQZwGBPKsJjMR1s81as20mEwaY181vX+VZC/lUc9smtCrPJk/2KycrJovE7qev8gy0csZAwp5Sl5hn7VKedTphAMgpz7JUOFLKM8kdPd8F0Lhx6QkDbJ+dKskzU4f4jmMnbJvmPkkqz/bbr9W64UueGbtf2f60Hdk2fZVnWYlTpM4R/C2lSjWURmV26qG5H1wXY57F61bWtimlPIPWNuFKiichrTyLK+N8sm1CMXnmkzAgaZ/yHR8NeWbOU4o881WeDQ62jmdlbZumbmWIpTzyrA7ZNkG3iTLrjLQx22cumIx5BvVRnuWN2VJKaon76JqYLI68MdvHch6f0wfyLCCQZzVBlvIsqXRIBhS1GQjTBjyzI9IO5VkVts3BQV1dH+UZZO9aSsQ8800YAOWtA8m6JZVn62LCgPhny8Q8M5maDOqoPJOwbZbNTJqnPHNtq+PGySnP5s/Xf0srz+LkmWv/VXWgeddFtukvDzywdbHnmzAAZIJ3t8O2WUblmhU8vRO2zSSM0khCeVanmGdVkWfxhAFlYp4lsyv6xDyD1jZRJkkGNNqDyexXJubZ0FBrHwhy2TZ97+eECbpdxMstozxbsgSef96/ThIxz+LtITmeSdg2DXnmOwfPcrG41K0o5lmnbZtpWRrLkGfxdcaiReXIs7S6+ZBnpqyyMc+qsG3Gw+qU3QzKsp37WM7jyrMQ8ywgkGc1QVx5tnhxc5DJPNumzSKsr6+RvtnA7EqmkmeCyrPeXnnb5sCAjg8G/uRZ1uReMuaZy0Rn0031d5dNlx5HnDxbvly3A5+BSIo8q3vMM0hXU9VNeVbWtmkgObksozyTtm2aRYc0eTY8rH98Ap5LZO6SyET5qlfpGDp77NFKni1dqietPtcrK8aVxES8jArHTMTLKs9ARnkmaduMwwSIr3PMMx/b5ujRuk+vImGAhG0TmtuET7ZNyFaelbHpGbVEWeUZpBMJUtk2zVzU13qW3MTxuWbbbKN/m/lXp5Rn8WuVHM/KZts0dSsTTF9SeVbXmGfmu6sgz6SVZwMDujyfJVvWmN3pmGfxsDoSSmop22ZQngXEEcizmiCuPAN48slGkMo826at8gyaBz0zMLfYNk2aRiFUYdsEuO8+/bsMeVZ1zDOXy9jTA1tuWT5dehzxbGArVvhJqCF9AHKVUxfZNn0XjSBLnpWJV2JQdcyzssozgzKTy2TCDV+iN408W7WqnjHPfJMipFlTfUiXPGLJtk5dXfCiF+m/kxl5ly7VdVXKvl4GEsG7q1CeGetGXIErHf9Jaqe+DHlm+npJ22ZZ5dnAQLNKxYeQUEr3N3HlmVQiHQnbJjS3e9f+OUt5Vta2Gc/AWibmmcS4mHWOBqlzUQukBT0vY9uExvxLKmFAmWuVZtssY+OF8urUqmOeDQ/7z1WTsbJ8581mzC47F4zbNk1dFi9uzEskyLMykXayQpVIhSHwtW1Ccx9dVnlWhiCMt9UQ8ywgjkCe1QRx5Rlo62baZDMZP8I25hk0D3pmN6spZphP5MkCVJEwAODee/VvSfLM17aZtPv5KM9AJuNTsm5x5VkZxUVyIeQayLNK22aV5JlS7mXWOeZZvA34XiulWgmhMgkD0mKelSHPFi7UGw/SMc8kz1EyE2VPjx/hBc0KXEOe+ZZTlfKsDHkGzddfWnnmY9uss/IsGfNMknQx5+3a7yQJdolxcenSRjmS5JkrwZHV10vYNkG3CWnlWZnxLIrgllua3/clz7Kuv88123JL/buM8sz0nRLKsyzyTEp5Vsa2WVZ5lmfbNGN2GbufiXlWph9M9vVllWebbKJfK6s86+vT18+0MfPbZ9mWNWZLhSHwVZ6ZuklsBpW1bQblWUAWAnlWA6xerTutuPLsiSfSd1iT8SNss21CM/mRqTwTJs96e3UHaOorpTwrS55J2IygMSmJT+59EgaAJs+kEwYsXtwgEnx3gbKyD61Lts20XWzfhWjVMc86bduE1klJnWybQ0O6btK2Td/nUYJ0ydrhLRsDLz6BlibPpJVnvu0+fv3LKs+qSopg6lZWeSYV86xsrKws8qy3153oTSrPJMZFaNgFJccM32ybWcqzstkVTYylKmybPkG3//xn2GsvuOeexvtlyTND/pdps/39emO2DHnW3d3aR5S5VnHyLIrkbJtllWdlY57lbQ6a57ys3a9sP5hFnvlsBi1e3FjXlY15lqxbWeVZHWOembpVFfPMN9N5iHkWEEdl5JlSajOl1NVKqfuUUvcopT428vpkpdRflFIPjPz2pD/WHZiHsr8fNt5YTy7nzk1XOvhm2wQL2+aiRaLxzuLfbc6lTrbNtJhnrpOTtCCxPrZN0OTZ/PmNSb1EzLPBQT1Yl1WeQTnybG3ItgmtwX4lyLM6Kc+qJs86mTDA9Gmg/5Ymz3zPUYJ0ydrhLRsDL056LVnilywAmi3iBpLKs+7uctlh6xTzrKqEAVLZNlev1gvksjHPoLlN+Ci7IZs8851HmL7e9BeSY4avbVM622ZSeVYmYQDIKM+GhuCxx/Tf8YzyUsqzZcv0uU6d6laOQVz5XyaJQbw9+GbbjCvPBgZ031BmoySeXbHMHFzStpm2OWjmTWVCjFRJnvkqz6ZO1X1pXHkmMQ5J2zZ9Yp5VYduM38cqlGc+NmrTNseMCcqzgGqVZ4PAyVEU7QTsC3xIKbUzcCrwtyiKtgP+NvL/eo34Im/UKNhoo2blWR55JhrzrCLbZvy7fSfQBhMm6OskQZ4lMzWVUZ7FO9Mytk2ARx7RvyVinoG+rXVQnmXZNsuoQaBa26bPBGzs2LUj5pnkpMS3rRryLIoar9WNPDPPcx1tm+uL8qzMOUopz8oGH4bqbJsTJ+rxbNWq8gkDoLHIk7Zt+oxlVdg2QY48k7BtSmfbrJPyLD5nfe45/fcLLzTeX7CgoRpyQVL5Z8recEO3cgzi5JmvkjrZD5a5VsnxrKzq3LgtyhBLErbNqpRn0DjHspv0yb6+bMyzCRMabUNSeVYmx1ua+8ZVeZa1GTQ8rOfAZe9jp5Vn8c0NM5+cPj2QZwEVkmdRFD0dRdGtI38vAe4DNgEOAy4ZOewS4M1V1WFtQXK3ZbPN4Lrr4Dvf0f/HB8ykzN822yZY2jaFlWdJIqDsoKaU7rzMZLoMeQatBIAEeearPEtmfJJaJCxevP4ozyTJM9+4Gf39+t7F2zyUV54Z+3OdlWc+xNLgYPOE3Ic8GxiQJ8+yYp6VtW0OD2uyUCrbpsSCCjof86xd5FnZHf840Stlvx0a0udZRnkGut2XtW1CdeSZT1uVtm0a0sX0F5Jjhq9tUzrbZlx5ViZ2nYTyLH6Ozz6r/06SZ5Mmud+H5PU35Nm0aW7lGGyzjXZ8rFolR55JKM9A/y2hMpZIGFDWtpmMefavf8G8efrvsuSZxDlC9vzGJx6YWVZJkWdxYk8i5ll8PJPKtlkmdp2pm4l5JnEffc8xTXm20UaBPAtoU8wzpdSWwIuBG4CNoih6GjTBBqTuEyml3qeUulkpdfNg1qp7HUFykbfnnjomxGc/q8kiE8wUZJVno0cnOvA2KM98J9BxmKQBfX3lduqh/M64pPJsq6307yrIs7oqzwYHdRsuQ55JqKmkY55B47mWUp6VbQ8gR54ld2Z962bImnhZZZRnU6bo/6u0bZZVnvnET8nLtllWeSaVMCCZVMRVKZFn25Qgz0xfU4Y8GxxszSApcR/LWnlM/zV/fnnbJuh+cNUq+ZhndVKemfAIvv2gRLbHLOVZWdumqZtUwoA0NZVtO4ufY5byzGcTNGmbNcScL3m25ZZ6kR0PmeITxkNSeRYfz6RUxmU2sPv7m4lsA1/b5tAQHHIInHuufm1dtW1OmNBoG3WKeWYs+tDY1JMItSB1HyWUZ8kx20VdZxKGDQ01K89CzLOAyskzpdQ44JfAx6MosuZroyi6MIqivaIo2qunjFRpLUCyo7ngAj0Jnj9fP6Svf33jWMmYZy0TljaRZ2Vvp4l71pQp1BFp8Up8iL20cnwTBkycqCdLSetAp5VnaSo91x2hLFVJ2UUjyCjP4pmaDHzTnZvn2DzXUsqzslkHQVZ5VmaH3cCQNfHF8cCA/bOTJM+M9bkK8qxMHJyyKr08VZZUzLOy5Bm09qd1UJ6ZczTtQVqFI3GOZduqURrNny+jPJs/X9ezrPKsyphnnbZtmmeliphnZW2bY8bozxrbpi8Jmra54ZORz3xOkjwzY7aUbdNsyj7zTDnlWZmYZ2b+YpRn8fGsrG1TgljaaCN9fZJwaffxNv/CC3q+bGLgSSjPzDmWWWeUTfxgjl26VJ/nxImNtiExDkmRZ9Borz7nmDWeSdzHZct0m5faDDLwHbPNfD7YNgOgYvJMKdWLJs5+GkXRr0ZenqeUmjHy/gzg2SrrsDYgOXFWSk8mNtigNQ5EcrJVJttm04QliiqxbUonDIAGeeZr2QS5nfGs3WfwW/DFM27WLeZZ/Bx9bJtRpD8XR9ldOJBJGBDP1GRQVnlmJhDSyrMyREJ8cS4ZS6JMwgBoJc98lWdp5Jlv20rGPCuTMEBqFzsJKTVCFJVPGACt8Z8klGdlz9Fcf4lAzdB6LyVtLmWVZ2Vtm6Yco+IpmzBAQnmWJM+kNpXmz9e/ffvBtDFDKuZZWYJQKX0PyirPurv19U+2eVd1CmTbNufP99sI7epqJv/L2jbj5FmZjZIypItSDWv3/PnN45mURb/MHHzGDG2xTM7jXNp9V5f+GRyEp5/Wr5nfkjHP6qA8MwR9mm2zTBIP08YWLdL30uf5TvbRZTKKJiFxH0GfX9l5KpQj/805rlihr82UKa121/UJSqmLlFLPKqXujr223iWCrIw8U0op4IfAfVEUnRt760rg2JG/jwV+W1Ud1ha4SFyTky0x5ZmJ2i2sPIvHJAIZ8sxMcqTJM6mYZ2ax7TPRSWZ8MhMNH1QZ88w1C05WhiVp8kwp/3LSJr5lyLOqlGd1sG1KJgwAGfJs/nwdL9JMWo3iwvf5yYp55mPbXLmyWS3sWk5VyrOJE/V5rVwpozyT2OFNQsK2OTDQ2GFfl5VnUSSzU1+WPItn9zPwDdkgbduMWxqhvFKvyphnZdr9pEnw/PO6TZQZX9M2SnyUZ9K2TWi+/s8+q58f3wW72ZR9+unOxTwDfW1N3K6k8kxio6SM8mz69MZYazA0pH9c2r2JgWtUbOa3IV3K2P2kYp6tWtV4Dn3JM3OdkuRZmXlJUnk2caLfvDc5ZvvEdavStgmNZCK+yFq7uD6PRnk2ZoyuW9zGuR7iR8BrE6+td4kgq1Se7Q+8G3ilUur2kZ/XA18FXq2UegB49cj/6zVcJs6SMc9aMm3CWmXbLEOeSe2Mm8VmcgLd1+c3oG21lU7nPjwsI9M3dSsbKBvKxzyD1kWCJHlWZpCF9HglEuSZlPKsbrbN+OSyTDwwaCyOo0iX60qeLVmiPzd5sl40GuVZGTuwlG0z+fxI2iMkFlTQUBNIkmd1inkGjYV72X6wCoJQSnkGMrZNc6181RGmLCnl2YoVjbZRljwzdr+ytk1oHjOGhvTi3+UZqirbpqmbISUkyTOfjHyg79vzz+u/JckzM3V97jmtOvPdQJsyRde1jG1z4kR9rYwyy5d0Mc+fiXcsZds0xJLvHNzMvePWTR+i18TATSrPzJyprN1vYKD8/AbKjdlJ8iwe86zs82i0DmXMQskx21d5VpVtE/S1qkJ55hOn1Lh30uY66xOiKPoXMD/x8nqXCLIy8iyKon9HUaSiKNotiqI9Rn7+GEXRC1EUHRxF0XYjv5M3Yb2Dj/LMJeZZlm2zSSpfxjyfg7rbNsvGPDPWjWTMM9/F3mabNewNZZMrSCUMMLLwstk2oXWgLWutAznyLC1eSZ2UZxJqBInkCtA6KSlr20yW40qeGaXMBhvofm3+/PLkWVJ5VpYgTO7wStgjJGKeATz1lP69LsY8S5JnZeN4lZmIV2XbNMoz8x2+iJOpUK5fTvanvjHPTJv03YxIwozZpq2VVeqZc3zmGX1vN9vM/vNVZdsE3SbMfSxDgpZVnpljX3ihcV6GPIsiOeWZIc980dXViOlVxrYJreOZaz9oSMapU/V9fOEFmfngwoXumZ7jiFtbDXzJs7jyzNiLpUiXhQvLrTOS99GXWDKbgsmYZ2X71eFh3R8uWlSePDP9V5mMoklI3Ueoj20zrjyDkDQgAatEkOsSKk8YEFAMl4lzPHWu+e2jPJs/vz3Ks3XdtgmtiiWXgOdJbLqp/m0yPpW5VqNG6UHaTFrLEAnJCbSv8qxK26YEebY2KM/qYtuERpuQsm26qutMjJg4ebbBBjLKs64uXQ9p5ZmkbVNKeVaWPEsqeYeH9Y+U8qxMmzfX37SRTsY8q0p5JrXY6OvTP2Vtm9A6LpZRnkFrDEmJxTHI2TbnztW/zRhug6qybYK+/hIkqJTyzKiLpk5tkGdLl+rypGybvskCDKZPL2/bhFY1j+ti3ZBnZjwzxH/Zvt6nPnHEra0GPop4Y9uMlzNvXuMZL9sPliEIQU55Fq+Xuf4LFpR/Hk3dyijPqox5JmXbNN/hCwnbphmzjQAhzbW0jqFHKXVz7Od9na5QHRHIsxrAdDQ+tk2fmGeDg7ozaZqwmJ5gPbFtJjM1lalbknQpqzwDnX2orEzf1M1MoH0HMihPnmUpzyTJszKDLKw9Mc/qYtsEOeWZL3lmvrMK8gz09ZJIGADlJ+JVxTwDePJJ/ds3YUBW/JQ6Kc/KEkLJ+xhF/vFTkihLnnV3N+on0Q9KkGdptk2ftppFnkm0eyivPDPnaDIGSijPJDZKJk1q1K3sYj15H31IBKMy2nFH/QwNDDSss75zuThBW1Z5BnpjVkJ5ViaOVE9Pgywz45mZw0m1+TIJA6BZeebTVpPKM9BEmlH3+D6TUvb1pFpcijwD3bdKkme+S7YqY55JJQwAGeWZOUeTtMyHIEwqz9Zh8mwwiqK9Yj8XWnxmvUsEGcizGsBMnF1tm8PDdjssSdumCZSbqjyryLYpTZ4ddRQccoh/GclMTaZuPpOTNPJMSnkmQZ6ZCUoZIiF5jtLKMwl7XRUxz3za6voQ8yw5gSgTTB/kyLPJk2XJs76+8gkDpKw8VWXbhAZ5JhXzzGfxWRV5lgyCL6U889mpz7qPZckzaFg3JckzyZhnZW2bpo+QIM9Mm5AcM+qoPDMoS4JKKs922kn/nj+/PHlmrHBRJEOelVWeSal5ksoz8zxKtHnzHT4YN04TImWVZ/GYZ6ZezzyjSRdfwgWaz7HMOiNrc7AMeWbaxrx59VCeScQ8yxqz62LbzLLf+qjFQ8yzXKx3iSADeVYDuCjP4juVtp1dksBKnbBUbNuUjHnW3Q2XXgozZ5YrJy3Gla/yLF5OmcXe1Kl6wfLEE+VjXJi6GfJMWnnmk3GrCuWZ+ax0zLO6Kc/Whphnrs/PmDFaAWrKqaPyrM62zbrEPDPZFZPxU6TiutUhYUAyPp9k4gcJ8swM3RL9oJTyTGJ8rUJ5Ztq9pFr5iSd03+9CBFUd88ygkzHPzD03fcyOO+rfL7wgQ54tXqzbxooV5W2bM2botm82mn03Sky79+0jzP1PkmcSmwjmO3wxfbpszLM99tCvPf20vo9l5qlV2f0klWdS5NnixeViniXHbN9zrNq2WWY8y4qpK6E8W19jnimlfg5cB+yglHpCKXUC62EiyJI0RoAEVqywT10c36m07eysyLOKEwZIKs+kILUzPnEiPP544/8yyjOl9M713Lm6PZS9VhMmwKOP6r/Lxjwz1gHQba9utk2JReOyZQ3SLMQ8y4aUbbOrSy+OyyrPTFYrs9hYuFBf/zLWbmgmz+po26xLzDNoVuHUSXkmZdvs6dF9aNmJeFXkmZTybOLEBlElHfPMp++qUnkmQZ4tWaKf6blz9djtku2xymybcfKskzHPkrbNHXbQv6XIs2XLGmVLKM+GhxvKqrIxz3z7CPN7/Hh9bUyMuE4rz6BhbTXwaavxmGeHHALXXKPLXL5cTnlWF/Js9Gg9fpm6LVhQfi5u6lZGeQbNfbTkhpcZP3zJMxNWJ4rKzeu7u3UdyioIjfJsxoygPIui6O0Zbx3c1op0GEF5VgMYRtsGcVWKbWeXtG1mKs+UKrd6SsHaRJ5JxTwrkzAAdMwUqZhnEyc2iIVOxjxbWxIGQPNA6zMBM89yXHmmlH39qox5ZoLgQz0SBoDucpLkmcvzE39GJk7U/drQkFYaScY8K2tNrcK2WRflmSmrqoyikuSZlH1d8j5KKs8kCCED6ZhnEsozXxI7DkmVHuj+64kn3OKdQbHyrA62zfHjdfuMx9n1UZ4Zi97GG+v/Jcgzc44PPaR/S5Bn0Ni8dG0fUgkDQJOfSjVfG6mYZ2X6CGNtNfC1bS5cqJ+bTTfV903Ctil1jhJ2P3OsKUuyXwX9/KxaVY48i/fRkpt6y5aVi11nwuqYv8sgvnYpE2phPYp5FmCBQJ7VAMZLbYP4wlpUeWb0v2V7qozvlrRtSkFqZ1wyYQA0lGdSMc8MOpltc21IGJAWr8SnzN5e/RNXnrnuyprPxSGxoAIZm6uUbRPSyTNX5Rno+9fd3ejXnnqqmphnvsqzOgbTN9kVyyYMgOZ+UFJ5VlZdl7RtSqlwJO+jpPJMihCC8ou8gYFm8rlMzLO4bbO7203hlVY3kB0zjPLMBWuL8gwafbRvzLNFizRJMmWK/l9KeQYN8kzCtgmaCPV1IUD5vh4a1yR+bepg20wqz3xtmybBxowZ+kfatikZ80yCPJMks6ExZpeJtFPVZtDy5eXuo6kbyJJnZTb1zDq9t1eP04E8W78RyLMawEV5ZjrkoSH7jsBMwAptm8KWzbTv9p1AVwFJ5ZlJuQ7llWebbqoHxrKqElM3gzoqz8yisU7Ks7LkGehrHVee+Uyeq8jABo1rXYXyzKdu48c3FmZmoe1DniUXG6tWycY88yUI+/p0HctOxLMSBkj0Eeb6l1We1THmWW+vvgdlY55B+i62xH2U6AerUJ6VTRgAzW2ijPIsbtuUGhelrtX8+XrxL608KzNXkl6sxxfZvrGfNtywlTzr6iqf5ffBB/VvSeVZGYtx2ThSkE6e1cG2OX26Vo2ZPss326ZJsDF9eiOOWlnbprH7QblzHDVK/0goCKWVZ0nyrKzyrIqYZ2UVhKZuIEOelc1+OzjYvE5PxvMMWP8QyLMaoGrlmVJ6ICi0bQonC4Bm1VsU+WcwrALxDrBM3ZIS77LKs8020/f3ySdlYp4ZlF00Ll2qSTPwJ8/qHvMMmicTvtc/Tp5JKc8kbJsgQ54lJ5dllWdlEgaYY01/Nnly4706JAyA6hRLZYklaLR7peQsjXWKeQb6+puyO608GxrS400cLnFPsyCZbdNAwl4U7yN8np20hAFS46LUmPHf/+r7KqU8M2NGGXWdZMIAaCaNfTaDQJNb/f26PoY8mzTJ/z4kybOyyjNDns2f79fGDBEooTwz41h8PJMiz8oqz6ARA9dXLb5wYaO8uPKsDOkSJ2LL9oNl7X7m+82yKk4Ql+lXzfUxyj0p26ZkDE9J8qwO9zGuPDN1C8qz9RuBPKsBXLLC+cQ8Az2wmUWgCVjZ1IFXTJ6tXt3ouMruGkuh7MBhkJTql0kYAI0J+MMPy8Q8M5CQw5vd/zraNtd15VmdbJvQCJYN9bBtpu3US8Y8KxNrKe1aSWRplIqLCPo+lFmsSwQfrpI8M99R5npJkGfQSpZIZIaViuMlpVhKs7DVRXkmrdK75x7921d5lmbblBz7JZQuvrFAk+SZUlp99sILmqSKk0OuiMc8GzOm/IJ9zJhGmb7XXyKOFMjbNo1F37U+SRiC0cQ987VtxsubPl2TcUuXlrf7mftXlmCXUBlDo48YNarxHJZ5Hru69FgtoTyLj9m+mWGzlGdS97HT89Tubt3GV65sjNHJkD8B6x8CeVYDuPjD4zJ/l85u663h3nv13wsWpMSYaINts8wCuwqYrGJxC6zvwhganalEwgDQHX6dYp6ZOoEmz3wm0GkJA3p7y03mpMgzqZhnUK3yrA62TWieXJaJQ1Rn8iwt5plP/yW1+5mEpPKsbK4YCeVZFUkRTN2g3KIF0skznwVVFeRZ3ZVnvoqx7m5dj7jyrC62TTNmGPLMV3mWtlFS9hylYp6lBU/3UeBAQxlmyLPUuahH3R5+uLxl08CQQ77zVIlNBJC3bULjepWZg5vrY+Ke+do2QZ/r1KlaebZ6tSbk6qxYKkOeQaO/kBiHjPKskzHPsuYlZe23pm5QTcIA17WLmZ8G5VmAQSDPagAf5ZlLzDOA/faDG27QpEfqhKUNts26kWfxSWGZhXHS7ieRMMCgTjHPoJk8k7Jtlp1I9PT4ZcZKIs1m1AnlWVeXJqGqyLYJjb5GcnJZJhFIncmzOts2o6h8MH1otPsyyQJMOYsW6XrVzZpqzq1se4jvYvtm7oLW85RUnq1rMc9A9xFVkGdSY4bZmJRSnkk+11Av5RnIk2crV5a3bBoYW6JvWy0bRyovYUAdSGNzfZLkmY/ybKON9DNoCLnBwfqQZ2XV4mnkmflbYhwy2aMlYp6ZsDWwbsY8K6s8M58PMc8CDAJ5VgO4KM98Yp6BJs8WL4b77tNS+VTlWQXkWZ2VZ/HJfZm6SSvPpk5tfL5OMc+geeEoZdssS54ppa+X1KIxPvH1LXPsWH/lGejj6xzzDFonJb4T+3g5EuTZuHGNc6tDwgCQ2cVOPjtl1LJxSCrPVq/Wmwc+RGPaRHx4WJ9nXcizsvGMsgLESyrPpAih3t5yZUnFPAPdn9Y5YcB//6vncHG1lw3yksOUPcfu7ka772TMs/g1roo8i5ddFobIkbBtliFdpG2bpm6u9Uli2jTdLxjbZpkx21xr8xvksjTWUXkmqYBOlumDCRN0G125sr4xz6ogz1zJbPP5oDwLMAjkWQ3Qjphn++2nf193XY7yrALbplINIqCu5NnixfIxz8pMcpRqqM8k455I2zYlsm1KkGdQPtg2NDI1dTrmGaSrcOoW8yxp2yyrPIsiGfJMqcbfkjHPOq08S1OnQPn2EI95JlGOb39aZZs3/ZfEomX5cnflt0E7Yp5JWRHLXqvkuFimjxg7VlZ5JnWtTJzAwUE9Zrva1vOUZxKxYc15lnl+JJVn0rbNeJxGKfJMQnkWn0MYJbktksqziRMbn5dq92Xm4N3d+j4a5VmZmGfmWpvfUJ50qUvMM/P98Tl43cizeB/te47Dw60JcFwEIUV1k5inmjHbN2RGUnkWYp4FBPKsBvCJeRbvCGw6u+220xOWVPJsYECzGBUoz0AP+HVUnqUt9iRinpVNGAAN+4fUDntZcqkseZalPFuxoj7kWVdX68S3E9k2IV95VseYZ2UtWUND+rmRIM/if0vGPCvTR0hkYMuy8dZJeQb6PH2VZ1HUyOgLcmpLSeUZaLK3zIKqSuWZlJqqbL+cpjyTsHaXUbAl6yYxZpg24WrZhPyYZ2XbPOg2MXp0uUQg5vx8x8U85dnCheXIM6Ua91LKtikd88y1nKTyrKtLhgQFOVXW9OmtyjOfmGdpyrO62DbjY3YdY56BvuZScSnLKKnjYzbUT3kGeq7qO/fKUp4lScOA9QeBPKsBXCbOcduHS0egFOy7bwZ5ZkaICpRnoAf8OpJnaYs9iZhnEjF6jPJMyrZZdhdofVCeQSt5VkZ5ZpQSUsqzOpJncVWJb70MabN0aeMcXcjnKsmzZMwzpfzaWRW2TSlVljR55muDT1Nl1VF5Bv4T8Sptm5LZyaD8BlBfn75v8ZhnZWybdUwYEC/LNVlA/PuryLYJuk2UbfN9fc0LSFflWbzPjJNnRr1ZhjyDxvWXVp6VsW2WCf2QVJ7F/65DwgDQZFeZmGfmPMy1Hj++QbbUiTyru21zwoRyxHh8zC5zjsnxTJI8k7iP0Dxmu56jaePxmGdDQ40N8oD1D4E8qwFclGdKNRZSrp3dfvvpmGdLliQmLCbyZEXKs1Gj6m3bLBvzzFgHzE5EHZVnUooLQ5bUKWEAyJJnEjHPqlCemYyWZScTUrbNZEBd3+c6ruapm/Js9OjGIq/Mon38+IY1Vcq2Ka08k0gYAOWUZ9B8nnVVnpXZxYa1I9umRL+cjP9Ul4QBxqIvSZ5JK88kyLNJk8rPRZRqJRJ8NoOgmTwzkCLP6qI8mzChoUyVUJ7F/64LaTxjhoxtM644M39LxTyTsG2aMbvO5FkZlFWepY1nw8N6PJO6j5LKM1/bpkFceQbBurk+I5BnHYYhlVwmzoY8c+3sTNwzSExYLrpIF/ryl9tXwgF1tW2mDRw+kxNj3YiXU3bCKhXzTEp5lkxXPzzsNpHISxhQdtEIMgkDoHWxV6eYZ1JqBEnlWZwQKqs8W7KkEV/MhzybPLnxmiR5Bo2AumXUCMPDuk3ULR5YnWKeQfN5SpFn0osW313sKm2bo0fr+kkpCCXIs7iFrWzMs3jCgLJzCGPRl9pwAVnlmZRtc6ON3JMYpCG5UeKjppowoTEvkiTPTL9Tp4QB0CDQXK9VHnkm1ddL2DafeUaPaRK2zfjfUjHPJOY3UaRJ+zKkS5Uxz8qSZ2VjnqX1XytW6N9S91FKSV12wwuaY55BIM/WZ9SExlh/YToaF3LDqBBcO7u999Yd0fBwbKG5aBFceCG87W2wxRb2lXBAXW2bZRd7cRjSxWfxnwYp5dmoUXqgLrswGzNGt50qbJsSbuG+vtayfTBxos5GC+WVZytW6OskGfNMYkFl2oLk5LJswgCQVZ6Z/k2KPDMZJMuq6+K7n2Vtm3WOeWbGMx/lWRXkmZTyLD4RN23BZ0FVhfJMKfjHP8oP4319+qdOyjNp26apm8SGi5lHSCrPpDZKzjijMZ6VQVnlWXd3M7lVhfKsLgkDkvNKX5VefDPI/F0X2+aMGfrc5s/366OTCQPif9fF7hfv66VjnkmNQ5LKM1OnsuOZ6afrGPPMPD8+9xGC8iyggaA86zAMeebSmRoVgivhM24c7Lqr/nvNhOV739O9yqxZ9hVwRF1tm/HsimVinkFjkeATsykNUjHPQNetrPIszbpRJ9vm6NH1i3kGDcWSVLZNCfJMUnkGjR09SfLMZZFQdcIA0PexrG0Tyu1+VpVtswryTMoCIkUQSsc8k1TXgQx5BvCSlzQTE76Iq4TKlrN4cSMjWxl1alx5VifyrCrlmcQ5zpgBL3pR+XKSyWF8lGdxW2WdbZuTJ+v6lpkLQkPN46M86+5u7o/rZts0KrGnn/az6Jtjq7RtSs5v6mrbLBtpJ9lWoXzMM+O4WFdsm2nKs0CeBdSExlh/4dPRmIW1T2e3335wxx0jg/GqVfD1r8PBB8OLX2xfiCN6e/Uge8st+v+6kGcmU1PZmGegy3n8cbj2Wv1/XZRnoOsmsTCLT6B9s23+978wZ07j9QULYPvty9etr69BRJdBMuZZmWybAP/8pz7H+CTRBr292hYRv1Zz58raNqUmJf/6lw6bWNa2ecst8PDD7nHdzPfGJ5JV2TYllGe+dj9DQJgAwXVVnt19t7aLgZ+V57rrGkqLBx7Qv+uiPIvfR/OM+0zEb75ZqzZe9CLdbqXIMylMmCCnPPvPf+Caa/T/ZZVnUaQX62Xj85m6GaV42XLAT3lm+uBHHmnu6+fPb1bldBrjx+vMmOAf82xtUZ51denxuqxt89pr4amn/K7VBhs0B4KXsm1KKs8Arr66MWb7bKbG50XSyjOJmGdQnlhaG2Kexcdsn/Hs+usbY/ajj+rfdVOeLV7cqJNUzLObbtLjtlLNYZEC1n3UhMZYf+GjPBs3Du68E970Jv2/S0fwildosdkmmwA/+5lmtS6+2L4AD2ywgSYR/vlP/X9FeQm8MG0a3HgjHHWU/t93wjR9OvzmN417Epfc+2DKFJg6Vf+UxaabupM3aTDkmUnP7DKo9ffrdnruufonjte9rnzdNtxQRnk2bRo89xw89FA55Zm5b69/vf69ww5un584UU9M99+/+fWdd/arTxwbbaQnEWWVJWaydfTR+veBB/qVYxQDp52mf7u2+WnTdBuP36stttD/l30OzSR3+XK46y7/RXvZ3U9DbN15J+y+u/5bSnk2fbq+VhtvXK6cvj4dX+m732285nK9zLhw6KGt75VdYFdBns2bp/92WSSYc3z3u/XvrbbSm1l1I8823VRGyTN9Ovzud3DQQfp/37HfZGe8/XY5VdZmm+mNjbIw18ontphS+ppcfHHrNGynncrXTQrjx+vNm3nz9I/rwnjKFNh668b/hhyKovLP9qab6jGg7GI9jm239VdwmrnW+9+vf7vexylTYPPNm1/bYgs9hypLuhiCt+y4aKzhH/uY/u06Zk+dqsebuGhg2231OFR2zmsUoGUVuPG+/s47dd1c5kxTpuhxO05wmbqVJXqlyDMzZn/ve61l2yBvzC57jhtsoNtH2bYav4/PPaf/dukr4vNKM0abua+Zs44aJbMRE7D2IJBnHYaP8uxTn4IPfajR4bks8I88EnbbbWTw+/GP9ch+yCH2BXjg5z+He+7Rf/f3w8yZlX6dEz79aTj+ePjGN/T/vrtVF14IJ56o/+7rayU9XKEU3HqrjAXnF7+QUfuZpAjDw/p/F7Jq7Fh9Pk8/3frePvuUr9sFF7RaoXzwwQ/qso4/vpHd0gdHHqknh2ZAfclL3D5/+eWNZyYOCZXe8cfDa19bnnR55Su1osT0Ybvs4lfOxhtr1dnzz+v/t9zS7fOf+hS8733Nrx1+uM4sXJYAMIuVc8/Vu6sXXeRXTlm737HHwllnwXveAzfc0EjCAuWJhBkz9LXaZpty5YCum9l5njrVjbR/29v0po45L4OxY8vv6krbNm+/HX76U02O77ab/ecPPrjxzDz5JJxwApx0kiYR6kSeXX65zJhx1llwxBH6754e/3HxuONg9mzd/leskCHPvvOdVrukD2bN0vcxrhRywQ03wGOPtb7uOmZUCbNxduKJelz8+MfdPv+3vzUvyru79aJ90aLyKsJZs/SYJonLLvMf+3fbTatnjaXLdcz+6ldbVfQnnKA3GctueB14oFaCbrdduXI220x+zD7iCNhjjwYx4Yudd5Y5R9Muf/1ruOQSOOUUt/Hjve/VpFJ8nvWyl+m6lZ3HSZFn0DxmT5vmdv3NPDc5Zkus8/r79Ry47KZefMz++c/1c+QyZqfZNqdP1+sZQ8b59v0Bay8CedZh+CjPPvABuOIK+OUv9f8uk1ylYMcdR/555BE9m634yd9kkxGlWw1x3HH6Wl52mf7fd8EwbZo8B+ljA0mDVCwQM4H2Ic9Ax9szMfekUXb32mDTTeG88xqTcd8JdE9PueS1VT4zo0a5T3bT0NUFBxxQvhwot1AcO7Z1J7Grq/zkGRqLlR/9SBMlxx3nV07Z+ClTp2pF1+GHw1e+Ap//vJzyDGSuFehFge/CoLe3oVCShpTybPRofd9+8AO9637hhW7DZ/KZuesu3d9I1E0SUha4SZNkxsXJk/Vm4WGH6f/32EOmTAmk9T8u2GEHd2VyuzF+PDzxhP752tfc1VRpC+ApU/TzUFYx3t9fPr5SEmXav1Kw777+n584sVWhKTVmKyWzAQfVjNlSdZMox4wZ55+vn88vfcnt8319rclbpK6/VMwzqO+YDTJt3ozZP/yh35ht5mk9Pc2bNhVGOgpYCxASBnQYPsqzri7dEZjBx2uBPzSkZ0JSDM1aCqV0Z2oGobrEY6sjJkzQaolf/EL/L2GTrCOOO65ht5QIKB2w9sLsNPtMuuIwO8T/+IeOdwXufc1b3gJvfzucfjp8//vw17/q1yVUOOs6pGLNmDiZoMOFliW4zzijQVzWiTyrI970JnjXu/Tfoc23F6bN77MPnHyyTJlTpshtegUESCMec+tHP6pX/yyVbXN9QHzMPu8898QuZp4mTdAHrN1YR5e/aw98lGegY6Wcd57uGLxiBMybp/1DyeAK6yE22QS++U19LctKxtdlbLaZTopg4vVIqRPqBkOoTpkS2sP6jo031u3hm98sR5RMnqw3O77/fe2WHzfOj8g5/3zdJt/3Pvjyl/VrUsrSdRkbbKB/kkoAH2yxhbbjHHts+bL6+/XCrLe3vursOuEb35CL4RlgDxNz6+KL5TaUdtxRTmkUECCNDTbQ4/QnP1lOSVgFNt5Yzx+23bbTNVk7YMZsH+eA6e/qRJ4GdB4qMtG/a4yxY8dGy5Yt63Q1KsHPfgbvfCfcf7+fdH/RIk/p7g036BHhd7+DN77Ro4B1D97Xcj3B4GAj+11Pjx6412Wv/5IlmvBYVxV2AXZYuNAvGHgSzz3XiBEzbZp/YOSlS3XwbtA7qoF0scOyZXoCXPZ5XrpUL1wkVcqLFul7uS73p1Ko4voH5COKdAwvyfnRwIAOASGR1TUgoArUuV9eskSTe3WsW91QZsw46SStMt9qK51Zdl2HUmp5FEWC6VfWTYTpR4fhqzwz8J7MmNXXem7bjCMQZ/no6alXBrCqUTaQccC6AQniDDRhJqHWHDdu/XoOpSCVjc9kPpVEGHvsUcX1D8iHyQoqCYlYjQEBVaLO/XKYn9qjzJgRlGcBaQiaig7DJ+aZCB5/XP8Ots2AgICAgICAgICAgICAAKBBnoWYZwFxBPKswyirPPPG3Ll6K15KVhEQEBAQEBAQEBAQEBAQsJbDWD2D8iwgjkCedRhGedYR8myzzYJhPiAgICAgICAgICAgICBgBEF5FpCGQJ51GCtWQF9fB4KSP/54iHcWEBAQEBAQEBAQEBAQEBBDUJ4FpCGQZx3G8uUdYrTnzg3xzgICAgICAgICAgICAgICYgjKs4A0BPKsw1ixogOM9qpV8MwzQXkWEBAQEBAQEBAQEBAQEBBDyLYZkIZAnnUYHVGePfmk/h3Is4CAgICAgICAgICAgICANTC2zaA8C4gjkGcdRkeUZ3Pn6t/BthkQEBAQEBAQEBAQEBAQsAZBeRaQhkCedRgdUZ4Z8iwozwICAgICAgICAgICAgIC1iAozwLSEMizDqOjyrNAngUEBAQEBAQEBAQEBAQErEFQngWkIZBnHUZHlGePPw5TpgQqPSAgICAgICAgICAgICAghqA8C0hDIM86jI4pz4LqLCAgICAgICAgICAgICCgCUF5FpCGQJ51GMuWBfIsICAgICAgICAgICAgIKAOMORZUJ4FxBHIsw5i7lx47DHYaac2f/HjjwfyLCAgICAgICAgICAgICAgAWPbDMqzgDgCedZBXHGF/n3kkW380qVLYeFC2HzzNn5pQEBAQEBAQEBAQEBAQED9EZRnAWkI5FkHcdllsMcesN12bfzSkGkzICAgICAgICAgICAgICAVQXkWkIaeTldgfcXjj8P118OXvyxc8OrV8KUvwfPPp7//1FP6dyDPAgICAgICAgICAgICAgKa0NurfwflWUAcgTzrECqzbP7iF3DGGTB1KnRlCAt33BF22UX4iwMCAgICAgICAgICAgIC1m686lXwta9pl1hAgIGKoqjTdSjE2LFjo2XLlnW6GqLYbz9YuRJuu02w0CjST/jgINx1VzZ5FhAQEBAQEBAQEBAQEBAQsN5DKbU8iqKxna5H3RHYlQ7AWDbf9jbhgv/yF7jzTjjllECcBQQEBAQEBAQEBAQEBAQEBAggMCwdQGWWzdmzYcYMeMc7hAsOCAgICAgICAgICAgICAgIWD8RyLMO4LLL4MUvhm23FSz01lvhr3+Fj30M+voECw4ICAgICAgICAgICAgICAhYfxESBrQZjz0GN9yQkmXz9tvh0EN1IDQfLF8O48fD+99ftooBAQEBAQEBAQEBAQEBAQEBASMI5FmbkWnZPOMMWLIE3vlO/8IPPhgmTfL/fEBAQEBAQEBAQEBAQEBAQEBAE0K2zTZj331hYEC7LNfgwQdh++3htNPgzDM7VreAgICAgICAgICAgICAgID1ByHbph1CzLM2wlg2W1Rn554Lvb3wkY90pF4BAQEBAQEBAQEBAQEBAQEBaVBKvVYp9R+l1INKqVM7XZ9OIJBnbUSqZfO55+Dii+GYY2D69I7UKyAgICAgICAgICAgICAgICAJpVQ38G3gdcDOwNuVUjt3tlbtR4h51i6sXs0DP5jDCdvCtk8CT468ftllOknAySd3snYBAQEBAQEBAQEBAQEBAQEBSewNPBhF0cMASqlLgcOAeztaqzYjkGdtwtx7FvPd+w/S/xyUePOww2DHHdtco4CAgICAgICAgICAgICAgIBcbALMjf3/BLBPh+rSMQTyrE3YZKcJ3PWNvzNjBkydmnhzzz07UqeAgICAgICAgICAgICAgID1Gj1KqZtj/18YRdGFsf9Vymfqn3lSGIE8axO6+nrZ9aOv6HQ1AgICAgICAgICAgICAgICAgwGoyjaK+f9J4DNYv9vCjxVbZXqh5AwICAgICAgICAgICAgICAgICAgDTcB2ymltlJKjQKOBq7scJ3ajqA8CwgICAgICAgICAgICAgICAhoQRRFg0qpDwN/ArqBi6IouqfD1Wo7VBTV36o6duzYaNmyZZ2uRkBAQEBAQEBAQEBAQEBAQMA6A6XU8iiKxna6HnVHsG0GBAQEBAQEBAQEBAQEBAQEBARkIJBnAQEBAQEBAQEBAQEBAQEBAQEBGQjkWUBAQEBAQEBAQEBAQEBAQEBAQAYCeRYQEBAQEBAQEBAQEBAQEBAQEJCBQJ4FBAQEBAQEBAQEBAQEBAQEBARkIJBnAQEBAQEBAQEBAQEBAQEBAQEBGegIeaaUeq1S6j9KqQeVUqd2og4BAQEBAQEBAQEBAQEBAQEBAQFFaDt5ppTqBr4NvA7YGXi7UmrndtcjICAgICAgICAgICAgICAgICCgCJ1Qnu0NPBhF0cNRFA0AlwKHdaAeAQEBAQEBAQEBAQEBAQEBAQEBuegEebYJMDf2/xMjrwUEBAQEBAQEBAQEBAQEBAQEBNQKPR34TpXyWtRykFLvA94HMGrUqKrrFBAQEBAQEBAQEBAQEBAQEBAQ0IJOKM+eADaL/b8p8FTyoCiKLoyiaK8oivbq6ekExxcQEBAQEBAQEBAQEBAQEBAQsL5DRVGL6KvaL1SqB/gvcDDwJHAT8I4oiu7J+cwwsKI9NawcPcBgpysR0FGENhAAoR0EaIR2EAChHQSENhCgEdpBAIR2EKDRznYwJoqiTgir1iq0XdIVRdGgUurDwJ+AbuCiPOJs5DPrzI1USt0cRdFena5HQOcQ2kAAhHYQoBHaQQCEdhAQ2kCARmgHARDaQYBGaAf1Q0f8kFEU/RH4Yye+OyAgICAgICAgICAgICAgICAgwBbrjKIrICAgICAgICAgICAgICAgICBAGoE8az8u7HQFAjqO0AYCILSDAI3QDgIgtIOA0AYCNEI7CIDQDgI0QjuoGdqeMCAgICAgICAgICAgICAgICAgIGBtQVCeBQQEBAQEBAQEBAQEBAQEBAQEZCCQZwVQSu2plLpLKfWgUuqbSik18voWSqm/KaXuVEr9Qym1aUE5Vyql7o79f55S6vaRn/8qpRZmfO4fSqn/xI7d0OXzAeWhlDpTKTVXKbU08XqfUuoXI23jBqXUlhmfT21DI++9TSl1r1LqHqXUzxy/36kNBpRDmXaglOpXSv1BKXX/yL3+asoxRyilIqVUbladlL7kQKXUrUqpQaXUESVOMcACZfuD2PHJ+/iBkX7idqXUv5VSO2d8LmtM+sRIX3LnSL+whcDpBmQgpx1YPY8597Hw85L9SYA/BNqAyNie0pccp5R6LjZH/B/fcwwohkA7uEopdcfIs/xdpVT3yOubK6WuVkrdNtIWXp/x+ay+JKwT2giBdpC63ht5L3etkDcmuPYnAQEBBYiiKPzk/AA3AvsBCvg/4HUjr18OHDvy9yuBH+eUcTjwM+DujPc/AlyU8d4/gL0K6pj5+fAj0gb2BWYASxOvfxD47sjfRwO/cGxD2wG3ARuM/L+h4/dbt8Hw09l2APQDrxj5exRwjWkHI6+NB/4FXJ/3vKf1JcCWwG7A/wOO6PR1Wtd/yvYHOfdxQuzvNwFXZXw2qz95BdA/8veJed8ffiptB1bPY859LPy8VH8SfjreBkqP7Rl9yXHAtzp9fdaXH4F2MGHktwJ+CRw98v+FwIkjf+8MPJrx+dS+JHFMWCfUvx38I62/xmKtkDcmuPQn4Sf8hJ/in6A8y4FSagZ6ULsuiqII3fG9eeTtnYG/jfx9NXBYRhnjgE8AZ+R81duBn5eoatnPB+QgiqLroyh6OuWtw4BLRv6+AjjY7PgZFLSh9wLfjqJowcj3POv4/VZtMEAGZdpBFEXLoyi6euTvAeBWIL77dzpwFrAy6/uz+pIoih6NouhOYNjtjAJ8UKYdQO59XBz7dyzQEpA0rz+JoujqKIqWjxx6Pc3tK0AYWe3A5nksuI+Fn5foTwLKo0wbyPs8svPLgIoh0A5M39+DJj5M3x8BE0b+ngg8lfxswRwzjrBOqBhl20EOCtcKBWNCWCsEBAgikGf52AR4Ivb/EyOvAdwBvHXk77cA45VSUwCUUrfHPnM6cA6wnBSMWGu2Av4ee+32xGEXj0h4P5dCzrR8PqBt2ASYCxBF0SCwCEi2gbw2tD2wvVLqWqXU9Uqp15qDUtpAGjLbYEBbYdMO1kApNQk4lJHJjFLqxcBmURT9PuXY+Odz+5KAjsO2HWTeR6XUh5RSD6GJj4/GXjefz+tP4jgBrUAIqBE87mPW5+OvTcKyPwnoPMqO7Q5jwltHbFpXKKU2869xQBVItgOl1J+AZ4El6M0XgC8C71JKPQH8Ea0eS36+sC8J64T6wnK957RWSI4JhLVCQIAoAnmWjxbVAI0doVOAlyulbgNeDjwJDAJEUbQHgFJqD2DbKIp+nfMdRwNXRFE0tOYLRj4/gndGUbQr8LKRn3cXfT6gbchsH7F7mNeGetBy7IPQu4I/GBn0km0gC5ltMKCtsGkH+kCletC7v9+MouhhpVQXcB5wclrBjn1JQGdR2A6K7mMURd+Oomgb4FPAZ2Ov71H0HWsqodS7gL2A2U61D6gcLvex4PO6EMf+JKDzKDu2W/YlvwO2jKJoN+CvNBSxATVBsh1EUfQatOWvD22tAz0v/FEURZsCrwd+PPKMu/YlYZ1QU1iu96zXCskxYeTlsFYICBBEIM/y8QTNVohNGZFNR1H0VBRFh0dR9GLgMyOvLUp8fj9gT6XUo8C/0TsH/0gcczQ5Uuooip4c+b0EHddib5fPB1SKJ4DNYM2ANRGYn3JMahsaee+3URStjqLoEeA/6AHSCpZtMKB62LQDgwuBB6Io+vrI/+OBXYB/jPQT+wJXqtYg3zZ9SUBnYdMObO/jpaRbb/L6E5RSr0L3BW+KomiVz0kEtAW599EBvv1JQI1Rdn4ZRdELsef/+8Cebal4QClEUbQSuJKGre4E4LKR964DRgNTEx+z6UvCOmEtQM56z2WtkBwTwlohIEAYgTzLwYh3fYlSat8R+ewxwG8BlFJTzQ4QcBpwUcrnvxNF0cZRFG0JHAD8N4qig8z7SqkdgA2A69K+XynVo5SaOvJ3L/BG4G7bzwdUjiuBY0f+PgL4+0jMiTXIa0PAb9BBvhm5z9sDD2MJmzYY0BYUtgMApdQZaELl4+a1KIoWRVE0NYqiLUf6ievRxMfN8c8W9SUBtYBNf5B5H5VS8cnwG4AHkl9QMCa9GPgeuv2kxk8MqAcKxgUrlOlPAuqNsvPLkThYBm8C7qu2xgG+UEqNM/drZNPl9cD9I28/Dhw88t5OaPLsufjni/qSsE5YO1Cw3vsNFmuFtDHBfCasFQIC5BDIs2KcCPwAeBB4iEYcmYOA/yil/gtsBJxpPmAZ0wK0/PbS5AIr9vk+4E9KqTuB29FS2+8XfT5AFkqps0ZiTvQrpZ5QSn1x5K0fAlOUUg+ig/aeGvvM7bEistrQn4AXlFL3ooN4zoqi6IXk53O+/yAy2mCAPMq0A6VTg38GHbj11pGYFv9j8Z23Wxzz0pF6HQl8Tyl1j9OJBThBoD/IwoeVTjF/+8jnDRFn25/MBsYBl4+0ryvdzy7AFlntIO95tLmPNp/37U8CZFG2DfiM7ZZ9yUdH+pI70LETj/M+yYBClGwHY9Hq0DvRsameBb478t7JwHtH7uPPgePMfN9yTICwTmgbSraDvPVe4VqhYEw4iLBWCAgQgwr9aUBAQEBAQEBAQEBAQEBAQEBAQDqC8iwgICAgICAgICAgICAgICAgICADgTwLCAgICAgICAgICAgICAgICAjIQCDPAgICAgICAgICAgICAgICAgICMhDIs4CAgICAgICAgICAgICAgICAgAwE8iwgICAgICAgICAgICAgICAgICADgTwLCAgICAgICCiAUmqSUuqDI39vrJS6otN1CggICAgICAgIaA9UFEWdrkNAQEBAQEBAQK2hlNoS+H0URbt0ui4BAQEBAQEBAQHtRU+nKxAQEBAQEBAQsBbgq8A2SqnbgQeAnaIo2kUpdRzwZqAb2AU4BxgFvBtYBbw+iqL5SqltgG8D04DlwHujKLq/3ScREBAQEBAQEBDgjmDbDAgICAgICAgoxqnAQ1EU7QHMSry3C/AOYG/gTGB5FEUvBq4Djhk55kLgI1EU7QmcAlzQjkoHBAQEBAQEBASUR1CeBQQEBAQEBASUw9VRFC0BliilFgG/G3n9LmA3pdQ4YCZwuVLKfKav/dUMCAgICAgICAjwQSDPAgICAgICAgLKYVXs7+HY/8PouVYXsHBEtRYQEBAQEBAQELCWIdg2AwICAgICAgKKsQQY7/PBKIoWA48opY4EUBq7S1YuICAgICAgICCgOgTyLCAgICAgICCgAFEUvQBcq5S6G5jtUcQ7gROUUncA9wCHSdYvICAgICAgICCgOqgoijpdh4CAgICAgICAgICAgICAgICAgFoiKM8CAgICAgICAgICAgICAgICAv5/O3YgAAAAACDI33qCDQojhjwDAAAAgCHPAAAAAGDIMwAAAAAY8gwAAAAAhjwDAAAAgCHPAAAAAGDIMwAAAAAYAfeJUTSGWpEgAAAAAElFTkSuQmCC\n", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "fig, ax1 = plt.subplots(figsize=(20,7))\n", + "\n", + "ax1.set_xlabel('time')\n", + "\n", + "ax1.set_ylabel('CPU usage [%]', color='blue')\n", + "cpu_ram_log.plot(x=\"time\", y=\"CPU usage\", label=\"CPU usage\", color='blue', ax=ax1)\n", + "\n", + "ax2 = ax1.twinx()\n", + "ax2.set_ylabel('RAM usage [Gb]', color='red')\n", + "cpu_ram_log.plot(x=\"time\", y=\"RAM used\", label=\"RAM used\", color='red', ax=ax2)\n", + "cpu_ram_log.plot(x=\"time\", y=\"RAM available\", label=\"RAM available\", color='green', ax=ax2)\n", + "\n", + "\n", + "ax1.legend().remove()\n", + "ax2.legend().remove()\n", + "fig.legend(loc=\"upper right\", bbox_to_anchor=(0.95,0.95))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c6f39397-5d19-4517-bfc0-a3a01d82689a", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/jupyter/utility/cpu_ram_display.py b/jupyter/utility/cpu_ram_display.py new file mode 100644 index 00000000000..06a09d4a6ab --- /dev/null +++ b/jupyter/utility/cpu_ram_display.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[1]: + + +import matplotlib.pyplot as plt +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt + +pd.set_option('display.max_rows', 500) +pd.set_option('display.max_columns', 500) +pd.set_option('display.width', 1000) + + +# In[2]: + + +log_url = "https://beam-outputs.s3.amazonaws.com/output/sf-light/sf-light-1k-xml-warmstart__2022-07-05_09-52-48_gsw/cpu_ram_usage.csv.gz" +cpu_ram_log = pd.read_csv(log_url) +print(cpu_ram_log.shape) +cpu_ram_log.head() + + +# In[27]: + + +fig, ax1 = plt.subplots(figsize=(20,7)) + +ax1.set_xlabel('time') + +ax1.set_ylabel('CPU usage [%]', color='blue') +cpu_ram_log.plot(x="time", y="CPU usage", label="CPU usage", color='blue', ax=ax1) + +ax2 = ax1.twinx() +ax2.set_ylabel('RAM usage [Gb]', color='red') +cpu_ram_log.plot(x="time", y="RAM used", label="RAM used", color='red', ax=ax2) +cpu_ram_log.plot(x="time", y="RAM available", label="RAM available", color='green', ax=ax2) + + +ax1.legend().remove() +ax2.legend().remove() +fig.legend(loc="upper right", bbox_to_anchor=(0.95,0.95)) + + +# In[ ]: + + + + From f699087f40e453279f81f2c7a14ca0ef4d7d4dcc Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 6 Jul 2022 22:25:38 +0600 Subject: [PATCH 206/307] Fixes --- aws/build.gradle | 2 +- .../python/beam_lambda/lambda_function.py | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index 0d1c1348872..6b1db52f2da 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -108,7 +108,7 @@ task deploy(type: AWSLambdaInvokeTask) { "run_grafana" : ${ext.getParameterValue('runGrafana') ?: false}, "run_helics" : ${ext.getParameterValue('runHelics') ?: false}, "run_jupyter" : ${ext.getParameterValue('runJupyter') ?: false}, - "jupyter_token" : ${ext.getParameterValue('jupyterToken') ?: UUID.randomUUID().toString()}, + "jupyter_token" : "${ext.getParameterValue('jupyterToken') ?: UUID.randomUUID().toString()}", "is_spot" : ${ext.getParameterValue('isSpot') ?: false}, "min_cores": ${ext.getParameterValue('minCores') ?: 0}, "max_cores": ${ext.getParameterValue('maxCores') ?: 0}, diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 13ea2c1875c..c66f4ea252b 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -15,8 +15,6 @@ - cd /home/ubuntu/git/beam - ''' -JUPYTER_RUN = 'sudo /home/ubuntu/install-and-run-jupyter.sh' - HELICS_OUTPUT_MOVE_TO_BEAM_OUTPUT = ''' - opth="output" - echo $opth @@ -134,17 +132,22 @@ echo $timestamp_CPU, $ram_used_available done path: /home/ubuntu/write-cpu-ram-usage.sh - - content: | + - content: | #!/bin/bash - - pip install setuptools - - pip install jupyter - - JUPYTER_TOKEN=$JUPYTER_TOKEN jupyter-notebook --allow-root --no-browser --ip=$(ec2metadata --public-hostname) + pip install setuptools + pip install jupyter + JUPYTER_TOKEN=$JUPYTER_TOKEN jupyter-notebook --allow-root --no-browser --ip=$(ec2metadata --public-hostname) --log-level=ERROR path: /home/ubuntu/install-and-run-jupyter.sh runcmd: - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh - sudo chmod +x /home/ubuntu/install-and-run-jupyter.sh + - if [ "$RUN_JUPYTER" = "True" ] + - then + - echo "Installing and starting Jupyter" + - /home/ubuntu/install-and-run-jupyter.sh & + - fi - cd /home/ubuntu - ./write-cpu-ram-usage.sh 20 > cpu_ram_usage.csv & - cd /home/ubuntu/git @@ -786,9 +789,6 @@ def get_param(param_name): if run_helics: selected_script = HELICS_RUN + selected_script + HELICS_OUTPUT_MOVE_TO_BEAM_OUTPUT - if run_jupyter: - selected_script = JUPYTER_RUN + selected_script - params = configs if s3_publish: selected_script += S3_PUBLISH_SCRIPT @@ -842,6 +842,7 @@ def get_param(param_name): .replace('$SLACK_TOKEN', os.environ['SLACK_TOKEN']) \ .replace('$SLACK_CHANNEL', os.environ['SLACK_CHANNEL']) \ .replace('$SHEET_ID', os.environ['SHEET_ID']) \ + .replace('$RUN_JUPYTER', str(run_jupyter)) \ .replace('$JUPYTER_TOKEN', jupyter_token) if is_spot: min_cores = event.get('min_cores', 0) From 6792190d8a8e8e33fb1aa2d9eb2c517ff99fed40 Mon Sep 17 00:00:00 2001 From: Xuan-1998 Date: Wed, 6 Jul 2022 11:29:13 -0700 Subject: [PATCH 207/307] initial documentation for reposition --- docs/behaviors.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/behaviors.rst b/docs/behaviors.rst index 4a231e5adf8..e0351a14bc5 100755 --- a/docs/behaviors.rst +++ b/docs/behaviors.rst @@ -93,3 +93,6 @@ the *chargingPointType* attribute will result in the following charger power in Refueling --------- +Reposition +---------- + From 36da6518d8b603e288b2bf157581da934d9f3957 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Fri, 8 Jul 2022 13:09:58 +0300 Subject: [PATCH 208/307] fix for Elki dependency --- build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 248bf1880b3..e42f1b2c8b3 100755 --- a/build.gradle +++ b/build.gradle @@ -126,8 +126,11 @@ configurations { configurations.all { resolutionStrategy { -// we need this in order to get Elki library working fine. + // we need this in order to get Elki library working fine. + force 'net.jafama:jafama:2.3.2' + // we need this in order to get Elki library working fine. force 'it.unimi.dsi:fastutil:8.5.4' + force 'org.apache.logging.log4j:log4j-core:2.15.0' force 'org.apache.logging.log4j:log4j-api:2.15.0' } From 8839171298c54d097ad1d72f27fdfa1a0538a47b Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Fri, 8 Jul 2022 16:58:57 +0600 Subject: [PATCH 209/307] Run Jupyter as non root --- aws/src/main/python/beam_lambda/lambda_function.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index c66f4ea252b..aa2674a9b03 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -136,17 +136,22 @@ #!/bin/bash pip install setuptools pip install jupyter - JUPYTER_TOKEN=$JUPYTER_TOKEN jupyter-notebook --allow-root --no-browser --ip=$(ec2metadata --public-hostname) --log-level=ERROR - path: /home/ubuntu/install-and-run-jupyter.sh + path: /home/ubuntu/install-jupyter.sh + - content: | + #!/bin/bash + JUPYTER_TOKEN=$JUPYTER_TOKEN jupyter-notebook --no-browser --ip=$(ec2metadata --public-hostname) --log-level=ERROR + path: /home/ubuntu/run-jupyter.sh runcmd: - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh - - sudo chmod +x /home/ubuntu/install-and-run-jupyter.sh + - sudo chmod +x /home/ubuntu/install-jupyter.sh + - sudo chmod +x /home/ubuntu/run-jupyter.sh - if [ "$RUN_JUPYTER" = "True" ] - then - echo "Installing and starting Jupyter" - - /home/ubuntu/install-and-run-jupyter.sh & + - /home/ubuntu/install-jupyter.sh + - su -c "/home/ubuntu/run-jupyter.sh &" - ubuntu - fi - cd /home/ubuntu - ./write-cpu-ram-usage.sh 20 > cpu_ram_usage.csv & From f4be1a478e496975ad4fd20b77329a41101decd4 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Fri, 8 Jul 2022 17:05:42 +0600 Subject: [PATCH 210/307] Run Jupyter as non root for `jupyterEC2` --- .../main/python/start-jupyter-on-instance/lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/start-jupyter-on-instance/lambda_function.py b/aws/src/main/python/start-jupyter-on-instance/lambda_function.py index aa124b5b5ba..a19a5cbc673 100644 --- a/aws/src/main/python/start-jupyter-on-instance/lambda_function.py +++ b/aws/src/main/python/start-jupyter-on-instance/lambda_function.py @@ -18,7 +18,7 @@ runcmd: - pip install setuptools - pip install jupyter - - JUPYTER_TOKEN=$TOKEN jupyter-notebook --allow-root --no-browser --ip=$(ec2metadata --public-hostname) + - su -c "JUPYTER_TOKEN=$TOKEN jupyter-notebook --no-browser --ip=$(ec2metadata --public-hostname) --log-level=ERROR" - ubuntu - sudo shutdown -h +30 ''')) From 526057c091e8f6725d3d6a633652a2a30dfc74bd Mon Sep 17 00:00:00 2001 From: Rutvik Patel Date: Fri, 8 Jul 2022 16:37:38 +0530 Subject: [PATCH 211/307] updates viz module --- .../{utils => }/CollectIds.scala | 80 ++---- .../beam_to_matsim/EventsByTransitTypes.scala | 87 +++++++ .../beam_to_matsim/EventsByVehicleIds.scala | 34 +++ .../beam_to_matsim/EventsByVehicleMode.scala | 95 +++---- .../beam_to_matsim/FindIdsInCircles.scala | 79 ++++++ .../{utils => }/FindPersonsUsesVehicles.scala | 28 +- .../{utils => }/ZipViaEventsFiles.scala | 107 ++------ .../beam_to_matsim/events/BeamActivity.scala | 2 +- .../beam_to_matsim/events/BeamEvent.scala | 13 +- .../events/BeamModeChoice.scala | 2 +- .../events/BeamPathTraversal.scala | 210 +++++++++------ .../events/BeamPersonEntersVehicle.scala | 2 +- .../events/BeamPersonLeavesVehicle.scala | 2 +- .../MutablePopulationEventsFilter.scala | 4 +- .../MutablePopulationFilter.scala | 4 +- .../events_filter/MutableSamplingFilter.scala | 4 +- .../events_filter/MutableVehiclesFilter.scala | 4 +- .../events_filter/PersonEvents.scala | 4 +- .../events_filter/PersonTrip.scala | 4 +- .../events_filter/PopulationSample.scala | 2 +- .../events_filter/VehicleSample.scala | 2 +- .../events_filter/VehicleTrip.scala | 4 +- .../beam_to_matsim/io/BeamEventsReader.scala | 4 +- .../beam_to_matsim/io/ConsoleProgress.scala | 2 +- .../beam_to_matsim/io/HashSetReader.scala | 2 +- .../scripts/beam_to_matsim/io/Reader.scala | 26 +- .../scripts/beam_to_matsim/io/Utils.scala | 21 ++ .../scripts/beam_to_matsim/io/Writer.scala | 4 +- .../transit/TransitEventsGroup.scala | 84 ++++++ .../transit/TransitHelper.scala | 89 +++++++ .../generator/TransitViaEventsGenerator.scala | 25 ++ .../TransitViaEventsGeneratorWithLinks.scala | 49 ++++ ...ransitViaEventsGeneratorWithoutLinks.scala | 47 ++++ .../utils/FindIdsInCircles.scala | 72 ------ .../beam_to_matsim/utils/LinkCoordinate.scala | 21 +- .../via_event/ViaActivity.scala | 2 +- .../beam_to_matsim/via_event/ViaEvent.scala | 2 +- .../via_event/ViaEventsCollection.scala | 2 +- .../via_event/ViaPersonArrivalEvent.scala | 2 +- .../via_event/ViaPersonDepartureEvent.scala | 2 +- .../via_event/ViaTraverseLinkEvent.scala | 2 +- .../visualization/via/visualization_11.scala | 71 ------ .../visualization/via/visualization_12.scala | 36 --- .../via/visualization_20_24.scala | 38 --- .../via/visualization_33_34.scala | 51 ---- .../visualization/via/visualization_35.scala | 77 ------ ...isualization_35_person1_alternatives.scala | 239 ------------------ .../via/visualization_3_4_5.scala | 66 ----- .../visualization/via/visualization_6.scala | 98 ------- .../visualization/via/visualization_9.scala | 43 ---- 50 files changed, 817 insertions(+), 1133 deletions(-) rename src/main/scala/scripts/beam_to_matsim/{utils => }/CollectIds.scala (51%) create mode 100644 src/main/scala/scripts/beam_to_matsim/EventsByTransitTypes.scala create mode 100644 src/main/scala/scripts/beam_to_matsim/EventsByVehicleIds.scala create mode 100644 src/main/scala/scripts/beam_to_matsim/FindIdsInCircles.scala rename src/main/scala/scripts/beam_to_matsim/{utils => }/FindPersonsUsesVehicles.scala (51%) rename src/main/scala/scripts/beam_to_matsim/{utils => }/ZipViaEventsFiles.scala (52%) create mode 100644 src/main/scala/scripts/beam_to_matsim/io/Utils.scala create mode 100644 src/main/scala/scripts/beam_to_matsim/transit/TransitEventsGroup.scala create mode 100644 src/main/scala/scripts/beam_to_matsim/transit/TransitHelper.scala create mode 100644 src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGenerator.scala create mode 100644 src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithLinks.scala create mode 100644 src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithoutLinks.scala delete mode 100644 src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala delete mode 100755 src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala delete mode 100755 src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala delete mode 100755 src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala delete mode 100755 src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala delete mode 100755 src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala delete mode 100755 src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala delete mode 100755 src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala delete mode 100755 src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala delete mode 100755 src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala diff --git a/src/main/scala/scripts/beam_to_matsim/utils/CollectIds.scala b/src/main/scala/scripts/beam_to_matsim/CollectIds.scala similarity index 51% rename from src/main/scala/scripts/beam_to_matsim/utils/CollectIds.scala rename to src/main/scala/scripts/beam_to_matsim/CollectIds.scala index 35302ce8654..c5cdbe9acb7 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/CollectIds.scala +++ b/src/main/scala/scripts/beam_to_matsim/CollectIds.scala @@ -1,7 +1,7 @@ -package scripts.beam_to_matsim.utils +package scripts.beam_to_matsim -import scripts.beam_to_matsim.io.{BeamEventsReader, HashSetReader, Writer} -import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} +import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} +import beam.utils.beam_to_matsim.io.{BeamEventsReader, HashSetReader, Writer} import scala.collection.mutable @@ -11,55 +11,21 @@ a script to collect vehicle types ids inside and outside of specified circle. object CollectIds extends App { - val sourceFileName = "v34.it30.events.third.csv" - - val dirPath = "D:/Work/BEAM/visualizations/" - val sourcePath = dirPath + sourceFileName - val outputPath = dirPath + "collectedIds/" + sourceFileName - - // file was generated with FindIdsInCircles script - val vehiclesInCircle = HashSetReader.fromFile(dirPath + "v34.it30.events.third.csv.in_SF.vehicles.txt") - - case class PersonIdInfo( - id: String, - var enteredVehicle: Int = 0, - var leftVehicle: Int = 0, - var hasBeenDriver: Int = 0, - usedVehicles: mutable.HashSet[String] = mutable.HashSet.empty[String] - ) { - - def toStr: String = - "entered: % 3d left: % 3d beenDriver: % 3d id: %9s ".format(enteredVehicle, leftVehicle, hasBeenDriver, id) - - def toStr(vehiclesMap: mutable.HashMap[String, String]): String = { - val usedVehicleTypes = usedVehicles.map(vId => vehiclesMap.getOrElse(vId, "")).toSeq.sorted - "%02d entered: % 3d left: % 3d beenDriver: % 3d id: %9s %s :: %s".format( - usedVehicleTypes.size, - enteredVehicle, - leftVehicle, - hasBeenDriver, - id, - usedVehicleTypes.mkString(" "), - usedVehicles.mkString(" ") - ) - } - } + // format: off + /***************************************************************************************** + ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.CollectIds -PappArgs="[ + '', + '', + '' + ]" -PmaxRAM=16g + *****************************************************************************************/ + // format: on - case class VehicleIdInfo( - id: String, - var vehicleType: String, - vehicleMode: mutable.HashSet[String], - var appearedInPathTraversal: Int - ) { - - def toStr: String = - "type: %s mode: %s appears: % 3d id: %s".format( - vehicleType, - vehicleMode.mkString(","), - appearedInPathTraversal, - id - ) - } + val eventsPath = args(0) + val outputPath = args(1) + val idsInCircles = args(2) // file was generated with FindIdsInCircles script + + val vehiclesInCircle = HashSetReader.fromFile(idsInCircles) def vehicleType(pte: BeamPathTraversal): String = pte.mode + "_" + pte.vehicleType + "_P%03d".format(pte.numberOfPassengers) @@ -94,7 +60,7 @@ object CollectIds extends App { val accumulator = BeamEventsReader .fromFileFoldLeft[Accumulator]( - sourcePath, + eventsPath, new Accumulator(), (acc, event) => { acc.process(event) @@ -111,9 +77,9 @@ object CollectIds extends App { } .toSeq .sorted, - outputPath + ".vehicleTypes.txt" + outputPath + "/vehicleTypes.txt" ) - Console.println("vehicle types written into " + outputPath + ".vehicleTypes.txt") + Console.println("vehicle types written into " + outputPath + "/vehicleTypes.txt") Writer.writeSeqOfString( accumulator.vehicleTypesOutOfCircle @@ -123,9 +89,7 @@ object CollectIds extends App { } .toSeq .sorted, - outputPath + ".vehicleTypes.OOC.txt" + outputPath + "/vehicleTypes.OOC.txt" ) - Console.println("vehicle types out of circle written into " + outputPath + ".vehicleTypes.txt") - - Console.println("done") + Console.println("vehicle types out of circle written into " + outputPath + "/vehicleTypes.txt") } diff --git a/src/main/scala/scripts/beam_to_matsim/EventsByTransitTypes.scala b/src/main/scala/scripts/beam_to_matsim/EventsByTransitTypes.scala new file mode 100644 index 00000000000..c5ff0881c00 --- /dev/null +++ b/src/main/scala/scripts/beam_to_matsim/EventsByTransitTypes.scala @@ -0,0 +1,87 @@ +package scripts.beam_to_matsim + +import beam.utils.beam_to_matsim.events_filter.MutableVehiclesFilter +import beam.utils.beam_to_matsim.io.{Reader, Writer} +import beam.utils.beam_to_matsim.transit.generator.TransitViaEventsGenerator + +/* +a script to generate Via events for transit vehicles + */ + +object EventsByTransitTypes extends App { + + // format: off + /******************************************************************************************************** + ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.via.EventsByTransitTypes -PappArgs="[ + '', + '', + '--ridehail', '', '', ',', + '--common', '', '', ',' + ]" -PmaxRAM=16g + + ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.via.EventsByTransitTypes -PappArgs="[ + '', + '', + '--network', '', '', '', ',' + ]" -PmaxRAM=16g + *********************************************************************************************************/ + // format: on + + val eventsFile = args(0) + val outputFile = args(1) + val otherArgs = args.drop(2) + + val askedForPublicTransitEvents = otherArgs.headOption.contains("--network") + + val vehicleTypeToGenerator = { + if (askedForPublicTransitEvents) processArgForWithoutLinks(otherArgs) + else processArgForLinks(otherArgs) + } + + val filter = MutableVehiclesFilter((vehicleMode: String, vehicleType: String, vehicleId: String) => + vehicleTypeToGenerator.keys.toList.contains(vehicleType) + ) + + val (vehiclesEvents, _) = Reader.readWithFilter(eventsFile, filter) + + val viaEvents = vehiclesEvents.flatMap(_.trip.toList).groupBy(_.vehicleType).flatMap { case (vehicleType, events) => + val viaEventsGenerator = vehicleTypeToGenerator(vehicleType) + events + .groupBy(_.vehicleId) + .mapValues(es => viaEventsGenerator(es.toVector)) + .values + .flatten + } + + Writer.writeViaEvents(viaEvents, outputFile) + + private def processArgForLinks(args: Array[String]): Map[String, TransitViaEventsGenerator.EventsGenerator] = { + args + .grouped(4) + .flatMap { + case Array("--ridehail", idleThreshold, rangeSize, vehicleTypes) => + val generator = TransitViaEventsGenerator.ridehailViaEventsGenerator(idleThreshold.toInt, rangeSize.toInt) + vehicleTypes.split(",").map(_.trim).map(_ -> generator) + case Array("--common", idleThreshold, rangeSize, vehicleTypes) => + val generator = + TransitViaEventsGenerator.commonViaEventsGeneratorWithLinks(idleThreshold.toInt, rangeSize.toInt) + vehicleTypes.split(",").map(_.trim).map(_ -> generator) + } + .toMap + } + + private def processArgForWithoutLinks(args: Array[String]): Map[String, TransitViaEventsGenerator.EventsGenerator] = { + args + .grouped(5) + .flatMap { case Array("--network", networkPath, idleThreshold, rangeSize, vehicleTypes) => + val generator = + TransitViaEventsGenerator.commonViaEventsGeneratorWithoutLinks( + idleThreshold.toInt, + rangeSize.toInt, + networkPath + ) + vehicleTypes.split(",").map(_.trim).map(_ -> generator) + } + .toMap + } +} diff --git a/src/main/scala/scripts/beam_to_matsim/EventsByVehicleIds.scala b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleIds.scala new file mode 100644 index 00000000000..27a85dafeb1 --- /dev/null +++ b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleIds.scala @@ -0,0 +1,34 @@ +package scripts.beam_to_matsim + +import beam.utils.beam_to_matsim.events_filter.MutableVehiclesFilter +import beam.utils.beam_to_matsim.io.Utils + +/* +a script to generate Via events for specific vehicle ids + */ + +object EventsByVehicleIds extends App { + + // format: off + /******************************************************************************************************** + ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.via.EventsByVehicleIds -PappArgs="[ + '', + '', + ',,,', + ]" -PmaxRAM=16g + *********************************************************************************************************/ + // format: on + + val eventsFile = args(0) + val outputFile = args(1) + val selectedVehicleIds = args(2).split(",").map(_.trim) + + Console.println(s"going to transform BEAM events from $eventsFile and write them into $outputFile") + Console.println(s"vehicle ids: ${selectedVehicleIds.mkString("[", ", ", "]")}") + + val filter = MutableVehiclesFilter((vehicleMode: String, vehicleType: String, vehicleId: String) => + selectedVehicleIds.contains(vehicleId) + ) + + Utils.buildViaFile(eventsFile, outputFile, filter) +} diff --git a/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala index 29a5a96877f..50a34dc17db 100644 --- a/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala +++ b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala @@ -1,45 +1,42 @@ package scripts.beam_to_matsim -import scripts.beam_to_matsim.io.{BeamEventsReader, Reader, Writer} -import scripts.beam_to_matsim.utils.{LinkCoordinate, Point} -import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} -import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter} -import scripts.beam_to_matsim.via_event.ViaEvent +import beam.utils.beam_to_matsim.events.{BeamEvent, PathTraversalWithLinks} +import beam.utils.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter} +import beam.utils.beam_to_matsim.io.{BeamEventsReader, Utils} +import beam.utils.beam_to_matsim.utils.{Circle, LinkCoordinate, Point} import scala.collection.mutable import scala.xml.XML +/* +a script to generate Via events for specific modes. + */ + object EventsByVehicleMode extends App { - // gradle execute -PmainClass=beam.utils.beamToVia.EventsByVehicleMode -PappArgs="['D:/Work/BEAM/history/visualizations/v35.it3.events.csv', 'D:/Work/BEAM/_tmp/output.via.xml', 'car,bus', '0.5', 'D:/Work/BEAM/history/visualizations/physSimNetwork.xml', '548966', '4179000', '500']" -PmaxRAM=16g - val inputArgs1 = Seq( - // Events file path may be in csv or xml format. Does not work with archives. - "/mnt/data/work/beam/beam-production/output/sf-light/sf-light-1k-xml__2022-04-06_22-49-06_rub/ITERS/it.0/0.events.csv.gz", - // output file path - "/mnt/data/work/beam/beam-production/output/sf-light/sf-light-1k-xml__2022-04-06_22-49-06_rub/ITERS/it.0/0.events.via.xml", - // list of vehicle modes, case insensitive - "car,bus", - // 1 means 100% - "0.5", - // network path - "D:/Work/BEAM/history/visualizations/physSimNetwork.xml", - // san francisco, approximately: x:548966 y:4179000 r:5000 - "548966", - "4179000", - "50000" - ) - - // gradle execute -PmainClass=beam.utils.beamToVia.EventsByVehicleMode -PappArgs="['D:/Work/BEAM/history/visualizations/v33.0.events.csv', 'D:/Work/BEAM/_tmp/output.via.xml', 'car,bus', '1']" -PmaxRAM=16g - val inputArgs2 = Seq( - // Events file path may be in csv or xml format. Does not work with archives. - "/mnt/data/work/beam/beam-production/freight-base-2018-60k__2022-04-19_04-36-11_rrq.0.events.1000000.csv", - // output file path - "/mnt/data/work/beam/beam-production/freight-base-2018-60k__2022-04-19_04-36-11_rrq.0.events.1000000.via.xml", - // list of vehicle modes, case insensitive - "car,bus", - // 1 means 100% - "1" - ) + // format: off + /********************************************************************************************************** + ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.via.EventsByVehicleMode -PappArgs="[ + '', + '', + ',', + '', + ]" -PmaxRAM=16g + + ************************************************************************************************************ + + ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.EventsByVehicleMode -PappArgs="[ + '', + '', + ',', + '', + '', + '', // 548966 + '', // 4179000 + '' // 5000 + ]" -PmaxRAM=16g + ********************************************************************************************************/ + // format: on val inputArgs = args @@ -53,7 +50,7 @@ object EventsByVehicleMode extends App { Console.println(s"selected modes are: ${selectedModes.mkString(",")} and samling is: $sampling") val filter = MutableVehiclesFilter.withListOfVehicleModes(selectedModes, sampling) - buildViaFile(eventsFile, outputFile, filter) + Utils.buildViaFile(eventsFile, outputFile, filter) } else if (inputArgs.length == 8) { val eventsFile = inputArgs.head val outputFile = inputArgs(1) @@ -81,7 +78,7 @@ object EventsByVehicleMode extends App { circleR ) - buildViaFile(eventsFile, outputFile, filter) + Utils.buildViaFile(eventsFile, outputFile, filter) } else { Console.print("wrong args") Console.print("usage:") @@ -89,19 +86,6 @@ object EventsByVehicleMode extends App { Console.print("with circle sampling args: beamEventsFile outputFile selectedModes sampling networkFile X Y R") } - def buildViaFile(eventsFile: String, outputFile: String, filter: MutableSamplingFilter): Unit = { - Console.println("reading events with vehicles sampling ...") - - def vehicleType(pte: BeamPathTraversal): String = pte.mode + "__" + pte.vehicleType - def vehicleId(pte: BeamPathTraversal): String = vehicleType(pte) + "__" + pte.vehicleId - - val (vehiclesEvents, _) = Reader.readWithFilter(eventsFile, filter) - val (events, typeToId) = Reader.transformPathTraversals(vehiclesEvents, vehicleId, vehicleType) - - Writer.writeViaEventsCollection(events, _.toXmlString, outputFile) - Writer.writeViaIdFile(typeToId, outputFile + ".ids.txt") - } - def getFilterWithCircleSampling( vehicleModes: Seq[String], sampling: Double, @@ -115,17 +99,12 @@ object EventsByVehicleMode extends App { val networkXml = XML.loadFile(networkPath) val nodes = LinkCoordinate.parseNodes(networkXml) - case class Circle(x: Double, y: Double, r: Double) { - val rSquare: Double = r * r - } - - val sfCircle = Circle(circleX, circleY, circleR) - def pointIsInteresting(point: Point): Boolean = point.vithinCircle(sfCircle.x, sfCircle.y, sfCircle.rSquare) + val circle = Circle(circleX, circleY, circleR) val interestingNodes = nodes .foldLeft(mutable.Map.empty[Int, Point]) { - case (selectedNodes, (nodeId, point)) if pointIsInteresting(point) => selectedNodes += nodeId -> point - case (selectedNodes, _) => selectedNodes + case (selectedNodes, (nodeId, point)) if circle.contains(point) => selectedNodes += nodeId -> point + case (selectedNodes, _) => selectedNodes } .toMap @@ -139,7 +118,7 @@ object EventsByVehicleMode extends App { val interestingVehicles = mutable.HashSet.empty[String] def process(event: BeamEvent): Unit = event match { - case pte: BeamPathTraversal if pte.linkIds.exists(interestingLinks.contains) => + case pte: PathTraversalWithLinks if pte.linkIds.exists(interestingLinks.contains) => interestingVehicles += pte.vehicleId case _ => diff --git a/src/main/scala/scripts/beam_to_matsim/FindIdsInCircles.scala b/src/main/scala/scripts/beam_to_matsim/FindIdsInCircles.scala new file mode 100644 index 00000000000..36a413758b6 --- /dev/null +++ b/src/main/scala/scripts/beam_to_matsim/FindIdsInCircles.scala @@ -0,0 +1,79 @@ +package scripts.beam_to_matsim + +import beam.utils.beam_to_matsim.events.{BeamEvent, PathTraversalWithLinks} +import beam.utils.beam_to_matsim.io.{BeamEventsReader, Writer} +import beam.utils.beam_to_matsim.utils.{Circle, LinkCoordinate, Point} + +import scala.collection.mutable +import scala.xml.XML + +/* +a script to collect ids of all vehicles which move through selected circle + */ + +object FindIdsInCircles extends App { + + // format: off + /************************************************************************************************ + ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.FindIdsInCircles -PappArgs="[ + '', + '', + '', + '', // 548966 + '', // 4179000 + '' // 5000 + ]" -PmaxRAM=16g + *************************************************************************************************/ + // format: on + + val eventsPath = args(0) + val outputPath = args(1) + val networkPath = args(2) + val circleX = args(3).toInt + val circleY = args(4).toInt + val circleR = args(5).toInt + + val networkXml = XML.loadFile(networkPath) + val nodes = LinkCoordinate.parseNodes(networkXml) + + val circle = Circle(circleX, circleY, circleR) + + val interestingNodes = nodes + .foldLeft(mutable.Map.empty[Int, Point]) { + case (selectedNodes, (nodeId, point)) if circle.contains(point) => selectedNodes += nodeId -> point + case (selectedNodes, _) => selectedNodes + } + .toMap + + val interestingLinks = LinkCoordinate + .parseNetwork(networkXml, interestingNodes) + .foldLeft(mutable.HashSet.empty[Int]) { case (links, (linkId, _)) => + links += linkId + } + + class CircleAccumulator() { + val interestingVehicles = mutable.HashSet.empty[String] + + def process(event: BeamEvent): Unit = event match { + case pte: PathTraversalWithLinks if pte.linkIds.exists(interestingLinks.contains) => + interestingVehicles += pte.vehicleId + + case _ => + } + } + + val vehiclesInCircle = BeamEventsReader + .fromFileFoldLeft[CircleAccumulator]( + eventsPath, + new CircleAccumulator(), + (acc, event) => { + acc.process(event) + acc + } + ) + .getOrElse(new CircleAccumulator()) + .interestingVehicles + + Writer.writeSeqOfString(vehiclesInCircle, outputPath) + Console.println("vehicles written into " + outputPath) +} diff --git a/src/main/scala/scripts/beam_to_matsim/utils/FindPersonsUsesVehicles.scala b/src/main/scala/scripts/beam_to_matsim/FindPersonsUsesVehicles.scala similarity index 51% rename from src/main/scala/scripts/beam_to_matsim/utils/FindPersonsUsesVehicles.scala rename to src/main/scala/scripts/beam_to_matsim/FindPersonsUsesVehicles.scala index 8c48d0f6a72..91d73656a67 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/FindPersonsUsesVehicles.scala +++ b/src/main/scala/scripts/beam_to_matsim/FindPersonsUsesVehicles.scala @@ -1,7 +1,7 @@ -package scripts.beam_to_matsim.utils +package scripts.beam_to_matsim -import scripts.beam_to_matsim.io.{BeamEventsReader, Writer} -import scripts.beam_to_matsim.events.{BeamEvent, BeamPersonEntersVehicle} +import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPersonEntersVehicle} +import beam.utils.beam_to_matsim.io.{BeamEventsReader, Writer} import scala.collection.mutable import scala.io.Source @@ -9,14 +9,22 @@ import scala.io.Source /* a script to find all persons which uses specific vehicles */ + object FindPersonsUsesVehicles extends App { - val personsIds: Iterable[String] = find( - "D:/Work/BEAM/visualizations/v1.0.events.bridge_cap_5000.csv.RHids.txt", - "D:/Work/BEAM/visualizations/v1.0.events.bridge_cap_5000.csv" - ) + // format: off + /****************************************************************************************************** + ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.FindPersonsUsesVehicles -PappArgs="[ + '', + '', + '' + ]" -PmaxRAM=16g + *******************************************************************************************************/ + // format: on - Writer.writeSeqOfString(personsIds, "D:/Work/BEAM/visualizations/v1.0.events.bridge_cap_5000.csv.RHUsersIds.txt") + val eventsPath = args(0) + val outputPath = args(1) + val vehiclesIdsFilePath = args(2) def find(vehiclesIdsFilePath: String, eventsFilePath: String): Iterable[String] = { val vehicleIds = mutable.HashSet.empty[String] @@ -39,4 +47,8 @@ object FindPersonsUsesVehicles extends App { personsIds } + + val personsIds: Iterable[String] = find(vehiclesIdsFilePath, eventsPath) + + Writer.writeSeqOfString(personsIds, outputPath) } diff --git a/src/main/scala/scripts/beam_to_matsim/utils/ZipViaEventsFiles.scala b/src/main/scala/scripts/beam_to_matsim/ZipViaEventsFiles.scala similarity index 52% rename from src/main/scala/scripts/beam_to_matsim/utils/ZipViaEventsFiles.scala rename to src/main/scala/scripts/beam_to_matsim/ZipViaEventsFiles.scala index 92d7077d6f4..c4f16146312 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/ZipViaEventsFiles.scala +++ b/src/main/scala/scripts/beam_to_matsim/ZipViaEventsFiles.scala @@ -1,11 +1,8 @@ -package scripts.beam_to_matsim.utils - -import java.io.{File, PrintWriter} +package scripts.beam_to_matsim import beam.utils.FileUtils -import scala.collection.mutable -import scala.io.Source +import java.io.{File, PrintWriter} import scala.language.postfixOps import scala.xml.{Node, XML} @@ -14,17 +11,22 @@ a script to merge two files from EventsByVehicleMode script output to get one fi */ object ZipViaEventsFiles extends App { - /*zipEventsFilesInMemory( - "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half.csv.via.events.persons_1_2.xml", - "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half.csv.via.events.person3.xml", - "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half.csv.via.events.persons_1_2_3.xml" - )*/ - - zipEventsFilesInMemory( - "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half.csv.via.events.person5_1.xml", - "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half.csv.via.events.popSize0.3.xml", - "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half.csv.via.events.ZIPPED_p5.xml" - ) + + // format: off + /**************************************************************************************************** + ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.via.ZipViaEventsFiles -PappArgs="[ + '', + '', + '', + ]" -PmaxRAM=16g + *****************************************************************************************************/ + // format: on + + val viaEvents1 = args(0) + val viaEvents2 = args(1) + val outputFile = args(2) + + case class ViaEventString(time: Double, xmlString: String) object ViaEventString { @@ -63,77 +65,6 @@ object ZipViaEventsFiles extends App { } } - case class ViaEventString(time: Double, xmlString: String) - - def zipEventsFiles(filePath1: String, filePath2: String, outputFile: String): Unit = { - FileUtils.using(new PrintWriter(new File(outputFile))) { pw => - pw.println("\n") - - val pwCashe = mutable.Queue.empty[String] - - def writeEvent(event: ViaEventString): Unit = { - pwCashe.enqueue(event.xmlString) - - if (pwCashe.size >= 1000000) { - pwCashe.dequeueAll(_ => true).foreach(pw.println) - Console.println("dropped to output file portion of messages") - } - } - - def getReader(filePath: String): (Iterator[String], () => Unit) = { - val source = Source fromFile filePath - (source.getLines, () => source.close()) - } - - val (file1Iterator, file1Close) = getReader(filePath1) - val (file2Iterator, file2Close) = getReader(filePath2) - - def nextEvent(iterator: Iterator[String]): Option[ViaEventString] = - ViaEventString.readStr(if (iterator.hasNext) iterator.next() else "") - - def nextEvent1(): Option[ViaEventString] = nextEvent(file1Iterator) - - def nextEvent2(): Option[ViaEventString] = nextEvent(file2Iterator) - - var ev1 = nextEvent1() - var ev2 = nextEvent2() - - while (file1Iterator.hasNext && file2Iterator.hasNext) { - (ev1, ev2) match { - case (None, _) => ev1 = nextEvent1() - case (_, None) => ev2 = nextEvent2() - - case (Some(e1), Some(e2)) => - if (e1.time <= e2.time) { - writeEvent(e1) - ev1 = nextEvent1() - } else { - writeEvent(e2) - ev2 = nextEvent2() - } - } - } - - pwCashe.dequeueAll(_ => true).foreach(pw.println) - - def writeTail(iterator: Iterator[String]): Unit = - iterator.foreach(event => { - ViaEventString.readStr(event) match { - case Some(viaES) => writeEvent(viaES) - case _ => - } - }) - - if (file1Iterator.hasNext) writeTail(file1Iterator) - if (file2Iterator.hasNext) writeTail(file2Iterator) - - pw.println("") - - file1Close() - file2Close() - } - } - def zipEventsFilesInMemory(filePath1: String, filePath2: String, outputFile: String): Unit = { object EventsIterator { def fromFile(filePath: String): EventsIterator = { @@ -194,4 +125,6 @@ object ZipViaEventsFiles extends App { pw.println("") } } + + zipEventsFilesInMemory(viaEvents1, viaEvents2, outputFile) } diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala index f3d1bb71f99..571b9db8ea8 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.events +package beam.utils.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala index 3eae66150e3..77dd3d6c4af 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala @@ -1,17 +1,16 @@ -package scripts.beam_to_matsim.events +package beam.utils.beam_to_matsim.events import org.matsim.api.core.v01.events.Event object BeamEventReader { - private def readPTE(event: Event): Option[BeamEvent] = { - val bpte = BeamPathTraversal(event) - if (bpte.linkIds.nonEmpty) Some(bpte) - else None + private def readPTE(event: Event): BeamEvent = { + if (BeamPathTraversal.isLinksAvailable(event)) BeamPathTraversal.withLinks(event) + else BeamPathTraversal.withoutLinks(event) } def read(event: Event): Option[BeamEvent] = event.getEventType match { - case BeamPathTraversal.EVENT_TYPE => readPTE(event) + case BeamPathTraversal.EVENT_TYPE => Some(readPTE(event)) case BeamPersonLeavesVehicle.EVENT_TYPE => Some(BeamPersonLeavesVehicle(event)) case BeamPersonEntersVehicle.EVENT_TYPE => Some(BeamPersonEntersVehicle(event)) case BeamModeChoice.EVENT_TYPE => Some(BeamModeChoice(event)) @@ -22,5 +21,5 @@ object BeamEventReader { } trait BeamEvent { - val time: Double + def time: Double } diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala index a89f16f8eaf..93341a4aae9 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.events +package beam.utils.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala index df692ad59bf..482404d630d 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala @@ -1,12 +1,105 @@ -package scripts.beam_to_matsim.events +package beam.utils.beam_to_matsim.events import beam.router.Modes.BeamMode -import scripts.beam_to_matsim.via_event.ViaTraverseLinkEvent +import beam.sim.common.GeoUtils +import beam.utils.beam_to_matsim.transit.TransitHelper +import beam.utils.beam_to_matsim.via_event.ViaTraverseLinkEvent +import org.matsim.api.core.v01.{Coord, Id} import org.matsim.api.core.v01.events.Event +import org.matsim.api.core.v01.network.Link import scala.collection.JavaConverters._ import scala.collection.mutable +sealed trait BeamPathTraversal extends BeamEvent { + def time: Double + def vehicleId: String + def driverId: String + def vehicleType: String + def mode: String + def numberOfPassengers: Int + def arrivalTime: Int +} + +case class PathTraversalWithLinks( + time: Double, + vehicleId: String, + driverId: String, + vehicleType: String, + mode: String, + numberOfPassengers: Int, + arrivalTime: Int, + var linkIds: Seq[Int], + var linkTravelTime: Seq[Double] +) extends BeamPathTraversal { + assert(linkIds.size == linkTravelTime.size, "linkIds size does not equal to linkTravelTime size") + + @SuppressWarnings(Array("UnsafeTraversableMethods")) + def removeHeadLinkFromTrip(): Unit = { + linkIds = linkIds.tail + linkTravelTime = linkTravelTime.tail + } + + def adjustTime(deltaTime: Double): Unit = { + val travelTime = arrivalTime - time + val delta = (travelTime + deltaTime) / travelTime + linkTravelTime = linkTravelTime.map(x => x * delta) + } + + def toViaEvents( + vehicleId: String, + timeLimit: Option[Double] + ): Seq[ViaTraverseLinkEvent] = { + val onePiece: Double = timeLimit match { + case None => 1.0 + case Some(limit) => + val sum: Double = linkTravelTime.sum * 1.0 + if (time + sum <= limit) 1.0 + else (limit - time) / sum + } + + val (_, times) = + linkTravelTime.foldLeft((time, mutable.MutableList.empty[(Double, Double)])) { + case ((lastTime, timeList), travelTime) => + val linkTime = lastTime + Math.round(travelTime * onePiece) + timeList += Tuple2(lastTime, linkTime) + (linkTime, timeList) + } + + val paths = linkIds + .zip(times) + .flatMap { case (linkId, (enteredTime, leftTime)) => + val entered = ViaTraverseLinkEvent.entered(enteredTime, vehicleId, linkId) + val left = ViaTraverseLinkEvent.left(leftTime, vehicleId, linkId) + Seq(entered, left) + } + + paths + } +} + +case class PathTraversalWithoutLinks( + time: Double, + vehicleId: String, + driverId: String, + vehicleType: String, + mode: String, + numberOfPassengers: Int, + arrivalTime: Int, + startCoord: Coord, + endCoord: Coord +) extends BeamPathTraversal { + + def toViaEvents( + vehicleId: String, + linkId: Id[Link] + ): Seq[ViaTraverseLinkEvent] = { + val entered = ViaTraverseLinkEvent.entered(time, vehicleId, linkId.toString.toInt) + val left = ViaTraverseLinkEvent.left(arrivalTime, vehicleId, linkId.toString.toInt) + Seq(entered, left) + } +} + object BeamPathTraversal { val EVENT_TYPE: String = "PathTraversal" val ATTRIBUTE_NUM_PASS: String = "numPassengers" @@ -18,30 +111,20 @@ object BeamPathTraversal { val ATTRIBUTE_VEHICLE_ID: String = "vehicle" val ATTRIBUTE_DRIVER_ID: String = "driver" val ATTRIBUTE_VEHICLE_TYPE: String = "vehicleType" + val ATTRIBUTE_START_X: String = "startX" + val ATTRIBUTE_START_Y: String = "startY" + val ATTRIBUTE_END_X: String = "endX" + val ATTRIBUTE_END_Y: String = "endY" + + def isLinksAvailable(genericEvent: Event): Boolean = { + val linkIdsAsStr = Option(genericEvent.getAttributes.asScala.getOrElse(ATTRIBUTE_LINK_IDS, "")) + linkIdsAsStr match { + case None | Some("") => false + case Some(v) => true + } + } - def apply( - time: Double, - vehicleId: String, - driverId: String, - vehicleType: String, - mode: String, - linkIds: Seq[Int], - linkTravelTime: Seq[Double], - numberOfPassengers: Int = 0 - ): BeamPathTraversal = - new BeamPathTraversal( - time, - vehicleId, - driverId, - vehicleType, - mode, - numberOfPassengers, - linkTravelTime.sum.toInt, - linkIds, - linkTravelTime - ) - - def apply(genericEvent: Event): BeamPathTraversal = { + def withLinks(genericEvent: Event): BeamPathTraversal = { assert(genericEvent.getEventType == EVENT_TYPE) val attr: mutable.Map[String, String] = genericEvent.getAttributes.asScala @@ -80,7 +163,7 @@ object BeamPathTraversal { val mode: BeamMode = BeamMode.fromString(attr(ATTRIBUTE_MODE)).get - new BeamPathTraversal( + PathTraversalWithLinks( time, vehicleId, driverId, @@ -92,59 +175,34 @@ object BeamPathTraversal { linkTravelTime ) } -} - -case class BeamPathTraversal( - time: Double, - vehicleId: String, - driverId: String, - vehicleType: String, - mode: String, - numberOfPassengers: Int, - arrivalTime: Int, - var linkIds: Seq[Int], - var linkTravelTime: Seq[Double] -) extends BeamEvent { - assert(linkIds.size == linkTravelTime.size, "linkIds size does not equal to linkTravelTime size") - - @SuppressWarnings(Array("UnsafeTraversableMethods")) - def removeHeadLinkFromTrip(): Unit = { - linkIds = linkIds.tail - linkTravelTime = linkTravelTime.tail - } - - def adjustTime(deltaTime: Double): Unit = { - val travelTime = arrivalTime - time - val delta = (travelTime + deltaTime) / travelTime - linkTravelTime = linkTravelTime.map(x => x * delta) - } - - def toViaEvents(vehicleId: String, timeLimit: Option[Double]): Seq[ViaTraverseLinkEvent] = { - val onePiece: Double = timeLimit match { - case None => 1.0 - case Some(limit) => - val sum: Double = linkTravelTime.sum * 1.0 - if (time + sum <= limit) 1.0 - else (limit - time) / sum - } + def withoutLinks(genericEvent: Event): BeamPathTraversal = { + assert(genericEvent.getEventType == EVENT_TYPE) + val attr: mutable.Map[String, String] = genericEvent.getAttributes.asScala - val (_, times) = - linkTravelTime.foldLeft((time, mutable.MutableList.empty[(Double, Double)])) { - case ((lastTime, timeList), travelTime) => - val linkTime = lastTime + Math.round(travelTime * onePiece) - timeList += Tuple2(lastTime, linkTime) - (linkTime, timeList) - } + val vehicleId: String = attr(ATTRIBUTE_VEHICLE_ID) + val driverId: String = attr(ATTRIBUTE_DRIVER_ID) + val vehicleType: String = attr(ATTRIBUTE_VEHICLE_TYPE) + val numberOfPassengers: Int = attr(ATTRIBUTE_NUM_PASS).toDouble.toInt + val time: Int = attr(ATTRIBUTE_DEPARTURE_TIME).toDouble.toInt + val arrivalTime: Int = attr(ATTRIBUTE_ARRIVAL_TIME).toDouble.toInt + val mode: BeamMode = BeamMode.fromString(attr(ATTRIBUTE_MODE)).get - val paths = linkIds - .zip(times) - .flatMap { case (linkId, (enteredTime, leftTime)) => - val entered = ViaTraverseLinkEvent.entered(enteredTime, vehicleId, linkId) - val left = ViaTraverseLinkEvent.left(leftTime, vehicleId, linkId) - Seq(entered, left) - } + val startX: Double = TransitHelper.round(attr(ATTRIBUTE_START_X).toDouble) + val startY: Double = TransitHelper.round(attr(ATTRIBUTE_START_Y).toDouble) + val endX: Double = TransitHelper.round(attr(ATTRIBUTE_END_X).toDouble) + val endY: Double = TransitHelper.round(attr(ATTRIBUTE_END_Y).toDouble) - paths + PathTraversalWithoutLinks( + time, + vehicleId, + driverId, + vehicleType, + mode.toString, + numberOfPassengers, + arrivalTime, + new Coord(startX, startY), + new Coord(endX, endY) + ) } } diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala index c76d0c9b42f..6c0a6f45953 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.events +package beam.utils.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala index f432f9165b0..f762a7525a7 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.events +package beam.utils.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala index bfe5317096c..86efbecbd47 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala @@ -1,6 +1,6 @@ -package scripts.beam_to_matsim.events_filter +package beam.utils.beam_to_matsim.events_filter -import scripts.beam_to_matsim.events.{BeamActivityEnd, BeamActivityStart, BeamEvent, BeamModeChoice} +import beam.utils.beam_to_matsim.events.{BeamActivityEnd, BeamActivityStart, BeamEvent, BeamModeChoice} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala index 9174b6d23c2..b88f2d1c5c5 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala @@ -1,6 +1,6 @@ -package scripts.beam_to_matsim.events_filter +package beam.utils.beam_to_matsim.events_filter -import scripts.beam_to_matsim.events._ +import beam.utils.beam_to_matsim.events._ import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala index c8f3162183c..fae5d00d9a0 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala @@ -1,6 +1,6 @@ -package scripts.beam_to_matsim.events_filter +package beam.utils.beam_to_matsim.events_filter -import scripts.beam_to_matsim.events.BeamEvent +import beam.utils.beam_to_matsim.events.BeamEvent trait MutableSamplingFilter { def filter(event: BeamEvent): Unit diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala index c505edc07fa..51a9818c18e 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala @@ -1,6 +1,6 @@ -package scripts.beam_to_matsim.events_filter +package beam.utils.beam_to_matsim.events_filter -import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} +import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala index aba7d56246d..f752d79ab1f 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala @@ -1,6 +1,6 @@ -package scripts.beam_to_matsim.events_filter +package beam.utils.beam_to_matsim.events_filter -import scripts.beam_to_matsim.events.BeamEvent +import beam.utils.beam_to_matsim.events.BeamEvent import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala index 58fba78496d..1c74053754c 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala @@ -1,6 +1,6 @@ -package scripts.beam_to_matsim.events_filter +package beam.utils.beam_to_matsim.events_filter -import scripts.beam_to_matsim.events.BeamPathTraversal +import beam.utils.beam_to_matsim.events.BeamPathTraversal import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala index abba684d9f3..03d66c813a3 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala @@ -1,3 +1,3 @@ -package scripts.beam_to_matsim.events_filter +package beam.utils.beam_to_matsim.events_filter case class PopulationSample(percentage: Double, personIsInteresting: String => Boolean) diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala index 3716149335d..bb648431b56 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala @@ -1,3 +1,3 @@ -package scripts.beam_to_matsim.events_filter +package beam.utils.beam_to_matsim.events_filter case class VehicleSample(vehicleType: String, percentage: Double) diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala index e7750e50e11..fc5c6ebae94 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala @@ -1,6 +1,6 @@ -package scripts.beam_to_matsim.events_filter +package beam.utils.beam_to_matsim.events_filter -import scripts.beam_to_matsim.events.BeamPathTraversal +import beam.utils.beam_to_matsim.events.BeamPathTraversal import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala b/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala index 3fee160b933..ae150ac804a 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala @@ -1,7 +1,7 @@ -package scripts.beam_to_matsim.io +package beam.utils.beam_to_matsim.io import beam.utils.EventReader -import scripts.beam_to_matsim.events.{BeamEvent, BeamEventReader} +import beam.utils.beam_to_matsim.events.{BeamEvent, BeamEventReader} object BeamEventsReader { diff --git a/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala b/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala index ca9a24ca8c5..7ee63509c15 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.io +package beam.utils.beam_to_matsim.io class ConsoleProgress(message: String, maxSteps: Int, percentageToWrite: Int = 10) { diff --git a/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala b/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala index 9817024f253..7b96aace509 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.io +package beam.utils.beam_to_matsim.io import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/io/Reader.scala b/src/main/scala/scripts/beam_to_matsim/io/Reader.scala index e1b60545e9d..8f951639a8b 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/Reader.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/Reader.scala @@ -1,8 +1,15 @@ -package scripts.beam_to_matsim.io - -import scripts.beam_to_matsim.events.{BeamActivityEnd, BeamActivityStart, BeamModeChoice, BeamPathTraversal} -import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, PersonEvents, VehicleTrip} -import scripts.beam_to_matsim.via_event._ +package beam.utils.beam_to_matsim.io + +import beam.utils.beam_to_matsim.events.{ + BeamActivityEnd, + BeamActivityStart, + BeamModeChoice, + BeamPathTraversal, + PathTraversalWithLinks, + PathTraversalWithoutLinks +} +import beam.utils.beam_to_matsim.events_filter.{MutableSamplingFilter, PersonEvents, VehicleTrip} +import beam.utils.beam_to_matsim.via_event._ import scala.collection.mutable @@ -26,7 +33,8 @@ object Reader { // fix overlapping of path traversal events for vehicle def pteOverlappingFix(pteSeqRaw: Seq[BeamPathTraversal]): Unit = { - val pteSeq = pteSeqRaw.filter(pte => pte.linkTravelTime.nonEmpty) + val rows = pteSeqRaw.collect { case p: PathTraversalWithLinks => p } + val pteSeq = rows.filter(pte => pte.linkTravelTime.nonEmpty) val maybePteSeqHead = pteSeq.headOption maybePteSeqHead match { case Some(pteSeqHead) => @@ -215,7 +223,11 @@ object Reader { val transformer = ptEvents.foldLeft(EventsTransformer(eventsCollection))((acc, pte) => { val vId = vehicleId(pte) - pte.toViaEvents(vId, None).foreach(acc.addPTEEvent) + pte match { + case p: PathTraversalWithLinks => + p.toViaEvents(vId, None).foreach(acc.addPTEEvent) + case _ => + } val vType = vehicleType(pte) vehicleTypeToId.get(vType) match { diff --git a/src/main/scala/scripts/beam_to_matsim/io/Utils.scala b/src/main/scala/scripts/beam_to_matsim/io/Utils.scala new file mode 100644 index 00000000000..744d0049029 --- /dev/null +++ b/src/main/scala/scripts/beam_to_matsim/io/Utils.scala @@ -0,0 +1,21 @@ +package beam.utils.beam_to_matsim.io + +import beam.utils.beam_to_matsim.events.BeamPathTraversal +import beam.utils.beam_to_matsim.events_filter.MutableSamplingFilter + +object Utils { + + def buildViaFile(eventsFile: String, outputFile: String, filter: MutableSamplingFilter): Unit = { + Console.println("reading events with vehicles sampling ...") + + def vehicleType(pte: BeamPathTraversal): String = pte.mode + "__" + pte.vehicleType + def vehicleId(pte: BeamPathTraversal): String = vehicleType(pte) + "__" + pte.vehicleId + + val (vehiclesEvents, _) = Reader.readWithFilter(eventsFile, filter) + val (events, typeToId) = Reader.transformPathTraversals(vehiclesEvents, vehicleId, vehicleType) + + Writer.writeViaEventsCollection(events, _.toXmlString, outputFile) + Writer.writeViaIdFile(typeToId, outputFile + ".ids.txt") + } + +} diff --git a/src/main/scala/scripts/beam_to_matsim/io/Writer.scala b/src/main/scala/scripts/beam_to_matsim/io/Writer.scala index a893064babb..50e7c29f9b2 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/Writer.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/Writer.scala @@ -1,7 +1,7 @@ -package scripts.beam_to_matsim.io +package beam.utils.beam_to_matsim.io import beam.utils.FileUtils -import scripts.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} +import beam.utils.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} import java.io.{File, PrintWriter} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/transit/TransitEventsGroup.scala b/src/main/scala/scripts/beam_to_matsim/transit/TransitEventsGroup.scala new file mode 100644 index 00000000000..445008caa33 --- /dev/null +++ b/src/main/scala/scripts/beam_to_matsim/transit/TransitEventsGroup.scala @@ -0,0 +1,84 @@ +package beam.utils.beam_to_matsim.transit + +import beam.utils.beam_to_matsim.events.BeamPathTraversal + +object TransitEventsGroup { + + /** + * path traversal events of a single vehicle will be grouped based on passenger range + * + * @param rangeSize size of passenger range (see `rangeInclusive`) + * @param events beam path traversal events of a vehicle + * @return group of events fall within same passenger range + * group cannot be empty. + */ + def groupEvents( + rangeSize: Int, + events: Vector[BeamPathTraversal] + ): Vector[(PassengerRange, Vector[BeamPathTraversal])] = { + val range = { + events.headOption + .map(e => rangeInclusive(e.numberOfPassengers, rangeSize)) + .getOrElse(PassengerRange.Empty) + } + val groupedEvents = events.foldLeft(GroupedEvents(range)) { (groupedEvents, event) => + val currRange = rangeInclusive(event.numberOfPassengers, rangeSize) + if (groupedEvents.range == currRange) groupedEvents.add(event) + else groupedEvents.group(currRange, event) + } + groupedEvents.build() + } + + // helper class to use with foldLeft to build group of events based on passenger + // state `ranges` tracks each group's range separately from of state `groups` + private case class GroupedEvents( + range: PassengerRange, + acc: Vector[BeamPathTraversal] = Vector(), + ranges: Vector[PassengerRange] = Vector(), + groups: Vector[Vector[BeamPathTraversal]] = Vector() + ) { + + // add event to current accumulator + def add(event: BeamPathTraversal): GroupedEvents = + GroupedEvents(range, acc :+ event, ranges, groups) + + // create group of accumulated events and start new accumulator + def group(newRange: PassengerRange, event: BeamPathTraversal): GroupedEvents = + GroupedEvents(newRange, Vector(event), ranges :+ range, groups :+ acc) + + // filter out empty groups + def build(): Vector[(PassengerRange, Vector[BeamPathTraversal])] = + (ranges :+ range).zip(groups :+ acc).filter(_._2.nonEmpty) + } + + sealed trait PassengerRange + + object PassengerRange { + final case object Empty extends PassengerRange + final case class Range(start: Int, end: Int) extends PassengerRange + } + + /** + * if `rangeSize` is zero, range will be same as the passenger count, + * if passenger count is 5, its range will be 5:5; + * if transit is empty, range will be empty + * for non-empty transit, + * if range size is 5 and there are 3 passengers, it fall within 1:5 range, + * but 7 passengers will fall within 6:10 range. + * + * @param passengersCount transit passenger count + * @param rangeSize bin size + * @return range passenger count falls within + */ + private def rangeInclusive(passengersCount: Int, rangeSize: Int): PassengerRange = { + if (rangeSize == 0) PassengerRange.Range(passengersCount, passengersCount) + else if (passengersCount == 0) PassengerRange.Empty + else { + import scala.math.Integral.Implicits._ + passengersCount /% rangeSize match { + case (quotient, 0) => PassengerRange.Range(((quotient - 1) * rangeSize) + 1, quotient * rangeSize) + case (quotient, _) => PassengerRange.Range((quotient * rangeSize) + 1, (quotient + 1) * rangeSize) + } + } + } +} diff --git a/src/main/scala/scripts/beam_to_matsim/transit/TransitHelper.scala b/src/main/scala/scripts/beam_to_matsim/transit/TransitHelper.scala new file mode 100644 index 00000000000..3cefae9559f --- /dev/null +++ b/src/main/scala/scripts/beam_to_matsim/transit/TransitHelper.scala @@ -0,0 +1,89 @@ +package beam.utils.beam_to_matsim.transit + +import beam.utils.beam_to_matsim.events.{BeamPathTraversal, PathTraversalWithLinks, PathTraversalWithoutLinks} +import beam.utils.beam_to_matsim.transit.TransitEventsGroup.PassengerRange +import beam.utils.beam_to_matsim.via_event.{ViaActivity, ViaEvent, ViaPersonArrivalEvent, ViaPersonDepartureEvent} +import com.typesafe.scalalogging.LazyLogging +import org.matsim.api.core.v01.{Coord, Id} +import org.matsim.api.core.v01.network.Link + +object TransitHelper extends LazyLogging { + + def round(d: Double): Double = BigDecimal.valueOf(d).setScale(3, BigDecimal.RoundingMode.HALF_UP).toDouble + + def departure(vehicleId: String, viaEvent: ViaEvent): ViaEvent = + ViaPersonDepartureEvent(viaEvent.time, vehicleId, viaEvent.link) + + def arrival(vehicleId: String, viaEvent: ViaEvent): ViaEvent = + ViaPersonArrivalEvent(viaEvent.time, vehicleId, viaEvent.link) + + def createViaEvents( + events: Vector[BeamPathTraversal], + vehicleId: String, + linkStartAndEndMapMaybe: Option[Map[(Coord, Coord), Id[Link]]] = None + ): Vector[ViaEvent] = { + val uniqueVehicleIds = events.map(_.vehicleId).toSet + assume( + events.isEmpty || (uniqueVehicleIds.size == 1), + s"Either events needs to be empty or vehicle ids should be same for all events. Found vehicle ids: $uniqueVehicleIds" + ) + + if (events.isEmpty) Vector() + else { + val viaEvents: Vector[ViaEvent] = events.flatMap { + case p: PathTraversalWithLinks => p.toViaEvents(vehicleId, None) + case p: PathTraversalWithoutLinks => + assume( + linkStartAndEndMapMaybe.nonEmpty, + "User must provide link information for PathTraversal events without `links`." + ) + val linkLocationStore = linkStartAndEndMapMaybe.get + linkLocationStore + .get((p.startCoord, p.endCoord)) + .map { linkId => + p.toViaEvents(vehicleId, linkId) + } + .getOrElse { + logger.error( + "Could not find link in matsim network where start and end locations are {} and {} respectively.", + p.startCoord, + p.endCoord + ) + Vector() + } + } + + if (viaEvents.isEmpty) viaEvents + else (departure(vehicleId, viaEvents.head) +: viaEvents) :+ arrival(vehicleId, viaEvents.last) + } + } + + def prefixVehicleId(event: BeamPathTraversal): String = + event.mode + "__" + event.vehicleType + "__" + event.vehicleId + + def createVehicleId(prefix: String, range: PassengerRange): String = { + range match { + case PassengerRange.Empty => + prefix + "__passenger__0" + case PassengerRange.Range(start, end) => + prefix + "__passenger__" + start + ":" + end + } + } + + def insertIdleEvents(idleThresholdInSec: Double, xss: Vector[(String, Vector[ViaEvent])]): Vector[ViaEvent] = { + case class State(prevTime: Double = 0.0, viaEvents: Vector[ViaEvent] = Vector()) + val state = xss.filter(_._2.nonEmpty).foldLeft(State()) { case (state, (vehicleId, events)) => + val event = events.head + val delta = event.time - state.prevTime + if (delta < idleThresholdInSec) State(events.last.time, state.viaEvents ++ events) + else { + val insertedEvents = + ViaActivity.start(state.prevTime, vehicleId, event.link, actionName = vehicleId + "__idle") +: + ViaActivity.end(event.time, vehicleId, event.link, actionName = vehicleId + "__idle") +: + events + State(events.last.time, state.viaEvents ++ insertedEvents) + } + } + state.viaEvents + } +} diff --git a/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGenerator.scala b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGenerator.scala new file mode 100644 index 00000000000..90e8a2547a5 --- /dev/null +++ b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGenerator.scala @@ -0,0 +1,25 @@ +package beam.utils.beam_to_matsim.transit.generator + +import beam.utils.beam_to_matsim.events.BeamPathTraversal +import beam.utils.beam_to_matsim.via_event.ViaEvent + +object TransitViaEventsGenerator { + type EventsGenerator = Vector[BeamPathTraversal] => Vector[ViaEvent] + + def commonViaEventsGeneratorWithLinks(idleThreshold: Double, numPassengersSplit: Int): EventsGenerator = + CommonViaEventsGeneratorWithLinks.generator(idleThreshold, numPassengersSplit) + + def ridehailViaEventsGenerator(idleThreshold: Double, numPassengersSplit: Int): EventsGenerator = + RidehailViaEventsGenerator.generator(idleThreshold, numPassengersSplit) + + def commonViaEventsGeneratorWithoutLinks( + idleThreshold: Double, + numPassengersSplit: Int, + networkPath: String + ): EventsGenerator = + CommonViaEventsGeneratorWithoutLinks(networkPath).generator(idleThreshold, numPassengersSplit) +} + +private[transit] trait TransitViaEventsGenerator { + def generator(idleThresholdInSec: Double, rangeSize: Int)(events: Vector[BeamPathTraversal]): Vector[ViaEvent] +} diff --git a/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithLinks.scala b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithLinks.scala new file mode 100644 index 00000000000..ba1c17a22a4 --- /dev/null +++ b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithLinks.scala @@ -0,0 +1,49 @@ +package beam.utils.beam_to_matsim.transit.generator + +import beam.utils.beam_to_matsim.events.BeamPathTraversal +import beam.utils.beam_to_matsim.transit.TransitEventsGroup.PassengerRange +import beam.utils.beam_to_matsim.transit.{TransitEventsGroup, TransitHelper} +import beam.utils.beam_to_matsim.via_event.ViaEvent + +private[transit] trait TransitViaEventsGeneratorWithLinks extends TransitViaEventsGenerator + +private[transit] object CommonViaEventsGeneratorWithLinks extends TransitViaEventsGeneratorWithLinks { + import TransitHelper._ + + override def generator(idleThresholdInSec: Double, rangeSize: Int)( + events: Vector[BeamPathTraversal] + ): Vector[ViaEvent] = { + val groupedEvents = TransitEventsGroup.groupEvents(rangeSize, events) + val xss = groupedEvents.map { case (range, trips) => + val event = trips.head + val prefix = prefixVehicleId(event) + prefix -> createViaEvents(trips, createVehicleId(prefix, range)) + } + insertIdleEvents(idleThresholdInSec, xss) + } +} + +private[transit] object RidehailViaEventsGenerator extends TransitViaEventsGeneratorWithLinks { + import TransitHelper._ + + override def generator(idleThresholdInSec: Double, rangeSize: Int)( + events: Vector[BeamPathTraversal] + ): Vector[ViaEvent] = { + val groupedEvents = TransitEventsGroup.groupEvents(rangeSize, events) + val xss = groupedEvents.map { case (range, trips) => + if (range == PassengerRange.Empty) { + val rev = trips.reverse + val (pickup, repositions) = (rev.head, rev.tail) + val prefix = prefixVehicleId(pickup) + prefix -> ( + createViaEvents(repositions, prefix + "__reposition") ++ + createViaEvents(Vector(pickup), prefix + "__pickup") + ) + } else { + val prefix = prefixVehicleId(trips.head) + prefix -> createViaEvents(trips, createVehicleId(prefix, range)) + } + } + insertIdleEvents(idleThresholdInSec, xss) + } +} diff --git a/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithoutLinks.scala b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithoutLinks.scala new file mode 100644 index 00000000000..5a42440b27a --- /dev/null +++ b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithoutLinks.scala @@ -0,0 +1,47 @@ +package beam.utils.beam_to_matsim.transit.generator + +import beam.sim.common.GeoUtils +import beam.utils.beam_to_matsim.events.BeamPathTraversal +import beam.utils.beam_to_matsim.transit.{TransitEventsGroup, TransitHelper} +import beam.utils.beam_to_matsim.via_event.ViaEvent +import beam.utils.{NetworkHelper, NetworkHelperImpl} +import org.matsim.api.core.v01.network.Link +import org.matsim.api.core.v01.{Coord, Id} +import org.matsim.core.network.NetworkUtils +import org.matsim.core.network.io.MatsimNetworkReader + +private[transit] trait TransitViaEventsGeneratorWithoutLinks extends TransitViaEventsGenerator { + import TransitHelper._ + + def networkHelper: NetworkHelper + + override def generator(idleThresholdInSec: Double, rangeSize: Int)( + events: Vector[BeamPathTraversal] + ): Vector[ViaEvent] = { + val linkStartAndEndMap: Map[(Coord, Coord), Id[Link]] = networkHelper.allLinks.map { link => + val fromNode = link.getFromNode + val toNode = link.getToNode + val from = GeoUtils.GeoUtilsNad83.utm2Wgs(fromNode.getCoord) + val to = GeoUtils.GeoUtilsNad83.utm2Wgs(toNode.getCoord) + val startAndEnd = (new Coord(round(from.getX), round(from.getY)), new Coord(round(to.getX), round(to.getY))) + startAndEnd -> link.getId + }.toMap + val groupedEvents = TransitEventsGroup.groupEvents(rangeSize, events) + val xss = groupedEvents.map { case (range, trips) => + val event = trips.head + val prefix = prefixVehicleId(event) + prefix -> createViaEvents(trips, createVehicleId(prefix, range), Some(linkStartAndEndMap)) + } + insertIdleEvents(idleThresholdInSec, xss) + } +} + +private[transit] case class CommonViaEventsGeneratorWithoutLinks(networkPath: String) + extends TransitViaEventsGeneratorWithoutLinks { + + lazy val networkHelper: NetworkHelper = { + val temp = NetworkUtils.createNetwork() + new MatsimNetworkReader(temp).readFile(networkPath) + new NetworkHelperImpl(temp) + } +} diff --git a/src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala b/src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala deleted file mode 100644 index aa6771215ec..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/utils/FindIdsInCircles.scala +++ /dev/null @@ -1,72 +0,0 @@ -package scripts.beam_to_matsim.utils - -import scripts.beam_to_matsim.io.{BeamEventsReader, Writer} -import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} - -import scala.collection.mutable -import scala.xml.XML - -/* -a script to collect ids of all vehicles which move through selected circle - */ -object FindIdsInCircles extends App { - val sourceFileName = "40.events.csv" - - val dirPath = "D:/Work/beam/September2019/Runs/AnoterRun-40iter/" - val sourcePath = dirPath + sourceFileName - val baseOutputPath = dirPath + sourceFileName + ".in_SF" - - val networkPath = dirPath + "output_network.xml" - //val networkPath = dirPath + "physSimNetwork.xml" - //val networkPath = dirPath + "physSimNetwork.HQ.xml" - - val networkXml = XML.loadFile(networkPath) - val nodes = LinkCoordinate.parseNodes(networkXml) - - case class Circle(x: Double, y: Double, r: Double) { - val rSquare: Double = r * r - } - - val sfCircle = Circle(548966, 4179000, 5000) - def pointIsInteresting(point: Point): Boolean = point.vithinCircle(sfCircle.x, sfCircle.y, sfCircle.rSquare) - - val interestingNodes = nodes - .foldLeft(mutable.Map.empty[Int, Point]) { - case (selectedNodes, (nodeId, point)) if pointIsInteresting(point) => selectedNodes += nodeId -> point - case (selectedNodes, _) => selectedNodes - } - .toMap - - val interestingLinks = LinkCoordinate - .parseNetwork(networkXml, interestingNodes) - .foldLeft(mutable.HashSet.empty[Int]) { case (links, (linkId, _)) => - links += linkId - } - - class CircleAccumulator() { - val interestingVehicles = mutable.HashSet.empty[String] - - def process(event: BeamEvent): Unit = event match { - case pte: BeamPathTraversal if pte.linkIds.exists(interestingLinks.contains) => - interestingVehicles += pte.vehicleId - - case _ => - } - } - - val vehiclesInCircle = BeamEventsReader - .fromFileFoldLeft[CircleAccumulator]( - sourcePath, - new CircleAccumulator(), - (acc, event) => { - acc.process(event) - acc - } - ) - .getOrElse(new CircleAccumulator()) - .interestingVehicles - - val vehiclesPath = baseOutputPath + ".vehicles.txt" - Writer.writeSeqOfString(vehiclesInCircle, vehiclesPath) - Console.println("vehicles written into " + vehiclesPath) -} diff --git a/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala b/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala index ef6406c0025..9c11e3b4c29 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala +++ b/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala @@ -1,22 +1,25 @@ -package scripts.beam_to_matsim.utils +package beam.utils.beam_to_matsim.utils import scala.collection.mutable import scala.xml.{Elem, Node} -case class Point(x: Double, y: Double) { +case class Point(x: Double, y: Double) - def vithinCircle(circleX: Double, circleY: Double, circleRSquare: Double): Boolean = { - val deltaX = x - circleX - val deltaY = y - circleY +case class Circle(x: Double, y: Double, r: Double) { + val rSquare: Double = r * r + + def contains(point: Point): Boolean = { + val deltaX = point.x - x + val deltaY = point.y - y val distanceSquare = deltaX * deltaX + deltaY * deltaY - distanceSquare <= circleRSquare + distanceSquare <= rSquare } } object LinkCoordinate { - def supressNFE[T](func: => T): Option[T] = { + def suppressNFE[T](func: => T): Option[T] = { try { Some(func) } catch { @@ -26,13 +29,13 @@ object LinkCoordinate { def intAttributeValue(node: Node, attributeName: String): Option[Int] = node.attribute(attributeName) match { - case Some(attVal) => supressNFE { attVal.text.toInt } + case Some(attVal) => suppressNFE { attVal.text.toInt } case _ => None } def doubleAttributeValue(node: Node, attributeName: String): Option[Double] = node.attribute(attributeName) match { - case Some(attVal) => supressNFE { attVal.text.toDouble } + case Some(attVal) => suppressNFE { attVal.text.toDouble } case _ => None } diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala index 88eb607320c..0a97b5daa41 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.via_event +package beam.utils.beam_to_matsim.via_event sealed trait ActType object ActionStart extends ActType diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala index f311a18ef1d..928ae0ed0bb 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.via_event +package beam.utils.beam_to_matsim.via_event trait ViaEvent { var time: Double diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala index a5bf9804da6..d6aa780043e 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.via_event +package beam.utils.beam_to_matsim.via_event import scala.collection.mutable.ArrayBuffer diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala index bfcc7da380b..40d33f62583 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.via_event +package beam.utils.beam_to_matsim.via_event case class ViaPersonArrivalEvent(var time: Double, person: String, link: Int) extends ViaEvent { diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala index 0a82b20abf5..a9288920361 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.via_event +package beam.utils.beam_to_matsim.via_event case class ViaPersonDepartureEvent(var time: Double, person: String, link: Int) extends ViaEvent { diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala index 8b0a9bb48fb..8650b3b95fd 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala @@ -1,4 +1,4 @@ -package scripts.beam_to_matsim.via_event +package beam.utils.beam_to_matsim.via_event sealed trait ViaTraverseLinkEventType object EnteredLink extends ViaTraverseLinkEventType diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala deleted file mode 100755 index 0f5394021d3..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_11.scala +++ /dev/null @@ -1,71 +0,0 @@ -package scripts.beam_to_matsim.visualization.via - -import scripts.beam_to_matsim.events.BeamPathTraversal -import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter, VehicleSample} -import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import scripts.beam_to_matsim.via_event.ViaEvent - -import scala.collection.mutable - -object visualization_11 extends App { - - val beamEventsFilePath = "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.third.csv" - val vehiclesInCircleFilePath = "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half_in_SF.vehicles.txt" - - val idPrefix = "" - val sampleSize = 1 - - val viaOutputBaseFilePath = "D:/Work/BEAM/visualizations/v11.it20.events.bridge_cap_5000.third.popSize" + sampleSize - val viaEventsFile = viaOutputBaseFilePath + ".via.xml" - val viaIdsFile = viaOutputBaseFilePath + ".ids.txt" - - // vehicle1 - val necessaryVehicles = mutable.HashSet("rideHailVehicle-1860433") - val vehiclesInCircle = HashSetReader.fromFile(vehiclesInCircleFilePath) - - val filter: MutableSamplingFilter = MutableVehiclesFilter.withListOfIncludeAndNecessary( - vehiclesInCircle, - necessaryVehicles, - Seq( - VehicleSample("RH_PHEV-Car_L1", sampleSize), - VehicleSample("RH_HEV-Car_L1", sampleSize), - VehicleSample("RH_Conventional-Truck_L1", sampleSize), - VehicleSample("RH_BEV-Car_L1", sampleSize), - VehicleSample("PHEV-Car_L1", sampleSize), - VehicleSample("HEV-Car_L1", sampleSize), - VehicleSample("Conventional-Truck_L1", sampleSize), - VehicleSample("Conventional-Car_L1", sampleSize), - VehicleSample("CAR", sampleSize), - VehicleSample("BUS-WH", sampleSize), - VehicleSample("BUS-WC", sampleSize), - VehicleSample("BUS-VTA", sampleSize), - VehicleSample("BUS-VN", sampleSize), - VehicleSample("BUS-VC", sampleSize), - VehicleSample("BUS-SR", sampleSize), - VehicleSample("BUS-RV", sampleSize), - VehicleSample("BUS-PE", sampleSize), - VehicleSample("BUS-MA", sampleSize), - VehicleSample("BUS-GG", sampleSize), - VehicleSample("BUS-DEFAULT", sampleSize), - VehicleSample("BUS-DE", sampleSize), - VehicleSample("BUS-CT", sampleSize), - VehicleSample("BUS-CM", sampleSize), - VehicleSample("BUS-CC", sampleSize), - VehicleSample("BUS-AC", sampleSize), - VehicleSample("BEV-Car_L1", sampleSize) - ), - 0 - ) - - def vehicleType(pte: BeamPathTraversal): String = - pte.mode + "_" + pte.vehicleType + "_P%03d".format(pte.numberOfPassengers) - - def vehicleId(pte: BeamPathTraversal): String = - idPrefix + vehicleType(pte) + "__" + pte.vehicleId - - val (vehiclesEvents, _) = Reader.readWithFilter(beamEventsFilePath, filter) - val (events, typeToId) = Reader.transformPathTraversals(vehiclesEvents, vehicleId, vehicleType) - - Writer.writeViaEventsCollection(events, _.toXml.toString, viaEventsFile) - Writer.writeViaIdFile(typeToId, viaIdsFile) -} diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala deleted file mode 100755 index dc21ddae26f..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_12.scala +++ /dev/null @@ -1,36 +0,0 @@ -package scripts.beam_to_matsim.visualization.via - -import scripts.beam_to_matsim.events_filter.{MutablePopulationFilter, MutableSamplingFilter, PopulationSample} -import scripts.beam_to_matsim.io.{Reader, Writer} -import scripts.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} - -import java.io.File -import java.nio.file.Files -import scala.collection.mutable - -object visualization_12 extends App { - val basePath = "D:/Work/beam/NewYork/Runs/calibrated/new-york-200k-baseline__2020-09-01_22-53-55_sfi" - - val beamEventsFilePath = s"${basePath}/10.events.csv" - val sampleSize = 0.2 - - val viaOutputBaseFilePath = s"${basePath}/via_${sampleSize}" - Files.createDirectory(new File(viaOutputBaseFilePath).toPath) - - val viaEventsFile = viaOutputBaseFilePath + "/via.xml" - val viaIdsFile = viaOutputBaseFilePath + "/ids.txt" - val viaModesFile = viaOutputBaseFilePath + "/activity.txt" - - val idPrefix = "" - - val filter: MutableSamplingFilter = MutablePopulationFilter(Seq(PopulationSample(sampleSize, _ => true))) - - val (vehiclesEvents, personsEvents) = Reader.readWithFilter(beamEventsFilePath, filter) - - val eventsCollection = new ViaEventsCollection() - val (activities, activityToCnt) = Reader.transformActivities(personsEvents) - activities.foreach(eventsCollection.put) - - Writer.writeViaEventsCollection(eventsCollection, _.toXml.toString, viaEventsFile) - Writer.writeViaActivities(activityToCnt, viaModesFile) -} diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala deleted file mode 100755 index faef760dc11..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_20_24.scala +++ /dev/null @@ -1,38 +0,0 @@ -package scripts.beam_to_matsim.visualization.via - -import scripts.beam_to_matsim.events.BeamPathTraversal -import scripts.beam_to_matsim.events_filter.{MutablePopulationFilter, MutableSamplingFilter, PopulationSample} -import scripts.beam_to_matsim.io.{Reader, Writer} -import scripts.beam_to_matsim.via_event.ViaEvent - -object visualization_20_24 extends App { - val beamEventsFilePath = "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half.csv" - val sampleSize = 0.1 - - val viaOutputBaseFilePath = "D:/Work/BEAM/visualizations/v20_24.it20.events.bridge_cap_5000.popSize" + sampleSize - val viaEventsFile = viaOutputBaseFilePath + ".via.xml" - val viaIdsFile = viaOutputBaseFilePath + ".ids.txt" - val viaActivitiesFile = viaOutputBaseFilePath + ".act.txt" - val viaModesFile = viaOutputBaseFilePath + ".mode.txt" - - def notADriver(id: String) = !id.contains("Agent") - val filter: MutableSamplingFilter = MutablePopulationFilter(Seq(PopulationSample(sampleSize, notADriver))) - - def vehicleType(pte: BeamPathTraversal): String = pte.mode + "_" + pte.vehicleType - def vehicleId(pte: BeamPathTraversal): String = vehicleType(pte) + "__" + pte.vehicleId - - val (vehiclesEvents, personsEvents) = Reader.readWithFilter(beamEventsFilePath, filter) - val (events, typeToId) = Reader.transformPathTraversals(vehiclesEvents, vehicleId, vehicleType) - - val (modeChoiceEvents, modeToCnt) = Reader.transformModeChoices(personsEvents, 20) - modeChoiceEvents.foreach(events.put) - - val (activities, activityToCnt) = Reader.transformActivities(personsEvents) - activities.foreach(events.put) - - Writer.writeViaEventsCollection(events, _.toXml.toString, viaEventsFile) - - Writer.writeViaActivities(activityToCnt, viaActivitiesFile) - Writer.writeViaModes(modeToCnt, viaModesFile) - Writer.writeViaIdFile(typeToId, viaIdsFile) -} diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala deleted file mode 100755 index cd608462b89..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_33_34.scala +++ /dev/null @@ -1,51 +0,0 @@ -package scripts.beam_to_matsim.visualization.via - -import scripts.beam_to_matsim.events.BeamPathTraversal -import scripts.beam_to_matsim.events_filter.MutableVehiclesFilter -import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import scripts.beam_to_matsim.via_event.ViaEvent - -object visualization_33_34 extends App { - val dirPath = "D:/Work/BEAM/visualizations/" - - val beamEventsFilePath = dirPath + "v33.0.events.third.csv" - val vehiclesInCircleFilePath = dirPath + "v33.0.events.third.csv.in_SF.vehicles.txt" - -// val beamEventsFilePath = dirPath + "v34.it0.events.third.csv" -// val vehiclesInCircleFilePath = dirPath + "v34.it0.events.third.csv.in_SF.vehicles.txt" - - val sampleSize = 0.3 - - val viaOutputBaseFilePath = beamEventsFilePath + ".popSize" + sampleSize - val viaEventsFile = viaOutputBaseFilePath + ".via.xml" - val viaIdsFile = viaOutputBaseFilePath + ".ids.txt" - - val vehiclesInCircle = HashSetReader.fromFile(vehiclesInCircleFilePath) - - object Selector extends MutableVehiclesFilter.SelectNewVehicle { - - override def select(vehicleMode: String, vehicleType: String, vehicleId: String): Boolean = { - if (!vehiclesInCircle.contains(vehicleId)) false - else { - vehicleMode match { - case "CAR" | "BUS" => fitIn(sampleSize) - case _ => false - } - } - } - } - - def vehicleType(pte: BeamPathTraversal): String = { - if (pte.vehicleId.contains("rideHail")) pte.mode + "_RH_P%03d".format(pte.numberOfPassengers) - else pte.mode + "_P%03d".format(pte.numberOfPassengers) - } - - def vehicleId(pte: BeamPathTraversal): String = - vehicleType(pte) + "__" + pte.vehicleId - - val (vehiclesEvents, _) = Reader.readWithFilter(beamEventsFilePath, MutableVehiclesFilter(Selector)) - val (events, typeToId) = Reader.transformPathTraversals(vehiclesEvents, vehicleId, vehicleType) - - Writer.writeViaEventsCollection(events, _.toXml.toString, viaEventsFile) - Writer.writeViaIdFile(typeToId, viaIdsFile) -} diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala deleted file mode 100755 index e39ac461771..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35.scala +++ /dev/null @@ -1,77 +0,0 @@ -package scripts.beam_to_matsim.visualization.via - -import scripts.beam_to_matsim.events.BeamPathTraversal -import scripts.beam_to_matsim.events_filter.{MutableVehiclesFilter, VehicleTrip} -import scripts.beam_to_matsim.io.{Reader, Writer} -import scripts.beam_to_matsim.via_event.ViaEvent - -import scala.collection.mutable - -object visualization_35 extends App { - val dirPath = "D:/Work/BEAM/visualizations/vis35/" - val fileName = "2.events.csv" - - val beamEventsFilePath = dirPath + fileName - val viaEventsFile = beamEventsFilePath + ".all.via.xml" - val viaIdFile = beamEventsFilePath + ".all.ids.txt" - - object Selector extends MutableVehiclesFilter.SelectNewVehicle { - - override def select(vehicleMode: String, vehicleType: String, vehicleId: String): Boolean = { - vehicleMode match { - case "CAR" | "BUS" => true - case _ => false - } - } - } - - val eventsWithAlternatives = { - val (vehiclesEvents, _) = Reader.readWithFilter(beamEventsFilePath, MutableVehiclesFilter(Selector)) - - def alternativePathToVehiclesTrips(path: Seq[BeamPathTraversal], idPrefix: String): Iterable[VehicleTrip] = { - val trips = mutable.Map.empty[String, VehicleTrip] - path.foreach(pte => { - val vId = idPrefix + pte.vehicleId - val pteWithCorrectVehicleId = new BeamPathTraversal( - pte.time, - vId, - pte.driverId, - pte.vehicleType, - pte.mode, - pte.numberOfPassengers, - pte.arrivalTime, - pte.linkIds, - pte.linkTravelTime - ) - - trips.get(vId) match { - case Some(trip) => trip.trip += pteWithCorrectVehicleId - case None => trips(vId) = VehicleTrip(vId, pteWithCorrectVehicleId) - } - }) - - trips.values - } - - val alt0 = alternativePathToVehiclesTrips(visualization_35_person1_alternatives.alternative0_ride_hail, "_alt0_") - val alt1 = - alternativePathToVehiclesTrips(visualization_35_person1_alternatives.alternative1_ride_hail_pooled, "_alt1_") - val alt2 = alternativePathToVehiclesTrips(visualization_35_person1_alternatives.alternative2_bike, "_alt2_") - val alt3 = - alternativePathToVehiclesTrips(visualization_35_person1_alternatives.alternative3_walk_transit_bike_bus, "_alt3_") - val alt4 = alternativePathToVehiclesTrips(visualization_35_person1_alternatives.alternative4_walk, "_alt4_") - val alt5 = - alternativePathToVehiclesTrips(visualization_35_person1_alternatives.alternative5_walk_transit_bus, "_alt5_") - - vehiclesEvents // ++ alt0 ++ alt1 ++ alt2 ++ alt3 ++ alt4 ++ alt5 - } - - def vehicleType(pte: BeamPathTraversal): String = pte.mode + "_P%03d".format(pte.numberOfPassengers) - def vehicleId(pte: BeamPathTraversal): String = vehicleType(pte) + "__" + pte.vehicleId - - val (events, typeToId) = Reader.transformPathTraversals(eventsWithAlternatives, vehicleId, vehicleType) - - Writer.writeViaEventsCollection(events, _.toXml.toString, viaEventsFile) - Writer.writeViaIdFile(typeToId, viaIdFile) - -} diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala deleted file mode 100755 index 2974118df7b..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_35_person1_alternatives.scala +++ /dev/null @@ -1,239 +0,0 @@ -package scripts.beam_to_matsim.visualization.via - -import scripts.beam_to_matsim.events.BeamPathTraversal - -import scala.collection.mutable - -object visualization_35_person1_alternatives { - val personUid: String = "026303-2015000142533-0-3364370" - - val alternative0_ride_hail: Seq[BeamPathTraversal] = Seq( - BeamPathTraversal( - 29182, - "rideHailVehicle-026301-2016000858086-1-3746736", - "rideHailAgent-026301-2016000858086-1-3746736", - "Car", - "CAR", - Seq[Int](88932, 3126, 3128, 815, 813, 811, 809, 807, 805, 105, 50500, 50502, 50504, 50506, 50508, 55750, 10863, - 10861, 10859, 10857, 27578, 43138, 43140, 51884, 86776, 71225, 46077, 46075, 46073, 46071, 46069, 52103, 89823, - 83221, 26967, 83225, 26965, 46052, 89141, 10803, 51676, 83246, 83242, 51678, 83250, 85931, 51859, 3939, 7648, - 7650, 7652, 7654, 7656, 7658, 7660, 7662, 7664, 7666, 7668, 7670, 7672, 7674, 7676, 7678, 7680, 7682, 49416, - 49418, 49420, 94340, 49422, 49424, 91218, 81297, 20661, 51684, 51828, 8401, 12545, 13545, 13543, 13541, 13539, - 11777, 8392, 26187, 20579, 20577, 20575, 20573, 20571, 20569, 52359, 92999, 5995, 5546, 54679, 54677, 54675, - 54673, 54671, 54668, 54648, 64358, 64376, 30245, 10027, 10025, 10023, 52170, 90950, 90930, 90926, 52420, 54696, - 64360, 89664, 36426, 36428, 36430, 54542, 89720, 47249, 88561, 47247, 47238, 88556, 47240, 47242, 47244, 47232, - 52785, 52783, 52781, 52779, 52777, 52775, 52773, 52771, 52769, 52767, 88605, 88601, 52765, 52763, 88597, 88593, - 52761, 52759, 57075), - Seq[Double](6, 3, 5, 9, 11, 19, 6, 5, 5, 11, 5, 4, 5, 5, 5, 2, 3, 5, 5, 10, 3, 6, 45, 1, 2, 1, 14, 9, 19, 19, 19, - 4, 2, 17, 1, 18, 1, 8, 1, 18, 9, 2, 1, 7, 1, 1, 8, 13, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, - 2, 1, 5, 1, 4, 2, 2, 4, 3, 25, 6, 15, 5, 6, 7, 8, 12, 1, 10, 2, 6, 33, 7, 2, 5, 2, 1, 4, 8, 19, 2, 1, 1, 1, 4, - 2, 2, 4, 5, 8, 8, 8, 2, 9, 2, 1, 4, 2, 2, 1, 9, 18, 6, 16, 2, 8, 2, 7, 1, 11, 1, 1, 1, 6, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 2, 1, 2, 2, 13, 2, 1, 14, 1, 26) - ) - ) - - val alternative1_ride_hail_pooled: Seq[BeamPathTraversal] = Seq( - BeamPathTraversal( - 29565, - "rideHailVehicle-026301-2014000082333-0-2601704", - "rideHailAgent-026301-2014000082333-0-2601704", - "Car", - "CAR", - Seq[Int](3125, 88929, 55759, 50576, 6845, 11018, 11020, 67107, 67105, 67103, 67101, 78014, 78018, 78020, 11372, - 11374, 11376, 11378, 11701, 11699, 11697, 11695, 86539, 11693, 48884, 67034, 86530, 67036, 67038, 67040, 67042, - 67044, 67046, 67048, 67050, 67052, 67054, 13300, 2427, 22212, 22214, 22216, 22218, 11675, 54284, 54286, 54288, - 41244, 8796, 8798, 54319, 54317, 8802, 9320, 55906, 19427, 24244, 10816, 2288, 53109, 53107, 53105, 53103, - 53101, 40841, 7880, 7882, 7884, 5163, 5161, 3582, 3584, 3586, 3588, 40552, 40554, 40556, 20198, 20200, 4280, - 4282, 4284, 4286, 36597, 36595, 36649, 36647, 36645, 80116, 36641, 36639, 90017, 78443, 78441, 78444, 78446, - 78448, 78450, 78452, 55812, 55814, 55816, 55817, 55815, 55813, 89435, 49399, 49397, 42741, 20192, 20194, 28286, - 28288, 28290, 48968, 48970, 86744, 75472, 51892, 53728, 23294, 41206, 41208, 86520, 41484, 55803, 55801, 11698, - 11700, 11702, 11704, 78011, 78009, 78007, 78005, 78018, 78020, 11371, 11369, 11367, 11365, 8670, 10091, 15802, - 50506, 50508, 55750, 10863, 10861, 10859, 10857, 27578, 43138, 43140, 51884, 86776, 71225, 46077, 46075, 46073, - 46071, 46069, 52103, 89823, 83221, 26967, 83225, 26965, 46052, 89141, 10803, 51676, 83246, 83242, 51678, 83250, - 85931, 51859, 3939, 7648, 7650, 7652, 7654, 7656, 7658, 7660, 7662, 7664, 7666, 7668, 7670, 7672, 7674, 7676, - 7678, 7680, 7682, 49416, 49418, 49420, 94340, 49422, 49424, 91218, 81297, 20661, 51684, 51828, 8401, 12545, - 13545, 13543, 13541, 13539, 11777, 8392, 26187, 20579, 20577, 20575, 20573, 20571, 20569, 52359, 92999, 5995, - 5546, 54679, 54677, 54675, 54673, 54671, 54668, 54648, 64358, 64376, 30245, 10027, 10025, 10023, 52170, 90950, - 90930, 90926, 52420, 54696, 64360, 89664, 36426, 36428, 36430, 54542, 89720, 47249, 64634, 89943, 34237, 34235, - 89939, 34233, 89935, 34231, 34229, 89931, 34227, 4921, 4919, 4917, 4915, 4913, 23212, 85834, 1109, 1107, 1105, - 1103, 1101, 1099, 3361, 3359, 29810, 4728, 4730, 4732, 57066, 85210, 57068, 57070), - Seq[Double](29, 1, 3, 6, 15, 7, 8, 8, 7, 7, 7, 2, 2, 4, 1, 7, 8, 9, 7, 7, 5, 4, 6, 1, 7, 2, 6, 6, 9, 5, 9, 7, 7, - 8, 7, 4, 3, 7, 5, 4, 4, 5, 5, 10, 5, 5, 1, 2, 1, 9, 6, 1, 5, 16, 2, 9, 3, 2, 9, 18, 18, 18, 11, 13, 4, 7, 7, 7, - 12, 18, 4, 5, 7, 1, 4, 4, 1, 1, 7, 8, 8, 9, 8, 7, 12, 8, 9, 8, 9, 9, 9, 1, 8, 8, 10, 3, 1, 3, 1, 1, 5, 1, 1, 5, - 1, 1, 1, 3, 40, 10, 29, 2, 3, 2, 8, 1, 3, 2, 2, 1, 2, 1, 2, 45, 15, 2, 14, 7, 7, 6, 8, 5, 7, 6, 1, 2, 4, 8, 2, - 7, 7, 11, 9, 14, 5, 5, 2, 3, 5, 5, 10, 3, 6, 45, 1, 2, 1, 14, 9, 19, 19, 19, 4, 2, 17, 1, 18, 1, 8, 1, 18, 9, 2, - 1, 7, 1, 1, 8, 13, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 2, 1, 5, 1, 4, 2, 2, 4, 3, 25, 6, - 15, 5, 6, 7, 8, 12, 1, 10, 2, 6, 33, 7, 2, 5, 2, 1, 4, 8, 19, 2, 1, 1, 1, 4, 2, 2, 4, 5, 8, 8, 8, 2, 9, 2, 1, 4, - 2, 2, 1, 9, 18, 6, 16, 2, 8, 8, 1, 7, 4, 4, 1, 1, 8, 8, 8, 12, 8, 8, 8, 8, 8, 1, 7, 7, 3, 5, 4, 8, 3, 1, 3, 3, - 1, 1, 1, 4, 3, 1, 3) - ) - ) - - val alternative2_bike: Seq[BeamPathTraversal] = Seq( - BeamPathTraversal( - 29160, - "bike-10001-1", - "026303-2015000142533-0-3364370", - "BIKE-DEFAULT", - "BIKE", - Seq[Int](55761, 27548, 34050, 50490, 50492, 50494, 50496, 50498, 50500, 50502, 50504, 50506, 50508, 55750, 10863, - 10861, 10859, 10857, 27578, 43138, 43140, 52074, 88515, 52087, 88495, 88523, 52085, 52083, 88535, 52081, 52079, - 52077, 88505, 52073, 8909, 8907, 8905, 34160, 34162, 34164, 91368, 34166, 91364, 34168, 34170, 34172, 91336, - 91340, 34174, 34176, 91408, 34178, 91404, 34180, 34182, 34184, 34186, 91360, 34188, 91356, 34190, 34192, 34194, - 91328, 34196, 91372, 34198, 91384, 34200, 91380, 34202, 34204, 34206, 34208, 91420, 20664, 25238, 20662, 36504, - 91332, 36506, 36508, 36510, 36512, 36514, 91324, 36516, 93448, 36518, 91426, 36520, 36522, 36524, 91416, 91412, - 64350, 64352, 64354, 89736, 36467, 36465, 1119, 1117, 1115, 87617, 87621, 87613, 48169, 4921, 4919, 4917, 4915, - 4913, 4911, 68882, 6172, 6174, 6176, 23358, 54504, 57066, 85210, 57068, 57070, 57074), - Seq[Double](19, 18, 25, 40, 15, 3, 12, 8, 11, 9, 10, 10, 10, 4, 7, 10, 10, 21, 6, 13, 5, 3, 6, 23, 5, 16, 2, 41, - 39, 2, 41, 41, 2, 39, 41, 41, 42, 20, 9, 17, 2, 3, 17, 19, 19, 3, 4, 14, 22, 17, 2, 2, 17, 12, 7, 7, 7, 6, 6, 7, - 6, 19, 12, 6, 6, 14, 10, 2, 2, 6, 19, 15, 4, 18, 2, 3, 16, 3, 7, 2, 19, 15, 5, 11, 2, 8, 5, 2, 12, 2, 13, 3, 29, - 4, 3, 2, 17, 19, 4, 9, 9, 17, 30, 39, 3, 3, 33, 3, 18, 17, 18, 18, 18, 17, 3, 2, 1, 2, 34, 25, 10, 6, 1, 6, 64) - ) - ) - - val alternative3_walk_transit_bike_bus: Seq[BeamPathTraversal] = Seq( - BeamPathTraversal( - 29682, - "bike-10001-1", - "026303-2015000142533-0-3364370", - "BIKE-DEFAULT", - "BIKE", - Seq[Int](55761, 88929, 55759, 88859, 55757, 88855, 55755, 88833, 55753, 45453, 88809, 45451, 45449, 45447, 45445, - 45443, 88769, 45441, 88867, 45439, 45437, 45435, 45433, 64869, 45429, 88825, 50857, 55065, 55063, 55061, 55059, - 88849, 55057, 88845, 55055, 55053, 55051, 55049, 55047, 55045, 88881, 55043, 55041, 88901, 50855, 50853, 88885, - 49845, 52031, 88875, 88789, 52029, 52037, 52035, 52033, 88813, 88803, 22631, 22629, 22627, 22625, 22623, 22621, - 34214, 91399), - Seq[Double](19, 2, 14, 26, 2, 2, 5, 32, 2, 3, 2, 3, 6, 9, 7, 10, 18, 2, 3, 22, 4, 5, 8, 10, 2, 7, 2, 13, 1, 10, - 21, 7, 7, 4, 6, 4, 15, 2, 3, 26, 2, 10, 24, 8, 8, 3, 9, 11, 4, 7, 9, 2, 15, 16, 13, 2, 3, 6, 16, 15, 13, 5, 15, - 2, 2) - ), - BeamPathTraversal( - 30240, - "SF:7686588", - "TransitDriverAgent-SF:7686588", - "DEFAULT", - "BUS", - Seq[Int](34214, 91396, 91392, 34148, 10030, 91376, 91377, 10031, 34150, 93716, 34152, 34154, 34156, 91352, 34158, - 91348, 34160, 34162, 34164, 91368, 34166, 91364, 34168, 34170, 34172, 91336, 91340, 34174, 34176, 91408, 34178, - 91404, 34180, 34182, 34184, 34186, 91360, 34188, 91356, 34190, 34192, 34194, 91328, 34196, 91372, 34198, 91384, - 34200, 91380, 34202, 34204, 34206, 34208, 91420, 20664, 25238, 20662, 36504, 91332, 36506, 36508, 36510, 36512, - 36514, 91324, 36516, 93448, 36518, 91426, 36520, 36522, 36524, 91416), - Seq[Double](8, 8, 8, 8, 8, 4, 6, 6, 6, 6, 6, 6, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 13, 13, 13, 14, 7, 7, 7, 7, - 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 10, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, - 10, 10, 10, 10, 10, 0) - ), - BeamPathTraversal( - 30836, - "body-026303-2015000142533-0-3364370", - "026303-2015000142533-0-3364370", - "BODY-TYPE-DEFAULT", - "WALK", - Seq[Int](91414, 91412, 64350, 64352, 64354, 89736, 36467, 36465, 1119, 1117, 1115, 87617, 87621, 87613, 48169, - 4921, 4919, 4917, 4915, 4913, 4911, 15713, 54695, 54693, 54511, 54509, 54507, 54504, 57066, 85210, 57068, - 57070), - Seq[Double](2, 3, 2, 17, 19, 4, 9, 9, 17, 30, 39, 3, 3, 33, 3, 18, 17, 18, 18, 18, 17, 12, 7, 16, 1, 1, 2, 25, 10, - 6, 1, 6) - ) - ) - - val alternative4_walk: Seq[BeamPathTraversal] = Seq( - BeamPathTraversal( - 29160, - "body-026303-2015000142533-0-3364370", - "026303-2015000142533-0-3364370", - "BODY-TYPE-DEFAULT", - "WALK", - Seq[Int](88933, 3125, 27548, 34050, 50490, 50492, 50494, 50496, 50498, 50500, 50502, 50504, 50506, 50508, 55750, - 10863, 10861, 10859, 10857, 27578, 43138, 43140, 52074, 88515, 52087, 88495, 88523, 52085, 52083, 88535, 52081, - 52079, 52077, 88505, 52073, 8909, 8907, 8905, 34160, 34162, 34164, 91368, 34166, 91364, 34168, 34170, 34172, - 91336, 91340, 34174, 34176, 91408, 34178, 91404, 34180, 34182, 34184, 34186, 91360, 34188, 91356, 34190, 34192, - 34194, 91328, 34196, 91372, 34198, 91384, 34200, 91380, 34202, 34204, 34206, 34208, 91420, 20664, 25238, 20662, - 36504, 91332, 36506, 36508, 36510, 36512, 36514, 91324, 36516, 93448, 36518, 91426, 36520, 36522, 36524, 91416, - 91412, 64350, 64352, 64354, 89736, 36467, 36465, 1119, 1117, 1115, 87617, 87621, 87613, 48169, 4921, 4919, 4917, - 4915, 4913, 4911, 15713, 54695, 54693, 54511, 54509, 54507, 54504, 57066, 85210, 57068, 57070, 57074), - Seq[Double](51, 11, 67, 96, 151, 57, 10, 45, 31, 40, 35, 36, 37, 38, 13, 24, 38, 37, 78, 21, 50, 18, 11, 23, 88, - 17, 60, 6, 155, 149, 7, 156, 155, 7, 149, 155, 155, 158, 77, 33, 66, 8, 8, 65, 73, 71, 9, 16, 52, 83, 65, 8, 7, - 65, 47, 24, 24, 26, 23, 23, 27, 22, 72, 45, 22, 23, 52, 36, 6, 7, 23, 71, 56, 15, 67, 5, 10, 59, 10, 24, 4, 72, - 57, 17, 40, 7, 28, 17, 6, 45, 8, 49, 9, 110, 15, 9, 7, 66, 71, 15, 33, 34, 66, 116, 148, 10, 10, 125, 11, 66, - 66, 66, 66, 67, 65, 46, 24, 60, 4, 4, 5, 95, 38, 23, 2, 21, 245) - ) - ) - - val alternative5_walk_transit_bus: Seq[BeamPathTraversal] = Seq( - BeamPathTraversal( - 29347, - "body-026303-2015000142533-0-3364370", - "026303-2015000142533-0-3364370", - "BODY-TYPE-DEFAULT", - "WALK", - Seq[Int](88933, 3125, 88929, 55759, 88859, 55757, 88855, 88857), - Seq[Double](51, 11, 8, 53, 98, 8, 8, 2) - ), - BeamPathTraversal( - 29535, - "SF:7597760", - "TransitDriverAgent-SF:7597760", - "DEFAULT", - "BUS", - Seq[Int](88855, 55755, 88833, 55753, 45453, 88809, 45451, 45449, 45447, 45445, 45443, 88769, 45441, 88867, 45439, - 45437, 45435, 45433, 64869, 45429, 88825, 50857, 55065, 55063, 55061, 55059, 88849, 55057, 88845, 55055, 55053, - 55051, 55049, 55047, 55045, 88881, 55043, 55041, 88901, 50855, 50853, 88885, 49845, 52031, 88875, 88789, 52029, - 52037, 52035, 52033, 88813, 88803, 22631, 22629, 22627, 22625, 22623, 22621), - Seq[Double](7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 18, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 8, 8, 8, 8, 8, 8, 8, 8, 30, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11) - ), - BeamPathTraversal( - 30060, - "body-026303-2015000142533-0-3364370", - "026303-2015000142533-0-3364370", - "BODY-TYPE-DEFAULT", - "WALK", - Seq[Int](88908, 34214, 91399), - Seq[Double](2, 8, 5) - ), - BeamPathTraversal( - 30240, - "SF:7686588", - "TransitDriverAgent-SF:7686588", - "DEFAULT", - "BUS", - Seq[Int](34214, 91396, 91392, 34148, 10030, 91376, 91377, 10031, 34150, 93716, 34152, 34154, 34156, 91352, 34158, - 91348, 34160, 34162, 34164, 91368, 34166, 91364, 34168, 34170, 34172, 91336, 91340, 34174, 34176, 91408, 34178, - 91404, 34180, 34182, 34184, 34186, 91360, 34188, 91356, 34190, 34192, 34194, 91328, 34196, 91372, 34198, 91384, - 34200, 91380, 34202, 34204, 34206, 34208, 91420, 20664, 25238, 20662, 36504, 91332, 36506, 36508, 36510, 36512, - 36514, 91324, 36516, 93448, 36518, 91426, 36520, 36522, 36524, 91416, 91412, 64350, 64352, 64354, 89736, 34238, - 34239, 89733, 19111, 89729, 19109, 89725, 89717, 47279, 47250, 47252, 38644, 54703, 54701, 54699, 54696, 64360, - 89664, 89713, 19115, 89709, 89701, 89705, 19113, 87793, 8941, 87789, 88547, 8939, 15750, 15736, 15737, 15752, - 52350, 52352, 93026, 93030, 7725, 6860, 6861, 87199, 7723, 87177, 87181, 7721, 87383, 1077, 87379, 1075, 88573, - 93297, 3041, 88585, 88581, 3039, 3037, 3035, 88577, 3033, 39976, 85798, 39978, 85826, 74810, 74812), - Seq[Double](8, 8, 8, 8, 8, 6, 6, 6, 6, 6, 6, 12, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 13, 13, 13, 14, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 7, 10, 10, 10, 10, 10, 10, 10, 5, 5, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 8, - 8, 6, 10, 10, 10, 10, 10, 10, 10, 6, 6, 6, 6, 6, 6, 9, 8, 8, 8, 8, 13, 12, 12, 12, 10, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 10, 10, 10, 10, 9, 9, 9, 9, 8, 9, 9, 8, 8, 7, 8, 8, 8, 8, 9, 7, 7, 7, 4, 10, 10, 10, 10, 14, 12, 12, 12, 10, - 20, 20, 20, 17, 17, 18, 10, 10, 10, 8) - ), - BeamPathTraversal( - 31516, - "body-026303-2015000142533-0-3364370", - "026303-2015000142533-0-3364370", - "BODY-TYPE-DEFAULT", - "WALK", - Seq[Int](93204, 93202, 88605, 88601, 52765, 52763, 88597, 88593, 52761, 52759), - Seq[Double](1, 10, 5, 16, 11, 106, 10, 8, 115, 4) - ) - ) - - lazy val vehicleIds: mutable.HashSet[String] = { - def getVehicleId(pte: BeamPathTraversal) = pte.vehicleId - val alts = { - alternative0_ride_hail.map(getVehicleId) ++ - alternative1_ride_hail_pooled.map(getVehicleId) ++ - alternative2_bike.map(getVehicleId) ++ - alternative3_walk_transit_bike_bus.map(getVehicleId) ++ - alternative4_walk.map(getVehicleId) ++ - alternative5_walk_transit_bus.map(getVehicleId) - } - - mutable.HashSet[String](alts: _*) - } -} diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala deleted file mode 100755 index eeac8a2ea33..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_3_4_5.scala +++ /dev/null @@ -1,66 +0,0 @@ -package scripts.beam_to_matsim.visualization.via - -import scripts.beam_to_matsim.events.BeamPathTraversal -import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter, VehicleSample} -import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import scripts.beam_to_matsim.via_event.ViaEvent - -object visualization_3_4_5 extends App { - - val beamEventsFilePath = "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half.csv" - val vehiclesInCircleFilePath = "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half_in_SF.vehicles.txt" - - val idPrefix = "" - val sampleSize = 0.3 - - val viaOutputBaseFilePath = "D:/Work/BEAM/visualizations/v3_4_5.it20.events.bridge_cap_5000.half.popSize" + sampleSize - val viaEventsFile = viaOutputBaseFilePath + ".via.xml" - val viaIdsFile = viaOutputBaseFilePath + ".ids.txt" - - val vehiclesInCircle = HashSetReader.fromFile(vehiclesInCircleFilePath) - - val filter: MutableSamplingFilter = MutableVehiclesFilter.withListOfInclude( - vehiclesInCircle, - Seq( - VehicleSample("RH_PHEV-Car_L1", sampleSize), - VehicleSample("RH_HEV-Car_L1", sampleSize), - VehicleSample("RH_Conventional-Truck_L1", sampleSize), - VehicleSample("RH_BEV-Car_L1", sampleSize), - VehicleSample("PHEV-Car_L1", sampleSize), - VehicleSample("HEV-Car_L1", sampleSize), - VehicleSample("Conventional-Truck_L1", sampleSize), - VehicleSample("Conventional-Car_L1", sampleSize), - VehicleSample("CAR", sampleSize), - VehicleSample("BUS-WH", sampleSize), - VehicleSample("BUS-WC", sampleSize), - VehicleSample("BUS-VTA", sampleSize), - VehicleSample("BUS-VN", sampleSize), - VehicleSample("BUS-VC", sampleSize), - VehicleSample("BUS-SR", sampleSize), - VehicleSample("BUS-RV", sampleSize), - VehicleSample("BUS-PE", sampleSize), - VehicleSample("BUS-MA", sampleSize), - VehicleSample("BUS-GG", sampleSize), - VehicleSample("BUS-DEFAULT", sampleSize), - VehicleSample("BUS-DE", sampleSize), - VehicleSample("BUS-CT", sampleSize), - VehicleSample("BUS-CM", sampleSize), - VehicleSample("BUS-CC", sampleSize), - VehicleSample("BUS-AC", sampleSize), - VehicleSample("BEV-Car_L1", sampleSize) - ), - 0 - ) - - def vehicleType(pte: BeamPathTraversal): String = - pte.mode + "_" + pte.vehicleType + "_P%03d".format(pte.numberOfPassengers) - - def vehicleId(pte: BeamPathTraversal): String = - idPrefix + vehicleType(pte) + "__" + pte.vehicleId - - val (vehiclesEvents, _) = Reader.readWithFilter(beamEventsFilePath, filter) - val (events, typeToId) = Reader.transformPathTraversals(vehiclesEvents, vehicleId, vehicleType) - - Writer.writeViaEventsCollection(events, _.toXml.toString, viaEventsFile) - Writer.writeViaIdFile(typeToId, viaIdsFile) -} diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala deleted file mode 100755 index bf35d26ad12..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_6.scala +++ /dev/null @@ -1,98 +0,0 @@ -package scripts.beam_to_matsim.visualization.via - -import scripts.beam_to_matsim.events.BeamPathTraversal -import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter, VehicleSample} -import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import scripts.beam_to_matsim.via_event.ViaEvent - -object visualization_6 extends App { - - val vehiclesInCircleFilePath = "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half_in_SF.vehicles.txt" - val vehiclesInCircle = HashSetReader.fromFile(vehiclesInCircleFilePath) - - var sample = 0.3 - process( - "D:/Work/BEAM/visualizations/v6.0.events.csv", - "D:/Work/BEAM/visualizations/v6.v6.0.events.popSize" + sample, - sample - ) - process( - "D:/Work/BEAM/visualizations/v6.0.events.intercepts5.csv", - "D:/Work/BEAM/visualizations/v6.0.events.intercepts5.popSize" + sample, - sample - ) - process( - "D:/Work/BEAM/visualizations/v6.0.events.intercepts10.csv", - "D:/Work/BEAM/visualizations/v6.0.events.intercepts10.popSize" + sample, - sample - ) - - sample = 0.5 - process( - "D:/Work/BEAM/visualizations/v6.0.events.csv", - "D:/Work/BEAM/visualizations/v6.v6.0.events.popSize" + sample, - sample - ) - process( - "D:/Work/BEAM/visualizations/v6.0.events.intercepts5.csv", - "D:/Work/BEAM/visualizations/v6.0.events.intercepts5.popSize" + sample, - sample - ) - process( - "D:/Work/BEAM/visualizations/v6.0.events.intercepts10.csv", - "D:/Work/BEAM/visualizations/v6.0.events.intercepts10.popSize" + sample, - sample - ) - - private def process(beamEventsFilePath: String, viaOutputBaseFilePath: String, sampleSize: Double): Unit = { - val idPrefix = "" - - val viaEventsFile = viaOutputBaseFilePath + ".via.xml" - val viaIdsFile = viaOutputBaseFilePath + ".ids.txt" - - val filter: MutableSamplingFilter = MutableVehiclesFilter.withListOfInclude( - vehiclesInCircle, - Seq( - VehicleSample("RH_PHEV-Car_L1", sampleSize), - VehicleSample("RH_HEV-Car_L1", sampleSize), - VehicleSample("RH_Conventional-Truck_L1", sampleSize), - VehicleSample("RH_BEV-Car_L1", sampleSize), - VehicleSample("PHEV-Car_L1", sampleSize), - VehicleSample("HEV-Car_L1", sampleSize), - VehicleSample("Conventional-Truck_L1", sampleSize), - VehicleSample("Conventional-Car_L1", sampleSize), - VehicleSample("CAR", sampleSize), - VehicleSample("BUS-WH", sampleSize), - VehicleSample("BUS-WC", sampleSize), - VehicleSample("BUS-VTA", sampleSize), - VehicleSample("BUS-VN", sampleSize), - VehicleSample("BUS-VC", sampleSize), - VehicleSample("BUS-SR", sampleSize), - VehicleSample("BUS-RV", sampleSize), - VehicleSample("BUS-PE", sampleSize), - VehicleSample("BUS-MA", sampleSize), - VehicleSample("BUS-GG", sampleSize), - VehicleSample("BUS-DEFAULT", sampleSize), - VehicleSample("BUS-DE", sampleSize), - VehicleSample("BUS-CT", sampleSize), - VehicleSample("BUS-CM", sampleSize), - VehicleSample("BUS-CC", sampleSize), - VehicleSample("BUS-AC", sampleSize), - VehicleSample("BEV-Car_L1", sampleSize) - ), - 0 - ) - - def vehicleType(pte: BeamPathTraversal): String = - pte.mode + "_" + pte.vehicleType + "_VC%d".format(pte.numberOfPassengers / 5) - - def vehicleId(pte: BeamPathTraversal): String = - idPrefix + vehicleType(pte) + "__" + pte.vehicleId - - val (vehiclesEvents, _) = Reader.readWithFilter(beamEventsFilePath, filter) - val (events, typeToId) = Reader.transformPathTraversals(vehiclesEvents, vehicleId, vehicleType) - - Writer.writeViaEventsCollection(events, _.toXml.toString, viaEventsFile) - Writer.writeViaIdFile(typeToId, viaIdsFile) - } -} diff --git a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala b/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala deleted file mode 100755 index 23a81e9896a..00000000000 --- a/src/main/scala/scripts/beam_to_matsim/visualization/via/visualization_9.scala +++ /dev/null @@ -1,43 +0,0 @@ -package scripts.beam_to_matsim.visualization.via - -import scripts.beam_to_matsim.events.BeamPathTraversal -import scripts.beam_to_matsim.events_filter.{MutablePopulationFilter, MutableSamplingFilter, PopulationSample} -import scripts.beam_to_matsim.io.{HashSetReader, Reader, Writer} -import scripts.beam_to_matsim.via_event.ViaEventsCollection - -object visualization_9 extends App { - val personsInCircleFilePath = "D:/Work/BEAM/visualizations/v2.it20.events.bridge_cap_5000.half_in_SF.persons.txt" - val personsInCircle = HashSetReader.fromFile(personsInCircleFilePath) - - val beamEventsFilePath = "D:/Work/BEAM/visualizations/v1.it20.events.bridge_cap_5000.csv" - val sampleSize = 1 - - val viaOutputBaseFilePath = "D:/Work/BEAM/visualizations/v9.it20.events.bridge_cap_5000.popSize" + sampleSize - val viaEventsFile = viaOutputBaseFilePath + ".via.xml" - val viaIdsFile = viaOutputBaseFilePath + ".ids.txt" - val viaModesFile = viaOutputBaseFilePath + ".mode.txt" - - val idPrefix = "" - - val filter: MutableSamplingFilter = MutablePopulationFilter(Seq(PopulationSample(0.3, personsInCircle.contains))) - - // val selectedPersons = scala.collection.mutable.HashSet("5637427", "6034392", "5856103") - // val filter: MutableSamplingFilter = MutablePopulationFilter(Seq(PopulationSample(1, selectedPersons.contains))) - - def vehicleType(pte: BeamPathTraversal): String = - pte.mode + "_" + pte.vehicleType + "_P%03d".format(pte.numberOfPassengers) - - def vehicleId(pte: BeamPathTraversal): String = - idPrefix + vehicleType(pte) + "__" + pte.vehicleId - - val (vehiclesEvents, personsEvents) = Reader.readWithFilter(beamEventsFilePath, filter) - //val (events, typeToId) = EventsProcessor.transformPathTraversals(vehiclesEvents, vehicleId, vehicleType) - - val eventsCollection = new ViaEventsCollection() - val (modeChoiceEvents, modeToCnt) = Reader.transformModeChoices(personsEvents) - modeChoiceEvents.foreach(eventsCollection.put) - - Writer.writeViaEventsCollection(eventsCollection, _.toXml.toString, viaEventsFile) - //Writer.writeViaIdFile(typeToId, viaIdsFile) - Writer.writeViaModes(modeToCnt, viaModesFile) -} From 857fdea0f781bf56007461860a353a72e003f84a Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Fri, 8 Jul 2022 15:31:02 +0300 Subject: [PATCH 212/307] Storing state if awaitingResponse is not empty --- .../scheduler/BeamAgentScheduler.scala | 56 ++++++++++++++++++- src/main/scala/beam/sim/BeamMobsim.scala | 1 + .../ChargingNetworkManagerSpec.scala | 2 +- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala index 014d9999147..0585b654f5b 100644 --- a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala +++ b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala @@ -1,13 +1,13 @@ package beam.agentsim.scheduler -import akka.actor.{ActorLogging, ActorRef, BeamLoggingReceive, Cancellable, Props, Terminated} +import akka.actor.{ActorLogging, ActorRef, BeamLoggingReceive, Cancellable, CoordinatedShutdown, Props, Terminated} import akka.util.Timeout import beam.agentsim.agents.BeamAgent.Finish import beam.agentsim.agents.ridehail.RideHailManager.RideHailRepositioningTrigger import beam.agentsim.scheduler.BeamAgentScheduler._ import beam.agentsim.scheduler.Trigger.TriggerWithId import beam.sim.config.BeamConfig -import beam.utils.StuckFinder +import beam.utils.{FileUtils, StuckFinder} import beam.utils.logging.{LogActorState, LoggingMessageActor} import com.google.common.collect.TreeMultimap @@ -49,6 +49,8 @@ object BeamAgentScheduler { case object SimulationStuckCheck extends SchedulerMessage + case object BeforeShutdown extends SchedulerMessage + case object RequestCurrentTime extends SchedulerMessage case object SkipOverBadActors extends SchedulerMessage @@ -91,13 +93,16 @@ object BeamAgentScheduler { } } + /** + * Intended for testing, because it doesn't provide the right iteration output directory + */ def SchedulerProps( beamConfig: BeamConfig, stopTick: Int = TimeUnit.HOURS.toSeconds(24).toInt, maxWindow: Int = 1, stuckFinder: StuckFinder ): Props = { - Props(classOf[BeamAgentScheduler], beamConfig, stopTick, maxWindow, stuckFinder) + Props(classOf[BeamAgentScheduler], beamConfig, ".", stopTick, maxWindow, stuckFinder) } object ScheduledTriggerComparator extends Comparator[ScheduledTrigger] { @@ -121,6 +126,7 @@ case object BeamAgentSchedulerTimer class BeamAgentScheduler( val beamConfig: BeamConfig, + val iterationOutputDir: String, stopTick: Int, val maxWindow: Int, val stuckFinder: StuckFinder @@ -150,6 +156,7 @@ class BeamAgentScheduler( private var nowInSeconds: Int = 0 private var nowUpdateTime: Long = System.currentTimeMillis() private var longestNowUpdateDelay: Long = 0 + private var shutdownInitiated = false private val maybeTriggerMeasurer: Option[TriggerMeasurer] = if (beamConfig.beam.debug.triggerMeasurer.enabled) { Some(new TriggerMeasurer(beamConfig.beam.debug.triggerMeasurer)) @@ -178,6 +185,13 @@ class BeamAgentScheduler( private val initialDelay = beamConfig.beam.agentsim.scheduleMonitorTask.initialDelay private val interval = beamConfig.beam.agentsim.scheduleMonitorTask.interval + CoordinatedShutdown(context.system).addActorTerminationTask( + CoordinatedShutdown.PhaseBeforeServiceUnbind, + "scheduler.storeState", + self, + Some(BeforeShutdown) + ) + def scheduleTrigger(triggerToSchedule: ScheduleTrigger): Unit = { this.idCount += 1 @@ -273,10 +287,20 @@ class BeamAgentScheduler( currentDelayMillis, nowInSeconds ) + if (!shutdownInitiated) { + shutdownInitiated = true + storeSchedulerState() + } System.exit(10) } } + case BeforeShutdown => + if (!shutdownInitiated) { + shutdownInitiated = true + storeSchedulerState() + } + case Monitor => if (beamConfig.beam.debug.debugEnabled) { val logStr = @@ -372,6 +396,32 @@ class BeamAgentScheduler( if (started) doSimStep(nowInSeconds) } + //not thread safe (needs to be called only within actor receive or lifecycle methods) + private def storeSchedulerState(): Unit = { + if (awaitingResponse.isEmpty) { + log.info("awaitingResponse is empty, nowInSeconds = {}", nowInSeconds) + } else { + val queueFile = s"$iterationOutputDir/triggerQueue.txt.gz" + log.info("triggerQueue.size = {}, saving to {}, nowInSeconds = {}", triggerQueue.size(), queueFile, nowInSeconds) + val sorted = (0 until math.min(triggerQueue.size(), 1024)).view.map(_ => triggerQueue.poll().toString + "\n") + FileUtils.writeToFile(queueFile, (s"total queue size = ${triggerQueue.size()}\n" +: sorted).iterator) + val awaitingResponseFile = s"$iterationOutputDir/awaitingResponse.txt.gz" + log.info( + "awaitingResponse.size = {}, saving to {}, nowInSeconds = {}", + awaitingResponse.size(), + awaitingResponseFile, + nowInSeconds + ) + val iterator = awaitingResponse.entries().iterator() + val triggers = (0 until math.min(awaitingResponse.size(), 1024)).view + .map(_ => iterator.next().getValue.toString + "\n") + FileUtils.writeToFile( + awaitingResponseFile, + (s"total awaitingResponse size = ${awaitingResponse.size()}\n" +: triggers).iterator + ) + } + } + private def terminateActor(actor: ActorRef): Unit = { awaitingResponse .values() diff --git a/src/main/scala/beam/sim/BeamMobsim.scala b/src/main/scala/beam/sim/BeamMobsim.scala index 6659ff22c0a..e3940c0bda3 100755 --- a/src/main/scala/beam/sim/BeamMobsim.scala +++ b/src/main/scala/beam/sim/BeamMobsim.scala @@ -381,6 +381,7 @@ class BeamMobsimIteration( Props( classOf[BeamAgentScheduler], beamConfig, + beamServices.matsimServices.getControlerIO.getIterationPath(beamServices.matsimServices.getIterationNumber), Time.parseTime(beamConfig.matsim.modules.qsim.endTime).toInt, config.schedulerParallelismWindow, new StuckFinder(beamConfig.beam.debug.stuckAgentDetection) diff --git a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala index a02a2180065..6aa26401883 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala @@ -111,7 +111,7 @@ class ChargingNetworkManagerSpec stopTick: Int, override val maxWindow: Int, override val stuckFinder: StuckFinder - ) extends BeamAgentScheduler(beamConfig, stopTick, maxWindow, stuckFinder) { + ) extends BeamAgentScheduler(beamConfig, ".", stopTick, maxWindow, stuckFinder) { override def receive: Receive = { case Finish => context.stop(self) From a0d064eb4149f4e774ebf39704e93c3dbbec4961 Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Fri, 8 Jul 2022 15:44:39 +0300 Subject: [PATCH 213/307] Enabled exiting in case of beam got stuck by default; removed maxInitializationTimeBeforeConsideredStuckMin param. --- src/main/resources/beam-template.conf | 3 +-- .../beam/agentsim/scheduler/BeamAgentScheduler.scala | 8 +------- src/main/scala/beam/sim/config/BeamConfig.scala | 7 +------ 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 585807083e2..da096d51bf8 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -773,8 +773,7 @@ beam.debug { writeRealizedModeChoiceFile = "boolean | false" messageLogging = "boolean | false" # the max of the next 2 values is taken for the initialization step - maxSimulationStepTimeBeforeConsideredStuckMin = "int | 999999" - maxInitializationTimeBeforeConsideredStuckMin = "int | 180" + maxSimulationStepTimeBeforeConsideredStuckMin = "int | 60" } beam.logger.keepConsoleAppenderOn = "boolean | true" diff --git a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala index 0585b654f5b..93d7e44aace 100644 --- a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala +++ b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala @@ -273,13 +273,7 @@ class BeamAgentScheduler( case SimulationStuckCheck => if (started) { - val stuckThresholdMin = - if (nowInSeconds == 0) - Math.max( - beamConfig.beam.debug.maxInitializationTimeBeforeConsideredStuckMin, - beamConfig.beam.debug.maxSimulationStepTimeBeforeConsideredStuckMin - ) - else beamConfig.beam.debug.maxSimulationStepTimeBeforeConsideredStuckMin + val stuckThresholdMin = beamConfig.beam.debug.maxSimulationStepTimeBeforeConsideredStuckMin val currentDelayMillis = System.currentTimeMillis() - nowUpdateTime if (currentDelayMillis > stuckThresholdMin * 60000L) { log.error( diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index ac2cfcc488c..7980182bd67 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -2479,7 +2479,6 @@ object BeamConfig { clearRoutedOutstandingWorkEnabled: scala.Boolean, debugActorTimerIntervalInSec: scala.Int, debugEnabled: scala.Boolean, - maxInitializationTimeBeforeConsideredStuckMin: scala.Int, maxSimulationStepTimeBeforeConsideredStuckMin: scala.Int, memoryConsumptionDisplayTimeoutInSec: scala.Int, messageLogging: scala.Boolean, @@ -2641,14 +2640,10 @@ object BeamConfig { debugActorTimerIntervalInSec = if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - maxInitializationTimeBeforeConsideredStuckMin = - if (c.hasPathOrNull("maxInitializationTimeBeforeConsideredStuckMin")) - c.getInt("maxInitializationTimeBeforeConsideredStuckMin") - else 180, maxSimulationStepTimeBeforeConsideredStuckMin = if (c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") - else 999999, + else 60, memoryConsumptionDisplayTimeoutInSec = if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") From 5e4822b9d2e5ab014566928c2b71079dcaba4fe7 Mon Sep 17 00:00:00 2001 From: Rutvik Patel Date: Fri, 8 Jul 2022 19:13:04 +0530 Subject: [PATCH 214/307] fixes package names --- .../scripts/beam_to_matsim/CollectIds.scala | 16 +++++++++------- .../beam_to_matsim/EventsByTransitTypes.scala | 8 ++++---- .../beam_to_matsim/EventsByVehicleIds.scala | 6 +++--- .../beam_to_matsim/EventsByVehicleMode.scala | 16 ++++++++-------- .../beam_to_matsim/FindIdsInCircles.scala | 8 ++++---- .../FindPersonsUsesVehicles.scala | 6 +++--- .../beam_to_matsim/ZipViaEventsFiles.scala | 2 +- .../beam_to_matsim/events/BeamActivity.scala | 2 +- .../beam_to_matsim/events/BeamEvent.scala | 2 +- .../beam_to_matsim/events/BeamModeChoice.scala | 2 +- .../events/BeamPathTraversal.scala | 9 ++++----- .../events/BeamPersonEntersVehicle.scala | 2 +- .../events/BeamPersonLeavesVehicle.scala | 2 +- .../MutablePopulationEventsFilter.scala | 4 ++-- .../events_filter/MutablePopulationFilter.scala | 4 ++-- .../events_filter/MutableSamplingFilter.scala | 4 ++-- .../events_filter/MutableVehiclesFilter.scala | 4 ++-- .../events_filter/PersonEvents.scala | 4 ++-- .../events_filter/PersonTrip.scala | 4 ++-- .../events_filter/PopulationSample.scala | 2 +- .../events_filter/VehicleSample.scala | 2 +- .../events_filter/VehicleTrip.scala | 4 ++-- .../beam_to_matsim/io/BeamEventsReader.scala | 4 ++-- .../beam_to_matsim/io/ConsoleProgress.scala | 2 +- .../beam_to_matsim/io/HashSetReader.scala | 2 +- .../scripts/beam_to_matsim/io/Reader.scala | 17 +++++------------ .../scala/scripts/beam_to_matsim/io/Utils.scala | 6 +++--- .../scripts/beam_to_matsim/io/Writer.scala | 4 ++-- .../transit/TransitEventsGroup.scala | 4 ++-- .../beam_to_matsim/transit/TransitHelper.scala | 10 +++++----- .../generator/TransitViaEventsGenerator.scala | 6 +++--- .../TransitViaEventsGeneratorWithLinks.scala | 11 ++++++----- .../TransitViaEventsGeneratorWithoutLinks.scala | 8 ++++---- .../beam_to_matsim/utils/LinkCoordinate.scala | 2 +- .../beam_to_matsim/via_event/ViaActivity.scala | 2 +- .../beam_to_matsim/via_event/ViaEvent.scala | 2 +- .../via_event/ViaEventsCollection.scala | 2 +- .../via_event/ViaPersonArrivalEvent.scala | 2 +- .../via_event/ViaPersonDepartureEvent.scala | 2 +- .../via_event/ViaTraverseLinkEvent.scala | 2 +- 40 files changed, 98 insertions(+), 103 deletions(-) diff --git a/src/main/scala/scripts/beam_to_matsim/CollectIds.scala b/src/main/scala/scripts/beam_to_matsim/CollectIds.scala index c5cdbe9acb7..7bf8be0d86c 100644 --- a/src/main/scala/scripts/beam_to_matsim/CollectIds.scala +++ b/src/main/scala/scripts/beam_to_matsim/CollectIds.scala @@ -1,7 +1,7 @@ package scripts.beam_to_matsim -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} -import beam.utils.beam_to_matsim.io.{BeamEventsReader, HashSetReader, Writer} +import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} +import scripts.beam_to_matsim.io.{BeamEventsReader, HashSetReader, Writer} import scala.collection.mutable @@ -13,7 +13,7 @@ object CollectIds extends App { // format: off /***************************************************************************************** - ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.CollectIds -PappArgs="[ + ./gradlew execute -PmainClass=scripts.beam_to_matsim.CollectIds -PappArgs="[ '', '', '' @@ -69,6 +69,7 @@ object CollectIds extends App { ) .getOrElse(new Accumulator()) + val inFilePath = outputPath + "/vehicleTypes.txt" Writer.writeSeqOfString( accumulator.vehicleTypes .map { @@ -77,10 +78,11 @@ object CollectIds extends App { } .toSeq .sorted, - outputPath + "/vehicleTypes.txt" + inFilePath ) - Console.println("vehicle types written into " + outputPath + "/vehicleTypes.txt") + Console.println("vehicle types written into " + inFilePath) + val outFilePath = outputPath + "/vehicleTypes.OOC.txt" Writer.writeSeqOfString( accumulator.vehicleTypesOutOfCircle .map { @@ -89,7 +91,7 @@ object CollectIds extends App { } .toSeq .sorted, - outputPath + "/vehicleTypes.OOC.txt" + outFilePath ) - Console.println("vehicle types out of circle written into " + outputPath + "/vehicleTypes.txt") + Console.println("vehicle types out of circle written into " + outFilePath) } diff --git a/src/main/scala/scripts/beam_to_matsim/EventsByTransitTypes.scala b/src/main/scala/scripts/beam_to_matsim/EventsByTransitTypes.scala index c5ff0881c00..6ccb7727d59 100644 --- a/src/main/scala/scripts/beam_to_matsim/EventsByTransitTypes.scala +++ b/src/main/scala/scripts/beam_to_matsim/EventsByTransitTypes.scala @@ -1,8 +1,8 @@ package scripts.beam_to_matsim -import beam.utils.beam_to_matsim.events_filter.MutableVehiclesFilter -import beam.utils.beam_to_matsim.io.{Reader, Writer} -import beam.utils.beam_to_matsim.transit.generator.TransitViaEventsGenerator +import scripts.beam_to_matsim.events_filter.MutableVehiclesFilter +import scripts.beam_to_matsim.io.{Reader, Writer} +import scripts.beam_to_matsim.transit.generator.TransitViaEventsGenerator /* a script to generate Via events for transit vehicles @@ -12,7 +12,7 @@ object EventsByTransitTypes extends App { // format: off /******************************************************************************************************** - ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.via.EventsByTransitTypes -PappArgs="[ + ./gradlew execute -PmainClass=scripts.beam_to_matsim.EventsByTransitTypes -PappArgs="[ '', '', '--ridehail', '', '', ',', diff --git a/src/main/scala/scripts/beam_to_matsim/EventsByVehicleIds.scala b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleIds.scala index 27a85dafeb1..ca12389d5be 100644 --- a/src/main/scala/scripts/beam_to_matsim/EventsByVehicleIds.scala +++ b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleIds.scala @@ -1,7 +1,7 @@ package scripts.beam_to_matsim -import beam.utils.beam_to_matsim.events_filter.MutableVehiclesFilter -import beam.utils.beam_to_matsim.io.Utils +import scripts.beam_to_matsim.events_filter.MutableVehiclesFilter +import scripts.beam_to_matsim.io.Utils /* a script to generate Via events for specific vehicle ids @@ -11,7 +11,7 @@ object EventsByVehicleIds extends App { // format: off /******************************************************************************************************** - ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.via.EventsByVehicleIds -PappArgs="[ + ./gradlew execute -PmainClass=scripts.beam_to_matsim.EventsByVehicleIds -PappArgs="[ '', '', ',,,', diff --git a/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala index 50a34dc17db..46f30eb8c9d 100644 --- a/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala +++ b/src/main/scala/scripts/beam_to_matsim/EventsByVehicleMode.scala @@ -1,9 +1,9 @@ package scripts.beam_to_matsim -import beam.utils.beam_to_matsim.events.{BeamEvent, PathTraversalWithLinks} -import beam.utils.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter} -import beam.utils.beam_to_matsim.io.{BeamEventsReader, Utils} -import beam.utils.beam_to_matsim.utils.{Circle, LinkCoordinate, Point} +import scripts.beam_to_matsim.events.{BeamEvent, PathTraversalWithLinks} +import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, MutableVehiclesFilter} +import scripts.beam_to_matsim.io.{BeamEventsReader, Utils} +import scripts.beam_to_matsim.utils.{Circle, LinkCoordinate, Point} import scala.collection.mutable import scala.xml.XML @@ -16,7 +16,7 @@ object EventsByVehicleMode extends App { // format: off /********************************************************************************************************** - ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.via.EventsByVehicleMode -PappArgs="[ + ./gradlew execute -PmainClass=scripts.beam_to_matsim.EventsByVehicleMode -PappArgs="[ '', '', ',', @@ -25,7 +25,7 @@ object EventsByVehicleMode extends App { ************************************************************************************************************ - ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.EventsByVehicleMode -PappArgs="[ + ./gradlew execute -PmainClass=scripts.beam_to_matsim.EventsByVehicleMode -PappArgs="[ '', '', ',', @@ -41,9 +41,9 @@ object EventsByVehicleMode extends App { val inputArgs = args if (inputArgs.length == 4) { - val eventsFile = inputArgs.head + val eventsFile = inputArgs(0) val outputFile = inputArgs(1) - val selectedModes = inputArgs(2).split(',').toSeq + val selectedModes = inputArgs(2).split(',').map(_.trim) val sampling = inputArgs(3).toDouble Console.println(s"going to transform BEAM events from $eventsFile and write them into $outputFile") diff --git a/src/main/scala/scripts/beam_to_matsim/FindIdsInCircles.scala b/src/main/scala/scripts/beam_to_matsim/FindIdsInCircles.scala index 36a413758b6..9b4dba9258b 100644 --- a/src/main/scala/scripts/beam_to_matsim/FindIdsInCircles.scala +++ b/src/main/scala/scripts/beam_to_matsim/FindIdsInCircles.scala @@ -1,8 +1,8 @@ package scripts.beam_to_matsim -import beam.utils.beam_to_matsim.events.{BeamEvent, PathTraversalWithLinks} -import beam.utils.beam_to_matsim.io.{BeamEventsReader, Writer} -import beam.utils.beam_to_matsim.utils.{Circle, LinkCoordinate, Point} +import scripts.beam_to_matsim.events.{BeamEvent, PathTraversalWithLinks} +import scripts.beam_to_matsim.io.{BeamEventsReader, Writer} +import scripts.beam_to_matsim.utils.{Circle, LinkCoordinate, Point} import scala.collection.mutable import scala.xml.XML @@ -15,7 +15,7 @@ object FindIdsInCircles extends App { // format: off /************************************************************************************************ - ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.FindIdsInCircles -PappArgs="[ + ./gradlew execute -PmainClass=scripts.beam_to_matsim.FindIdsInCircles -PappArgs="[ '', '', '', diff --git a/src/main/scala/scripts/beam_to_matsim/FindPersonsUsesVehicles.scala b/src/main/scala/scripts/beam_to_matsim/FindPersonsUsesVehicles.scala index 91d73656a67..9a0331303d7 100644 --- a/src/main/scala/scripts/beam_to_matsim/FindPersonsUsesVehicles.scala +++ b/src/main/scala/scripts/beam_to_matsim/FindPersonsUsesVehicles.scala @@ -1,7 +1,7 @@ package scripts.beam_to_matsim -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPersonEntersVehicle} -import beam.utils.beam_to_matsim.io.{BeamEventsReader, Writer} +import scripts.beam_to_matsim.events.{BeamEvent, BeamPersonEntersVehicle} +import scripts.beam_to_matsim.io.{BeamEventsReader, Writer} import scala.collection.mutable import scala.io.Source @@ -14,7 +14,7 @@ object FindPersonsUsesVehicles extends App { // format: off /****************************************************************************************************** - ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.FindPersonsUsesVehicles -PappArgs="[ + ./gradlew execute -PmainClass=scripts.beam_to_matsim.FindPersonsUsesVehicles -PappArgs="[ '', '', '' diff --git a/src/main/scala/scripts/beam_to_matsim/ZipViaEventsFiles.scala b/src/main/scala/scripts/beam_to_matsim/ZipViaEventsFiles.scala index c4f16146312..d1b1a7da288 100644 --- a/src/main/scala/scripts/beam_to_matsim/ZipViaEventsFiles.scala +++ b/src/main/scala/scripts/beam_to_matsim/ZipViaEventsFiles.scala @@ -14,7 +14,7 @@ object ZipViaEventsFiles extends App { // format: off /**************************************************************************************************** - ./gradlew execute -PmainClass=beam.utils.beam_to_matsim.scripts.via.ZipViaEventsFiles -PappArgs="[ + ./gradlew execute -PmainClass=scripts.beam_to_matsim.ZipViaEventsFiles -PappArgs="[ '', '', '', diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala index 571b9db8ea8..f3d1bb71f99 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamActivity.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala index 77dd3d6c4af..63f343f68dd 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala index 93341a4aae9..a89f16f8eaf 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamModeChoice.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala index 482404d630d..f76061cd077 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamPathTraversal.scala @@ -1,12 +1,11 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import beam.router.Modes.BeamMode -import beam.sim.common.GeoUtils -import beam.utils.beam_to_matsim.transit.TransitHelper -import beam.utils.beam_to_matsim.via_event.ViaTraverseLinkEvent -import org.matsim.api.core.v01.{Coord, Id} import org.matsim.api.core.v01.events.Event import org.matsim.api.core.v01.network.Link +import org.matsim.api.core.v01.{Coord, Id} +import scripts.beam_to_matsim.transit.TransitHelper +import scripts.beam_to_matsim.via_event.ViaTraverseLinkEvent import scala.collection.JavaConverters._ import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala index 6c0a6f45953..c76d0c9b42f 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonEntersVehicle.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala index f762a7525a7..f432f9165b0 100644 --- a/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala +++ b/src/main/scala/scripts/beam_to_matsim/events/BeamPersonLeavesVehicle.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.events +package scripts.beam_to_matsim.events import org.matsim.api.core.v01.events.Event diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala index 86efbecbd47..bfe5317096c 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationEventsFilter.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.{BeamActivityEnd, BeamActivityStart, BeamEvent, BeamModeChoice} +import scripts.beam_to_matsim.events.{BeamActivityEnd, BeamActivityStart, BeamEvent, BeamModeChoice} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala index b88f2d1c5c5..9174b6d23c2 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutablePopulationFilter.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events._ +import scripts.beam_to_matsim.events._ import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala index fae5d00d9a0..c8f3162183c 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableSamplingFilter.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.BeamEvent +import scripts.beam_to_matsim.events.BeamEvent trait MutableSamplingFilter { def filter(event: BeamEvent): Unit diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala index 51a9818c18e..c505edc07fa 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/MutableVehiclesFilter.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} +import scripts.beam_to_matsim.events.{BeamEvent, BeamPathTraversal} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala index f752d79ab1f..aba7d56246d 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonEvents.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.BeamEvent +import scripts.beam_to_matsim.events.BeamEvent import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala index 1c74053754c..58fba78496d 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/PersonTrip.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events.BeamPathTraversal import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala index 03d66c813a3..abba684d9f3 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/PopulationSample.scala @@ -1,3 +1,3 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter case class PopulationSample(percentage: Double, personIsInteresting: String => Boolean) diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala index bb648431b56..3716149335d 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleSample.scala @@ -1,3 +1,3 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter case class VehicleSample(vehicleType: String, percentage: Double) diff --git a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala index fc5c6ebae94..e7750e50e11 100644 --- a/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala +++ b/src/main/scala/scripts/beam_to_matsim/events_filter/VehicleTrip.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.events_filter +package scripts.beam_to_matsim.events_filter -import beam.utils.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events.BeamPathTraversal import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala b/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala index ae150ac804a..3fee160b933 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/BeamEventsReader.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io import beam.utils.EventReader -import beam.utils.beam_to_matsim.events.{BeamEvent, BeamEventReader} +import scripts.beam_to_matsim.events.{BeamEvent, BeamEventReader} object BeamEventsReader { diff --git a/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala b/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala index 7ee63509c15..ca9a24ca8c5 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/ConsoleProgress.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io class ConsoleProgress(message: String, maxSteps: Int, percentageToWrite: Int = 10) { diff --git a/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala b/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala index 7b96aace509..9817024f253 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/HashSetReader.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/io/Reader.scala b/src/main/scala/scripts/beam_to_matsim/io/Reader.scala index 8f951639a8b..e4ce4127487 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/Reader.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/Reader.scala @@ -1,15 +1,8 @@ -package beam.utils.beam_to_matsim.io - -import beam.utils.beam_to_matsim.events.{ - BeamActivityEnd, - BeamActivityStart, - BeamModeChoice, - BeamPathTraversal, - PathTraversalWithLinks, - PathTraversalWithoutLinks -} -import beam.utils.beam_to_matsim.events_filter.{MutableSamplingFilter, PersonEvents, VehicleTrip} -import beam.utils.beam_to_matsim.via_event._ +package scripts.beam_to_matsim.io + +import scripts.beam_to_matsim.events._ +import scripts.beam_to_matsim.events_filter.{MutableSamplingFilter, PersonEvents, VehicleTrip} +import scripts.beam_to_matsim.via_event._ import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/io/Utils.scala b/src/main/scala/scripts/beam_to_matsim/io/Utils.scala index 744d0049029..ee78f6d8bc4 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/Utils.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/Utils.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.events_filter.MutableSamplingFilter +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events_filter.MutableSamplingFilter object Utils { diff --git a/src/main/scala/scripts/beam_to_matsim/io/Writer.scala b/src/main/scala/scripts/beam_to_matsim/io/Writer.scala index 50e7c29f9b2..a893064babb 100644 --- a/src/main/scala/scripts/beam_to_matsim/io/Writer.scala +++ b/src/main/scala/scripts/beam_to_matsim/io/Writer.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.io +package scripts.beam_to_matsim.io import beam.utils.FileUtils -import beam.utils.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} +import scripts.beam_to_matsim.via_event.{ViaEvent, ViaEventsCollection} import java.io.{File, PrintWriter} import scala.collection.mutable diff --git a/src/main/scala/scripts/beam_to_matsim/transit/TransitEventsGroup.scala b/src/main/scala/scripts/beam_to_matsim/transit/TransitEventsGroup.scala index 445008caa33..5c7cfd756e7 100644 --- a/src/main/scala/scripts/beam_to_matsim/transit/TransitEventsGroup.scala +++ b/src/main/scala/scripts/beam_to_matsim/transit/TransitEventsGroup.scala @@ -1,6 +1,6 @@ -package beam.utils.beam_to_matsim.transit +package scripts.beam_to_matsim.transit -import beam.utils.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.events.BeamPathTraversal object TransitEventsGroup { diff --git a/src/main/scala/scripts/beam_to_matsim/transit/TransitHelper.scala b/src/main/scala/scripts/beam_to_matsim/transit/TransitHelper.scala index 3cefae9559f..b4939a0f222 100644 --- a/src/main/scala/scripts/beam_to_matsim/transit/TransitHelper.scala +++ b/src/main/scala/scripts/beam_to_matsim/transit/TransitHelper.scala @@ -1,11 +1,11 @@ -package beam.utils.beam_to_matsim.transit +package scripts.beam_to_matsim.transit -import beam.utils.beam_to_matsim.events.{BeamPathTraversal, PathTraversalWithLinks, PathTraversalWithoutLinks} -import beam.utils.beam_to_matsim.transit.TransitEventsGroup.PassengerRange -import beam.utils.beam_to_matsim.via_event.{ViaActivity, ViaEvent, ViaPersonArrivalEvent, ViaPersonDepartureEvent} import com.typesafe.scalalogging.LazyLogging -import org.matsim.api.core.v01.{Coord, Id} import org.matsim.api.core.v01.network.Link +import org.matsim.api.core.v01.{Coord, Id} +import scripts.beam_to_matsim.events.{BeamPathTraversal, PathTraversalWithLinks, PathTraversalWithoutLinks} +import scripts.beam_to_matsim.transit.TransitEventsGroup.PassengerRange +import scripts.beam_to_matsim.via_event.{ViaActivity, ViaEvent, ViaPersonArrivalEvent, ViaPersonDepartureEvent} object TransitHelper extends LazyLogging { diff --git a/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGenerator.scala b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGenerator.scala index 90e8a2547a5..d74bece55f5 100644 --- a/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGenerator.scala +++ b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGenerator.scala @@ -1,7 +1,7 @@ -package beam.utils.beam_to_matsim.transit.generator +package scripts.beam_to_matsim.transit.generator -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.via_event.ViaEvent object TransitViaEventsGenerator { type EventsGenerator = Vector[BeamPathTraversal] => Vector[ViaEvent] diff --git a/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithLinks.scala b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithLinks.scala index ba1c17a22a4..97b600c3856 100644 --- a/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithLinks.scala +++ b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithLinks.scala @@ -1,9 +1,10 @@ -package beam.utils.beam_to_matsim.transit.generator +package scripts.beam_to_matsim.transit.generator -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.transit.TransitEventsGroup.PassengerRange -import beam.utils.beam_to_matsim.transit.{TransitEventsGroup, TransitHelper} -import beam.utils.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.transit.TransitEventsGroup +import scripts.beam_to_matsim.transit.TransitEventsGroup.PassengerRange +import scripts.beam_to_matsim.via_event.ViaEvent +import scripts.beam_to_matsim.transit.TransitHelper private[transit] trait TransitViaEventsGeneratorWithLinks extends TransitViaEventsGenerator diff --git a/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithoutLinks.scala b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithoutLinks.scala index 5a42440b27a..06b933eae97 100644 --- a/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithoutLinks.scala +++ b/src/main/scala/scripts/beam_to_matsim/transit/generator/TransitViaEventsGeneratorWithoutLinks.scala @@ -1,14 +1,14 @@ -package beam.utils.beam_to_matsim.transit.generator +package scripts.beam_to_matsim.transit.generator import beam.sim.common.GeoUtils -import beam.utils.beam_to_matsim.events.BeamPathTraversal -import beam.utils.beam_to_matsim.transit.{TransitEventsGroup, TransitHelper} -import beam.utils.beam_to_matsim.via_event.ViaEvent import beam.utils.{NetworkHelper, NetworkHelperImpl} import org.matsim.api.core.v01.network.Link import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.network.NetworkUtils import org.matsim.core.network.io.MatsimNetworkReader +import scripts.beam_to_matsim.events.BeamPathTraversal +import scripts.beam_to_matsim.transit.{TransitEventsGroup, TransitHelper} +import scripts.beam_to_matsim.via_event.ViaEvent private[transit] trait TransitViaEventsGeneratorWithoutLinks extends TransitViaEventsGenerator { import TransitHelper._ diff --git a/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala b/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala index 9c11e3b4c29..e7ce176393c 100644 --- a/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala +++ b/src/main/scala/scripts/beam_to_matsim/utils/LinkCoordinate.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.utils +package scripts.beam_to_matsim.utils import scala.collection.mutable import scala.xml.{Elem, Node} diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala index 0a97b5daa41..88eb607320c 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaActivity.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event sealed trait ActType object ActionStart extends ActType diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala index 928ae0ed0bb..f311a18ef1d 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event trait ViaEvent { var time: Double diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala index d6aa780043e..a5bf9804da6 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaEventsCollection.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event import scala.collection.mutable.ArrayBuffer diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala index 40d33f62583..bfcc7da380b 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonArrivalEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event case class ViaPersonArrivalEvent(var time: Double, person: String, link: Int) extends ViaEvent { diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala index a9288920361..0a82b20abf5 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaPersonDepartureEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event case class ViaPersonDepartureEvent(var time: Double, person: String, link: Int) extends ViaEvent { diff --git a/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala b/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala index 8650b3b95fd..8b0a9bb48fb 100644 --- a/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala +++ b/src/main/scala/scripts/beam_to_matsim/via_event/ViaTraverseLinkEvent.scala @@ -1,4 +1,4 @@ -package beam.utils.beam_to_matsim.via_event +package scripts.beam_to_matsim.via_event sealed trait ViaTraverseLinkEventType object EnteredLink extends ViaTraverseLinkEventType From 0d6015268dfd2e7d47776d24e330e4aa68ce8b20 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Fri, 8 Jul 2022 20:54:26 +0600 Subject: [PATCH 215/307] Update docs --- docs/developers.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/developers.rst b/docs/developers.rst index 140c61ed6b2..4bf3521dda3 100755 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -191,6 +191,7 @@ The command will start an ec2 instance based on the provided configurations and * **beamBranch**: To specify the branch for simulation, current source branch will be used as default branch. * **beamCommit**: The commit SHA to run simulation. use `HEAD` if you want to run with latest commit, default is `HEAD`. * **dataBranch**: To specify the data branch (branch on production data repository) for simulation, 'develop' branch will be used as default data branch. +* **dataCommit**: The commit SHA for the the data branch, default is `HEAD` * **deployMode**: to specify what type of deploy it will be: config | experiment | execute * **beamConfigs**: A comma `,` separated list of `beam.conf` files. It should be relative path under the project home. You can create branch level defaults by specifying the branch name with `.configs` suffix like `master.configs`. Branch level default will be used if `beamConfigs` is not present. * **beamExperiments**: A comma `,` separated list of `experiment.yml` files. It should be relative path under the project home.You can create branch level defaults same as configs by specifying the branch name with `.experiments` suffix like `master.experiments`. Branch level default will be used if `beamExperiments` is not present. `beamConfigs` has priority over this, in other words, if both are provided then `beamConfigs` will be used. @@ -203,6 +204,7 @@ The command will start an ec2 instance based on the provided configurations and * **region**: Use this parameter to select the AWS region for the run, all instances would be created in specified region. Default `region` is `us-east-2`. * **shutdownWait**: As simulation ends, ec2 instance would automatically terminate. In case you want to use the instance, please specify the wait in minutes, default wait is 30 min. * **shutdownBehaviour**: to specify shutdown behaviour after and of simulation. May be `stop` or `terminate`, default is `terminate`. +* **runJupyter**: Should it launch Jupyter Notebook along with a simulation, default is `false`. There is a default file to specify parameters for task: gradle.deploy.properties_ and it is advised to use it (or custom) file to specify all default values for `deploy` task and not use gradle.properties_ file because latter used as a source of default values for all gradle tasks. @@ -333,6 +335,26 @@ Below is syntax to use the command:: .. _link: https://goo.gl/Db37yM +Running Jupyter Notebook locally and remotely (EC2) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +There are 3 options to run Jupyter Notebook via Gradle task. + +1. Locally - Jupyter Notebook will be run on the local machine via Docker. To start it use command:: + + ./gradlew jupyterStart + +It will be run in the background. To stop it use command:: + + ./gradlew jupyterStop + +2. Remotely on EC2 on a dedicated instance. Use the following command: + + ./gradlew jupyterEC2 + +3. Remotely on EC2 together with a simulation. Use `-PrunJupyter=true` option for deploy command. + + Performance Monitoring ^^^^^^^^^^^^^^^^^^^^^^ From 96a5096d3632e4ea6c7088c2f495cb62b690a6ea Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Mon, 11 Jul 2022 10:36:34 +0300 Subject: [PATCH 216/307] Scheduler state files are moved to the output folder, stop Scheduler when forcibly shutdown happens --- .../agentsim/scheduler/BeamAgentScheduler.scala | 13 +++++++------ src/main/scala/beam/sim/BeamMobsim.scala | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala index 93d7e44aace..f56b59bc5fb 100644 --- a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala +++ b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala @@ -49,7 +49,7 @@ object BeamAgentScheduler { case object SimulationStuckCheck extends SchedulerMessage - case object BeforeShutdown extends SchedulerMessage + case object BeforeForcedShutdown extends SchedulerMessage case object RequestCurrentTime extends SchedulerMessage @@ -126,7 +126,7 @@ case object BeamAgentSchedulerTimer class BeamAgentScheduler( val beamConfig: BeamConfig, - val iterationOutputDir: String, + val outputDir: String, stopTick: Int, val maxWindow: Int, val stuckFinder: StuckFinder @@ -189,7 +189,7 @@ class BeamAgentScheduler( CoordinatedShutdown.PhaseBeforeServiceUnbind, "scheduler.storeState", self, - Some(BeforeShutdown) + Some(BeforeForcedShutdown) ) def scheduleTrigger(triggerToSchedule: ScheduleTrigger): Unit = { @@ -289,11 +289,12 @@ class BeamAgentScheduler( } } - case BeforeShutdown => + case BeforeForcedShutdown => if (!shutdownInitiated) { shutdownInitiated = true storeSchedulerState() } + context.stop(self) case Monitor => if (beamConfig.beam.debug.debugEnabled) { @@ -395,11 +396,11 @@ class BeamAgentScheduler( if (awaitingResponse.isEmpty) { log.info("awaitingResponse is empty, nowInSeconds = {}", nowInSeconds) } else { - val queueFile = s"$iterationOutputDir/triggerQueue.txt.gz" + val queueFile = s"$outputDir/scheduler_shutdown_dump_trigger_queue.txt.gz" log.info("triggerQueue.size = {}, saving to {}, nowInSeconds = {}", triggerQueue.size(), queueFile, nowInSeconds) val sorted = (0 until math.min(triggerQueue.size(), 1024)).view.map(_ => triggerQueue.poll().toString + "\n") FileUtils.writeToFile(queueFile, (s"total queue size = ${triggerQueue.size()}\n" +: sorted).iterator) - val awaitingResponseFile = s"$iterationOutputDir/awaitingResponse.txt.gz" + val awaitingResponseFile = s"$outputDir/scheduler_shutdown_dump_awaiting_response.txt.gz" log.info( "awaitingResponse.size = {}, saving to {}, nowInSeconds = {}", awaitingResponse.size(), diff --git a/src/main/scala/beam/sim/BeamMobsim.scala b/src/main/scala/beam/sim/BeamMobsim.scala index e3940c0bda3..34a0acfbdb1 100755 --- a/src/main/scala/beam/sim/BeamMobsim.scala +++ b/src/main/scala/beam/sim/BeamMobsim.scala @@ -381,7 +381,7 @@ class BeamMobsimIteration( Props( classOf[BeamAgentScheduler], beamConfig, - beamServices.matsimServices.getControlerIO.getIterationPath(beamServices.matsimServices.getIterationNumber), + beamServices.matsimServices.getControlerIO.getOutputPath, Time.parseTime(beamConfig.matsim.modules.qsim.endTime).toInt, config.schedulerParallelismWindow, new StuckFinder(beamConfig.beam.debug.stuckAgentDetection) From 5883826954c292c2efb2a2d9c8ca58e2f63e1484 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Mon, 11 Jul 2022 14:46:14 +0300 Subject: [PATCH 217/307] Update build.gradle default instance size which is big enough for most cases --- aws/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/build.gradle b/aws/build.gradle index 6b1db52f2da..73df38ae148 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -251,7 +251,7 @@ task jupyterEC2(type: AWSLambdaInvokeTask) { payload = """ { "budget_override": "${project.findProperty('budgetOverride') ?: false}", - "instance_type": "${project.findProperty('instanceType') ?: 't2.nano'}", + "instance_type": "${project.findProperty('instanceType') ?: 'r5.xlarge'}", "title": "${project.findProperty('title') ?: 'jupyter-notebook'}", "region": "${project.findProperty('region') ?: defaultRegion}", "storage_size": ${project.findProperty('storageSize') ?: 128}, From e5a603fab1b0e6b78cdb13321095f090e90da388 Mon Sep 17 00:00:00 2001 From: Rutvik Patel Date: Tue, 12 Jul 2022 15:20:38 +0530 Subject: [PATCH 218/307] fix param name typo --- docs/behaviors.rst | 24 ++--- docs/inputs.rst | 62 ++++++------- production/austin | 2 +- production/sfbay | 2 +- src/main/resources/beam-template.conf | 68 +++++++------- .../choice/logit/DestinationChoiceModel.scala | 6 +- .../mode/ModeChoiceMultinomialLogit.scala | 6 +- .../DefaultRideHailDepotParkingManager.scala | 8 +- .../infrastructure/ChargingFunctions.scala | 2 +- .../infrastructure/ChargingNetwork.scala | 2 +- .../DefaultRidehailFunctions.scala | 8 +- .../HierarchicalParkingManager.scala | 6 +- .../infrastructure/InfrastructureUtils.scala | 4 +- .../ParallelParkingManager.scala | 4 +- .../infrastructure/ParkingFunctions.scala | 2 +- .../infrastructure/ZonalParkingManager.scala | 8 +- .../replanning/AddSupplementaryTrips.scala | 2 +- .../SupplementaryTripGenerator.scala | 10 +-- src/main/scala/beam/sim/BeamHelper.scala | 2 +- src/main/scala/beam/sim/BeamMobsim.scala | 2 +- .../scala/beam/sim/config/BeamConfig.scala | 90 +++++++++---------- .../sim/population/PopulationAttributes.scala | 4 +- .../scripts/ParkingManagerBenchmark.scala | 10 +-- .../HierarchicalParkingManagerSpec.scala | 12 +-- .../ZonalParkingManagerSpec.scala | 8 +- .../integration/BikeTransitModeSpec.scala | 6 +- .../beam/integration/DriveTransitSpec.scala | 2 +- .../beam/integration/EventsFileSpec.scala | 2 +- .../MultinomialCustomConfigSpec.scala | 20 ++--- .../scala/beam/integration/ParkingSpec.scala | 14 +-- .../beam/sim/SecondaryActivitiesSpec.scala | 20 ++--- test/input/beamville/beam-urbansimv2.conf | 36 ++++---- test/input/beamville/beam.conf | 36 ++++---- test/input/equil-square/equil-0.001k.conf | 16 ++-- .../parkingMNLExperiment/experiment.yml | 18 ++-- test/input/sf-light/sf-light---bpr.conf | 2 +- test/input/sf-light/sf-light-0.5k.conf | 18 ++-- test/input/sf-light/sf-light-10k.conf | 18 ++-- test/input/sf-light/sf-light-1k.conf | 24 ++--- test/input/sf-light/sf-light-2.5k.conf | 18 ++-- .../sf-light/sf-light-25k-experiment-1.conf | 2 +- ...f-light-25k-test-with-pickupsdropoffs.conf | 2 +- ...ight-25k-test-without-pickupsdropoffs.conf | 2 +- test/input/sf-light/sf-light-25k.conf | 24 ++--- test/input/sf-light/sf-light-5k.conf | 18 ++-- .../sf-light-calibration/experiment-test.yml | 20 ++--- .../sf-light-calibration/experiment.yml | 20 ++--- test/input/sf-light/sf-light.conf | 18 ++-- test/input/sf-light/shared-bike.conf | 20 ++--- test/input/sf-light/urbansim-100k.conf | 18 ++-- .../sf-light/urbansim-10k-test-energy.conf | 18 ++-- test/input/sf-light/urbansim-10k.conf | 18 ++-- .../sf-light/urbansim-1k-activities.conf | 36 ++++---- .../sf-light/urbansim-1k-geofence-test.conf | 18 ++-- .../sf-light/urbansim-1k-rh-ev-cavs.conf | 18 ++-- .../sf-light/urbansim-1k-rh-ev-humans.conf | 18 ++-- test/input/sf-light/urbansim-1k.conf | 18 ++-- test/input/sf-light/urbansim-250k.conf | 18 ++-- test/input/sf-light/urbansim-25k.conf | 18 ++-- test/input/texas/austin-prod-200k.conf | 24 ++--- test/input/texas/austin-sep2021-base.conf | 24 ++--- 61 files changed, 488 insertions(+), 488 deletions(-) diff --git a/docs/behaviors.rst b/docs/behaviors.rst index 4a231e5adf8..cbc2d164b01 100755 --- a/docs/behaviors.rst +++ b/docs/behaviors.rst @@ -33,18 +33,18 @@ V_j = ASC_j + Beta_cost * cost + Beta_time * time + Beta_xfer * num_transfers The ASC (alternative specific constant) parameters as well as the Beta parameters can be configured in the BEAM configuration file and default to the following values: -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.cost = -1.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.time = -0.0047 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding_percentile = 90 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.cost = -1.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.time = -0.0047 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding_percentile = 90 Latent Class Mode Choice ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/inputs.rst b/docs/inputs.rst index 5966eb28ae1..5ae57e3e393 100755 --- a/docs/inputs.rst +++ b/docs/inputs.rst @@ -106,20 +106,20 @@ Mode choice parameters beam.agentsim.agents.modalBehaviors.lowTimeSensitivity.highCongestion.nonHighwayFactor.LevelLE2 = 1.0 beam.agentsim.agents.modalBehaviors.lowTimeSensitivity.lowCongestion.highwayFactor.LevelLE2 = 1.0 beam.agentsim.agents.modalBehaviors.lowTimeSensitivity.lowCongestion.nonHighwayFactor.LevelLE2 = 1.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.cav_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_transit_intercept = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding = 0.0 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding_percentile = 90 - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.utility_scale_factor = 1.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.cav_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_transit_intercept = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding = 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding_percentile = 90 + beam.agentsim.agents.modalBehaviors.multinomialLogit.utility_scale_factor = 1.0 beam.agentsim.agents.modalBehaviors.lccm.paramFile = ${beam.inputDirectory}"/lccm-long.csv" #Toll params beam.agentsim.toll.file=${beam.inputDirectory}"/toll-prices.csv" @@ -392,10 +392,10 @@ Ride hail management beam.agentsim.agents.rideHail.surgePricing.priceAdjustmentStrategy = "KEEP_PRICE_LEVEL_FIXED_AT_ONE" beam.agentsim.agents.rideHail.surgePricing.numberOfCategories = 6 - beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.drivingTimeMultiplier = -0.01666667 // one minute of driving is one util - beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.queueingTimeMultiplier = -0.01666667 // one minute of queueing is one util - beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.chargingTimeMultiplier = -0.01666667 // one minute of charging is one util - beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.insufficientRangeMultiplier = -60.0 // indicator variable so straight 60 minute penalty if out of range + beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.drivingTimeMultiplier = -0.01666667 // one minute of driving is one util + beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.queueingTimeMultiplier = -0.01666667 // one minute of queueing is one util + beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.chargingTimeMultiplier = -0.01666667 // one minute of charging is one util + beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.insufficientRangeMultiplier = -60.0 // indicator variable so straight 60 minute penalty if out of range beam.agentsim.agents.rideHail.iterationStats.timeBinSizeInSec = 3600.0 @@ -459,10 +459,10 @@ Ride hail management * cav.refuelRequiredThresholdInMeters: when range below this value, EV ride-hail CAVs will charge * cav.noRefuelThresholdInMeters: when range above noRefuelThresholdInMeters, EV ride-hail CAVs will not charge * rangeBufferForDispatchInMeters: do not dispatch vehicles below this range to ensure enough available to get to charger -* charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.drivingTimeMultiplier: one minute of driving is one util -* charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.queueingTimeMultiplier: one minute of queueing is one util -* charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.chargingTimeMultiplier: one minute of charging is one util -* charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.insufficientRangeMultiplier: indicator variable so straight 60 minute penalty if out of range +* charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.drivingTimeMultiplier: one minute of driving is one util +* charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.queueingTimeMultiplier: one minute of queueing is one util +* charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.chargingTimeMultiplier: one minute of charging is one util +* charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.insufficientRangeMultiplier: indicator variable so straight 60 minute penalty if out of range * iterationStats.timeBinSizeInSec: time bin size of ride-hail statistic @@ -470,15 +470,15 @@ Secondary activities generation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ :: - beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities = true - beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path = ${beam.inputDirectory}"/activity-intercepts.csv" - beam.agentsim.agents.tripBehaviors.mulitnomialLogit.activity_file_path = ${beam.inputDirectory}"/activity-params.csv" - beam.agentsim.agents.tripBehaviors.mulitnomialLogit.additional_trip_utility = 0.0 - beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_distance_meters = 16000 - beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_choice_set_size = 6 - beam.agentsim.agents.tripBehaviors.mulitnomialLogit.destination_nest_scale_factor = 1.0 - beam.agentsim.agents.tripBehaviors.mulitnomialLogit.mode_nest_scale_factor = 1.0 - beam.agentsim.agents.tripBehaviors.mulitnomialLogit.trip_nest_scale_factor = 1.0 + beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities = true + beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path = ${beam.inputDirectory}"/activity-intercepts.csv" + beam.agentsim.agents.tripBehaviors.multinomialLogit.activity_file_path = ${beam.inputDirectory}"/activity-params.csv" + beam.agentsim.agents.tripBehaviors.multinomialLogit.additional_trip_utility = 0.0 + beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_distance_meters = 16000 + beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_choice_set_size = 6 + beam.agentsim.agents.tripBehaviors.multinomialLogit.destination_nest_scale_factor = 1.0 + beam.agentsim.agents.tripBehaviors.multinomialLogit.mode_nest_scale_factor = 1.0 + beam.agentsim.agents.tripBehaviors.multinomialLogit.trip_nest_scale_factor = 1.0 * generate_secondary_activities: allow/disallow generation of secondary activities. * intercept_file_path: input file giving the relative likelihoods of starting different activities at different times of the day. diff --git a/production/austin b/production/austin index 958a8641cce..f9bee5d3989 160000 --- a/production/austin +++ b/production/austin @@ -1 +1 @@ -Subproject commit 958a8641cce392c257ac549af94bd84c653c1b36 +Subproject commit f9bee5d398917a25a59ea826777c6a985a9d49ab diff --git a/production/sfbay b/production/sfbay index 97950bc7eb2..786b20833d3 160000 --- a/production/sfbay +++ b/production/sfbay @@ -1 +1 @@ -Subproject commit 97950bc7eb201c7dfcd356089a23b23fa2b23d9d +Subproject commit 786b20833d34d1dfb57cff531717c31e7ea43e8c diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index da096d51bf8..91f17c5abfd 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -106,32 +106,32 @@ beam.agentsim.agents.modalBehaviors.lowTimeSensitivity.highCongestion.highwayFac beam.agentsim.agents.modalBehaviors.lowTimeSensitivity.highCongestion.nonHighwayFactor.LevelLE2 = "double | 1.0" beam.agentsim.agents.modalBehaviors.lowTimeSensitivity.lowCongestion.highwayFactor.LevelLE2 = "double | 1.0" beam.agentsim.agents.modalBehaviors.lowTimeSensitivity.lowCongestion.nonHighwayFactor.LevelLE2 = "double | 1.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = "double | -1.4" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding_percentile = "double | 90.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = "double | -1.4" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding_percentile = "double | 90.0" # any positive value -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding_VOT_multiplier = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding_VOT_multiplier = "double | 0.0" # from 0 to 1. # how full should be a vehicle to turn on crowding calculation. 0 - empty, 1 - full -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding_VOT_threshold = "double | 0.5" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.cav_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_transit_intercept = "double | 0.0" -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.utility_scale_factor = "double | 1.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding_VOT_threshold = "double | 0.5" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.cav_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_transit_intercept = "double | 0.0" +beam.agentsim.agents.modalBehaviors.multinomialLogit.utility_scale_factor = "double | 1.0" beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" ## SECONDARY ACTIVITIES GENERATION # Allow/disallow generation of secondary activities -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities = "boolean | false" +beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities = "boolean | false" # Input file giving the relative likelihoods of starting different activities at different times of the day -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path = "" +beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path = "" # Input file giving parameters for the different activity types, including mean duration (duration is drawn from an # exponential distribution with that mean) and value of time multiplier. The value of time multiplier modifies how # willing agents are to incur travel time and cost in order to accomplish that activity. For example, a value of 0.5 @@ -141,34 +141,34 @@ beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path = "" # commuting to participate in this activity. # # You can adjust the VOT values up or down to get more or less of a given activity -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.activity_file_path = "" +beam.agentsim.agents.tripBehaviors.multinomialLogit.activity_file_path = "" #This is an intercept value you can add to make all secondary activities more or less likely -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.additional_trip_utility = "double | 0.0" +beam.agentsim.agents.tripBehaviors.multinomialLogit.additional_trip_utility = "double | 0.0" # This sets a maximum distance in looking for places to participate in secondary activities. Increasing it # increases the maximum and mean trip distance for secondary activities. -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_distance_meters = "double | 32000" +beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_distance_meters = "double | 32000" # This determines how many options for secondary activity locations an agent chooses between. Increasing this # number decreases the mean distance traveled to secondary activities and slightly increases the number of trips # that are made (because the agents are more likely to find a suitable location for a secondary activity nearby) -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_choice_set_size = "int | 20" +beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_choice_set_size = "int | 20" #These three values should all be between zero and one and determine the amount of noise in each level of # the nested choice process. Increasing destination_nest_scale_factor means that people are more likely to # choose a less optimal destination, mode_nest_scale_factor means people are more likely to value destinations # accessible by multiple modes, and trip_nest_scale_factor means that people are more likely to take secondary # trips even if the costs are greater than the benefits -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.destination_nest_scale_factor = "double | 1.0" -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.mode_nest_scale_factor = "double | 1.0" -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.trip_nest_scale_factor = "double | 1.0" +beam.agentsim.agents.tripBehaviors.multinomialLogit.destination_nest_scale_factor = "double | 1.0" +beam.agentsim.agents.tripBehaviors.multinomialLogit.mode_nest_scale_factor = "double | 1.0" +beam.agentsim.agents.tripBehaviors.multinomialLogit.trip_nest_scale_factor = "double | 1.0" beam.agentsim.agents.tripBehaviors.carUsage.minDistanceToTrainStop = "double | 0.0" beam.agentsim.agents.modeIncentive.filePath = "" beam.agentsim.agents.ptFare.filePath = "" -beam.agentsim.agents.parking.mulitnomialLogit.params.rangeAnxietyMultiplier = "double | -0.5" # fit range anxiety between [-1, 0] -beam.agentsim.agents.parking.mulitnomialLogit.params.distanceMultiplier = "double | -0.086" # based on 20m walk, VoT = $35/hr should be u=-1.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.parkingPriceMultiplier = "double | -0.005" # based on avg. parking prices up to $200! -beam.agentsim.agents.parking.mulitnomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = "double | 1.0" # positive boost of 1.0 if true -beam.agentsim.agents.parking.mulitnomialLogit.params.enrouteDetourMultiplier = "double | 1.0" # based on skim travel time and the defined VoT for car trips +beam.agentsim.agents.parking.multinomialLogit.params.rangeAnxietyMultiplier = "double | -0.5" # fit range anxiety between [-1, 0] +beam.agentsim.agents.parking.multinomialLogit.params.distanceMultiplier = "double | -0.086" # based on 20m walk, VoT = $35/hr should be u=-1.0 +beam.agentsim.agents.parking.multinomialLogit.params.parkingPriceMultiplier = "double | -0.005" # based on avg. parking prices up to $200! +beam.agentsim.agents.parking.multinomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = "double | 1.0" # positive boost of 1.0 if true +beam.agentsim.agents.parking.multinomialLogit.params.enrouteDetourMultiplier = "double | 1.0" # based on skim travel time and the defined VoT for car trips beam.agentsim.agents.parking.rangeAnxietyBuffer = "double | 20000.0" # if our remaining range exceeds our remaining tour plus this many meters, then we feel no anxiety; default 20k beam.agentsim.agents.parking.minSearchRadius = "double | 250.00" # something small enough that, on average, we see 2 orders of magnitude of samples at most beam.agentsim.agents.parking.maxSearchRadius = "double | 8046.72" # something large enough that we do not strand our drivers in an oasis @@ -254,10 +254,10 @@ beam.agentsim.agents.rideHail.cav.refuelRequiredThresholdInMeters = 16090.0 # 10 beam.agentsim.agents.rideHail.cav.noRefuelThresholdInMeters = 96540.0 # 60 miles beam.agentsim.agents.rideHail.rangeBufferForDispatchInMeters = 10000 # do not dispatch vehicles below this range to ensure enough available to get to charger -beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.drivingTimeMultiplier = "double | -0.01666667" // one minute of driving is one util -beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.queueingTimeMultiplier = "double | -0.01666667" // one minute of queueing is one util -beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.chargingTimeMultiplier = "double | -0.01666667" // one minute of charging is one util -beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.insufficientRangeMultiplier = "double | -60.0" // indicator variable so straight 60 minute penalty if out of range +beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.drivingTimeMultiplier = "double | -0.01666667" // one minute of driving is one util +beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.queueingTimeMultiplier = "double | -0.01666667" // one minute of queueing is one util +beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.chargingTimeMultiplier = "double | -0.01666667" // one minute of charging is one util +beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.insufficientRangeMultiplier = "double | -60.0" // indicator variable so straight 60 minute penalty if out of range beam.agentsim.agents.freight { enabled = false diff --git a/src/main/scala/beam/agentsim/agents/choice/logit/DestinationChoiceModel.scala b/src/main/scala/beam/agentsim/agents/choice/logit/DestinationChoiceModel.scala index 394d970f77f..aa6c589b81b 100644 --- a/src/main/scala/beam/agentsim/agents/choice/logit/DestinationChoiceModel.scala +++ b/src/main/scala/beam/agentsim/agents/choice/logit/DestinationChoiceModel.scala @@ -135,11 +135,11 @@ class DestinationChoiceModel( ) val activityRates: DestinationChoiceModel.ActivityRates = loadActivityRates( - beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path + beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path ) val (activityVOTs, activityDurations) = loadActivityParams( - beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.activity_file_path + beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.activity_file_path ) def generateActivityRates( @@ -251,7 +251,7 @@ class DestinationChoiceModel( .getOrElse(secondsToIndex(actStart), 0d) val tripIntercept = activity.getType.toLowerCase match { case "home" | "work" => 0d - case _ => beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.additional_trip_utility + case _ => beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.additional_trip_utility } activityValueOfTime + activityIntercept + tripIntercept } diff --git a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala index 1048c128508..fda51c6e2ed 100755 --- a/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala +++ b/src/main/scala/beam/agentsim/agents/choice/mode/ModeChoiceMultinomialLogit.scala @@ -255,7 +255,7 @@ class ModeChoiceMultinomialLogit( override def getCrowdingForTrip(embodiedBeamTrip: EmbodiedBeamTrip): Double = { val percentile = - beamConfig.beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding_percentile + beamConfig.beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding_percentile transitCrowding.getTransitOccupancyLevelForPercentile(embodiedBeamTrip, percentile) } @@ -604,12 +604,12 @@ object ModeChoiceMultinomialLogit extends StrictLogging { configHolder: BeamConfigHolder ): (MultinomialLogit[EmbodiedBeamTrip, String], MultinomialLogit[BeamMode, String]) = { - val params = configHolder.beamConfig.beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params + val params = configHolder.beamConfig.beam.agentsim.agents.modalBehaviors.multinomialLogit.params val commonUtility: Map[String, UtilityFunctionOperation] = Map( "cost" -> UtilityFunctionOperation("multiplier", -1) ) val scale_factor: Double = - configHolder.beamConfig.beam.agentsim.agents.modalBehaviors.mulitnomialLogit.utility_scale_factor + configHolder.beamConfig.beam.agentsim.agents.modalBehaviors.multinomialLogit.utility_scale_factor val carIntercept = Map("intercept" -> UtilityFunctionOperation("intercept", params.car_intercept)) val mnlUtilityFunctions: Map[String, Map[String, UtilityFunctionOperation]] = Map( diff --git a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala index b0305eff483..2f943e61bb1 100644 --- a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala @@ -36,10 +36,10 @@ import scala.collection.mutable.ListBuffer * * Key parameters to control behavior of this class: * - * beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.drivingTimeMultiplier = "double | -0.01666667" // one minute of driving is one util - * beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.queueingTimeMultiplier = "double | -0.01666667" // one minute of queueing is one util - * beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.chargingTimeMultiplier = "double | -0.01666667" // one minute of charging is one util - * beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.insufficientRangeMultiplier = "double | -60.0" // 60 minute penalty if out of range + * beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.drivingTimeMultiplier = "double | -0.01666667" // one minute of driving is one util + * beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.queueingTimeMultiplier = "double | -0.01666667" // one minute of queueing is one util + * beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.chargingTimeMultiplier = "double | -0.01666667" // one minute of charging is one util + * beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.insufficientRangeMultiplier = "double | -60.0" // 60 minute penalty if out of range */ class DefaultRideHailDepotParkingManager( vehicleManagerId: Id[VehicleManager], diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index fcfd52b36c6..3da3d387110 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -29,7 +29,7 @@ class ChargingFunctions( minNumberOfSameTypeZones: Int, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, skims: Option[Skims], fuelPrice: Map[FuelType, Double] ) extends ParkingFunctions( diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 2b7f372e382..6b1dd22d117 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -175,7 +175,7 @@ object ChargingNetwork extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, envelopeInUTM, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, skims, fuelPrice ) diff --git a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala index fb660389885..f6e6fac8d35 100644 --- a/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/DefaultRidehailFunctions.scala @@ -238,16 +238,16 @@ object DefaultRidehailFunctions { ): Map[ParkingMNL.Parameters, UtilityFunctionOperation] = { Map( ParkingMNL.Parameters.DrivingTimeCost -> UtilityFunctionOperation.Multiplier( - rideHailConfig.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.drivingTimeMultiplier + rideHailConfig.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.drivingTimeMultiplier ), ParkingMNL.Parameters.QueueingTimeCost -> UtilityFunctionOperation.Multiplier( - rideHailConfig.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.queueingTimeMultiplier + rideHailConfig.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.queueingTimeMultiplier ), ParkingMNL.Parameters.ChargingTimeCost -> UtilityFunctionOperation.Multiplier( - rideHailConfig.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.chargingTimeMultiplier + rideHailConfig.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.chargingTimeMultiplier ), ParkingMNL.Parameters.InsufficientRangeCost -> UtilityFunctionOperation.Multiplier( - rideHailConfig.charging.vehicleChargingManager.defaultVehicleChargingManager.mulitnomialLogit.params.insufficientRangeMultiplier + rideHailConfig.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.insufficientRangeMultiplier ) ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala index 55137a47030..d9099703335 100644 --- a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala @@ -36,7 +36,7 @@ class HierarchicalParkingManager( maxSearchRadius: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, checkThatNumberOfStallsMatch: Boolean = false ) extends ParkingNetwork(parkingZones) { @@ -256,7 +256,7 @@ object HierarchicalParkingManager { maxSearchRadius: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork = { new HierarchicalParkingManager( @@ -280,7 +280,7 @@ object HierarchicalParkingManager { maxSearchRadius: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork = HierarchicalParkingManager( diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala index 74727fad8ea..f62d18b9e1f 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala @@ -138,12 +138,12 @@ object InfrastructureUtils extends LazyLogging { .init( parkingStalls, beamScenario.tazTreeMap, - geo.distUTMInMeters(_, _), + geo.distUTMInMeters, beamConfig.beam.agentsim.agents.parking.minSearchRadius, beamConfig.beam.agentsim.agents.parking.maxSearchRadius, envelopeInUTM, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.multinomialLogit ) case "PARALLEL" => ParallelParkingManager.init( diff --git a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala index c27cbf02f0c..3c9995ec795 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala @@ -41,7 +41,7 @@ class ParallelParkingManager( fractionOfSameTypeZones: Double, minNumberOfSameTypeZones: Int, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit ) extends ParkingNetwork(parkingZones) { override protected val searchFunctions: Option[InfrastructureFunctions] = None @@ -187,7 +187,7 @@ object ParallelParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.fractionOfSameTypeZones, beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.multinomialLogit ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index 84f1b16a84f..08baaf1443e 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -27,7 +27,7 @@ class ParkingFunctions( minNumberOfSameTypeZones: Int, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit ) extends InfrastructureFunctions( geoQuadTree, idToGeoMapping, diff --git a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala index 296f62d9725..e1a915461a9 100755 --- a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala @@ -41,7 +41,7 @@ object ZonalParkingManager extends LazyLogging { fractionOfSameTypeZones: Double, minNumberOfSameTypeZones: Int, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit ): ZonalParkingManager = { new ZonalParkingManager(parkingZones) { if (maxSearchRadius < minSearchRadius) { @@ -93,7 +93,7 @@ object ZonalParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.fractionOfSameTypeZones, beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.multinomialLogit ) } @@ -114,7 +114,7 @@ object ZonalParkingManager extends LazyLogging { minSearchRadius: Double, maxSearchRadius: Double, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, beamConfig: BeamConfig, beamServicesMaybe: Option[BeamServices] ): ZonalParkingManager = { @@ -155,7 +155,7 @@ object ZonalParkingManager extends LazyLogging { beamServices.beamScenario.tazTreeMap.idToTAZMapping, envelopeInUTM, beamServices.beamConfig, - beamServices.geo.distUTMInMeters(_, _) + beamServices.geo.distUTMInMeters ) } diff --git a/src/main/scala/beam/replanning/AddSupplementaryTrips.scala b/src/main/scala/beam/replanning/AddSupplementaryTrips.scala index 2ab8977ba19..7c2e92b7218 100755 --- a/src/main/scala/beam/replanning/AddSupplementaryTrips.scala +++ b/src/main/scala/beam/replanning/AddSupplementaryTrips.scala @@ -16,7 +16,7 @@ class AddSupplementaryTrips @Inject() (beamConfig: BeamConfig) extends PlansStra private val log = LoggerFactory.getLogger(classOf[AddSupplementaryTrips]) override def run(person: HasPlansAndId[Plan, Person]): Unit = { - if (beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities) { + if (beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities) { log.debug("Before Replanning AddNewActivities: Person-" + person.getId + " - " + person.getPlans.size()) ReplanningUtil.makeExperiencedMobSimCompatible(person) diff --git a/src/main/scala/beam/replanning/SupplementaryTripGenerator.scala b/src/main/scala/beam/replanning/SupplementaryTripGenerator.scala index 8db4efb2eef..73bb8c167ce 100755 --- a/src/main/scala/beam/replanning/SupplementaryTripGenerator.scala +++ b/src/main/scala/beam/replanning/SupplementaryTripGenerator.scala @@ -48,7 +48,7 @@ class SupplementaryTripGenerator( MultinomialLogit( Map.empty, destinationChoiceModel.DefaultMNLParameters, - beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.mode_nest_scale_factor + beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.mode_nest_scale_factor ) val destinationMNL: MultinomialLogit[ @@ -58,14 +58,14 @@ class SupplementaryTripGenerator( MultinomialLogit( Map.empty, destinationChoiceModel.TripMNLParameters, - beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.destination_nest_scale_factor + beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.destination_nest_scale_factor ) val tripMNL: MultinomialLogit[Boolean, DestinationChoiceModel.TripParameters] = MultinomialLogit( Map.empty, destinationChoiceModel.TripMNLParameters, - beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.trip_nest_scale_factor + beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.trip_nest_scale_factor ) val newPlan = PopulationUtils.createPlan(plan.getPerson) @@ -144,7 +144,7 @@ class SupplementaryTripGenerator( ): List[Activity] = { val tazChoiceSet: List[TAZ] = generateTazChoiceSet( - beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_choice_set_size, + beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_choice_set_size, prevActivity.getCoord ) @@ -396,7 +396,7 @@ class SupplementaryTripGenerator( private def generateTazChoiceSet(n: Int, coord: Coord): List[TAZ] = { val maxDistance = - beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_distance_meters + beamServices.beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_distance_meters val r_repeat = new scala.util.Random r_repeat.setSeed(personSpecificSeed) r_repeat diff --git a/src/main/scala/beam/sim/BeamHelper.scala b/src/main/scala/beam/sim/BeamHelper.scala index 34583d68dc8..c41a2b841a2 100755 --- a/src/main/scala/beam/sim/BeamHelper.scala +++ b/src/main/scala/beam/sim/BeamHelper.scala @@ -775,7 +775,7 @@ trait BeamHelper extends LazyLogging { val peopleForRemovingWorkActivities = (people.size * beamConfig.beam.agentsim.fractionOfPlansWithSingleActivity).toInt - if (beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities) { + if (beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities) { people .take(peopleForRemovingWorkActivities) .flatMap(p => p.getPlans.asScala.toSeq) diff --git a/src/main/scala/beam/sim/BeamMobsim.scala b/src/main/scala/beam/sim/BeamMobsim.scala index e3940c0bda3..e3737da5da4 100755 --- a/src/main/scala/beam/sim/BeamMobsim.scala +++ b/src/main/scala/beam/sim/BeamMobsim.scala @@ -146,7 +146,7 @@ class BeamMobsim @Inject() ( } )(scala.concurrent.ExecutionContext.global) - if (beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities) { + if (beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities) { logger.info("Filling in secondary trips in plans") fillInSecondaryActivities( beamServices.matsimServices.getScenario.getHouseholds diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 7980182bd67..6cc3107ba92 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -186,7 +186,7 @@ object BeamConfig { minimumValueOfTime: scala.Double, modeChoiceClass: java.lang.String, modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit, + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit, overrideAutomationForVOTT: scala.Boolean, overrideAutomationLevel: scala.Int, poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, @@ -609,12 +609,12 @@ object BeamConfig { } } - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params, + case class MultinomialLogit( + params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params, utility_scale_factor: scala.Double ) - object MulitnomialLogit { + object MultinomialLogit { case class Params( bike_intercept: scala.Double, @@ -638,8 +638,8 @@ object BeamConfig { def apply( c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, bike_transit_intercept = if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, @@ -676,9 +676,9 @@ object BeamConfig { def apply( c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit.Params( + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit = { + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( if (c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}") ), @@ -741,9 +741,9 @@ object BeamConfig { if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") ), overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), @@ -779,18 +779,18 @@ object BeamConfig { maxSearchRadius: scala.Double, minNumberOfSameTypeZones: scala.Int, minSearchRadius: scala.Double, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, rangeAnxietyBuffer: scala.Double, searchMaxDistanceRelativeToEllipseFoci: scala.Double ) object Parking { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + case class MultinomialLogit( + params: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params ) - object MulitnomialLogit { + object MultinomialLogit { case class Params( distanceMultiplier: scala.Double, @@ -804,8 +804,8 @@ object BeamConfig { def apply( c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( + ): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( distanceMultiplier = if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, enrouteDetourMultiplier = @@ -822,9 +822,9 @@ object BeamConfig { } } - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit = { + BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( if (c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}") ) @@ -840,9 +840,9 @@ object BeamConfig { minNumberOfSameTypeZones = if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") ), rangeAnxietyBuffer = if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, @@ -1114,16 +1114,16 @@ object BeamConfig { object VehicleChargingManager { case class DefaultVehicleChargingManager( - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit ) object DefaultVehicleChargingManager { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params + case class MultinomialLogit( + params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params ) - object MulitnomialLogit { + object MultinomialLogit { case class Params( chargingTimeMultiplier: scala.Double, @@ -1136,8 +1136,8 @@ object BeamConfig { def apply( c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit .Params( chargingTimeMultiplier = if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") @@ -1158,11 +1158,11 @@ object BeamConfig { def apply( c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit = { + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( + .MultinomialLogit( params = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MulitnomialLogit + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit .Params( if (c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}") @@ -1176,11 +1176,11 @@ object BeamConfig { ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager .DefaultVehicleChargingManager( - mulitnomialLogit = + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + .MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") ) ) } @@ -1538,7 +1538,7 @@ object BeamConfig { case class TripBehaviors( carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit ) object TripBehaviors { @@ -1557,7 +1557,7 @@ object BeamConfig { } } - case class MulitnomialLogit( + case class MultinomialLogit( activity_file_path: java.lang.String, additional_trip_utility: scala.Double, destination_nest_scale_factor: scala.Double, @@ -1569,10 +1569,10 @@ object BeamConfig { trip_nest_scale_factor: scala.Double ) - object MulitnomialLogit { + object MultinomialLogit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit = { + BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( activity_file_path = if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", additional_trip_utility = @@ -1604,9 +1604,9 @@ object BeamConfig { if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}") ), - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") ) ) } diff --git a/src/main/scala/beam/sim/population/PopulationAttributes.scala b/src/main/scala/beam/sim/population/PopulationAttributes.scala index 5c0a7ff136a..7973c9dcdb2 100644 --- a/src/main/scala/beam/sim/population/PopulationAttributes.scala +++ b/src/main/scala/beam/sim/population/PopulationAttributes.scala @@ -121,8 +121,8 @@ case class AttributesOfIndividual( case Some(transitCrowding) => val crowdingMultiplier = transitCrowding.getTransitCrowdingTimeMultiplier( embodiedBeamLeg, - beamServices.beamConfig.beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding_VOT_multiplier, - beamServices.beamConfig.beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transit_crowding_VOT_threshold + beamServices.beamConfig.beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding_VOT_multiplier, + beamServices.beamConfig.beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transit_crowding_VOT_threshold ) multiplier * durationInHours * crowdingMultiplier case _ => diff --git a/src/main/scala/scripts/ParkingManagerBenchmark.scala b/src/main/scala/scripts/ParkingManagerBenchmark.scala index def22836da0..69d8c9f6bd2 100644 --- a/src/main/scala/scripts/ParkingManagerBenchmark.scala +++ b/src/main/scala/scripts/ParkingManagerBenchmark.scala @@ -83,10 +83,10 @@ object ParkingManagerBenchmark extends StrictLogging { """ |beam.agentsim.agents.parking.minSearchRadius = 250.00 |beam.agentsim.agents.parking.maxSearchRadius = 8046.72 - |beam.agentsim.agents.parking.mulitnomialLogit.params.rangeAnxietyMultiplier = -0.5 - |beam.agentsim.agents.parking.mulitnomialLogit.params.distanceMultiplier = -0.086 - |beam.agentsim.agents.parking.mulitnomialLogit.params.parkingPriceMultiplier = -0.5 - |beam.agentsim.agents.parking.mulitnomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = 2.0 + |beam.agentsim.agents.parking.multinomialLogit.params.rangeAnxietyMultiplier = -0.5 + |beam.agentsim.agents.parking.multinomialLogit.params.distanceMultiplier = -0.086 + |beam.agentsim.agents.parking.multinomialLogit.params.parkingPriceMultiplier = -0.5 + |beam.agentsim.agents.parking.multinomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = 2.0 | |parallel-parking-manager-dispatcher { | executor = "thread-pool-executor" @@ -199,7 +199,7 @@ object ParkingManagerBenchmark extends StrictLogging { beamConfig.beam.agentsim.agents.parking.maxSearchRadius, boundingBox, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, checkThatNumberOfStallsMatch = true ) parkingNetwork diff --git a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala index 749a7b0c11d..6eed899b58d 100644 --- a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala @@ -77,7 +77,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, checkThatNumberOfStallsMatch = true ) } { @@ -116,7 +116,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, checkThatNumberOfStallsMatch = true ) @@ -172,7 +172,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, checkThatNumberOfStallsMatch = true ) } { @@ -244,7 +244,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, checkThatNumberOfStallsMatch = true ) } { @@ -329,7 +329,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, checkThatNumberOfStallsMatch = true ) } { @@ -382,7 +382,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, checkThatNumberOfStallsMatch = true ) diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index 8dfb98fdc98..d62ccaefff3 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -323,7 +323,7 @@ class ZonalParkingManagerSpec minSearchRadius, maxSearchRadius, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig, None ) @@ -382,7 +382,7 @@ class ZonalParkingManagerSpec minSearchRadius, maxSearchRadius, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig, None ) @@ -437,7 +437,7 @@ class ZonalParkingManagerSpec beamConfig.beam.agentsim.agents.parking.fractionOfSameTypeZones, beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit + beamConfig.beam.agentsim.agents.parking.multinomialLogit ) assertParkingResponse( @@ -551,7 +551,7 @@ object ZonalParkingManagerSpec { minSearchRadius, maxSearchRadius, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig, None ) diff --git a/src/test/scala/beam/integration/BikeTransitModeSpec.scala b/src/test/scala/beam/integration/BikeTransitModeSpec.scala index 63884b9a500..ca0b83ca366 100644 --- a/src/test/scala/beam/integration/BikeTransitModeSpec.scala +++ b/src/test/scala/beam/integration/BikeTransitModeSpec.scala @@ -44,9 +44,9 @@ class BikeTransitModeSpec ConfigFactory .parseString(""" |akka.test.timefactor = 10 - |beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0 - |beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 10 - |beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_transit_intercept = 20 + |beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0 + |beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 10 + |beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_transit_intercept = 20 |""".stripMargin) .withFallback(testConfig("test/input/beamville/beam.conf").resolve()) diff --git a/src/test/scala/beam/integration/DriveTransitSpec.scala b/src/test/scala/beam/integration/DriveTransitSpec.scala index ca1e3fe2bd7..94f75affd87 100755 --- a/src/test/scala/beam/integration/DriveTransitSpec.scala +++ b/src/test/scala/beam/integration/DriveTransitSpec.scala @@ -32,7 +32,7 @@ class DriveTransitSpec extends AnyWordSpecLike with Matchers with BeamHelper { ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept", ConfigValueFactory.fromAnyRef(9999) ) .withValue( diff --git a/src/test/scala/beam/integration/EventsFileSpec.scala b/src/test/scala/beam/integration/EventsFileSpec.scala index 62da74c68fb..4e4288cbf31 100755 --- a/src/test/scala/beam/integration/EventsFileSpec.scala +++ b/src/test/scala/beam/integration/EventsFileSpec.scala @@ -39,7 +39,7 @@ class EventsFileSpec .withValue("beam.physsim.events.fileOutputFormats", ConfigValueFactory.fromAnyRef("xml,csv")) .withValue("beam.physsim.writeEventsInterval", ConfigValueFactory.fromAnyRef("1")) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept", ConfigValueFactory.fromAnyRef("6") ) .resolve() diff --git a/src/test/scala/beam/integration/MultinomialCustomConfigSpec.scala b/src/test/scala/beam/integration/MultinomialCustomConfigSpec.scala index b3e20218661..1aae49137da 100755 --- a/src/test/scala/beam/integration/MultinomialCustomConfigSpec.scala +++ b/src/test/scala/beam/integration/MultinomialCustomConfigSpec.scala @@ -24,7 +24,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept", ConfigValueFactory.fromAnyRef(100) ) .withValue( @@ -39,7 +39,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept", ConfigValueFactory.fromAnyRef(-100) ) .resolve() @@ -66,7 +66,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept", ConfigValueFactory.fromAnyRef(100) ) .resolve() @@ -77,7 +77,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept", ConfigValueFactory.fromAnyRef(-100) ) .resolve() @@ -99,7 +99,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept", ConfigValueFactory.fromAnyRef(100) ) .resolve() @@ -110,7 +110,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept", ConfigValueFactory.fromAnyRef(-100) ) .resolve() @@ -132,7 +132,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept", ConfigValueFactory.fromAnyRef(100) ) .resolve() @@ -143,7 +143,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept", ConfigValueFactory.fromAnyRef(-100) ) .resolve() @@ -167,7 +167,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept", ConfigValueFactory.fromAnyRef(100) ) .resolve() @@ -178,7 +178,7 @@ class MultinomialCustomConfigSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept", ConfigValueFactory.fromAnyRef(-100) ) .resolve() diff --git a/src/test/scala/beam/integration/ParkingSpec.scala b/src/test/scala/beam/integration/ParkingSpec.scala index ef02e75a9c8..451fe0d90e0 100755 --- a/src/test/scala/beam/integration/ParkingSpec.scala +++ b/src/test/scala/beam/integration/ParkingSpec.scala @@ -45,31 +45,31 @@ class ParkingSpec ConfigValueFactory.fromAnyRef(TestConstants.MODE_CHOICE_MULTINOMIAL_LOGIT) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept", ConfigValueFactory.fromAnyRef(1.0) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept", ConfigValueFactory.fromAnyRef(0.0) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept", ConfigValueFactory.fromAnyRef(0.0) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept", ConfigValueFactory.fromAnyRef(0.0) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept", ConfigValueFactory.fromAnyRef(0.0) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept", ConfigValueFactory.fromAnyRef(-5.0) ) .withValue( - "beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept", + "beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept", ConfigValueFactory.fromAnyRef(0.0) ) .withValue("matsim.modules.strategy.ModuleProbability_1", ConfigValueFactory.fromAnyRef(0.3)) diff --git a/src/test/scala/beam/sim/SecondaryActivitiesSpec.scala b/src/test/scala/beam/sim/SecondaryActivitiesSpec.scala index c811e94727b..b102e19becc 100644 --- a/src/test/scala/beam/sim/SecondaryActivitiesSpec.scala +++ b/src/test/scala/beam/sim/SecondaryActivitiesSpec.scala @@ -34,9 +34,9 @@ class SecondaryActivitiesSpec .parseString(s""" |beam.agentsim.lastIteration = 0 |beam.exchange.scenario.urbansim.activitySimEnabled = true - |beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities = true - |beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path = "test/test-resources/beam/agentsim/activities/activity-intercepts.csv" - |beam.agentsim.agents.tripBehaviors.mulitnomialLogit.activity_file_path = "test/test-resources/beam/agentsim/activities/activity-params.csv" + |beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities = true + |beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path = "test/test-resources/beam/agentsim/activities/activity-intercepts.csv" + |beam.agentsim.agents.tripBehaviors.multinomialLogit.activity_file_path = "test/test-resources/beam/agentsim/activities/activity-params.csv" """.stripMargin) .withFallback(testConfig("test/input/beamville/beam.conf")) .resolve() @@ -68,7 +68,7 @@ class SecondaryActivitiesSpec eventManager = injector.getInstance(classOf[EventsManager]) networkHelper = injector.getInstance(classOf[NetworkHelper]) - val interceptFilePath = beamConfig.beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path + val interceptFilePath = beamConfig.beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path val interceptPath = Source.fromFile(interceptFilePath) interceptMode = interceptPath.getLines().next().split(",").drop(1).toSet interceptPath.close() @@ -109,9 +109,9 @@ class SecondaryActivitiesSpec .parseString(s""" |beam.agentsim.lastIteration = 0 |beam.exchange.scenario.urbansim.activitySimEnabled = true - |beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities = true - |beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path = "test/test-resources/beam/agentsim/activities/activity-intercepts-0.csv" - |beam.agentsim.agents.tripBehaviors.mulitnomialLogit.activity_file_path = "test/test-resources/beam/agentsim/activities/activity-params.csv" + |beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities = true + |beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path = "test/test-resources/beam/agentsim/activities/activity-intercepts-0.csv" + |beam.agentsim.agents.tripBehaviors.multinomialLogit.activity_file_path = "test/test-resources/beam/agentsim/activities/activity-params.csv" """.stripMargin) .withFallback(testConfig("test/input/beamville/beam.conf")) .resolve() @@ -128,9 +128,9 @@ class SecondaryActivitiesSpec .parseString(s""" |beam.agentsim.lastIteration = 0 |beam.exchange.scenario.urbansim.activitySimEnabled = true - |beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities = true - |beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path = "test/test-resources/beam/agentsim/activities/activity-intercepts-high.csv" - |beam.agentsim.agents.tripBehaviors.mulitnomialLogit.activity_file_path = "test/test-resources/beam/agentsim/activities/activity-params.csv" + |beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities = true + |beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path = "test/test-resources/beam/agentsim/activities/activity-intercepts-high.csv" + |beam.agentsim.agents.tripBehaviors.multinomialLogit.activity_file_path = "test/test-resources/beam/agentsim/activities/activity-params.csv" """.stripMargin) .withFallback(testConfig("test/input/beamville/beam.conf")) .resolve() diff --git a/test/input/beamville/beam-urbansimv2.conf b/test/input/beamville/beam-urbansimv2.conf index 65db71b6e4c..20d66bedc4b 100755 --- a/test/input/beamville/beam-urbansimv2.conf +++ b/test/input/beamville/beam-urbansimv2.conf @@ -19,29 +19,29 @@ beam.agentsim.endTime = "30:00:00" # ModeChoiceUniformRandom ModeChoiceLCCM beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 10.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 10.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 10.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 10.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 2.0 beam.agentsim.agents.modalBehaviors.overrideAutomationLevel = 5 beam.agentsim.agents.modalBehaviors.overrideAutomationForVOTT = false beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" # secondary mode choice -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities = false -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path = ${beam.inputDirectory}"/activity-intercepts.csv" -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.activity_file_path = ${beam.inputDirectory}"/activity-params.csv" -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.additional_trip_utility = 0.0 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_distance_meters = 16000 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_choice_set_size = 6 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.destination_nest_scale_factor = 1.0 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.mode_nest_scale_factor = 1.0 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.trip_nest_scale_factor = 1.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities = false +beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path = ${beam.inputDirectory}"/activity-intercepts.csv" +beam.agentsim.agents.tripBehaviors.multinomialLogit.activity_file_path = ${beam.inputDirectory}"/activity-params.csv" +beam.agentsim.agents.tripBehaviors.multinomialLogit.additional_trip_utility = 0.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_distance_meters = 16000 +beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_choice_set_size = 6 +beam.agentsim.agents.tripBehaviors.multinomialLogit.destination_nest_scale_factor = 1.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.mode_nest_scale_factor = 1.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.trip_nest_scale_factor = 1.0 # beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" # beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/beamville/beam.conf b/test/input/beamville/beam.conf index 47bde83a52f..6286aa24e26 100755 --- a/test/input/beamville/beam.conf +++ b/test/input/beamville/beam.conf @@ -21,29 +21,29 @@ beam.agentsim.endTime = "30:00:00" # ModeChoiceUniformRandom ModeChoiceLCCM beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 10.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 10.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 10.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 10.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 2.0 beam.agentsim.agents.modalBehaviors.overrideAutomationLevel = 5 beam.agentsim.agents.modalBehaviors.overrideAutomationForVOTT = false beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" # secondary mode choice -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities = false -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path = ${beam.inputDirectory}"/activity-intercepts.csv" -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.activity_file_path = ${beam.inputDirectory}"/activity-params.csv" -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.additional_trip_utility = 0.0 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_distance_meters = 16000 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_choice_set_size = 6 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.destination_nest_scale_factor = 1.0 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.mode_nest_scale_factor = 1.0 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.trip_nest_scale_factor = 1.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities = false +beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path = ${beam.inputDirectory}"/activity-intercepts.csv" +beam.agentsim.agents.tripBehaviors.multinomialLogit.activity_file_path = ${beam.inputDirectory}"/activity-params.csv" +beam.agentsim.agents.tripBehaviors.multinomialLogit.additional_trip_utility = 0.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_distance_meters = 16000 +beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_choice_set_size = 6 +beam.agentsim.agents.tripBehaviors.multinomialLogit.destination_nest_scale_factor = 1.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.mode_nest_scale_factor = 1.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.trip_nest_scale_factor = 1.0 beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/equil-square/equil-0.001k.conf b/test/input/equil-square/equil-0.001k.conf index 3b25664b456..cf61d95314a 100755 --- a/test/input/equil-square/equil-0.001k.conf +++ b/test/input/equil-square/equil-0.001k.conf @@ -20,14 +20,14 @@ beam.agentsim.endTime = "30:00:00" # ModeChoiceUniformRandom ModeChoiceLCCM beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = -1.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = -3.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = -1.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = -3.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.vehicles.sharedFleets = [] diff --git a/test/input/sf-light/parkingMNLExperiment/experiment.yml b/test/input/sf-light/parkingMNLExperiment/experiment.yml index 28541e8ab97..3402433e766 100644 --- a/test/input/sf-light/parkingMNLExperiment/experiment.yml +++ b/test/input/sf-light/parkingMNLExperiment/experiment.yml @@ -26,34 +26,34 @@ factors: levels: - name: Low params: - beam.agentsim.agents.parking.mulitnomialLogit.params.distance_multiplier: 0.5 + beam.agentsim.agents.parking.multinomialLogit.params.distance_multiplier: 0.5 - name: Base params: - beam.agentsim.agents.parking.mulitnomialLogit.params.distance_multiplier: 1 + beam.agentsim.agents.parking.multinomialLogit.params.distance_multiplier: 1 - name: High params: - beam.agentsim.agents.parking.mulitnomialLogit.params.distance_multiplier: 2 + beam.agentsim.agents.parking.multinomialLogit.params.distance_multiplier: 2 - title: InstalledCapacityMultiplier levels: - name: Low params: - beam.agentsim.agents.parking.mulitnomialLogit.params.installed_capacity_multiplier: 0.000 + beam.agentsim.agents.parking.multinomialLogit.params.installed_capacity_multiplier: 0.000 - name: Base params: - beam.agentsim.agents.parking.mulitnomialLogit.params.installed_capacity_multiplier: 0.001 + beam.agentsim.agents.parking.multinomialLogit.params.installed_capacity_multiplier: 0.001 - name: High params: - beam.agentsim.agents.parking.mulitnomialLogit.params.installed_capacity_multiplier: 0.002 + beam.agentsim.agents.parking.multinomialLogit.params.installed_capacity_multiplier: 0.002 - title: ParkingCostsPriceMultiplier levels: - name: Low params: - beam.agentsim.agents.parking.mulitnomialLogit.params.parking_costs_price_multiplier: 0 + beam.agentsim.agents.parking.multinomialLogit.params.parking_costs_price_multiplier: 0 - name: Base params: - beam.agentsim.agents.parking.mulitnomialLogit.params.parking_costs_price_multiplier: 4.5 + beam.agentsim.agents.parking.multinomialLogit.params.parking_costs_price_multiplier: 4.5 - name: High params: - beam.agentsim.agents.parking.mulitnomialLogit.params.parking_costs_price_multiplier: 9 \ No newline at end of file + beam.agentsim.agents.parking.multinomialLogit.params.parking_costs_price_multiplier: 9 \ No newline at end of file diff --git a/test/input/sf-light/sf-light---bpr.conf b/test/input/sf-light/sf-light---bpr.conf index 74670e36667..70af26f628b 100755 --- a/test/input/sf-light/sf-light---bpr.conf +++ b/test/input/sf-light/sf-light---bpr.conf @@ -13,5 +13,5 @@ beam.agentsim.lastIteration = 4 beam.physsim.skipPhysSim = false -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 100.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 100.0 beam.agentsim.agents.rideHail.initialization.procedural.fractionOfInitialVehicleFleet = 0.2 diff --git a/test/input/sf-light/sf-light-0.5k.conf b/test/input/sf-light/sf-light-0.5k.conf index 88b14d8ef3f..5fc0f50ad2b 100755 --- a/test/input/sf-light/sf-light-0.5k.conf +++ b/test/input/sf-light/sf-light-0.5k.conf @@ -22,15 +22,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = -1.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = -1.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.modeVotMultiplier.rideHailPooled = 2.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" diff --git a/test/input/sf-light/sf-light-10k.conf b/test/input/sf-light/sf-light-10k.conf index 8c6d6595dde..5b398f65338 100755 --- a/test/input/sf-light/sf-light-10k.conf +++ b/test/input/sf-light/sf-light-10k.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = -1.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = -1.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.modeVotMultiplier.rideHailPooled = 2.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" diff --git a/test/input/sf-light/sf-light-1k.conf b/test/input/sf-light/sf-light-1k.conf index 5d2b0772fba..5d863660d0c 100755 --- a/test/input/sf-light/sf-light-1k.conf +++ b/test/input/sf-light/sf-light-1k.conf @@ -26,19 +26,19 @@ beam.physsim.writeRouteHistoryInterval = 1 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 10.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = -1.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 10.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = -1.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.modeVotMultiplier.rideHailPooled = 2.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.distance_multiplier = 1.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.installed_capacity_multiplier = 0.001 -beam.agentsim.agents.parking.mulitnomialLogit.params.parking_costs_price_multiplier = 4.5 +beam.agentsim.agents.parking.multinomialLogit.params.distance_multiplier = 1.0 +beam.agentsim.agents.parking.multinomialLogit.params.installed_capacity_multiplier = 0.001 +beam.agentsim.agents.parking.multinomialLogit.params.parking_costs_price_multiplier = 4.5 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/sf-light-2.5k.conf b/test/input/sf-light/sf-light-2.5k.conf index a10b8bc0c87..f130e4e97d5 100755 --- a/test/input/sf-light/sf-light-2.5k.conf +++ b/test/input/sf-light/sf-light-2.5k.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = -1.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = -1.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.modeVotMultiplier.rideHailPooled = 2.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" diff --git a/test/input/sf-light/sf-light-25k-experiment-1.conf b/test/input/sf-light/sf-light-25k-experiment-1.conf index f6939ed8cd1..03104704da8 100755 --- a/test/input/sf-light/sf-light-25k-experiment-1.conf +++ b/test/input/sf-light/sf-light-25k-experiment-1.conf @@ -5,4 +5,4 @@ beam.agentsim.simulationName = "sf-light-25k-default" beam.agentsim.firstIteration = 0 beam.agentsim.lastIteration = 2 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 10.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 10.0 diff --git a/test/input/sf-light/sf-light-25k-test-with-pickupsdropoffs.conf b/test/input/sf-light/sf-light-25k-test-with-pickupsdropoffs.conf index 17f41c678d4..728e55d00d2 100755 --- a/test/input/sf-light/sf-light-25k-test-with-pickupsdropoffs.conf +++ b/test/input/sf-light/sf-light-25k-test-with-pickupsdropoffs.conf @@ -3,7 +3,7 @@ include "sf-light-25k.conf" beam.agentsim.simulationName = "sf-light-25k-with-pickups-dropoffs" beam.physsim.pickUpDropOffAnalysis.enabled = true -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 10000.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 10000.0 beam.agentsim.firstIteration = 0 beam.agentsim.lastIteration = 5 diff --git a/test/input/sf-light/sf-light-25k-test-without-pickupsdropoffs.conf b/test/input/sf-light/sf-light-25k-test-without-pickupsdropoffs.conf index 275b6194d8e..b7f615a407e 100755 --- a/test/input/sf-light/sf-light-25k-test-without-pickupsdropoffs.conf +++ b/test/input/sf-light/sf-light-25k-test-without-pickupsdropoffs.conf @@ -3,7 +3,7 @@ include "sf-light-25k.conf" beam.agentsim.simulationName = "sf-light-25k-without-pickups-dropoffs" beam.physsim.pickUpDropOffAnalysis.enabled = false -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 10000.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 10000.0 beam.agentsim.firstIteration = 0 beam.agentsim.lastIteration = 5 diff --git a/test/input/sf-light/sf-light-25k.conf b/test/input/sf-light/sf-light-25k.conf index abeced82b5c..4ccd97eecc0 100755 --- a/test/input/sf-light/sf-light-25k.conf +++ b/test/input/sf-light/sf-light-25k.conf @@ -21,19 +21,19 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = -1.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = -1.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.modeVotMultiplier.rideHailPooled = 2.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.distance_multiplier = 1.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.installed_capacity_multiplier = 0.001 -beam.agentsim.agents.parking.mulitnomialLogit.params.parking_costs_price_multiplier = 4.5 +beam.agentsim.agents.parking.multinomialLogit.params.distance_multiplier = 1.0 +beam.agentsim.agents.parking.multinomialLogit.params.installed_capacity_multiplier = 0.001 +beam.agentsim.agents.parking.multinomialLogit.params.parking_costs_price_multiplier = 4.5 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/sf-light-5k.conf b/test/input/sf-light/sf-light-5k.conf index 73bb84967b3..0658dc7672c 100644 --- a/test/input/sf-light/sf-light-5k.conf +++ b/test/input/sf-light/sf-light-5k.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = -1.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = -1.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.modeVotMultiplier.rideHailPooled = 2.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" diff --git a/test/input/sf-light/sf-light-calibration/experiment-test.yml b/test/input/sf-light/sf-light-calibration/experiment-test.yml index 1854050b4ab..8c5c76d1150 100755 --- a/test/input/sf-light/sf-light-calibration/experiment-test.yml +++ b/test/input/sf-light/sf-light-calibration/experiment-test.yml @@ -33,37 +33,37 @@ factors: levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept: -15.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept: -15.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept: 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept: 0.0 - title: driveTransitIntercept levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept: -15.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept: -15.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept: 0.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept: 0.0 - title: rideHailTransitIntercept levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept: -5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept: -5.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept: 5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept: 5.0 - title: rideHailIntercept levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept: -5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept: -5.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept: 5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept: 5.0 - title: transitCapacity levels: @@ -87,7 +87,7 @@ factors: levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept: -15.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept: -15.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept: -4.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept: -4.0 diff --git a/test/input/sf-light/sf-light-calibration/experiment.yml b/test/input/sf-light/sf-light-calibration/experiment.yml index d54f84f0ac6..9d754bdf1d2 100755 --- a/test/input/sf-light/sf-light-calibration/experiment.yml +++ b/test/input/sf-light/sf-light-calibration/experiment.yml @@ -46,37 +46,37 @@ factors: levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept: -15.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept: -15.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept: 5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept: 5.0 - title: driveTransitIntercept levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept: -15.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept: -15.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept: 5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept: 5.0 - title: rideHailTransitIntercept levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept: -5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept: -5.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept: 5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept: 5.0 - title: rideHailIntercept levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept: -5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept: -5.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept: 5.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept: 5.0 - title: transitCapacity levels: @@ -100,10 +100,10 @@ factors: levels: - name: Low params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept: -15.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept: -15.0 - name: High params: - beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept: -4.0 + beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept: -4.0 - title: countsFactor levels: diff --git a/test/input/sf-light/sf-light.conf b/test/input/sf-light/sf-light.conf index 546d22a7381..83230c6ba2b 100644 --- a/test/input/sf-light/sf-light.conf +++ b/test/input/sf-light/sf-light.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = -1.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = -1.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.modeVotMultiplier.rideHailPooled = 2.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" diff --git a/test/input/sf-light/shared-bike.conf b/test/input/sf-light/shared-bike.conf index d65b3dcfce5..676d7ccc53d 100644 --- a/test/input/sf-light/shared-bike.conf +++ b/test/input/sf-light/shared-bike.conf @@ -9,8 +9,8 @@ beam.agentsim.firstIteration = 0 beam.agentsim.lastIteration = 1 #generate second activity -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities = true -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_distance_meters = 100.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities = true +beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_distance_meters = 100.0 ################################################################## # Agentsim @@ -34,15 +34,15 @@ beam.warmStart.type = "linkStatsFromLastRun" #mode choice parameters beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 ##we set car intercept to be 0 now -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = -1.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = -3.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = -1.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = -3.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 #sampling beam.agentsim.numAgents = 100 diff --git a/test/input/sf-light/urbansim-100k.conf b/test/input/sf-light/urbansim-100k.conf index bf4c157ffae..123e647514e 100755 --- a/test/input/sf-light/urbansim-100k.conf +++ b/test/input/sf-light/urbansim-100k.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 20.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 20.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/urbansim-10k-test-energy.conf b/test/input/sf-light/urbansim-10k-test-energy.conf index 9cb7a6f8752..b34ade7d803 100755 --- a/test/input/sf-light/urbansim-10k-test-energy.conf +++ b/test/input/sf-light/urbansim-10k-test-energy.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/urbansim-10k.conf b/test/input/sf-light/urbansim-10k.conf index 1427ea1a87f..5771188ccd5 100755 --- a/test/input/sf-light/urbansim-10k.conf +++ b/test/input/sf-light/urbansim-10k.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 5.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 20.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 5.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 20.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/urbansim-1k-activities.conf b/test/input/sf-light/urbansim-1k-activities.conf index 70f4fa3fd9a..4a6c1e8d501 100755 --- a/test/input/sf-light/urbansim-1k-activities.conf +++ b/test/input/sf-light/urbansim-1k-activities.conf @@ -21,27 +21,27 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 2.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 2.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.generate_secondary_activities = true -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.intercept_file_path = ${beam.inputDirectory}"/activity-intercepts.csv" -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.activity_file_path = ${beam.inputDirectory}"/activity-params.csv" -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.additional_trip_utility = 0.0 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_distance_meters = 16000 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.max_destination_choice_set_size = 6 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.destination_nest_scale_factor = 1.0 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.mode_nest_scale_factor = 1.0 -beam.agentsim.agents.tripBehaviors.mulitnomialLogit.trip_nest_scale_factor = 1.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.generate_secondary_activities = true +beam.agentsim.agents.tripBehaviors.multinomialLogit.intercept_file_path = ${beam.inputDirectory}"/activity-intercepts.csv" +beam.agentsim.agents.tripBehaviors.multinomialLogit.activity_file_path = ${beam.inputDirectory}"/activity-params.csv" +beam.agentsim.agents.tripBehaviors.multinomialLogit.additional_trip_utility = 0.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_distance_meters = 16000 +beam.agentsim.agents.tripBehaviors.multinomialLogit.max_destination_choice_set_size = 6 +beam.agentsim.agents.tripBehaviors.multinomialLogit.destination_nest_scale_factor = 1.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.mode_nest_scale_factor = 1.0 +beam.agentsim.agents.tripBehaviors.multinomialLogit.trip_nest_scale_factor = 1.0 beam.agentsim.agents.plans { inputPlansFilePath = ${beam.inputDirectory}"/sample/1k/population.xml.gz" inputPersonAttributesFilePath = ${beam.inputDirectory}"/sample/1k/populationAttributes.xml.gz" diff --git a/test/input/sf-light/urbansim-1k-geofence-test.conf b/test/input/sf-light/urbansim-1k-geofence-test.conf index 40f620f58b4..dc683fcf5d2 100755 --- a/test/input/sf-light/urbansim-1k-geofence-test.conf +++ b/test/input/sf-light/urbansim-1k-geofence-test.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/urbansim-1k-rh-ev-cavs.conf b/test/input/sf-light/urbansim-1k-rh-ev-cavs.conf index 7a499bb32ad..a4d608ea9bb 100755 --- a/test/input/sf-light/urbansim-1k-rh-ev-cavs.conf +++ b/test/input/sf-light/urbansim-1k-rh-ev-cavs.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 2.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 2.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/urbansim-1k-rh-ev-humans.conf b/test/input/sf-light/urbansim-1k-rh-ev-humans.conf index 1de5947e5a9..e6a0b7f81cc 100755 --- a/test/input/sf-light/urbansim-1k-rh-ev-humans.conf +++ b/test/input/sf-light/urbansim-1k-rh-ev-humans.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 2.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 20.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 2.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 20.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/urbansim-1k.conf b/test/input/sf-light/urbansim-1k.conf index 48379de0960..87ff8288114 100755 --- a/test/input/sf-light/urbansim-1k.conf +++ b/test/input/sf-light/urbansim-1k.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 2.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 2.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/urbansim-250k.conf b/test/input/sf-light/urbansim-250k.conf index 5bb27782349..f1c8e482eed 100755 --- a/test/input/sf-light/urbansim-250k.conf +++ b/test/input/sf-light/urbansim-250k.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/sf-light/urbansim-25k.conf b/test/input/sf-light/urbansim-25k.conf index df8a9b47aa0..2b0ed49b5b8 100644 --- a/test/input/sf-light/urbansim-25k.conf +++ b/test/input/sf-light/urbansim-25k.conf @@ -21,15 +21,15 @@ beam.agentsim.schedulerParallelismWindow = 30 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 3.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 3.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = 0.0 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/texas/austin-prod-200k.conf b/test/input/texas/austin-prod-200k.conf index 35bed7fc8c8..a2ab68f7bb6 100644 --- a/test/input/texas/austin-prod-200k.conf +++ b/test/input/texas/austin-prod-200k.conf @@ -22,19 +22,19 @@ beam.agentsim.schedulerParallelismWindow = 150 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = -0.8 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 1.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = -1.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = -4.6 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = -5.22 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = -0.8 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 1.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = -1.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = -4.6 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = -5.22 beam.agentsim.agents.modalBehaviors.modeVotMultiplier.rideHailPooled = 2.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.distance_multiplier = 1.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.installed_capacity_multiplier = 0.001 -beam.agentsim.agents.parking.mulitnomialLogit.params.parking_costs_price_multiplier = 4.5 +beam.agentsim.agents.parking.multinomialLogit.params.distance_multiplier = 1.0 +beam.agentsim.agents.parking.multinomialLogit.params.installed_capacity_multiplier = 0.001 +beam.agentsim.agents.parking.multinomialLogit.params.parking_costs_price_multiplier = 4.5 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" diff --git a/test/input/texas/austin-sep2021-base.conf b/test/input/texas/austin-sep2021-base.conf index 94286c7c4e1..06314e26b4c 100644 --- a/test/input/texas/austin-sep2021-base.conf +++ b/test/input/texas/austin-sep2021-base.conf @@ -25,19 +25,19 @@ beam.agentsim.schedulerParallelismWindow = 150 # ModeChoiceUniformRandom beam.agentsim.agents.modalBehaviors.modeChoiceClass = "ModeChoiceMultinomialLogit" beam.agentsim.agents.modalBehaviors.defaultValueOfTime = 8.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.transfer = -1.4 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.car_intercept = 2.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_transit_intercept = -0.8 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.drive_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_transit_intercept = 0.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_intercept = 1.0 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.ride_hail_pooled_intercept = -1.5 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.walk_intercept = -4.6 -beam.agentsim.agents.modalBehaviors.mulitnomialLogit.params.bike_intercept = -5.22 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.transfer = -1.4 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.car_intercept = 2.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_transit_intercept = -0.8 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.drive_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_transit_intercept = 0.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_intercept = 1.0 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.ride_hail_pooled_intercept = -1.5 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.walk_intercept = -4.6 +beam.agentsim.agents.modalBehaviors.multinomialLogit.params.bike_intercept = -5.22 beam.agentsim.agents.modalBehaviors.modeVotMultiplier.rideHailPooled = 2.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.distance_multiplier = 1.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.installed_capacity_multiplier = 0.001 -beam.agentsim.agents.parking.mulitnomialLogit.params.parking_costs_price_multiplier = 4.5 +beam.agentsim.agents.parking.multinomialLogit.params.distance_multiplier = 1.0 +beam.agentsim.agents.parking.multinomialLogit.params.installed_capacity_multiplier = 0.001 +beam.agentsim.agents.parking.multinomialLogit.params.parking_costs_price_multiplier = 4.5 beam.agentsim.agents.modalBehaviors.lccm.filePath = ${beam.inputDirectory}"/lccm-long.csv" beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" From e72bd895bec134e524de60006098e5789a8aab29 Mon Sep 17 00:00:00 2001 From: Rutvik Patel Date: Tue, 12 Jul 2022 15:52:52 +0530 Subject: [PATCH 219/307] adds production/seattle changes --- production/seattle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/seattle b/production/seattle index bd1f2fcd32d..ad7f89b5e59 160000 --- a/production/seattle +++ b/production/seattle @@ -1 +1 @@ -Subproject commit bd1f2fcd32d80e3375e201104ddd22bd0cbee28f +Subproject commit ad7f89b5e596d79e26ff0fc8826543a6f0e61c93 From 6b5990fe453696b02ffa97a9ac553d0d6ddbbf64 Mon Sep 17 00:00:00 2001 From: Rutvik Patel Date: Tue, 12 Jul 2022 16:26:23 +0530 Subject: [PATCH 220/307] fixes resource closing --- src/main/scala/beam/router/gtfs/GTFSUtils.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/scala/beam/router/gtfs/GTFSUtils.scala b/src/main/scala/beam/router/gtfs/GTFSUtils.scala index eee436b488e..b22c59325cb 100644 --- a/src/main/scala/beam/router/gtfs/GTFSUtils.scala +++ b/src/main/scala/beam/router/gtfs/GTFSUtils.scala @@ -46,7 +46,11 @@ object GTFSUtils { ) .map(_.stop_id) .toSet - gtfsFeeds.flatMap(_.stops.values().asScala.filter(stop => trainStationIds.contains(stop.stop_id))) + gtfsFeeds.flatMap { gtfsFeed => + val result = gtfsFeed.stops.values().asScala.filter(stop => trainStationIds.contains(stop.stop_id)) + gtfsFeed.close() + result + } } def toQuadTree(stops: Seq[Stop], geo: GeoUtils): QuadTree[Stop] = { From e7b943809ec701fe4105dec995377d63f32a8858 Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Tue, 12 Jul 2022 18:19:04 +0300 Subject: [PATCH 221/307] Scheduler saves thread dump. --- src/main/java/beam/utils/DebugLib.java | 13 +++++++++++++ .../agentsim/scheduler/BeamAgentScheduler.scala | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/beam/utils/DebugLib.java b/src/main/java/beam/utils/DebugLib.java index 036266c58d9..375c3ce063d 100755 --- a/src/main/java/beam/utils/DebugLib.java +++ b/src/main/java/beam/utils/DebugLib.java @@ -3,6 +3,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.management.ManagementFactory; +import java.lang.management.ThreadInfo; +import java.lang.management.ThreadMXBean; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + public class DebugLib { private static final Logger log = LoggerFactory.getLogger(DebugLib.class); @@ -31,4 +38,10 @@ public static void busyWait(int nanos) { while(System.nanoTime() - start < nanos); } + public static List currentThreadDump() { + ThreadMXBean bean = ManagementFactory.getThreadMXBean(); + ThreadInfo[] infos = bean.dumpAllThreads(true, true); + return Arrays.stream(infos).map(Object::toString).collect(Collectors.toList()); + } + } diff --git a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala index f56b59bc5fb..0bc64449146 100644 --- a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala +++ b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala @@ -7,7 +7,7 @@ import beam.agentsim.agents.ridehail.RideHailManager.RideHailRepositioningTrigge import beam.agentsim.scheduler.BeamAgentScheduler._ import beam.agentsim.scheduler.Trigger.TriggerWithId import beam.sim.config.BeamConfig -import beam.utils.{FileUtils, StuckFinder} +import beam.utils.{DebugLib, FileUtils, StuckFinder} import beam.utils.logging.{LogActorState, LoggingMessageActor} import com.google.common.collect.TreeMultimap @@ -414,6 +414,10 @@ class BeamAgentScheduler( awaitingResponseFile, (s"total awaitingResponse size = ${awaitingResponse.size()}\n" +: triggers).iterator ) + FileUtils.writeToFile( + s"$outputDir/scheduler_shutdown_thread_dump.txt.gz", + DebugLib.currentThreadDump().asScala.iterator + ) } } From d05ba03a54861c543a4f06c5cad305fa9fb7819b Mon Sep 17 00:00:00 2001 From: Rutvik Patel Date: Tue, 12 Jul 2022 20:54:14 +0530 Subject: [PATCH 222/307] updates other data repos --- production/detroit | 2 +- production/newyork | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/production/detroit b/production/detroit index 4dd0351a6eb..4eb5a38c2a8 160000 --- a/production/detroit +++ b/production/detroit @@ -1 +1 @@ -Subproject commit 4dd0351a6eb7d411afd58eabdca3bad3234d45ff +Subproject commit 4eb5a38c2a832f276b8d6880d4dce233f522b47e diff --git a/production/newyork b/production/newyork index 5d4a5fab70c..31c64acc53e 160000 --- a/production/newyork +++ b/production/newyork @@ -1 +1 @@ -Subproject commit 5d4a5fab70c7e7bc059d1dcdea7365a6c49d33c0 +Subproject commit 31c64acc53ee235c53d304d2c8d1131398399b2c From dfac0d34fbe66344513136f96fd21c7c496579de Mon Sep 17 00:00:00 2001 From: Xuan-1998 Date: Tue, 12 Jul 2022 20:04:49 -0700 Subject: [PATCH 223/307] documentation for repositioning --- docs/behaviors.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/behaviors.rst b/docs/behaviors.rst index e0351a14bc5..20f0788407f 100755 --- a/docs/behaviors.rst +++ b/docs/behaviors.rst @@ -77,7 +77,7 @@ The following should be considered when configuring a set of parking alternative the *chargingPointType* attribute will result in the following charger power in kW: +----------------+--------+ -| *chargingPointType* | kW | +| *chargingPointType* | kW| +================+========+ | NoCharger | 0.0 | +----------------+--------+ @@ -96,3 +96,17 @@ Refueling Reposition ---------- +In BEAM, reposition is based on availability. minAvailabilityMap stores the Tazs with lowest availibility of vehicles, and we reposition the number of matchLimit vehicles from the Tazs with available fleets more than matchLimit based on statTimeBin and repositionTimeBin to determinine when we start doing reposition and the frequency of repositioning. + +There are several parameters we can adjust in repositioning: + ++----------------+--------------------------------------------------+ +| Parameters | Meaning | ++================+==================================================+ +| *matchLimit* | How many vehicles we want to reposition | ++----------------+--------------------------------------------------+ +| *repositionTimeBin* | How often we do repositioning | ++----------------+--------------------------------------------------+ +| *statTimeBin* | When do we start repositioning | ++----------------+--------------------------------------------------+ + From 4cf7a9811d2dbf84b80a0b19ca3ccd1d723872b2 Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Wed, 13 Jul 2022 13:56:55 +0300 Subject: [PATCH 224/307] beam lambda_function.py: added a cron job that stores a beam thread dump in case of issues. --- .../python/beam_lambda/lambda_function.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 4a2958f657e..a581c31b066 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -98,6 +98,8 @@ path: /tmp/slack.sh - content: | 0 * * * * curl -X POST -H "Content-type: application/json" --data '"'"'{"$(ec2metadata --instance-type) instance $(ec2metadata --instance-id) running... \\n Batch [$UID] completed and instance of type $(ec2metadata --instance-type) is still running in $REGION since last $(($(($(date +%s) - $(cat /tmp/.starttime))) / 3600)) Hour $(($(($(date +%s) - $(cat /tmp/.starttime))) / 60)) Minute."}'"'" + */10 * * * * /home/ubuntu/beam_stuck_guard.sh + path: /tmp/slack_notification - content: | #!/bin/bash @@ -132,10 +134,31 @@ echo $timestamp_CPU, $ram_used_available done path: /home/ubuntu/write-cpu-ram-usage.sh + - content: | + #!/bin/bash + pgrep -f RunBeam || exit 0 + out_dir=$(find /home/ubuntu/git/beam/output -maxdepth 2 -mindepth 2 -type d -print -quit) + if [[ -z "${out_dir}" ]]; then exit 0; fi + log_file="$out_dir/beamLog.out" + if [[ ! -f $log_file ]] ; then exit 0; fi + last_completed=$(tac $log_file | grep -m 1 completed | grep -m 1 -Eo '^[0-9]{2}:[0-9]{2}:[0-9]{2}') + if [[ -z "${last_completed}" ]]; then + last_completed=$(tac $log_file | grep -m 1 -Eo '^[0-9]{2}:[0-9]{2}:[0-9]{2}') + fi + beam_status=$(python3 -c "import datetime as dt; diff = dt.datetime.now() - dt.datetime.combine(dt.datetime.today(), dt.time.fromisoformat('$last_completed')); x = 'OK' if dt.timedelta(0) <= diff and diff < dt.timedelta(hours=3) else 'Bad'; print(x)") + pid=$(pgrep -f RunBeam) + if [ "$beam_status" == 'Bad' ] && [ "$pid" != "" ]; then + jstack $pid | gzip > "$out_dir/kill_thread_dump.txt.gz" + kill $pid + sleep 5m + kill -9 $pid + fi + path: /home/ubuntu/beam_stuck_guard.sh runcmd: - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh + - sudo chmod +x /home/ubuntu/beam_stuck_guard.sh - cd /home/ubuntu - ./write-cpu-ram-usage.sh 20 > cpu_ram_usage.csv & - cd /home/ubuntu/git From 28383875fd12f5fe9f38a1a96a37ece3e1fd5d51 Mon Sep 17 00:00:00 2001 From: Rutvik Patel Date: Thu, 14 Jul 2022 13:14:11 +0530 Subject: [PATCH 225/307] fixes plan issue --- .../scenario/UrbanSimScenarioLoader.scala | 48 +++++++++++++++---- ...SimTravelTimeWithCACCPickUpsDropOffs.scala | 2 +- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala index e3a39cd4dfb..47a5dfe6a2d 100644 --- a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala +++ b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala @@ -11,7 +11,7 @@ import beam.utils.plan.sampling.AvailableModeUtils import beam.utils.scenario.urbansim.HOVModeTransformer import com.typesafe.scalalogging.LazyLogging import org.apache.commons.math3.distribution.UniformRealDistribution -import org.matsim.api.core.v01.population.Population +import org.matsim.api.core.v01.population.{Person, Plan, Population} import org.matsim.api.core.v01.{Coord, Id, Scenario} import org.matsim.core.population.PopulationUtils import org.matsim.core.scenario.MutableScenario @@ -20,7 +20,7 @@ import org.matsim.vehicles.{Vehicle, VehicleType, VehicleUtils} import scala.collection.JavaConverters._ import scala.collection.mutable.ArrayBuffer -import scala.collection.{mutable, Iterable} +import scala.collection.{Iterable, mutable} import scala.concurrent.duration._ import scala.concurrent.{Await, ExecutionContext, Future} import scala.math.{max, min, round} @@ -533,15 +533,45 @@ class UrbanSimScenarioLoader( } private[utils] def applyPlans(plans: Iterable[PlanElement]): Unit = { - plans.foreach { planInfo => + // holds data related to plan element index and whether it will be inserted in selected plan or not + case class State(planIndex: Int, planSelected: Boolean) + + // person and their list of plans + // an index of state in map values (vector) will be the same as `person.getPlans` index + val store: mutable.Map[PersonId, Vector[State]] = mutable.Map.empty + + // updates person/plans store internally + // add new plan to person if not exist or select appropriate plan based on plan index/selected to operate on + // set selected plan if not already + def getPlan(person: Person, planInfo: PlanElement): Plan = { + val currentPlanSize = person.getPlans.size() + val (plan, state) = if (currentPlanSize == 0) { + val newState = State(planInfo.planIndex, planInfo.planSelected) + val plan = PopulationUtils.createPlan(person) + store += (planInfo.personId -> Vector(newState)) + person.addPlan(plan) + plan -> newState + } else { + val lookingFor = State(planInfo.planIndex, planInfo.planSelected) + val states = store(planInfo.personId) + val index = states.zipWithIndex.find(_._1 == lookingFor).map(_._2).getOrElse { + // couldn't find in store, create new plan + person.addPlan(PopulationUtils.createPlan(person)) + store += (planInfo.personId -> (states :+ lookingFor)) + currentPlanSize + } + person.getPlans.get(index) -> lookingFor + } + if (person.getSelectedPlan == null && state.planSelected) { + person.setSelectedPlan(plan) + } + plan + } + + plans.foreach { planInfo: PlanElement => val person = population.getPersons.get(Id.createPersonId(planInfo.personId.id)) if (person != null) { - var plan = person.getSelectedPlan - if (plan == null) { - plan = PopulationUtils.createPlan(person) - person.addPlan(plan) - person.setSelectedPlan(plan) - } + val plan = getPlan(person, planInfo) val planElement = planInfo.planElementType val tripId = Option(planInfo.tripId).getOrElse("") if (planElement == PlanElement.Leg) { diff --git a/src/test/scala/beam/physsim/travelTime/PhysSimTravelTimeWithCACCPickUpsDropOffs.scala b/src/test/scala/beam/physsim/travelTime/PhysSimTravelTimeWithCACCPickUpsDropOffs.scala index f1cee00df89..989c0f071a4 100644 --- a/src/test/scala/beam/physsim/travelTime/PhysSimTravelTimeWithCACCPickUpsDropOffs.scala +++ b/src/test/scala/beam/physsim/travelTime/PhysSimTravelTimeWithCACCPickUpsDropOffs.scala @@ -77,7 +77,7 @@ class PhysSimTravelTimeWithCACCPickUpsDropOffs extends AnyWordSpec with Matchers val isCACCVehicle: java.util.Map[String, java.lang.Boolean] = beamvilleAllVehiclesFromSimulation .map { vehId => - vehId.toString -> new java.lang.Boolean(true) + vehId.toString -> java.lang.Boolean.valueOf(true) } .toMap .asJava From 67f2cd39336e869d66d4a4c06c58bc392facb33c Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 14 Jul 2022 20:46:59 +0600 Subject: [PATCH 226/307] Use gradle local jupyter task to run jupyter in lambda --- .../python/beam_lambda/lambda_function.py | 22 +++++-------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index aa2674a9b03..4a9dd00cfce 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -132,27 +132,10 @@ echo $timestamp_CPU, $ram_used_available done path: /home/ubuntu/write-cpu-ram-usage.sh - - content: | - #!/bin/bash - pip install setuptools - pip install jupyter - path: /home/ubuntu/install-jupyter.sh - - content: | - #!/bin/bash - JUPYTER_TOKEN=$JUPYTER_TOKEN jupyter-notebook --no-browser --ip=$(ec2metadata --public-hostname) --log-level=ERROR - path: /home/ubuntu/run-jupyter.sh runcmd: - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh - - sudo chmod +x /home/ubuntu/install-jupyter.sh - - sudo chmod +x /home/ubuntu/run-jupyter.sh - - if [ "$RUN_JUPYTER" = "True" ] - - then - - echo "Installing and starting Jupyter" - - /home/ubuntu/install-jupyter.sh - - su -c "/home/ubuntu/run-jupyter.sh &" - ubuntu - - fi - cd /home/ubuntu - ./write-cpu-ram-usage.sh 20 > cpu_ram_usage.csv & - cd /home/ubuntu/git @@ -243,6 +226,11 @@ - crontab /tmp/slack_notification - crontab -l - echo "notification scheduled..." + + - if [ "$RUN_JUPYTER" = "True" ] + - then + - ./gradlew jupyterStart -PjupyterToken=$JUPYTER_TOKEN + - fi - 'echo "gradlew assemble: $(date)"' - ./gradlew assemble From 56f46fe0652b93711ef2aef92d59f4f4b25f0638 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 14 Jul 2022 20:26:33 -0700 Subject: [PATCH 227/307] fixing multinomialLogit --- src/main/R/gemini/gemini-main.R | 6 +- src/main/R/gemini/gemini-processing.R | 78 +++++++++++++++++++ src/main/python/gemini/events_processing.py | 5 +- src/main/python/gemini/events_processing2.py | 20 +++++ src/main/resources/beam-template.conf | 10 +-- .../infrastructure/ChargingFunctions.scala | 2 +- .../infrastructure/ParkingFunctions.scala | 2 +- .../ParkingManagerBenchmark.scala | 8 +- .../scala/beam/sim/config/BeamConfig.scala | 24 +++--- 9 files changed, 127 insertions(+), 28 deletions(-) create mode 100644 src/main/python/gemini/events_processing2.py diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 1228c0094cd..06d7feb3832 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -27,7 +27,7 @@ expFactor <- (6.015/0.6015) severity_order <- c("Public <1MW", "Public 1-5MW", "Public >5MW", "Ridehail Depot <1MW", "Ridehail Depot 1-5MW", "Ridehail Depot >5MW") extreme_lab_order <- c("<1MW", "1-5MW", ">5MW") -dataDir <- normalizePath("~/Data/GEMINI/2022-04-27-Calibration") +dataDir <- normalizePath("~/Data/GEMINI/2022-07-05") #events <- readCsv(pp(dataDir, "/events/0.events.BASE.csv.gz")) #eventsDir <- paste(dataDir, "/events",sep="") resultsDir <- paste(dataDir, "/results",sep="") @@ -69,12 +69,12 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('Scenario2', 'Scenario2-010', 'Scenario2-025', 'Scenario2-050') # scenarioNames <- c('Scenario4', 'Scenario4Bis', 'Scenario4Bis2', 'Scenario4Bis3', 'Scenario4Bis4', 'Scenario4Bis5') # scenarioNames <- c('Scenario4a-Base', 'Scenario4b-Base', 'Scenario6-HighEV') -scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') +# scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') # scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5') # scenarioNames <- c('5b1', '5b2') # scenarioNames <- c('5b3', '5b4', '5b5', '5b6', '5b7') -#scenarioNames <- c('BaseXFC', 'HighEV') +scenarioNames <- c('BaseXFC', 'HighEV') #scenarioBaselineLabel <- 'BaseXFC' scenarioBaselineLabel <- '5b1' #all.loads <- all.loads[!is.na(loadType)] diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 5037ae8caec..732f2e1d1fd 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -933,4 +933,82 @@ ev <- park.test.2[startsWith(i.vehicleType,"ev-")] phev <- park.test.2[startsWith(i.vehicleType,"phev-")] allev <- rbind(ev,phev) +#### processing PT + +ev <- readCsv(pp(workDir, "/2022-07-05/events/filtered.15.events.csv.gz")) +pt <- readCsv(pp(workDir, "/2022-07-05/events/ptmc.15.events.csv.gz")) + +ev0 <- readCsv(pp(workDir, "/2022-07-05/events/filtered.0.events.5bBase.csv.gz")) +sum(ev0[type=="RefuelSessionEvent"]$fuel) + +summary <- ev0[type=="RefuelSessionEvent",.(totFuel=sum(fuel)),by=.(chargingPointType)] +summary$share <- summary$totFuel / sum(summary$totFuel) +summary[order(chargingPointType)] + +plans <- readCsv(pp(workDir, "/2022-07-05/events/plans.csv.gz")) +ptmc <- readCsv(pp(workDir, "/2022-07-05/events/ptmc.0.events.csv.gz")) +pt5b <- readCsv(pp(workDir, "/2022-07-05/events/pt.0.events.5bBase.csv.gz")) +pt6 <- readCsv(pp(workDir, "/2022-07-05/events/pt.0.events.6HighEV.csv.gz")) + +pt <- ptmc[type=="PathTraversal"] +ptICE <- pt[startsWith(vehicleType,"conv-") | startsWith(vehicleType,"hev-")] +ptEV <- pt[startsWith(vehicleType,"ev-") | startsWith(vehicleType,"phev-")] + +ptAllVeh <- rbind(ptICE,ptEV) +ptAllVeh$durationInMin <- (ptAllVeh$arrivalTime-ptAllVeh$departureTime)/60.0 +ptICE$durationInMin <- (ptICE$arrivalTime-ptICE$departureTime)/60.0 +ptEV$durationInMin <- (ptEV$arrivalTime-ptEV$departureTime)/60.0 + +ggplot(ptAllVeh[durationInMin<=60], aes(x=durationInMin)) + + geom_histogram(color="black", fill="white") + +nrow(ptAllVeh[durationInMin<=5])/nrow(ptAllVeh) +nrow(ptAllVeh[durationInMin<=10])/nrow(ptAllVeh) + +under5 <- ptAllVeh[durationInMin<=5][,c("durationInMin", "driver", "primaryFuelType", + "departureTime", "arrivalTime", "primaryFuel", + "length", "vehicleType", "vehicle", "primaryFuelLevel", + "time", "startX", "startY", "endX", "endY")] + +write.csv( + under5[sample(.N,1000)][,ID:=paste(vehicle,time,sep="-")], + file = pp(workDir, "/2022-07-05/events/path.traversals.csv"), + row.names=FALSE, + quote=FALSE) + + +ptAllVeh$lengthInMile <- ptAllVeh$length/1609.0 +ptAllVeh$durationInHour <- ptAllVeh$durationInMin/60.0 +ptAllVeh$speedInMilePerHour <- ptAllVeh$lengthInMile/ptAllVeh$durationInHour + +ggplot(ptAllVeh[speedInMilePerHour<100], aes(x=speedInMilePerHour)) + + geom_histogram(color="black", fill="white") +ggplot(ptAllVeh[speedInMilePerHour>100], aes(x=speedInMilePerHour)) + + geom_histogram(color="black", fill="white") + + +ggplot(ptAllVeh[durationInMin<=10], aes(x=speedInMilePerHour)) + + geom_histogram(color="black", fill="white") + +nrow(ptAllVeh[durationInMin<=10&speedInMilePerHour>=100])/nrow(ptAllVeh) +nrow(ptAllVeh[durationInMin<=10&speedInMilePerHour<100&speedInMilePerHour>=50])/nrow(ptAllVeh) +nrow(ptAllVeh[durationInMin<=10&speedInMilePerHour<50&speedInMilePerHour>=40])/nrow(ptAllVeh) +nrow(ptAllVeh[durationInMin<=10&speedInMilePerHour<40&speedInMilePerHour>=30])/nrow(ptAllVeh) +nrow(ptAllVeh[durationInMin<=10&speedInMilePerHour<30])/nrow(ptAllVeh) + + +ptAllVeh$carOrRideHail <- "Car" +ptAllVeh[startsWith(vehicle,"rideHail")]$carOrRideHail <- "rideHail" +ggplot(ptAllVeh[durationInMin<=10&speedInMilePerHour>=80], aes(x=speedInMilePerHour, fill=carOrRideHail)) + + geom_histogram(color="black") + +nrow(ptAllVeh[durationInMin<=10&speedInMilePerHour>=50&carOrRideHail=="rideHail"]) + +mc <- ptmc[type=="ModeChoice"][!mode %in% c("walk", "bike", "walk_transit", "drive_transit", "ride_hail_transit", "bike_transit")] +mc$lengthInMile <- mc$length/1609 +ggplot(mc[lengthInMile<=50], aes(x=lengthInMile)) + + geom_histogram(color="black", fill="white") + +nrow(mc[lengthInMile<=5])/nrow(mc) +nrow(mc[lengthInMile<=10])/nrow(mc) diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 89c701b3816..4a75c427993 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,9 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022-04-27-Calibration/' -filename = '0.events.5b7.csv.gz' +work_directory = '~/Data/GEMINI/2022-07-05/' +# filename = '0.events.7Advanced.csv.gz' +filename = '15.events.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None diff --git a/src/main/python/gemini/events_processing2.py b/src/main/python/gemini/events_processing2.py new file mode 100644 index 00000000000..6ba53b45591 --- /dev/null +++ b/src/main/python/gemini/events_processing2.py @@ -0,0 +1,20 @@ +import pandas as pd +import os + +work_directory = '~/Data/GEMINI/2022-07-05/' +filename = '15.events.csv.gz' +full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) +print("reading " + filename) +compression = None +if full_filename.endswith(".gz"): + compression = 'gzip' +data = pd.read_csv(full_filename, sep=",", index_col=None, header=0, compression=compression) +print("filtering 1/2...") +data_filtered = data.loc[ + data.type.isin(["PathTraversal", "ModeChoice"]) +] +print("filtering 2/2...") +data_filtered2 = data_filtered +print("writing...") +data_filtered2.to_csv(work_directory + "events/ptmc." + filename) +print("END") diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index f37a22a4cc4..91417029ed7 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -160,11 +160,11 @@ beam.agentsim.agents.tripBehaviors.carUsage.minDistanceToTrainStop = "double | 0 beam.agentsim.agents.modeIncentive.filePath = "" beam.agentsim.agents.ptFare.filePath = "" -beam.agentsim.agents.parking.mulitnomialLogit.params.rangeAnxietyMultiplier = "double | -0.5" # fit range anxiety between [-1, 0] -beam.agentsim.agents.parking.mulitnomialLogit.params.distanceMultiplier = "double | -0.086" # based on 20m walk, VoT = $35/hr should be u=-1.0 -beam.agentsim.agents.parking.mulitnomialLogit.params.parkingPriceMultiplier = "double | -0.005" # based on avg. parking prices up to $200! -beam.agentsim.agents.parking.mulitnomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = "double | 1.0" # positive boost of 1.0 if true -beam.agentsim.agents.parking.mulitnomialLogit.params.enrouteDetourMultiplier = "double | -0.05" # based on skim travel time and the defined VoT for car trips +beam.agentsim.agents.parking.multinomialLogit.params.rangeAnxietyMultiplier = "double | -0.5" # fit range anxiety between [-1, 0] +beam.agentsim.agents.parking.multinomialLogit.params.distanceMultiplier = "double | -0.086" # based on 20m walk, VoT = $35/hr should be u=-1.0 +beam.agentsim.agents.parking.multinomialLogit.params.parkingPriceMultiplier = "double | -0.005" # based on avg. parking prices up to $200! +beam.agentsim.agents.parking.multinomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = "double | 1.0" # positive boost of 1.0 if true +beam.agentsim.agents.parking.multinomialLogit.params.enrouteDetourMultiplier = "double | -0.05" # based on skim travel time and the defined VoT for car trips beam.agentsim.agents.parking.rangeAnxietyBuffer = "double | 20000.0" # if our remaining range exceeds our remaining tour plus this many meters, then we feel no anxiety; default 20k beam.agentsim.agents.parking.minSearchRadius = "double | 250.00" # something small enough that, on average, we see 2 orders of magnitude of samples at most beam.agentsim.agents.parking.maxSearchRadius = "double | 8046.72" # something large enough that we do not strand our drivers in an oasis diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index c6ef6ec61fa..6fe430324b1 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -27,7 +27,7 @@ class ChargingFunctions( minNumberOfSameTypeZones: Int, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, skims: Option[Skims], fuelPrice: Map[FuelType, Double], estimatedMinParkingDurationInSeconds: Double diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala index ab8d9ee5fc4..8d0ec16d579 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingFunctions.scala @@ -26,7 +26,7 @@ class ParkingFunctions( minNumberOfSameTypeZones: Int, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, estimatedMinParkingDurationInSeconds: Double ) extends InfrastructureFunctions( geoQuadTree, diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala index 53271af0e51..d1b06fe0512 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala @@ -82,10 +82,10 @@ object ParkingManagerBenchmark extends StrictLogging { """ |beam.agentsim.agents.parking.minSearchRadius = 250.00 |beam.agentsim.agents.parking.maxSearchRadius = 8046.72 - |beam.agentsim.agents.parking.mulitnomialLogit.params.rangeAnxietyMultiplier = -0.5 - |beam.agentsim.agents.parking.mulitnomialLogit.params.distanceMultiplier = -0.086 - |beam.agentsim.agents.parking.mulitnomialLogit.params.parkingPriceMultiplier = -0.5 - |beam.agentsim.agents.parking.mulitnomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = 2.0 + |beam.agentsim.agents.parking.multinomialLogit.params.rangeAnxietyMultiplier = -0.5 + |beam.agentsim.agents.parking.multinomialLogit.params.distanceMultiplier = -0.086 + |beam.agentsim.agents.parking.multinomialLogit.params.parkingPriceMultiplier = -0.5 + |beam.agentsim.agents.parking.multinomialLogit.params.homeActivityPrefersResidentialParkingMultiplier = 2.0 | |parallel-parking-manager-dispatcher { | executor = "thread-pool-executor" diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index f01b860f423..8b962c97d62 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -720,7 +720,7 @@ object BeamConfig { maxSearchRadius: scala.Double, minNumberOfSameTypeZones: scala.Int, minSearchRadius: scala.Double, - mulitnomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, overnightChargingSampleSize: scala.Double, rangeAnxietyBuffer: scala.Double, searchMaxDistanceRelativeToEllipseFoci: scala.Double @@ -728,11 +728,11 @@ object BeamConfig { object Parking { - case class MulitnomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params + case class MultinomialLogit( + params: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params ) - object MulitnomialLogit { + object MultinomialLogit { case class Params( distanceMultiplier: scala.Double, @@ -746,8 +746,8 @@ object BeamConfig { def apply( c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( + ): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( distanceMultiplier = if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, enrouteDetourMultiplier = @@ -764,9 +764,9 @@ object BeamConfig { } } - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit = { - BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit.Params( + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit = { + BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( if (c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}") ) @@ -786,9 +786,9 @@ object BeamConfig { minNumberOfSameTypeZones = if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - mulitnomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit( - if (c.hasPathOrNull("mulitnomialLogit")) c.getConfig("mulitnomialLogit") - else com.typesafe.config.ConfigFactory.parseString("mulitnomialLogit{}") + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") ), overnightChargingSampleSize = if (c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0.0, From 251ff484808cab8f97a89400726362c5f9f8294b Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 14 Jul 2022 20:28:26 -0700 Subject: [PATCH 228/307] fixing compilation error --- .../beam/agentsim/infrastructure/ChargingNetwork.scala | 2 +- .../infrastructure/HierarchicalParkingManager.scala | 6 +++--- .../beam/agentsim/infrastructure/InfrastructureUtils.scala | 2 +- .../agentsim/infrastructure/ParallelParkingManager.scala | 4 ++-- .../agentsim/infrastructure/ParkingManagerBenchmark.scala | 2 +- .../beam/agentsim/infrastructure/ZonalParkingManager.scala | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 5bf49472279..62315d33f61 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -174,7 +174,7 @@ object ChargingNetwork extends LazyLogging { beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, envelopeInUTM, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, skims, fuelPrice, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds diff --git a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala index 65e877a46ae..bfddd282f09 100644 --- a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala @@ -36,7 +36,7 @@ class HierarchicalParkingManager( maxSearchRadius: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, estimatedMinParkingDurationInSeconds: Double, checkThatNumberOfStallsMatch: Boolean = false ) extends ParkingNetwork(parkingZones) { @@ -258,7 +258,7 @@ object HierarchicalParkingManager { maxSearchRadius: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, estimatedMinParkingDurationInSeconds: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork = { @@ -284,7 +284,7 @@ object HierarchicalParkingManager { maxSearchRadius: Double, boundingBox: Envelope, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, estimatedMinParkingDurationInSeconds: Double, checkThatNumberOfStallsMatch: Boolean = false ): ParkingNetwork = diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala index 073eb38ec63..d8d8d01c642 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala @@ -142,7 +142,7 @@ object InfrastructureUtils extends LazyLogging { beamConfig.beam.agentsim.agents.parking.maxSearchRadius, envelopeInUTM, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) case "PARALLEL" => diff --git a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala index 7d5da11e5ce..fb17dac361e 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala @@ -41,7 +41,7 @@ class ParallelParkingManager( fractionOfSameTypeZones: Double, minNumberOfSameTypeZones: Int, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, estimatedMinParkingDurationInSeconds: Double ) extends ParkingNetwork(parkingZones) { @@ -189,7 +189,7 @@ object ParallelParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.fractionOfSameTypeZones, beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) } diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala index d1b06fe0512..19131214066 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingManagerBenchmark.scala @@ -198,7 +198,7 @@ object ParkingManagerBenchmark extends StrictLogging { beamConfig.beam.agentsim.agents.parking.maxSearchRadius, boundingBox, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) diff --git a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala index 1bc48d88a09..0d404a1b760 100755 --- a/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ZonalParkingManager.scala @@ -41,7 +41,7 @@ object ZonalParkingManager extends LazyLogging { fractionOfSameTypeZones: Double, minNumberOfSameTypeZones: Int, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, estimatedMinParkingDurationInSeconds: Double ): ZonalParkingManager = { new ZonalParkingManager(parkingZones) { @@ -95,7 +95,7 @@ object ZonalParkingManager extends LazyLogging { beamConfig.beam.agentsim.agents.parking.fractionOfSameTypeZones, beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, beamConfig.matsim.modules.global.randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) } @@ -115,7 +115,7 @@ object ZonalParkingManager extends LazyLogging { minSearchRadius: Double, maxSearchRadius: Double, seed: Int, - mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MulitnomialLogit, + mnlParkingConfig: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, beamConfig: BeamConfig, beamServicesMaybe: Option[BeamServices] ): ZonalParkingManager = { From 705ccc26c573f057d19e46c69f9762f1a119f572 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 14 Jul 2022 20:30:08 -0700 Subject: [PATCH 229/307] adding gemini infrstructure R and merge --- src/main/R/gemini/gemini-infrastructure.R | 134 ++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 src/main/R/gemini/gemini-infrastructure.R diff --git a/src/main/R/gemini/gemini-infrastructure.R b/src/main/R/gemini/gemini-infrastructure.R new file mode 100644 index 00000000000..7a8d264a42f --- /dev/null +++ b/src/main/R/gemini/gemini-infrastructure.R @@ -0,0 +1,134 @@ +setwd(dirname(rstudioapi::getSourceEditorContext()$path)) +source("../common/helpers.R") +source("../common/theme.R") +source("gemini-utils.R") +library('colinmisc') +library(dplyr) +library(ggplot2) + +geminiDir <- normalizePath("~/Data/GEMINI") +infraDir <- pp(geminiDir,"/2022-04-28/_models/infrastructure") + + +infra5aBase <- readCsv(pp(infraDir, "/4a_output_2022_Apr_13_pubClust_withFees_noHousehold.csv")) +infra5bBase <- readCsv(pp(infraDir, "/4b_output_2022_Apr_13_pubClust_withFees_noHousehold.csv")) +infra6Base <- readCsv(pp(infraDir, "/6_output_2022_Apr_13_pubClust_withFees_noHousehold.csv")) + +aggregateInfrastructure <- function(FILE_NAME) { + DATA <- readCsv(pp(infraDir, "/", FILE_NAME, ".csv")) + DATA_agg <- DATA[,.(feeInCents=mean(feeInCents),numStalls=sum(numStalls)),by=.(taz,parkingType,chargingPointType,reservedFor,pricingModel)] + DATA_agg <- DATA_agg[,`:=`(IDX = 1:.N),by=taz] + DATA_agg$parkingZoneId <- paste("site",DATA_agg$taz,DATA_agg$IDX,sep="-") + DATA_agg <- DATA_agg[,-c("IDX")] + DATA_merge <- merge(DATA, DATA_agg, by=c("taz","parkingType","chargingPointType","reservedFor","pricingModel"), all = TRUE) + setnames(DATA_merge, "parkingZoneId.x", "parkingZoneId") + setnames(DATA_merge, "feeInCents.x", "feeInCents") + setnames(DATA_merge, "numStalls.x", "numStalls") + setnames(DATA_merge, "parkingZoneId.y", "siteId") + DATA_merge <- DATA_merge[,-c("feeInCents.y","numStalls.y")] + print(pp("printing... ", pp(infraDir, "/", FILE_NAME, "_siteId.csv"))) + write.csv( + DATA_merge, + file = pp(infraDir, "/", FILE_NAME, "_siteId.csv"), + row.names=FALSE, + quote=FALSE) + print(pp("printing... ", pp(infraDir, "/", FILE_NAME, "_aggregated.csv"))) + write.csv( + DATA_agg, + file = pp(infraDir, "/", FILE_NAME, "_aggregated.csv"), + row.names=FALSE, + quote=FALSE) + print("END aggregateInfrastructure") +} + +aggregateInfrastructure("4b_output_2022_Apr_13_pubClust_withFees_noHousehold") + +aggregateInfrastructure("6_output_2022_Apr_13_pubClust_withFees_noHousehold") + + + + + +infra5bBase_agg <- infra5bBase[,.(feeInCents=mean(feeInCents),numStalls=sum(numStalls)),by=.(taz,parkingType,chargingPointType,reservedFor,pricingModel)] +infra5bBase_agg <- infra5bBase_agg[,`:=`(IDX = 1:.N),by=taz] +infra5bBase_agg$parkingZoneId <- paste(infra5bBase_agg$taz,infra5bBase_agg$IDX,sep="-") +infra5bBase_agg <- infra5bBase_agg[,-c("IDX")] +infra5bBase_merge <- merge(infra5bBase, infra5bBase_agg, by=c("taz","parkingType","chargingPointType","reservedFor","pricingModel"), all = TRUE) + +infra5bBase_merge <- infra5bBase_merge[,c-("")] +setnames(infra5bBase_merge, "parkingZoneId.x", "parkingZoneId") +setnames(infra5bBase_merge, "feeInCents.x", "feeInCents") +setnames(infra5bBase_merge, "numStalls.x", "numStalls") +setnames(infra5bBase_merge, "parkingZoneId.y", "siteId") +infra5bBase_merge <- infra5bBase_merge[,-c("feeInCents.y","numStalls.y")] +write.csv( + infra5bBase_merge, + file = pp(infraDir, "/6_output_2022_Apr_13_pubClust_withFees_noHousehold.csv"), + row.names=FALSE, + quote=FALSE) + + + + +infra5aBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/4a_output_2022_Apr_13_pubClust_withFees_aggregated.csv")) +infra5bBase <- readCsv(pp(workDir, "/2022-04-28/_models/infrastructure/6_output_2022_Apr_13_pubClust_withFees_noHousehold.csv")) +infra5bBase[startsWith(reservedFor,"household")]$reservedFor <- "Any" +infra5bBase_NH <- infra5bBase[ + ,.(parkingZoneId=first(parkingZoneId),feeInCents=mean(feeInCents),numStalls=sum(numStalls)) + ,b=.(taz,parkingType,chargingPointType,X,Y,reservedFor,pricingModel)] +write.csv( + infra5bBase_NH, + file = pp(workDir, "/2022-04-28/_models/infrastructure/6_output_2022_Apr_13_pubClust_withFees_noHousehold.csv"), + row.names=FALSE, + quote=FALSE) + +vehicles1 <- readCsv(pp(workDir, "/vehicles.4Base.csv")) +vehicles1$stateOfCharge <- as.double(vehicles1$stateOfCharge) +vehicles1[is.na(stateOfCharge)]$stateOfCharge <- 1.0 +vehicles1[is.infinite(stateOfCharge)]$stateOfCharge <- 1.0 + +vehicles2 <- readCsv(pp(workDir, "/2.final_vehicles.5bBase.csv")) +vehicles2$stateOfCharge <- as.double(vehicles2$stateOfCharge) +vehicles2[is.na(stateOfCharge)]$stateOfCharge <- 0.5 +vehicles2[is.infinite(stateOfCharge)]$stateOfCharge <- 0.5 +vehicles2$stateOfCharge <- abs(vehicles2$stateOfCharge) +vehicles2[stateOfCharge < 0.2]$stateOfCharge <- 0.2 +vehicles2[stateOfCharge > 1]$stateOfCharge <- 1.0 + +vehicles3 <- rbind(vehicles1, vehicles2)[ + ,.(stateOfCharge=min(stateOfCharge)) + ,by=.(vehicleId,vehicleTypeId,householdId)] + +write.csv( + vehicles3, + file = pp(workDir, "/new.vehicles.5bBase.csv"), + row.names=FALSE, + quote=FALSE) + + +#### SITE CAPACITY + +sites <- infra5bBase[,.(numStalls=sum(numStalls)),by=.(taz,parkingType,chargingPointType,reservedFor,pricingModel)] + +sites[,kw:=unlist(lapply(str_split(as.character(chargingPointType),'\\('),function(ll){ as.numeric(str_split(ll[2],'\\|')[[1]][1])}))] +sites[,kwTot:=kw*numStalls] +sites[,plug.xfc:=(kw>=200)] +sites[,site.xfc:=(kwTot>=1000)] +nrow(sites) +nrow(sites[plug.xfc == TRUE | site.xfc == TRUE]) +nrow(sites[plug.xfc == TRUE & site.xfc == TRUE]) +nrow(sites[plug.xfc == TRUE]) +nrow(sites[site.xfc == TRUE]) + +fast_sites <- sites[kw >= 100] +nrow(fast_sites) +nrow(fast_sites[plug.xfc == TRUE | site.xfc == TRUE]) +nrow(fast_sites[plug.xfc == TRUE & site.xfc == TRUE]) +nrow(fast_sites[plug.xfc == TRUE]) +nrow(fast_sites[site.xfc == TRUE]) + + +sites[plug.xfc] + + + From a07512d05bea8d29d728624698f9c615b9b41b01 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Thu, 14 Jul 2022 20:31:41 -0700 Subject: [PATCH 230/307] fix more errors --- .../HierarchicalParkingManagerSpec.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala index b73d07b6b5b..f781d6ebe05 100644 --- a/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/HierarchicalParkingManagerSpec.scala @@ -77,7 +77,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) @@ -117,7 +117,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) @@ -174,7 +174,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) @@ -247,7 +247,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) @@ -333,7 +333,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) @@ -387,7 +387,7 @@ class HierarchicalParkingManagerSpec 8000.0, boundingBox, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, checkThatNumberOfStallsMatch = true ) From dccfd5f79ec8039a145684e6d6142a96808344d2 Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Fri, 15 Jul 2022 16:11:22 +0300 Subject: [PATCH 231/307] Removed outdated job from cron, renamed file that contains cron tasks --- aws/src/main/python/beam_lambda/lambda_function.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index a581c31b066..ed31a6f81aa 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -97,10 +97,9 @@ curl -X POST -H 'Content-type: application/json' --data-binary @/tmp/slack.json $SLACK_HOOK_WITH_TOKEN path: /tmp/slack.sh - content: | - 0 * * * * curl -X POST -H "Content-type: application/json" --data '"'"'{"$(ec2metadata --instance-type) instance $(ec2metadata --instance-id) running... \\n Batch [$UID] completed and instance of type $(ec2metadata --instance-type) is still running in $REGION since last $(($(($(date +%s) - $(cat /tmp/.starttime))) / 3600)) Hour $(($(($(date +%s) - $(cat /tmp/.starttime))) / 60)) Minute."}'"'" */10 * * * * /home/ubuntu/beam_stuck_guard.sh - path: /tmp/slack_notification + path: /tmp/cron_jobs - content: | #!/bin/bash pip install setuptools @@ -246,7 +245,7 @@ - chmod +x /tmp/slack.sh - echo "notification sent..." - echo "notification saved..." - - crontab /tmp/slack_notification + - crontab /tmp/cron_jobs - crontab -l - echo "notification scheduled..." From 68dfc5e43e26802795b15b2d6b6d30a5e37bbb93 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Sat, 16 Jul 2022 13:12:47 +0600 Subject: [PATCH 232/307] Fix Jupyter start --- aws/src/main/python/beam_lambda/lambda_function.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 4a9dd00cfce..294691b0cff 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -229,7 +229,8 @@ - if [ "$RUN_JUPYTER" = "True" ] - then - - ./gradlew jupyterStart -PjupyterToken=$JUPYTER_TOKEN + - echo "Starting Jupyter" + - sudo ./gradlew jupyterStart -PjupyterToken=$JUPYTER_TOKEN - fi - 'echo "gradlew assemble: $(date)"' From 8da7907a5677e6759278597df882a421288b01ac Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 18 Jul 2022 18:55:59 -0700 Subject: [PATCH 233/307] fmt --- src/main/R/gemini/gemini-processing.R | 27 ++- src/main/python/gemini/events_processing.py | 2 +- src/main/python/gemini/events_processing2.py | 2 +- .../infrastructure/ChargingNetwork.scala | 17 +- .../ChargingNetworkManager.scala | 25 ++- .../infrastructure/ScaleUpCharging.scala | 191 ++++++++---------- .../ZonalParkingManagerSpec.scala | 8 +- .../power/SitePowerManagerSpec.scala | 4 +- .../scala/beam/integration/ChargingSpec.scala | 2 +- 9 files changed, 154 insertions(+), 124 deletions(-) diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 732f2e1d1fd..318cbd52a62 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -936,11 +936,21 @@ allev <- rbind(ev,phev) #### processing PT -ev <- readCsv(pp(workDir, "/2022-07-05/events/filtered.15.events.csv.gz")) -pt <- readCsv(pp(workDir, "/2022-07-05/events/ptmc.15.events.csv.gz")) +ev <- readCsv(pp(workDir, "/2022-07-05/events/filtered.0.events.csv.gz")) +pt <- readCsv(pp(workDir, "/2022-07-05/events/ptmc.0.events.csv.gz")) ev0 <- readCsv(pp(workDir, "/2022-07-05/events/filtered.0.events.5bBase.csv.gz")) -sum(ev0[type=="RefuelSessionEvent"]$fuel) +sum(ev0[type=="RefuelSessionEvent"]$fuel)/sum(ev[type=="RefuelSessionEvent"]$fuel) +length(unique(ev0[startsWith(vehicle, "VirtualCar-")]$vehicle)) +length(unique(ev0[!startsWith(vehicle, "VirtualCar-")]$vehicle)) + + +ev1 <- readCsv(pp(workDir, "/2022-07-05/events/filtered.0.events.40p.csv.gz")) +sum(ev1[type=="RefuelSessionEvent"]$fuel)/sum(ev[type=="RefuelSessionEvent"]$fuel) +length(unique(ev1[startsWith(vehicle, "VirtualCar-")]$vehicle)) +length(unique(ev1[!startsWith(vehicle, "VirtualCar-")]$vehicle)) + + summary <- ev0[type=="RefuelSessionEvent",.(totFuel=sum(fuel)),by=.(chargingPointType)] summary$share <- summary$totFuel / sum(summary$totFuel) @@ -1012,3 +1022,14 @@ ggplot(mc[lengthInMile<=50], aes(x=lengthInMile)) + nrow(mc[lengthInMile<=5])/nrow(mc) nrow(mc[lengthInMile<=10])/nrow(mc) + + +lognormal <- function(m, v, sample_size) { + phi <- sqrt(v + m^2); + mu <- log((m^2)/phi) + sigma <- sqrt(log((phi^2)/(m^2))) + x <- rnorm(sample_size, mean=mu, sd=sigma) + exp(x) +} + + diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 4a75c427993..d211b4c3ac9 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -3,7 +3,7 @@ work_directory = '~/Data/GEMINI/2022-07-05/' # filename = '0.events.7Advanced.csv.gz' -filename = '15.events.csv.gz' +filename = '0.events.40p.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None diff --git a/src/main/python/gemini/events_processing2.py b/src/main/python/gemini/events_processing2.py index 6ba53b45591..25ef138f780 100644 --- a/src/main/python/gemini/events_processing2.py +++ b/src/main/python/gemini/events_processing2.py @@ -2,7 +2,7 @@ import os work_directory = '~/Data/GEMINI/2022-07-05/' -filename = '15.events.csv.gz' +filename = '0.events.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index 62315d33f61..d5b7710696b 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -84,6 +84,7 @@ class ChargingNetwork(val parkingZones: Map[Id[ParkingZoneId], ParkingZone]) ext */ def processChargingPlugRequest( request: ChargingPlugRequest, + estimatedParkingDuration: Int, activityType: String, theSender: ActorRef ): Option[ChargingVehicle] = lookupStation(request.stall.parkingZoneId) @@ -93,6 +94,7 @@ class ChargingNetwork(val parkingZones: Map[Id[ParkingZoneId], ParkingZone]) ext request.vehicle, request.stall, request.personId, + estimatedParkingDuration, activityType, request.shiftStatus, request.shiftDuration, @@ -274,6 +276,7 @@ object ChargingNetwork extends LazyLogging { vehicle: BeamVehicle, stall: ParkingStall, personId: Id[Person], + estimatedParkingDuration: Int, activityType: String, shiftStatus: ShiftStatus = NotApplicable, shiftDuration: Option[Int] = None, @@ -288,7 +291,18 @@ object ChargingNetwork extends LazyLogging { chargingVehicle case _ => val chargingVehicle = - ChargingVehicle(vehicle, stall, this, tick, personId, activityType, shiftStatus, shiftDuration, theSender) + ChargingVehicle( + vehicle, + stall, + this, + tick, + personId, + estimatedParkingDuration, + activityType, + shiftStatus, + shiftDuration, + theSender + ) if (numAvailableChargers > 0) { chargingVehiclesInternal.put(vehicle.id, chargingVehicle) chargingVehicle.updateStatus(Connected, tick) @@ -370,6 +384,7 @@ object ChargingNetwork extends LazyLogging { chargingStation: ChargingStation, arrivalTime: Int, personId: Id[Person], + estimatedParkingDuration: Int, activityType: String, shiftStatus: ShiftStatus, shiftDuration: Option[Int], diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 3a59e66982a..6460320a060 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -10,6 +10,7 @@ import beam.agentsim.agents.vehicles.VehicleManager.ReservedFor import beam.agentsim.agents.vehicles._ import beam.agentsim.events.RefuelSessionEvent.{NotApplicable, ShiftStatus} import beam.agentsim.infrastructure.ChargingNetwork.{ChargingStation, ChargingStatus, ChargingVehicle} +import beam.agentsim.infrastructure.ParkingInquiry.ParkingActivityType import beam.agentsim.infrastructure.ParkingInquiry.ParkingSearchMode.EnRouteCharging import beam.agentsim.infrastructure.power.{PowerController, SitePowerManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} @@ -155,7 +156,7 @@ class ChargingNetworkManager( None } vehicleEndedCharging match { - case Some(ChargingVehicle(_, _, _, _, _, _, _, _, theSender, _, _)) => + case Some(ChargingVehicle(_, _, _, _, _, _, _, _, _, theSender, _, _)) => theSender ! EndingRefuelSession(tick, vehicle.id, triggerId) case _ => sender ! CompletionNotice(triggerId) @@ -165,18 +166,24 @@ class ChargingNetworkManager( log.debug(s"ChargingPlugRequest received for vehicle $vehicle at $tick and stall ${vehicle.stall}") val responseHasTriggerId = if (vehicle.isEV) { // connecting the current vehicle - val activityType = vehicle2InquiryMap + val (parkingDuration, activityType) = vehicle2InquiryMap .get(vehicle.id) .map { - case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, searchMode, _, _) + case ParkingInquiry(_, activityType, _, _, _, _, _, parkingDuration, _, _, searchMode, _, _) if searchMode == EnRouteCharging => - "EnRoute-" + activityType - case ParkingInquiry(_, activityType, _, _, _, _, _, _, _, _, _, _, _) => activityType + (parkingDuration, "EnRoute-" + activityType) + case ParkingInquiry(_, activityType, _, _, _, _, _, parkingDuration, _, _, _, _, _) => + (parkingDuration, activityType) } - .getOrElse("") + .getOrElse( + ( + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds, + ParkingActivityType.Wherever.toString + ) + ) chargingNetworkHelper .get(stall.reservedFor.managerId) - .processChargingPlugRequest(request, activityType, sender()) map { + .processChargingPlugRequest(request, parkingDuration.toInt, activityType, sender()) map { case chargingVehicle if chargingVehicle.chargingStatus.last.status == WaitingAtStation => log.debug( s"Vehicle $vehicle is moved to waiting line at $tick in station ${chargingVehicle.chargingStation}, " + @@ -188,8 +195,8 @@ class ChargingNetworkManager( WaitingToCharge(tick, vehicle.id, triggerId) case chargingVehicle => vehicle2InquiryMap.remove(vehicle.id) - handleStartCharging(tick, chargingVehicle, triggerId = triggerId) collectVehicleRequestInfo(chargingVehicle) + handleStartCharging(tick, chargingVehicle, triggerId = triggerId) StartingRefuelSession(tick, triggerId) } getOrElse Failure( new RuntimeException( @@ -208,7 +215,7 @@ class ChargingNetworkManager( val responseHasTriggerId = vehicle.stall match { case Some(stall) => chargingNetworkHelper.get(stall.reservedFor.managerId).disconnectVehicle(vehicle.id, tick) match { - case Some(chargingVehicle @ ChargingVehicle(_, _, station, _, _, _, _, _, _, listStatus, sessions)) => + case Some(chargingVehicle @ ChargingVehicle(_, _, station, _, _, _, _, _, _, _, listStatus, sessions)) => if (sessions.nonEmpty && !listStatus.exists(_.status == GracePeriod)) { // If the vehicle was still charging val unplugTime = currentTimeBin(tick) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index e6be2b71d4d..50599af6742 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -12,7 +12,6 @@ import beam.agentsim.infrastructure.taz.{TAZ, TAZTreeMap} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger import beam.agentsim.scheduler.Trigger.TriggerWithId -import beam.utils.BeamVehicleUtils.toPowerInKW import beam.utils.MathUtils.roundUniformly import beam.utils.{MathUtils, VehicleIdGenerator} import org.apache.commons.math3.distribution.EnumeratedDistribution @@ -143,79 +142,64 @@ trait ScaleUpCharging extends { .par .mapValues(_.map { case ((_, parkingActivityType), data) => val numObservation = data.size - val totPowerInKW = data.map(x => toPowerInKW(x.energyToChargeInJoule, x.durationToChargeInSec)).sum - val durationList = data.map(_.durationToChargeInSec) - val socList = data.map(x => x.remainingFuelInJoule / x.fuelCapacityInJoule) - val energyList = data.map(_.energyToChargeInJoule) - val fuelCapacityList = data.map(_.fuelCapacityInJoule) - val meanDur: Double = durationList.sum / numObservation.toDouble - val meanSOC: Double = socList.sum / numObservation.toDouble - val meanEnergy: Double = energyList.sum / energyList.size.toDouble - val meanFuelCapacity: Double = fuelCapacityList.sum / numObservation.toDouble - val pmfActivityType = - data - .groupBy(_.activityType) - .map { case (activityType, elems) => - new CPair[String, java.lang.Double](activityType, elems.size.toDouble) - } - .toVector - val pmfVehicleType = - data - .groupBy(_.vehicleType) - .map { case (vehicleType, elems) => - new CPair[BeamVehicleType, java.lang.Double](vehicleType, elems.size.toDouble) - } - .toVector + val listDur = data.map(_.durationToChargeInSec) + val totDurationInSec = listDur.sum + val meanDur: Double = listDur.sum / numObservation.toDouble + val varianceDur: Double = listDur.map(d => math.pow(d - meanDur, 2)).sum / numObservation + val listSOC = data.map(_.stateOfCharge) + val meanSOC: Double = listSOC.sum / numObservation.toDouble + val varianceSOC: Double = listSOC.map(soc => math.pow(soc - meanSOC, 2)).sum / numObservation + val pmfVehicleTypeInfo = data + .groupBy(record => (record.vehicleType, record.activityType, record.vehicleAlias, record.reservedFor)) + .map { case ((vehicleType, activityType, vehicleAlias, reservedFor), elems) => + new CPair[VehicleTypeInfo, java.lang.Double]( + VehicleTypeInfo(vehicleType, activityType, vehicleAlias, reservedFor), + elems.size.toDouble + ) + } + .toVector val vehicleInfoSummary = VehicleInfoSummary( numObservation = numObservation, - totPowerInKW = totPowerInKW, - meanDur = meanDur, + totDurationInSec = totDurationInSec, + meanDuration = meanDur, + varianceDuration = varianceDur, meanSOC = meanSOC, - meanEnergy = meanEnergy, - meanFuelCapacity = meanFuelCapacity, - stdDevDur = Math.sqrt(durationList.map(_ - meanDur).map(t => t * t).sum / numObservation), - stdDevSOC = Math.sqrt(socList.map(_ - meanSOC).map(t => t * t).sum / numObservation), - stdDevEnergy = Math.sqrt(energyList.map(_ - meanEnergy).map(t => t * t).sum / numObservation), - stdFuelCapacity = Math.sqrt(fuelCapacityList.map(_ - meanFuelCapacity).map(t => t * t).sum / numObservation), - new EnumeratedDistribution[String](mersenne, pmfActivityType.asJava), - new EnumeratedDistribution[BeamVehicleType](mersenne, pmfVehicleType.asJava) + varianceSOC = varianceSOC, + new EnumeratedDistribution[VehicleTypeInfo](mersenne, pmfVehicleTypeInfo.asJava) ) parkingActivityType -> (data, vehicleInfoSummary) }) .flatMap { case (tazId, activityType2vehicleInfo) => val partialTriggersAndInquiries = Vector.newBuilder[(ScheduleTrigger, ParkingInquiry)] activityType2vehicleInfo.foldLeft((0.0, 0.0, Vector.empty[CPair[ParkingActivityType, java.lang.Double]])) { - case ((powerAcc, numEventsAcc, pmfAcc), (activityType, (_, dataSummary))) => - val power = (scaleUpFactors.getOrElse(activityType, defaultScaleUpFactor) - 1) * dataSummary.totPowerInKW - val pmf = new CPair[ParkingActivityType, java.lang.Double](activityType, power) - val numEvents = - (scaleUpFactors.getOrElse(activityType, defaultScaleUpFactor) - 1) * dataSummary.numObservation - (powerAcc + power, numEventsAcc + numEvents, pmfAcc :+ pmf) + case ((durationAcc, numEventsAcc, pmfAcc), (activityType, (_, dataSummary))) => + val scaleUpFactor = scaleUpFactors.getOrElse(activityType, defaultScaleUpFactor) - 1 + val duration = scaleUpFactor * dataSummary.totDurationInSec + val pmf = new CPair[ParkingActivityType, java.lang.Double](activityType, duration) + val numEvents = scaleUpFactor * dataSummary.numObservation + (durationAcc + duration, numEventsAcc + numEvents, pmfAcc :+ pmf) } match { - case (totPowerInKWToSimulate, totNumberOfEvents, pmf) if totPowerInKWToSimulate > 0 => + case (totDurationInSecondsToSimulate, totNumberOfEvents, pmf) if totDurationInSecondsToSimulate > 0 => val distribution = new EnumeratedDistribution[ParkingActivityType](mersenne, pmf.asJava) val rate = totNumberOfEvents / timeStepByHour - var cumulatedSimulatedPower = 0.0 + var cumulatedSimulatedDuration = 0.0 var timeStep = 0 - while (cumulatedSimulatedPower < totPowerInKWToSimulate && timeStep < timeStepByHour * 3600) { + while (cumulatedSimulatedDuration < totDurationInSecondsToSimulate && timeStep < timeStepByHour * 3600) { val (_, summary) = activityType2vehicleInfo(distribution.sample()) val duration = summary.getDuration(rand) if (duration > 0) { - timeStep += roundUniformly(nextTimeStepUsingPoissonProcess(rate), rand).toInt val soc = summary.getSOC(rand) - val energyToCharge = summary.getEnergy(rand) + val vehicleTypeInfo = summary.vehicleTypeInfoDistribution.sample() + timeStep += roundUniformly(nextTimeStepUsingPoissonProcess(rate), rand).toInt val taz = getBeamServices.beamScenario.tazTreeMap.getTAZ(tazId).get val destinationUtm = TAZTreeMap.randomLocationInTAZ(taz, rand) - val vehicleType = summary.vehicleTypeDistribution.sample() - val activityType = summary.activityTypeDistribution.sample() - val reservedFor = VehicleManager.AnyManager - val beamVehicle = getBeamVehicle(vehicleType, reservedFor, soc) + val beamVehicle = getBeamVehicle(vehicleTypeInfo, soc) val personId = getPerson(beamVehicle.id) val startTime = timeBin + timeStep val parkingInquiry = ParkingInquiry( SpaceTime(destinationUtm, startTime), - activityType, - reservedFor, + vehicleTypeInfo.activityType, + vehicleTypeInfo.reservedFor, Some(beamVehicle), None, // remainingTripData Some(personId), @@ -225,7 +209,7 @@ trait ScaleUpCharging extends { triggerId = triggerId ) val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) - cumulatedSimulatedPower += toPowerInKW(energyToCharge, duration) + cumulatedSimulatedDuration += duration partialTriggersAndInquiries += ((trigger, parkingInquiry)) } } @@ -246,25 +230,22 @@ trait ScaleUpCharging extends { * @param chargingVehicle the vehicle that just plugged in */ protected def collectVehicleRequestInfo(chargingVehicle: ChargingVehicle): Unit = { - if (cnmConfig.scaleUp.enabled && !isVirtualCar(chargingVehicle.vehicle.id)) { - val (durationToCharge, energyToCharge) = - chargingVehicle.vehicle.refuelingSessionDurationAndEnergyInJoulesForStall( - Some(chargingVehicle.stall), - sessionDurationLimit = None, - stateOfChargeLimit = None, - chargingPowerLimit = None - ) + if (cnmConfig.scaleUp.enabled && !isSampledCar(chargingVehicle.vehicle.id)) { + val vehicle = chargingVehicle.vehicle + val stall = chargingVehicle.stall + val vehicleIdArray = vehicle.id.toString.split("-") + val vehicleAlias = if (vehicleIdArray.length > 1) vehicleIdArray(0) else "personalVehicle" vehicleRequests.synchronized { - val key = (chargingVehicle.stall.tazId, activityTypeStringToEnum(chargingVehicle.activityType)) + val key = (stall.tazId, activityTypeStringToEnum(chargingVehicle.activityType)) vehicleRequests.put( key, vehicleRequests.getOrElse(key, List.empty) :+ VehicleRequestInfo( - energyToCharge, - durationToCharge, - Math.max(chargingVehicle.vehicle.primaryFuelLevelInJoules, 0.0), - chargingVehicle.vehicle.beamVehicleType.primaryFuelCapacityInJoule, + chargingVehicle.estimatedParkingDuration, + Math.max(vehicle.primaryFuelLevelInJoules, 0.0) / vehicle.beamVehicleType.primaryFuelCapacityInJoule, chargingVehicle.activityType, - chargingVehicle.vehicle.beamVehicleType + vehicle.beamVehicleType, + vehicleAlias, + VehicleManager.getReservedFor(vehicle.vehicleManagerId.get()).getOrElse(VehicleManager.AnyManager) ) ) } @@ -273,19 +254,18 @@ trait ScaleUpCharging extends { /** * get Beam Vehicle - * @param vehicleType BeamVehicleType - * @param reservedFor ReservedFor + * @param vehicleTypeInfo VehicleTypeInfo * @param soc State Of Charge In Double * @return */ - protected def getBeamVehicle(vehicleType: BeamVehicleType, reservedFor: ReservedFor, soc: Double): BeamVehicle = { - val powerTrain = new Powertrain(vehicleType.primaryFuelConsumptionInJoulePerMeter) + protected def getBeamVehicle(vehicleTypeInfo: VehicleTypeInfo, soc: Double): BeamVehicle = { + val powerTrain = new Powertrain(vehicleTypeInfo.vehicleType.primaryFuelConsumptionInJoulePerMeter) val nextId = VehicleIdGenerator.nextId val beamVehicle = new BeamVehicle( - Id.create(VIRTUAL_CAR_ALIAS + "-" + nextId, classOf[BeamVehicle]), + Id.create(SAMPLED_ALIAS + "-" + vehicleTypeInfo.vehicleAlias + "-" + nextId, classOf[BeamVehicle]), powerTrain, - vehicleType, - new AtomicReference(reservedFor.managerId), + vehicleTypeInfo.vehicleType, + new AtomicReference(vehicleTypeInfo.reservedFor.managerId), randomSeed = rand.nextInt ) beamVehicle.initializeFuelLevels(soc) @@ -297,7 +277,11 @@ trait ScaleUpCharging extends { * @return */ protected def getPerson(vehicleId: Id[BeamVehicle]): Id[Person] = { - Id.create(vehicleId.toString.replace(VIRTUAL_CAR_ALIAS, "VirtualPerson"), classOf[Person]) + val vehicleIdArray = vehicleId.toString.split("-") + val personIdString = if (vehicleIdArray.length > 1 && vehicleIdArray(0).startsWith(SAMPLED_ALIAS)) { + vehicleIdArray.drop(1).mkString("-") + } else vehicleId.toString + Id.create(SAMPLED_ALIAS + "-" + personIdString, classOf[Person]) } /** @@ -305,52 +289,55 @@ trait ScaleUpCharging extends { * @param vehicleId vehicle Id * @return */ - protected def isVirtualCar(vehicleId: Id[BeamVehicle]): Boolean = isVirtualEntity(vehicleId) + protected def isSampledCar(vehicleId: Id[BeamVehicle]): Boolean = isSampledEntity(vehicleId) - protected def isVirtualPerson(personId: Id[Person]): Boolean = isVirtualEntity(personId) + protected def isSampledPerson(personId: Id[Person]): Boolean = isSampledEntity(personId) - private def isVirtualEntity(entity: Id[_]): Boolean = entity.toString.startsWith(VIRTUAL_CAR_ALIAS) + private def isSampledEntity(entity: Id[_]): Boolean = entity.toString.startsWith(SAMPLED_ALIAS) } object ScaleUpCharging { - val VIRTUAL_CAR_ALIAS: String = "VirtualCar" + val SAMPLED_ALIAS: String = "sampled" case class PlanParkingInquiryTrigger(tick: Int, requestId: Int) extends Trigger case class PlanChargingUnplugRequestTrigger(tick: Int, beamVehicle: BeamVehicle, requestId: Int) extends Trigger case class VehicleRequestInfo( - energyToChargeInJoule: Double, durationToChargeInSec: Int, - remainingFuelInJoule: Double, - fuelCapacityInJoule: Double, + stateOfCharge: Double, activityType: String, - vehicleType: BeamVehicleType + vehicleType: BeamVehicleType, + vehicleAlias: String, + reservedFor: ReservedFor ) + case class VehicleTypeInfo( + vehicleType: BeamVehicleType, + activityType: String, + vehicleAlias: String, + reservedFor: ReservedFor + ) { + override def toString: String = s"${vehicleType.id.toString}-$activityType-$vehicleAlias-${reservedFor.toString}" + override val hashCode: Int = toString.hashCode + } + case class VehicleInfoSummary( numObservation: Int, - totPowerInKW: Double, - meanDur: Double, + totDurationInSec: Int, + meanDuration: Double, + varianceDuration: Double, meanSOC: Double, - meanEnergy: Double, - meanFuelCapacity: Double, - stdDevDur: Double, - stdDevSOC: Double, - stdDevEnergy: Double, - stdFuelCapacity: Double, - activityTypeDistribution: EnumeratedDistribution[String], - vehicleTypeDistribution: EnumeratedDistribution[BeamVehicleType] + varianceSOC: Double, + vehicleTypeInfoDistribution: EnumeratedDistribution[VehicleTypeInfo] ) { + def getDuration(rand: Random): Int = logNormalDistribution(meanDuration, varianceDuration, rand).toInt + def getSOC(rand: Random): Double = logNormalDistribution(meanSOC, varianceSOC, rand) - def getDuration(rand: Random): Int = { - MathUtils.roundUniformly(Math.max(meanDur + (rand.nextGaussian() * stdDevDur), 0.0), rand).toInt - } - - def getSOC(rand: Random): Double = Math.max(meanSOC + (rand.nextGaussian() * stdDevSOC), 0.0) - - def getEnergy(rand: Random): Double = Math.max(meanEnergy + (rand.nextGaussian() * stdDevEnergy), 0.0) - - def getFuelCapacity(rand: Random, energy: Double, soc: Double): Double = { - Math.max(meanFuelCapacity + (rand.nextGaussian() * stdFuelCapacity), if (soc == 1) energy else energy / (1 - soc)) + private def logNormalDistribution(mean: Double, variance: Double, rand: Random) /* mean and variance of Y */ = { + val phi = Math.sqrt(variance + Math.pow(mean, 2)) + val mu = Math.log(Math.pow(mean, 2) / phi) /* mean of log(Y) */ + val sigma = Math.sqrt(Math.log(Math.pow(phi, 2) / Math.pow(mean, 2))) /* std dev of log(Y) */ + val x = MathUtils.roundUniformly(Math.max(mu + (rand.nextGaussian() * sigma), 0.0), rand).toInt + Math.exp(x) } } } diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index b7e4608c2e3..9d22ae9294d 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -323,7 +323,7 @@ class ZonalParkingManagerSpec minSearchRadius, maxSearchRadius, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig, None ) @@ -382,7 +382,7 @@ class ZonalParkingManagerSpec minSearchRadius, maxSearchRadius, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig, None ) @@ -437,7 +437,7 @@ class ZonalParkingManagerSpec beamConfig.beam.agentsim.agents.parking.fractionOfSameTypeZones, beamConfig.beam.agentsim.agents.parking.minNumberOfSameTypeZones, randomSeed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds ) @@ -552,7 +552,7 @@ object ZonalParkingManagerSpec { minSearchRadius, maxSearchRadius, seed, - beamConfig.beam.agentsim.agents.parking.mulitnomialLogit, + beamConfig.beam.agentsim.agents.parking.multinomialLogit, beamConfig, None ) diff --git a/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala index 5b2654465ee..d9404336838 100644 --- a/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala @@ -25,7 +25,6 @@ import org.scalatest.BeforeAndAfterEach import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpecLike -import scala.collection.immutable.List import scala.collection.mutable.ListBuffer class SitePowerManagerSpec @@ -151,7 +150,7 @@ class SitePowerManagerSpec vehiclesList.foreach { case (v, person) => v.addFuel(v.primaryFuelLevelInJoules * 0.9 * -1) val request = ChargingPlugRequest(0, v, v.stall.get, person, 0) - val Some(chargingVehicle) = chargingNetwork.processChargingPlugRequest(request, "", ActorRef.noSender) + val Some(chargingVehicle) = chargingNetwork.processChargingPlugRequest(request, 60, "", ActorRef.noSender) chargingVehicle.chargingStatus.last shouldBe ChargingStatus(ChargingStatus.Connected, 0) chargingVehicle shouldBe ChargingVehicle( v, @@ -159,6 +158,7 @@ class SitePowerManagerSpec dummyStation, 0, person, + 60, "", NotApplicable, None, diff --git a/src/test/scala/beam/integration/ChargingSpec.scala b/src/test/scala/beam/integration/ChargingSpec.scala index c70b5d5664a..33fda3cecbe 100644 --- a/src/test/scala/beam/integration/ChargingSpec.scala +++ b/src/test/scala/beam/integration/ChargingSpec.scala @@ -117,7 +117,7 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { totRealPower += BeamVehicleUtils.toPowerInKW(energyInJoules, sessionDuration.toInt) case e: PathTraversalEvent if e.vehicleId == vehicleId => energyConsumed += e.primaryFuelConsumed - case e: RefuelSessionEvent if e.vehicleId.toString.startsWith(ScaleUpCharging.VIRTUAL_CAR_ALIAS) => + case e: RefuelSessionEvent if e.vehicleId.toString.startsWith(ScaleUpCharging.SAMPLED_ALIAS) => totVirtualPower += BeamVehicleUtils.toPowerInKW(e.energyInJoules, e.sessionDuration.toInt) case e: RefuelSessionEvent => totRealPower += BeamVehicleUtils.toPowerInKW(e.energyInJoules, e.sessionDuration.toInt) From 951acbbea85cb8aee444331c385100ddf99a77fc Mon Sep 17 00:00:00 2001 From: Rutvik Patel Date: Tue, 19 Jul 2022 16:54:31 +0530 Subject: [PATCH 234/307] runs fmt --- src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala index 47a5dfe6a2d..b4394c789f4 100644 --- a/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala +++ b/src/main/scala/beam/utils/scenario/UrbanSimScenarioLoader.scala @@ -20,7 +20,7 @@ import org.matsim.vehicles.{Vehicle, VehicleType, VehicleUtils} import scala.collection.JavaConverters._ import scala.collection.mutable.ArrayBuffer -import scala.collection.{Iterable, mutable} +import scala.collection.{mutable, Iterable} import scala.concurrent.duration._ import scala.concurrent.{Await, ExecutionContext, Future} import scala.math.{max, min, round} From 46e07d315d30bb5298cf53dbcf8f974c1a00fecf Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 19 Jul 2022 15:07:24 -0700 Subject: [PATCH 235/307] fixing bug and compilation error --- .../beam/agentsim/infrastructure/ChargingNetworkManager.scala | 2 +- .../beam/agentsim/infrastructure/power/SitePowerManager.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 6460320a060..7f18b2b6505 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -195,8 +195,8 @@ class ChargingNetworkManager( WaitingToCharge(tick, vehicle.id, triggerId) case chargingVehicle => vehicle2InquiryMap.remove(vehicle.id) - collectVehicleRequestInfo(chargingVehicle) handleStartCharging(tick, chargingVehicle, triggerId = triggerId) + collectVehicleRequestInfo(chargingVehicle) StartingRefuelSession(tick, triggerId) } getOrElse Failure( new RuntimeException( diff --git a/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala b/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala index fbea80fbcf2..13f2a5b7baf 100644 --- a/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala @@ -47,7 +47,7 @@ class SitePowerManager( chargingVehicle: ChargingVehicle, physicalBounds: Map[ChargingStation, PhysicalBounds] ): (ChargingDurationInSec, EnergyInJoules, EnergyInJoules) = { - val ChargingVehicle(vehicle, _, station, _, _, _, _, _, _, _, _) = chargingVehicle + val ChargingVehicle(vehicle, _, station, _, _, _, _, _, _, _, _, _) = chargingVehicle // dispatch val maxZoneLoad = physicalBounds(station).powerLimitUpper val maxUnlimitedZoneLoad = unlimitedPhysicalBounds(station).powerLimitUpper From f514452152bf9b5ee4f33a08210e036d5ede6229 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 19 Jul 2022 18:03:07 -0700 Subject: [PATCH 236/307] logs --- .../infrastructure/ScaleUpCharging.scala | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 50599af6742..b56955f18f7 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -71,7 +71,7 @@ trait ScaleUpCharging extends { override def loggedReceive: Receive = { case t @ TriggerWithId(PlanParkingInquiryTrigger(_, requestId), triggerId) => - log.debug(s"Received parking response: $t") + log.info(s"Received parking response: $t") virtualParkingInquiries.get(requestId) match { case Some(inquiry) => self ! inquiry case _ => @@ -81,13 +81,16 @@ trait ScaleUpCharging extends { } sender ! CompletionNotice(triggerId) case t @ TriggerWithId(PlanChargingUnplugRequestTrigger(tick, beamVehicle, requestId), triggerId) => - log.debug(s"Received parking response: $t") + log.info(s"Received parking response: $t") self ! ChargingUnplugRequest(tick, beamVehicle, triggerId) virtualParkingInquiries.remove(requestId) case response @ ParkingInquiryResponse(stall, requestId, triggerId) => - log.debug(s"Received parking response: $response") + log.info(s"Received parking response: $response") virtualParkingInquiries.get(requestId) match { case Some(parkingInquiry) if stall.chargingPointType.isDefined => + log.info( + s"parking inquiry with requestId $requestId returned a stall with charging point. Scheduling ChargingPlugRequest." + ) val beamVehicle = parkingInquiry.beamVehicle.get self ! ChargingPlugRequest( parkingInquiry.destinationUtm.time, @@ -104,22 +107,22 @@ trait ScaleUpCharging extends { self ) case Some(_) if stall.chargingPointType.isEmpty => - log.debug(s"parking inquiry with requestId $requestId returned a NoCharger stall") + log.info(s"parking inquiry with requestId $requestId returned a NoCharger stall") case _ => log.warning(s"inquiryMap does not have this requestId $requestId that returned stall $stall") } case reply @ StartingRefuelSession(_, _) => - log.debug(s"Received parking response: $reply") + log.info(s"Received parking response: $reply") case reply @ EndingRefuelSession(_, _, triggerId) => - log.debug(s"Received parking response: $reply") + log.info(s"Received parking response: $reply") getScheduler ! CompletionNotice(triggerId) case reply @ WaitingToCharge(_, _, _) => - log.debug(s"Received parking response: $reply") + log.info(s"Received parking response: $reply") case reply @ UnhandledVehicle(_, _, triggerId) => - log.debug(s"Received parking response: $reply") + log.info(s"Received parking response: $reply") getScheduler ! CompletionNotice(triggerId) case reply @ UnpluggingVehicle(_, _, triggerId) => - log.debug(s"Received parking response: $reply") + log.info(s"Received parking response: $reply") getScheduler ! CompletionNotice(triggerId) } @@ -214,7 +217,7 @@ trait ScaleUpCharging extends { } } case _ => - log.debug("The observed load is null. Most likely due to vehicles not needing to charge!") + log.info("The observed load is null. Most likely due to vehicles not needing to charge!") } partialTriggersAndInquiries.result() } From ffddb360d5f6b34e39b90d5bbd0d9b3f49514c2d Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 19 Jul 2022 18:05:25 -0700 Subject: [PATCH 237/307] more logs --- .../scala/beam/agentsim/infrastructure/ScaleUpCharging.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index b56955f18f7..18aa429531e 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -211,6 +211,7 @@ trait ScaleUpCharging extends { searchMode = ParkingSearchMode.DestinationCharging, triggerId = triggerId ) + log.info(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) cumulatedSimulatedDuration += duration partialTriggersAndInquiries += ((trigger, parkingInquiry)) From e746399acd82ad9ef8fb249985c55b3db671e412 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 19 Jul 2022 19:25:03 -0700 Subject: [PATCH 238/307] testing potential fix --- .../scala/beam/agentsim/infrastructure/ScaleUpCharging.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 18aa429531e..d1f1c0f6080 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -244,7 +244,10 @@ trait ScaleUpCharging extends { vehicleRequests.put( key, vehicleRequests.getOrElse(key, List.empty) :+ VehicleRequestInfo( - chargingVehicle.estimatedParkingDuration, + Math.max( + chargingVehicle.estimatedParkingDuration, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds.toInt + ), Math.max(vehicle.primaryFuelLevelInJoules, 0.0) / vehicle.beamVehicleType.primaryFuelCapacityInJoule, chargingVehicle.activityType, vehicle.beamVehicleType, From 24c3e8b5c4f7dfff864c00c1275fed434c025893 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 19 Jul 2022 23:26:38 -0700 Subject: [PATCH 239/307] removing logs --- .../infrastructure/ScaleUpCharging.scala | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index d1f1c0f6080..10ef458f7bc 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -71,26 +71,21 @@ trait ScaleUpCharging extends { override def loggedReceive: Receive = { case t @ TriggerWithId(PlanParkingInquiryTrigger(_, requestId), triggerId) => - log.info(s"Received parking response: $t") + log.debug(s"Received parking response: $t") virtualParkingInquiries.get(requestId) match { case Some(inquiry) => self ! inquiry - case _ => - log.error( - s"Something is broken in ScaleUpCharging. Request $requestId is not present in virtualParkingInquiries" - ) + case _ => log.error(s"Something is broken in ScaleUpCharging. Request $requestId has not been found") } sender ! CompletionNotice(triggerId) case t @ TriggerWithId(PlanChargingUnplugRequestTrigger(tick, beamVehicle, requestId), triggerId) => - log.info(s"Received parking response: $t") + log.debug(s"Received parking response: $t") self ! ChargingUnplugRequest(tick, beamVehicle, triggerId) virtualParkingInquiries.remove(requestId) case response @ ParkingInquiryResponse(stall, requestId, triggerId) => - log.info(s"Received parking response: $response") + log.debug(s"Received parking response: $response") virtualParkingInquiries.get(requestId) match { case Some(parkingInquiry) if stall.chargingPointType.isDefined => - log.info( - s"parking inquiry with requestId $requestId returned a stall with charging point. Scheduling ChargingPlugRequest." - ) + log.debug(s"parking inquiry with requestId $requestId returned a stall with charging point.") val beamVehicle = parkingInquiry.beamVehicle.get self ! ChargingPlugRequest( parkingInquiry.destinationUtm.time, @@ -107,22 +102,22 @@ trait ScaleUpCharging extends { self ) case Some(_) if stall.chargingPointType.isEmpty => - log.info(s"parking inquiry with requestId $requestId returned a NoCharger stall") + log.debug(s"parking inquiry with requestId $requestId returned a NoCharger stall") case _ => log.warning(s"inquiryMap does not have this requestId $requestId that returned stall $stall") } case reply @ StartingRefuelSession(_, _) => - log.info(s"Received parking response: $reply") + log.debug(s"Received parking response: $reply") case reply @ EndingRefuelSession(_, _, triggerId) => - log.info(s"Received parking response: $reply") + log.debug(s"Received parking response: $reply") getScheduler ! CompletionNotice(triggerId) case reply @ WaitingToCharge(_, _, _) => - log.info(s"Received parking response: $reply") + log.debug(s"Received parking response: $reply") case reply @ UnhandledVehicle(_, _, triggerId) => - log.info(s"Received parking response: $reply") + log.debug(s"Received parking response: $reply") getScheduler ! CompletionNotice(triggerId) case reply @ UnpluggingVehicle(_, _, triggerId) => - log.info(s"Received parking response: $reply") + log.debug(s"Received parking response: $reply") getScheduler ! CompletionNotice(triggerId) } @@ -211,14 +206,14 @@ trait ScaleUpCharging extends { searchMode = ParkingSearchMode.DestinationCharging, triggerId = triggerId ) - log.info(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") + log.debug(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) cumulatedSimulatedDuration += duration partialTriggersAndInquiries += ((trigger, parkingInquiry)) } } case _ => - log.info("The observed load is null. Most likely due to vehicles not needing to charge!") + log.debug("The observed load is null. Most likely due to vehicles not needing to charge!") } partialTriggersAndInquiries.result() } From 749711645a5a6e3d0c8e253b87a857addfcbd661 Mon Sep 17 00:00:00 2001 From: Dmitry Openkov Date: Wed, 20 Jul 2022 19:12:34 +0300 Subject: [PATCH 240/307] Fix time passing over midnight --- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index ed31a6f81aa..f61a874191e 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -144,7 +144,7 @@ if [[ -z "${last_completed}" ]]; then last_completed=$(tac $log_file | grep -m 1 -Eo '^[0-9]{2}:[0-9]{2}:[0-9]{2}') fi - beam_status=$(python3 -c "import datetime as dt; diff = dt.datetime.now() - dt.datetime.combine(dt.datetime.today(), dt.time.fromisoformat('$last_completed')); x = 'OK' if dt.timedelta(0) <= diff and diff < dt.timedelta(hours=3) else 'Bad'; print(x)") + beam_status=$(python3 -c "import datetime as dt; diff = dt.datetime.now() - dt.datetime.combine(dt.datetime.today(), dt.time.fromisoformat('$last_completed')); diff = diff + dt.timedelta(days = 1) if diff < dt.timedelta(0) else diff; x = 'OK' if diff < dt.timedelta(hours=3) else 'Bad'; print(x)") pid=$(pgrep -f RunBeam) if [ "$beam_status" == 'Bad' ] && [ "$pid" != "" ]; then jstack $pid | gzip > "$out_dir/kill_thread_dump.txt.gz" From 322464b597c3f91ce17ff9a0ed9a92b23ef29bed Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 20 Jul 2022 17:13:27 -0700 Subject: [PATCH 241/307] testing changes to scale up --- src/main/resources/beam-template.conf | 1 - .../agents/household/HouseholdActor.scala | 10 +- .../household/HouseholdFleetManager.scala | 10 +- .../infrastructure/ChargingFunctions.scala | 8 +- .../infrastructure/ChargingNetwork.scala | 2 + .../ChargingNetworkManager.scala | 16 ++- .../ChargingNetworkManagerHelper.scala | 10 +- .../HierarchicalParkingManager.scala | 1 + .../ParallelParkingManager.scala | 1 + .../ParkingNetworkManager.scala | 2 +- .../infrastructure/ScaleUpCharging.scala | 120 +++++++++++------- .../parking/ParkingNetwork.scala | 3 +- src/main/scala/beam/sim/BeamMobsim.scala | 2 +- .../scala/beam/sim/config/BeamConfig.scala | 3 - .../ChargingNetworkManagerSpec.scala | 1 + .../power/SitePowerManagerSpec.scala | 1 + .../scala/beam/integration/ChargingSpec.scala | 70 ++++++---- .../beam/input/vehicles-simple.csv | 4 +- 18 files changed, 160 insertions(+), 105 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 91417029ed7..e3e9eb3055d 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -172,7 +172,6 @@ beam.agentsim.agents.parking.searchMaxDistanceRelativeToEllipseFoci = "double | beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds = "double | 60.0" # in seconds, something small enough but has meaningful impact on pricing beam.agentsim.agents.parking.fractionOfSameTypeZones = "double | 0.5" beam.agentsim.agents.parking.minNumberOfSameTypeZones = "int | 10" -beam.agentsim.agents.parking.overnightChargingSampleSize = "double | 0.0" #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index 593aadf6fd2..a73fd41b762 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -589,11 +589,13 @@ object HouseholdActor { searchMode = ParkingSearchMode.Init ) // TODO Overnight charging is still a work in progress and might produce unexpected results - val probabilityOfOvernightCharging = - rand.nextDouble() < beamServices.beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize - if (vehicle.isEV && probabilityOfOvernightCharging) + if (vehicle.isEV && beamServices.beamConfig.beam.agentsim.chargingNetworkManager.overnightChargingEnabled) { + log.info(s"Overnight charging vehicle $vehicle with state of charge ${vehicle.getStateOfCharge}") chargingNetworkManager ? inquiry - else parkingManager ? inquiry + } else { + log.debug(s"Overnight parking vehicle $vehicle") + parkingManager ? inquiry + } } def dieIfNoChildren(): Unit = { diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 6292c809a83..6958249a041 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -104,11 +104,13 @@ class HouseholdFleetManager( searchMode = ParkingSearchMode.Init ) // TODO Overnight charging is still a work in progress and might produce unexpected results - val probabilityOfOvernightCharging = - rand.nextDouble() <= beamConfig.beam.agentsim.agents.parking.overnightChargingSampleSize - if (vehicle.isEV && probabilityOfOvernightCharging) + if (vehicle.isEV && beamConfig.beam.agentsim.chargingNetworkManager.overnightChargingEnabled) { + logger.info(s"Overnight charging vehicle $vehicle with state of charge ${vehicle.getStateOfCharge}") (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) - else (parkingManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) + } else { + logger.debug(s"Overnight parking vehicle $vehicle") + (parkingManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) + } } } val futureOfList = Future.sequence(listOfFutures) diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala index 6fe430324b1..898e11ffce0 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingFunctions.scala @@ -129,14 +129,18 @@ class ChargingFunctions( // if (zone.chargingPointType.isEmpty) // throw new RuntimeException("ChargingFunctions expect only stalls with charging points") // val isEV: Boolean = inquiry.beamVehicle.forall(_.isEV) + val needToBeChargerIfVirtualEV: Boolean = inquiry.beamVehicle match { + case Some(vehicle) if vehicle.id.toString.startsWith(ScaleUpCharging.VIRTUAL_ALIAS) => + zone.chargingPointType.isDefined + case _ => true + } val rideHailFastChargingOnly: Boolean = ifRideHailCurrentlyOnShiftThenFastChargingOnly(zone, inquiry) val enrouteFastChargingOnly: Boolean = ifEnrouteThenFastChargingOnly(zone, inquiry) val overnightStaySlowChargingOnly: Boolean = ifHomeOrWorkOrOvernightThenSlowChargingOnly(zone, inquiry) val validChargingCapability: Boolean = hasValidChargingCapability(zone, inquiry.beamVehicle) val preferredParkingTypes = getPreferredParkingTypes(inquiry) val canCarParkHere: Boolean = canThisCarParkHere(zone, inquiry, preferredParkingTypes) - /*isEV && */ - rideHailFastChargingOnly && validChargingCapability && canCarParkHere && enrouteFastChargingOnly && overnightStaySlowChargingOnly + rideHailFastChargingOnly && validChargingCapability && canCarParkHere && enrouteFastChargingOnly && overnightStaySlowChargingOnly && needToBeChargerIfVirtualEV } /** diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala index d5b7710696b..f51e2f747a1 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetwork.scala @@ -296,6 +296,7 @@ object ChargingNetwork extends LazyLogging { stall, this, tick, + vehicle.primaryFuelLevelInJoules, personId, estimatedParkingDuration, activityType, @@ -383,6 +384,7 @@ object ChargingNetwork extends LazyLogging { stall: ParkingStall, chargingStation: ChargingStation, arrivalTime: Int, + arrivalFuelLevel: Double, personId: Id[Person], estimatedParkingDuration: Int, activityType: String, diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 7f18b2b6505..175104b9559 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -38,6 +38,7 @@ class ChargingNetworkManager( beamServices: BeamServices, chargingNetwork: ChargingNetwork, rideHailNetwork: ChargingNetwork, + parkingNetworkManager: ActorRef, scheduler: ActorRef ) extends LoggingMessageActor with ActorLogging @@ -94,11 +95,12 @@ class ChargingNetworkManager( case inquiry: ParkingInquiry => log.debug(s"Received parking inquiry: $inquiry") - chargingNetworkHelper.get(inquiry.reservedFor.managerId).processParkingInquiry(inquiry) foreach { + chargingNetworkHelper.get(inquiry.reservedFor.managerId).processParkingInquiry(inquiry, true) foreach { parkingResponse => - if (parkingResponse.stall.chargingPointType.isDefined) + if (parkingResponse.stall.chargingPointType.isDefined) { inquiry.beamVehicle foreach (v => vehicle2InquiryMap.put(v.id, inquiry)) - sender() ! parkingResponse + sender() ! parkingResponse + } else (parkingNetworkManager ? inquiry).pipeTo(sender()) } case TriggerWithId(InitializeTrigger(_), triggerId) => @@ -156,7 +158,7 @@ class ChargingNetworkManager( None } vehicleEndedCharging match { - case Some(ChargingVehicle(_, _, _, _, _, _, _, _, _, theSender, _, _)) => + case Some(ChargingVehicle(_, _, _, _, _, _, _, _, _, _, theSender, _, _)) => theSender ! EndingRefuelSession(tick, vehicle.id, triggerId) case _ => sender ! CompletionNotice(triggerId) @@ -196,7 +198,6 @@ class ChargingNetworkManager( case chargingVehicle => vehicle2InquiryMap.remove(vehicle.id) handleStartCharging(tick, chargingVehicle, triggerId = triggerId) - collectVehicleRequestInfo(chargingVehicle) StartingRefuelSession(tick, triggerId) } getOrElse Failure( new RuntimeException( @@ -215,7 +216,7 @@ class ChargingNetworkManager( val responseHasTriggerId = vehicle.stall match { case Some(stall) => chargingNetworkHelper.get(stall.reservedFor.managerId).disconnectVehicle(vehicle.id, tick) match { - case Some(chargingVehicle @ ChargingVehicle(_, _, station, _, _, _, _, _, _, _, listStatus, sessions)) => + case Some(chargingVehicle @ ChargingVehicle(_, _, station, _, _, _, _, _, _, _, _, listStatus, sessions)) => if (sessions.nonEmpty && !listStatus.exists(_.status == GracePeriod)) { // If the vehicle was still charging val unplugTime = currentTimeBin(tick) @@ -294,9 +295,10 @@ object ChargingNetworkManager extends LazyLogging { beamServices: BeamServices, chargingNetwork: ChargingNetwork, rideHailNetwork: ChargingNetwork, + parkingNetworkManager: ActorRef, scheduler: ActorRef ): Props = { - Props(new ChargingNetworkManager(beamServices, chargingNetwork, rideHailNetwork, scheduler)) + Props(new ChargingNetworkManager(beamServices, chargingNetwork, rideHailNetwork, parkingNetworkManager, scheduler)) } case class ChargingNetworkHelper(chargingNetwork: ChargingNetwork, rideHailNetwork: ChargingNetwork) { diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala index 38c765ba3e8..56cfc19d539 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManagerHelper.scala @@ -133,6 +133,7 @@ trait ChargingNetworkManagerHelper extends { chargingVehicle: ChargingVehicle, triggerId: Long ): Unit = { + collectVehicleRequestInfo(chargingVehicle) val nextTick = nextTimeBin(tick) val vehicle = chargingVehicle.vehicle if (vehicle.stall.isEmpty) @@ -208,21 +209,22 @@ trait ChargingNetworkManagerHelper extends { * @param chargingVehicle vehicle charging information */ def processEndChargingEvents(currentTick: Int, chargingVehicle: ChargingVehicle): Unit = { - val (totDuration, totEnergy) = chargingVehicle.calculateChargingSessionLengthAndEnergyInJoule + val (totDuration, _) = chargingVehicle.calculateChargingSessionLengthAndEnergyInJoule val vehicle = chargingVehicle.vehicle val stall = chargingVehicle.stall + val addedFuelLevel = vehicle.primaryFuelLevelInJoules - chargingVehicle.arrivalFuelLevel log.debug( s"Vehicle ${chargingVehicle.vehicle} was disconnected at time {} with {} J delivered during {} sec", currentTick, - totEnergy, + addedFuelLevel, totDuration ) // Refuel Session val refuelSessionEvent = new RefuelSessionEvent( currentTick, stall.copy(locationUTM = getBeamServices.geo.utm2Wgs(stall.locationUTM)), - totEnergy, - vehicle.primaryFuelLevelInJoules - totEnergy, + addedFuelLevel, + chargingVehicle.arrivalFuelLevel, totDuration, vehicle.id, vehicle.beamVehicleType, diff --git a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala index bfddd282f09..7d5d489f8f1 100644 --- a/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/HierarchicalParkingManager.scala @@ -92,6 +92,7 @@ class HierarchicalParkingManager( */ override def processParkingInquiry( inquiry: ParkingInquiry, + doNotReserveStallWithoutChargingPoint: Boolean = false, parallelizationCounterOption: Option[SimpleCounter] = None ): Option[ParkingInquiryResponse] = { logger.debug("Received parking inquiry: {}", inquiry) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala index fb17dac361e..0b5b5648b04 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParallelParkingManager.scala @@ -90,6 +90,7 @@ class ParallelParkingManager( */ override def processParkingInquiry( inquiry: ParkingInquiry, + doNotReserveStallWithoutChargingPoint: Boolean = false, parallelizationCounterOption: Option[SimpleCounter] = None ): Option[ParkingInquiryResponse] = { parallelizationCounterOption.map(_.count("all")) diff --git a/src/main/scala/beam/agentsim/infrastructure/ParkingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ParkingNetworkManager.scala index ad3bcc1adb4..4eae1528983 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ParkingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ParkingNetworkManager.scala @@ -30,7 +30,7 @@ class ParkingNetworkManager(beamServices: BeamServices, parkingNetworkMap: Parki override def loggedReceive: Receive = { case inquiry: ParkingInquiry if beamConfig.beam.agentsim.taz.parkingManager.method == "PARALLEL" => - parkingNetworkMap.processParkingInquiry(inquiry, Some(counter)).map(sender() ! _) + parkingNetworkMap.processParkingInquiry(inquiry, false, Some(counter)).map(sender() ! _) case inquiry: ParkingInquiry => parkingNetworkMap.processParkingInquiry(inquiry).map(sender() ! _) case release: ReleaseParkingStall => diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 10ef458f7bc..7f98df3a240 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -12,6 +12,7 @@ import beam.agentsim.infrastructure.taz.{TAZ, TAZTreeMap} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.agentsim.scheduler.Trigger import beam.agentsim.scheduler.Trigger.TriggerWithId +import beam.utils.BeamVehicleUtils.toPowerInKW import beam.utils.MathUtils.roundUniformly import beam.utils.{MathUtils, VehicleIdGenerator} import org.apache.commons.math3.distribution.EnumeratedDistribution @@ -140,6 +141,7 @@ trait ScaleUpCharging extends { .par .mapValues(_.map { case ((_, parkingActivityType), data) => val numObservation = data.size + val totPowerInKW = data.map(x => toPowerInKW(x.energyToChargeInJoule, x.durationToChargeInSec)).sum val listDur = data.map(_.durationToChargeInSec) val totDurationInSec = listDur.sum val meanDur: Double = listDur.sum / numObservation.toDouble @@ -147,6 +149,9 @@ trait ScaleUpCharging extends { val listSOC = data.map(_.stateOfCharge) val meanSOC: Double = listSOC.sum / numObservation.toDouble val varianceSOC: Double = listSOC.map(soc => math.pow(soc - meanSOC, 2)).sum / numObservation + val listEnergy = data.map(_.energyToChargeInJoule) + val meanEnergy: Double = listEnergy.sum / listEnergy.size.toDouble + val varianceEnergy: Double = listEnergy.map(energy => math.pow(energy - meanEnergy, 2)).sum / numObservation val pmfVehicleTypeInfo = data .groupBy(record => (record.vehicleType, record.activityType, record.vehicleAlias, record.reservedFor)) .map { case ((vehicleType, activityType, vehicleAlias, reservedFor), elems) => @@ -158,11 +163,14 @@ trait ScaleUpCharging extends { .toVector val vehicleInfoSummary = VehicleInfoSummary( numObservation = numObservation, + totPowerInKW = totPowerInKW, totDurationInSec = totDurationInSec, meanDuration = meanDur, varianceDuration = varianceDur, meanSOC = meanSOC, varianceSOC = varianceSOC, + meanEnergy = meanEnergy, + varianceEnergy = varianceEnergy, new EnumeratedDistribution[VehicleTypeInfo](mersenne, pmfVehicleTypeInfo.asJava) ) parkingActivityType -> (data, vehicleInfoSummary) @@ -184,33 +192,35 @@ trait ScaleUpCharging extends { var timeStep = 0 while (cumulatedSimulatedDuration < totDurationInSecondsToSimulate && timeStep < timeStepByHour * 3600) { val (_, summary) = activityType2vehicleInfo(distribution.sample()) - val duration = summary.getDuration(rand) - if (duration > 0) { - val soc = summary.getSOC(rand) - val vehicleTypeInfo = summary.vehicleTypeInfoDistribution.sample() - timeStep += roundUniformly(nextTimeStepUsingPoissonProcess(rate), rand).toInt - val taz = getBeamServices.beamScenario.tazTreeMap.getTAZ(tazId).get - val destinationUtm = TAZTreeMap.randomLocationInTAZ(taz, rand) - val beamVehicle = getBeamVehicle(vehicleTypeInfo, soc) - val personId = getPerson(beamVehicle.id) - val startTime = timeBin + timeStep - val parkingInquiry = ParkingInquiry( - SpaceTime(destinationUtm, startTime), - vehicleTypeInfo.activityType, - vehicleTypeInfo.reservedFor, - Some(beamVehicle), - None, // remainingTripData - Some(personId), - 1.0, // valueOfTime - duration, - searchMode = ParkingSearchMode.DestinationCharging, - triggerId = triggerId - ) - log.debug(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") - val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) - cumulatedSimulatedDuration += duration - partialTriggersAndInquiries += ((trigger, parkingInquiry)) - } + val duration = Math.max( + summary.getDuration(rand), + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds.toInt + ) + timeStep += roundUniformly(nextTimeStepUsingPoissonProcess(rate), rand).toInt + //val energyToCharge = summary.getEnergy(rand) + val vehicleTypeInfo = summary.vehicleTypeInfoDistribution.sample() + val soc = summary.meanSOC / 100.0 + val taz = getBeamServices.beamScenario.tazTreeMap.getTAZ(tazId).get + val destinationUtm = TAZTreeMap.randomLocationInTAZ(taz, rand) + val beamVehicle = getBeamVehicle(vehicleTypeInfo, soc) + val personId = getPerson(beamVehicle.id) + val startTime = timeBin + timeStep + val parkingInquiry = ParkingInquiry( + SpaceTime(destinationUtm, startTime), + vehicleTypeInfo.activityType, + vehicleTypeInfo.reservedFor, + Some(beamVehicle), + None, // remainingTripData + Some(personId), + 1.0, // valueOfTime + duration, + searchMode = ParkingSearchMode.DestinationCharging, + triggerId = triggerId + ) + log.debug(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") + val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) + cumulatedSimulatedDuration += duration + partialTriggersAndInquiries += ((trigger, parkingInquiry)) } case _ => log.debug("The observed load is null. Most likely due to vehicles not needing to charge!") @@ -229,26 +239,37 @@ trait ScaleUpCharging extends { * @param chargingVehicle the vehicle that just plugged in */ protected def collectVehicleRequestInfo(chargingVehicle: ChargingVehicle): Unit = { - if (cnmConfig.scaleUp.enabled && !isSampledCar(chargingVehicle.vehicle.id)) { + if (cnmConfig.scaleUp.enabled && !isVirtualCar(chargingVehicle.vehicle.id)) { val vehicle = chargingVehicle.vehicle val stall = chargingVehicle.stall val vehicleIdArray = vehicle.id.toString.split("-") val vehicleAlias = if (vehicleIdArray.length > 1) vehicleIdArray(0) else "personalVehicle" + val estimatedChargingDuration = Math.max( + chargingVehicle.estimatedParkingDuration, + beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds.toInt + ) + val (durationToCharge, energyToCharge) = + chargingVehicle.vehicle.refuelingSessionDurationAndEnergyInJoulesForStall( + Some(chargingVehicle.stall), + sessionDurationLimit = Some(estimatedChargingDuration), + stateOfChargeLimit = None, + chargingPowerLimit = None + ) vehicleRequests.synchronized { val key = (stall.tazId, activityTypeStringToEnum(chargingVehicle.activityType)) vehicleRequests.put( - key, - vehicleRequests.getOrElse(key, List.empty) :+ VehicleRequestInfo( - Math.max( - chargingVehicle.estimatedParkingDuration, - beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds.toInt - ), - Math.max(vehicle.primaryFuelLevelInJoules, 0.0) / vehicle.beamVehicleType.primaryFuelCapacityInJoule, - chargingVehicle.activityType, - vehicle.beamVehicleType, - vehicleAlias, - VehicleManager.getReservedFor(vehicle.vehicleManagerId.get()).getOrElse(VehicleManager.AnyManager) - ) + key, { + val vehicleRequestInfo = VehicleRequestInfo( + energyToCharge, + Math.min(durationToCharge, estimatedChargingDuration), + 100 * Math.min(Math.max(vehicle.getStateOfCharge, 0), 1), + chargingVehicle.activityType, + vehicle.beamVehicleType, + vehicleAlias, + VehicleManager.getReservedFor(vehicle.vehicleManagerId.get()).getOrElse(VehicleManager.AnyManager) + ) + vehicleRequests.getOrElse(key, List.empty) :+ vehicleRequestInfo + } ) } } @@ -264,7 +285,7 @@ trait ScaleUpCharging extends { val powerTrain = new Powertrain(vehicleTypeInfo.vehicleType.primaryFuelConsumptionInJoulePerMeter) val nextId = VehicleIdGenerator.nextId val beamVehicle = new BeamVehicle( - Id.create(SAMPLED_ALIAS + "-" + vehicleTypeInfo.vehicleAlias + "-" + nextId, classOf[BeamVehicle]), + Id.create(VIRTUAL_ALIAS + "-" + vehicleTypeInfo.vehicleAlias + "-" + nextId, classOf[BeamVehicle]), powerTrain, vehicleTypeInfo.vehicleType, new AtomicReference(vehicleTypeInfo.reservedFor.managerId), @@ -280,10 +301,10 @@ trait ScaleUpCharging extends { */ protected def getPerson(vehicleId: Id[BeamVehicle]): Id[Person] = { val vehicleIdArray = vehicleId.toString.split("-") - val personIdString = if (vehicleIdArray.length > 1 && vehicleIdArray(0).startsWith(SAMPLED_ALIAS)) { + val personIdString = if (vehicleIdArray.length > 1 && vehicleIdArray(0).startsWith(VIRTUAL_ALIAS)) { vehicleIdArray.drop(1).mkString("-") } else vehicleId.toString - Id.create(SAMPLED_ALIAS + "-" + personIdString, classOf[Person]) + Id.create(VIRTUAL_ALIAS + "-" + personIdString, classOf[Person]) } /** @@ -291,19 +312,20 @@ trait ScaleUpCharging extends { * @param vehicleId vehicle Id * @return */ - protected def isSampledCar(vehicleId: Id[BeamVehicle]): Boolean = isSampledEntity(vehicleId) + protected def isVirtualCar(vehicleId: Id[BeamVehicle]): Boolean = isVirtualEntity(vehicleId) - protected def isSampledPerson(personId: Id[Person]): Boolean = isSampledEntity(personId) + protected def isVirtualPerson(personId: Id[Person]): Boolean = isVirtualEntity(personId) - private def isSampledEntity(entity: Id[_]): Boolean = entity.toString.startsWith(SAMPLED_ALIAS) + private def isVirtualEntity(entity: Id[_]): Boolean = entity.toString.startsWith(VIRTUAL_ALIAS) } object ScaleUpCharging { - val SAMPLED_ALIAS: String = "sampled" + val VIRTUAL_ALIAS: String = "virtual" case class PlanParkingInquiryTrigger(tick: Int, requestId: Int) extends Trigger case class PlanChargingUnplugRequestTrigger(tick: Int, beamVehicle: BeamVehicle, requestId: Int) extends Trigger case class VehicleRequestInfo( + energyToChargeInJoule: Double, durationToChargeInSec: Int, stateOfCharge: Double, activityType: String, @@ -324,15 +346,19 @@ object ScaleUpCharging { case class VehicleInfoSummary( numObservation: Int, + totPowerInKW: Double, totDurationInSec: Int, meanDuration: Double, varianceDuration: Double, meanSOC: Double, varianceSOC: Double, + meanEnergy: Double, + varianceEnergy: Double, vehicleTypeInfoDistribution: EnumeratedDistribution[VehicleTypeInfo] ) { def getDuration(rand: Random): Int = logNormalDistribution(meanDuration, varianceDuration, rand).toInt def getSOC(rand: Random): Double = logNormalDistribution(meanSOC, varianceSOC, rand) + def getEnergy(rand: Random): Double = logNormalDistribution(meanEnergy, varianceEnergy, rand) private def logNormalDistribution(mean: Double, variance: Double, rand: Random) /* mean and variance of Y */ = { val phi = Math.sqrt(variance + Math.pow(mean, 2)) diff --git a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala index 732cb4515ff..0a1f71ef2ff 100644 --- a/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala +++ b/src/main/scala/beam/agentsim/infrastructure/parking/ParkingNetwork.scala @@ -22,13 +22,14 @@ abstract class ParkingNetwork(parkingZones: Map[Id[ParkingZoneId], ParkingZone]) */ def processParkingInquiry( inquiry: ParkingInquiry, + doNotReserveStallWithoutChargingPoint: Boolean = false, parallelizationCounterOption: Option[SimpleCounter] = None ): Option[ParkingInquiryResponse] = { logger.debug("Received parking inquiry: {}", inquiry) searchFunctions.flatMap(_.searchForParkingStall(inquiry)) map { case ParkingZoneSearch.ParkingZoneSearchResult(parkingStall, parkingZone, _, _, _) => // reserveStall is false when agent is only seeking pricing information - if (inquiry.reserveStall) { + if (inquiry.reserveStall && !doNotReserveStallWithoutChargingPoint) { logger.debug( s"reserving a ${if (parkingStall.chargingPointType.isDefined) "charging" else "non-charging"} stall for agent ${inquiry.requestId} in parkingZone ${parkingZone.parkingZoneId}" diff --git a/src/main/scala/beam/sim/BeamMobsim.scala b/src/main/scala/beam/sim/BeamMobsim.scala index 4a27ceb0d66..f031f30aaa3 100755 --- a/src/main/scala/beam/sim/BeamMobsim.scala +++ b/src/main/scala/beam/sim/BeamMobsim.scala @@ -416,7 +416,7 @@ class BeamMobsimIteration( // Charging Network Manager private val chargingNetworkManager = context.actorOf( ChargingNetworkManager - .props(beamServices, nonRhChargingNetwork, rhChargingNetwork, scheduler) + .props(beamServices, nonRhChargingNetwork, rhChargingNetwork, parkingNetworkManager, scheduler) .withDispatcher("charging-network-manager-pinned-dispatcher"), "ChargingNetworkManager" ) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 8b962c97d62..98b5f5dd22e 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -721,7 +721,6 @@ object BeamConfig { minNumberOfSameTypeZones: scala.Int, minSearchRadius: scala.Double, multinomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, - overnightChargingSampleSize: scala.Double, rangeAnxietyBuffer: scala.Double, searchMaxDistanceRelativeToEllipseFoci: scala.Double ) @@ -790,8 +789,6 @@ object BeamConfig { if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") ), - overnightChargingSampleSize = - if (c.hasPathOrNull("overnightChargingSampleSize")) c.getDouble("overnightChargingSampleSize") else 0.0, rangeAnxietyBuffer = if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, searchMaxDistanceRelativeToEllipseFoci = diff --git a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala index 6ccd78d1d34..a02a2180065 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ChargingNetworkManagerSpec.scala @@ -460,6 +460,7 @@ class ChargingNetworkManagerSpec beamServices, chargingNetworkMap, rideHailNetwork, + parkingManager.ref, scheduler ) ) diff --git a/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala index d9404336838..93e078715d9 100644 --- a/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/power/SitePowerManagerSpec.scala @@ -157,6 +157,7 @@ class SitePowerManagerSpec v.stall.get, dummyStation, 0, + v.primaryFuelLevelInJoules, person, 60, "", diff --git a/src/test/scala/beam/integration/ChargingSpec.scala b/src/test/scala/beam/integration/ChargingSpec.scala index 33fda3cecbe..3a0bdb7506f 100644 --- a/src/test/scala/beam/integration/ChargingSpec.scala +++ b/src/test/scala/beam/integration/ChargingSpec.scala @@ -44,19 +44,20 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { |beam.agentsim.agents.vehicles.vehiclesFilePath = $filesPath"/vehicles-simple.csv" |beam.agentsim.agents.vehicles.vehicleTypesFilePath = $filesPath"/vehicleTypes-simple.csv" |beam.agentsim.taz.parkingFilePath = $filesPath"/taz-parking-ac-only.csv" - |beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC = 0.2 + |beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC = 0 |beam.agentsim.chargingNetworkManager { | timeStepInSeconds = 300 + | overnightChargingEnabled = true | chargingPointCountScalingFactor = 1.0 | chargingPointCostScalingFactor = 1.0 | chargingPointFilePath = "" | scaleUp { | enabled = true - | expansionFactor_home_activity = 3.0 - | expansionFactor_work_activity = 3.0 - | expansionFactor_charge_activity = 3.0 - | expansionFactor_wherever_activity = 3.0 - | expansionFactor_init_activity = 3.0 + | expansionFactor_home_activity = 10.0 + | expansionFactor_work_activity = 10.0 + | expansionFactor_charge_activity = 10.0 + | expansionFactor_wherever_activity = 10.0 + | expansionFactor_init_activity = 10.0 | } | helics { | connectionEnabled = false @@ -99,28 +100,40 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { addEventHandlerBinding().toInstance(new BasicEventHandler { override def handleEvent(event: Event): Unit = { event match { - case ChargingPlugInEvent(tick, _, _, `vehicleId`, fuelLevel, _) => + case e: PathTraversalEvent if e.vehicleId == vehicleId => + energyConsumed += e.primaryFuelConsumed + case ChargingPlugInEvent(tick, _, _, theVehicleId, fuelLevel, _) if theVehicleId == vehicleId => chargingPlugInEvents += ((tick, fuelLevel)) - case ChargingPlugOutEvent(tick, _, `vehicleId`, fuelLevel, _) => + case ChargingPlugOutEvent(tick, _, theVehicleId, fuelLevel, _) if theVehicleId == vehicleId => chargingPlugOutEvents += ((tick, fuelLevel)) - case RefuelSessionEvent(tick, stall, energyInJoules, _, sessionDuration, `vehicleId`, _, _, _, _) => + case RefuelSessionEvent( + tick, + stall, + energyInJoules, + _, + sessionDuration, + theVehicleId, + _, + _, + _, + _ + ) if theVehicleId == vehicleId => refuelSessionEvents += ( ( tick, energyInJoules, sessionDuration.toLong, - ChargingPointType.getChargingPointInstalledPowerInKw( - stall.chargingPointType.get - ) + ChargingPointType.getChargingPointInstalledPowerInKw(stall.chargingPointType.get) ) ) - totRealPower += BeamVehicleUtils.toPowerInKW(energyInJoules, sessionDuration.toInt) - case e: PathTraversalEvent if e.vehicleId == vehicleId => - energyConsumed += e.primaryFuelConsumed - case e: RefuelSessionEvent if e.vehicleId.toString.startsWith(ScaleUpCharging.SAMPLED_ALIAS) => - totVirtualPower += BeamVehicleUtils.toPowerInKW(e.energyInJoules, e.sessionDuration.toInt) - case e: RefuelSessionEvent => - totRealPower += BeamVehicleUtils.toPowerInKW(e.energyInJoules, e.sessionDuration.toInt) + val currentPower = BeamVehicleUtils.toPowerInKW(energyInJoules, sessionDuration.toInt) + totRealPower += currentPower + case e: RefuelSessionEvent if e.vehicleId.toString.startsWith(ScaleUpCharging.VIRTUAL_ALIAS) => + val upSampledPower = BeamVehicleUtils.toPowerInKW(e.energyInJoules, e.sessionDuration.toInt) + totVirtualPower += upSampledPower + case e: RefuelSessionEvent if e.vehicleId != vehicleId => + val currentPower = BeamVehicleUtils.toPowerInKW(e.energyInJoules, e.sessionDuration.toInt) + totRealPower += currentPower case _ => } } @@ -177,7 +190,7 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { // ensure each refuel event is difference of amounts of fuel before and after charging refuelSessionEvents.zipWithIndex foreach { case ((_, energyAdded, _, _), id) => - chargingPlugInEvents(id)._2 + energyAdded shouldBe chargingPlugOutEvents(id)._2 + (chargingPlugInEvents(id)._2 + energyAdded).toInt shouldBe chargingPlugOutEvents(id)._2.toInt } val energyChargedInKWh = refuelSessionEvents.map(_._2).sum / 3.6e+6 @@ -185,20 +198,21 @@ class ChargingSpec extends AnyFlatSpec with Matchers with BeamHelper { energyChargedInKWh shouldBe (powerPerTime +- 0.01) // Check that there is a charging event for start of iteration. - val fuelSeshsAtTick0 = chargingPlugInEvents.filter(event => event._1 == 0) - assume(fuelSeshsAtTick0.nonEmpty) - // Looking at every refuel session and deducting charging duration from tick (the end time of charging). - // If the simulation started at time t = 0, then there should be at least as many ChargingPLuginEvent as - // RefuelSessionEvent at t = 0 - val refSessionAtTick0 = refuelSessionEvents.filter(event => event._1 - event._3 == 0) - assume(fuelSeshsAtTick0.size == refSessionAtTick0.size) + val chargingPlugInEventsAtTick0 = chargingPlugInEvents.filter(_._1 == 0) + if (chargingPlugInEventsAtTick0.nonEmpty) { + // Looking at every refuel session and deducting charging duration from tick (the end time of charging). + // If the simulation started at time t = 0, then there should be at least as many ChargingPLuginEvent as + // RefuelSessionEvent at t = 0 + val refSessionAtTick0 = refuelSessionEvents.filter(event => event._1 - event._3 <= 1) + assume(chargingPlugInEventsAtTick0.size == refSessionAtTick0.size) + } // consumed energy should be more or less equal total added energy // TODO Hard to test this without ensuring an energy conservation mechanism // totalEnergyInJoules shouldBe (energyConsumed +- 1000) assume( totVirtualPower - totRealPower > 0, - "There should be at least as much virtual power as real power when scaling up by 2" + "There should be at least as much virtual power as real power when scaling up by 10" ) } } diff --git a/test/test-resources/beam/input/vehicles-simple.csv b/test/test-resources/beam/input/vehicles-simple.csv index 9c3f64c8f7a..a6f907bc5be 100644 --- a/test/test-resources/beam/input/vehicles-simple.csv +++ b/test/test-resources/beam/input/vehicles-simple.csv @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d4ba2cd23e618f264184e800b904be1e915fe8b6ab6dcb7f18e949b675793807 -size 81 +oid sha256:2bb698906c82a24f0a5fbfbc39d9753e9e70a7a01212c3fc9064ce43bfdd11fb +size 100 From d84ac9238efc76f41582be5191c34a5a284dda5a Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 20 Jul 2022 17:38:40 -0700 Subject: [PATCH 242/307] fix compilation error --- .../beam/agentsim/infrastructure/power/SitePowerManager.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala b/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala index 13f2a5b7baf..915d7bc506a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/power/SitePowerManager.scala @@ -47,7 +47,7 @@ class SitePowerManager( chargingVehicle: ChargingVehicle, physicalBounds: Map[ChargingStation, PhysicalBounds] ): (ChargingDurationInSec, EnergyInJoules, EnergyInJoules) = { - val ChargingVehicle(vehicle, _, station, _, _, _, _, _, _, _, _, _) = chargingVehicle + val ChargingVehicle(vehicle, _, station, _, _, _, _, _, _, _, _, _, _) = chargingVehicle // dispatch val maxZoneLoad = physicalBounds(station).powerLimitUpper val maxUnlimitedZoneLoad = unlimitedPhysicalBounds(station).powerLimitUpper From 0cfece76e860b2a0898c5e3c861bb0540cc77742 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 20 Jul 2022 19:39:28 -0700 Subject: [PATCH 243/307] activating log --- .../scala/beam/agentsim/infrastructure/ScaleUpCharging.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 7f98df3a240..4441f0c84a4 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -217,7 +217,7 @@ trait ScaleUpCharging extends { searchMode = ParkingSearchMode.DestinationCharging, triggerId = triggerId ) - log.debug(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") + log.info(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) cumulatedSimulatedDuration += duration partialTriggersAndInquiries += ((trigger, parkingInquiry)) From db141d35f00fa637e1c474ec5287a18151d3db98 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 20 Jul 2022 21:09:17 -0700 Subject: [PATCH 244/307] fmt --- src/main/python/gemini/events_processing2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/python/gemini/events_processing2.py b/src/main/python/gemini/events_processing2.py index 25ef138f780..2888494e12d 100644 --- a/src/main/python/gemini/events_processing2.py +++ b/src/main/python/gemini/events_processing2.py @@ -2,7 +2,7 @@ import os work_directory = '~/Data/GEMINI/2022-07-05/' -filename = '0.events.csv.gz' +filename = '0.events.5bBase.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None From 8485b5d172a5c7ac63802e879288566e134f4ccb Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 20 Jul 2022 21:15:22 -0700 Subject: [PATCH 245/307] removing logs --- .../scala/beam/agentsim/infrastructure/ScaleUpCharging.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 4441f0c84a4..2d6cf44c604 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -217,7 +217,7 @@ trait ScaleUpCharging extends { searchMode = ParkingSearchMode.DestinationCharging, triggerId = triggerId ) - log.info(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") + //log.debug(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) cumulatedSimulatedDuration += duration partialTriggersAndInquiries += ((trigger, parkingInquiry)) From aa0363e64548a7422e113010917508749a32b956 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Fri, 22 Jul 2022 19:55:13 +0600 Subject: [PATCH 246/307] Permission fixes --- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- jupyter/build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 9ed6fc80ceb..4d156f1713e 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -252,7 +252,7 @@ - if [ "$RUN_JUPYTER" = "True" ] - then - echo "Starting Jupyter" - - sudo ./gradlew jupyterStart -PjupyterToken=$JUPYTER_TOKEN + - sudo ./gradlew jupyterStart -Puser=root -PjupyterToken=$JUPYTER_TOKEN - fi - 'echo "gradlew assemble: $(date)"' diff --git a/jupyter/build.gradle b/jupyter/build.gradle index aa357c7ae3b..04243698da9 100644 --- a/jupyter/build.gradle +++ b/jupyter/build.gradle @@ -17,7 +17,7 @@ def imageName = 'jupyter/scipy-notebook:2022-04-02' def containerName = 'jupyter-for-beam' def port = '8888' def token = project.hasProperty("jupyterToken") ? jupyterToken : UUID.randomUUID().toString() - +def dockerArguments = project.hasProperty("user") ? ["--group-add=users", "--user=${project.property("user")}"] as String[] : "--group-add=users" static def readMappingFromFile(String filePath, String prefix, String basePath) { File file = new File(filePath) @@ -71,7 +71,7 @@ dockerRun { daemonize true clean true env 'GRANT_SUDO': 'yes', 'JUPYTER_TOKEN': "$token", "CHOWN_HOME": "yes", "CHOWN_HOME_OPTS": '-R' - arguments "--group-add=users" + arguments dockerArguments } task jupyterStart(dependsOn: ['dockerRun']) { From 60b6aaff4f70e9ab897d36efb2f3c9cb309d5a8c Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 22 Jul 2022 18:14:55 -0700 Subject: [PATCH 247/307] fmt --- src/main/R/gemini/gemini-main.R | 2 +- src/main/R/gemini/gemini-processing.R | 3 +++ src/main/python/gemini/events_processing.py | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 06d7feb3832..60f0ab0b1fb 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -210,7 +210,7 @@ ggsave(pp(plotsDir,'/baseline-ev-charging-loads-by-space-time-in-oakland.png'),p ## ************************************** ## public charging by scenario #scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') -scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') +#scenarioNames <- c('5b1', '5b2', '5b3', '5b4', '5b5', '5b6', '5b7') p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadType','hour.bin2','name')] %>% ggplot(aes(x=hour.bin2,y=kw/1e6,fill=factor(loadType, levels = names(chargingTypes.colors))))+ theme_marain() + diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 318cbd52a62..8de2f76a164 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -940,6 +940,9 @@ ev <- readCsv(pp(workDir, "/2022-07-05/events/filtered.0.events.csv.gz")) pt <- readCsv(pp(workDir, "/2022-07-05/events/ptmc.0.events.csv.gz")) ev0 <- readCsv(pp(workDir, "/2022-07-05/events/filtered.0.events.5bBase.csv.gz")) +test <- ev0[,.N,by=.(vehicle)] + + sum(ev0[type=="RefuelSessionEvent"]$fuel)/sum(ev[type=="RefuelSessionEvent"]$fuel) length(unique(ev0[startsWith(vehicle, "VirtualCar-")]$vehicle)) length(unique(ev0[!startsWith(vehicle, "VirtualCar-")]$vehicle)) diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index d211b4c3ac9..f525f41471a 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -2,8 +2,8 @@ import os work_directory = '~/Data/GEMINI/2022-07-05/' -# filename = '0.events.7Advanced.csv.gz' -filename = '0.events.40p.csv.gz' +filename = '0.events.7Advanced.csv.gz' +# filename = '0.events.40p.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None From cea543e2f5b4d960c22398a611aff6a15265b2a8 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 22 Jul 2022 18:33:09 -0700 Subject: [PATCH 248/307] updatin charging scale up --- .../agents/vehicles/BeamVehicle.scala | 2 + .../infrastructure/ScaleUpCharging.scala | 75 +++++++++++-------- 2 files changed, 44 insertions(+), 33 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala index 7ddaedcecf6..fe49a9f89e6 100755 --- a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala +++ b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala @@ -405,6 +405,8 @@ class BeamVehicle( StreetVehicle(id, beamVehicleType.id, spaceTime, mode, asDriver = true, needsToCalculateCost = needsToCalculateCost) } + def isRidehail: Boolean = beamVehicleType.id.toString.startsWith("rideHail") + def isSharedVehicle: Boolean = beamVehicleType.id.toString.startsWith("sharedVehicle") def isCAV: Boolean = beamVehicleType.automationLevel >= 4 diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index 2d6cf44c604..d52eb87da88 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -153,14 +153,21 @@ trait ScaleUpCharging extends { val meanEnergy: Double = listEnergy.sum / listEnergy.size.toDouble val varianceEnergy: Double = listEnergy.map(energy => math.pow(energy - meanEnergy, 2)).sum / numObservation val pmfVehicleTypeInfo = data - .groupBy(record => (record.vehicleType, record.activityType, record.vehicleAlias, record.reservedFor)) - .map { case ((vehicleType, activityType, vehicleAlias, reservedFor), elems) => + .groupBy(record => (record.vehicleType, record.vehicleAlias, record.reservedFor)) + .map { case ((vehicleType, vehicleAlias, reservedFor), elems) => new CPair[VehicleTypeInfo, java.lang.Double]( - VehicleTypeInfo(vehicleType, activityType, vehicleAlias, reservedFor), + VehicleTypeInfo(vehicleType, vehicleAlias, reservedFor), elems.size.toDouble ) } .toVector + val pmfActivityType = + data + .groupBy(_.activityType) + .map { case (activityType, elems) => + new CPair[String, java.lang.Double](activityType, elems.size.toDouble) + } + .toVector val vehicleInfoSummary = VehicleInfoSummary( numObservation = numObservation, totPowerInKW = totPowerInKW, @@ -171,44 +178,47 @@ trait ScaleUpCharging extends { varianceSOC = varianceSOC, meanEnergy = meanEnergy, varianceEnergy = varianceEnergy, - new EnumeratedDistribution[VehicleTypeInfo](mersenne, pmfVehicleTypeInfo.asJava) + new EnumeratedDistribution[VehicleTypeInfo](mersenne, pmfVehicleTypeInfo.asJava), + new EnumeratedDistribution[String](mersenne, pmfActivityType.asJava) ) parkingActivityType -> (data, vehicleInfoSummary) }) .flatMap { case (tazId, activityType2vehicleInfo) => val partialTriggersAndInquiries = Vector.newBuilder[(ScheduleTrigger, ParkingInquiry)] activityType2vehicleInfo.foldLeft((0.0, 0.0, Vector.empty[CPair[ParkingActivityType, java.lang.Double]])) { - case ((durationAcc, numEventsAcc, pmfAcc), (activityType, (_, dataSummary))) => + case ((powerAcc, numEventsAcc, pmfAcc), (activityType, (_, dataSummary))) => val scaleUpFactor = scaleUpFactors.getOrElse(activityType, defaultScaleUpFactor) - 1 - val duration = scaleUpFactor * dataSummary.totDurationInSec - val pmf = new CPair[ParkingActivityType, java.lang.Double](activityType, duration) + val power = scaleUpFactor * dataSummary.totPowerInKW + val pmf = new CPair[ParkingActivityType, java.lang.Double](activityType, power) val numEvents = scaleUpFactor * dataSummary.numObservation - (durationAcc + duration, numEventsAcc + numEvents, pmfAcc :+ pmf) + (powerAcc + power, numEventsAcc + numEvents, pmfAcc :+ pmf) } match { - case (totDurationInSecondsToSimulate, totNumberOfEvents, pmf) if totDurationInSecondsToSimulate > 0 => + case (totPowerInKWToSimulate, totNumberOfEvents, pmf) if totPowerInKWToSimulate > 0 => val distribution = new EnumeratedDistribution[ParkingActivityType](mersenne, pmf.asJava) val rate = totNumberOfEvents / timeStepByHour - var cumulatedSimulatedDuration = 0.0 + var cumulatedSimulatedPower = 0.0 var timeStep = 0 - while (cumulatedSimulatedDuration < totDurationInSecondsToSimulate && timeStep < timeStepByHour * 3600) { + while (cumulatedSimulatedPower < totPowerInKWToSimulate && timeStep < timeStepByHour * 3600) { val (_, summary) = activityType2vehicleInfo(distribution.sample()) val duration = Math.max( summary.getDuration(rand), beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds.toInt ) timeStep += roundUniformly(nextTimeStepUsingPoissonProcess(rate), rand).toInt - //val energyToCharge = summary.getEnergy(rand) val vehicleTypeInfo = summary.vehicleTypeInfoDistribution.sample() val soc = summary.meanSOC / 100.0 + val energyToCharge = summary.getEnergy(rand) val taz = getBeamServices.beamScenario.tazTreeMap.getTAZ(tazId).get val destinationUtm = TAZTreeMap.randomLocationInTAZ(taz, rand) + val activityType = summary.activityTypeDistribution.sample() + val reservedFor = vehicleTypeInfo.reservedFor val beamVehicle = getBeamVehicle(vehicleTypeInfo, soc) val personId = getPerson(beamVehicle.id) val startTime = timeBin + timeStep val parkingInquiry = ParkingInquiry( SpaceTime(destinationUtm, startTime), - vehicleTypeInfo.activityType, - vehicleTypeInfo.reservedFor, + activityType, + reservedFor, Some(beamVehicle), None, // remainingTripData Some(personId), @@ -217,9 +227,8 @@ trait ScaleUpCharging extends { searchMode = ParkingSearchMode.DestinationCharging, triggerId = triggerId ) - //log.debug(s"Creating parking inquiry with request id ${parkingInquiry.requestId} as $parkingInquiry") val trigger = ScheduleTrigger(PlanParkingInquiryTrigger(startTime, parkingInquiry.requestId), self) - cumulatedSimulatedDuration += duration + cumulatedSimulatedPower += toPowerInKW(energyToCharge, duration) partialTriggersAndInquiries += ((trigger, parkingInquiry)) } case _ => @@ -242,8 +251,10 @@ trait ScaleUpCharging extends { if (cnmConfig.scaleUp.enabled && !isVirtualCar(chargingVehicle.vehicle.id)) { val vehicle = chargingVehicle.vehicle val stall = chargingVehicle.stall - val vehicleIdArray = vehicle.id.toString.split("-") - val vehicleAlias = if (vehicleIdArray.length > 1) vehicleIdArray(0) else "personalVehicle" + val vehicleAlias = + if (vehicle.isRidehail) "rideHail" + else if (vehicle.isSharedVehicle) "sharedVehicle" + else "personalVehicle" val estimatedChargingDuration = Math.max( chargingVehicle.estimatedParkingDuration, beamConfig.beam.agentsim.agents.parking.estimatedMinParkingDurationInSeconds.toInt @@ -258,18 +269,16 @@ trait ScaleUpCharging extends { vehicleRequests.synchronized { val key = (stall.tazId, activityTypeStringToEnum(chargingVehicle.activityType)) vehicleRequests.put( - key, { - val vehicleRequestInfo = VehicleRequestInfo( - energyToCharge, - Math.min(durationToCharge, estimatedChargingDuration), - 100 * Math.min(Math.max(vehicle.getStateOfCharge, 0), 1), - chargingVehicle.activityType, - vehicle.beamVehicleType, - vehicleAlias, - VehicleManager.getReservedFor(vehicle.vehicleManagerId.get()).getOrElse(VehicleManager.AnyManager) - ) - vehicleRequests.getOrElse(key, List.empty) :+ vehicleRequestInfo - } + key, + vehicleRequests.getOrElse(key, List.empty) :+ VehicleRequestInfo( + energyToCharge, + Math.min(durationToCharge, estimatedChargingDuration), + 100 * Math.min(Math.max(vehicle.getStateOfCharge, 0), 1), + chargingVehicle.activityType, + vehicle.beamVehicleType, + vehicleAlias, + VehicleManager.getReservedFor(vehicle.vehicleManagerId.get()).getOrElse(VehicleManager.AnyManager) + ) ) } } @@ -336,11 +345,10 @@ object ScaleUpCharging { case class VehicleTypeInfo( vehicleType: BeamVehicleType, - activityType: String, vehicleAlias: String, reservedFor: ReservedFor ) { - override def toString: String = s"${vehicleType.id.toString}-$activityType-$vehicleAlias-${reservedFor.toString}" + override def toString: String = s"${vehicleType.id.toString}|$vehicleAlias|${reservedFor.toString}" override val hashCode: Int = toString.hashCode } @@ -354,7 +362,8 @@ object ScaleUpCharging { varianceSOC: Double, meanEnergy: Double, varianceEnergy: Double, - vehicleTypeInfoDistribution: EnumeratedDistribution[VehicleTypeInfo] + vehicleTypeInfoDistribution: EnumeratedDistribution[VehicleTypeInfo], + activityTypeDistribution: EnumeratedDistribution[String] ) { def getDuration(rand: Random): Int = logNormalDistribution(meanDuration, varianceDuration, rand).toInt def getSOC(rand: Random): Double = logNormalDistribution(meanSOC, varianceSOC, rand) From cb3ef68b6774ca71ff2ac0ca3f8c6c60a7a56968 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Fri, 22 Jul 2022 18:50:59 -0700 Subject: [PATCH 249/307] potential fix to bad completion --- .../infrastructure/ScaleUpCharging.scala | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index d52eb87da88..c427f08dc40 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -145,13 +145,20 @@ trait ScaleUpCharging extends { val listDur = data.map(_.durationToChargeInSec) val totDurationInSec = listDur.sum val meanDur: Double = listDur.sum / numObservation.toDouble - val varianceDur: Double = listDur.map(d => math.pow(d - meanDur, 2)).sum / numObservation + val varianceDur: Double = listDur.map(d => d - meanDur).map(t => t * t).sum / numObservation val listSOC = data.map(_.stateOfCharge) val meanSOC: Double = listSOC.sum / numObservation.toDouble - val varianceSOC: Double = listSOC.map(soc => math.pow(soc - meanSOC, 2)).sum / numObservation + val varianceSOC: Double = listSOC.map(soc => soc - meanSOC).map(t => t * t).sum / numObservation val listEnergy = data.map(_.energyToChargeInJoule) val meanEnergy: Double = listEnergy.sum / listEnergy.size.toDouble - val varianceEnergy: Double = listEnergy.map(energy => math.pow(energy - meanEnergy, 2)).sum / numObservation + val varianceEnergy: Double = listEnergy.map(energy => energy - meanEnergy).map(t => t * t).sum / numObservation + val pmfActivityType = + data + .groupBy(_.activityType) + .map { case (activityType, elems) => + new CPair[String, java.lang.Double](activityType, elems.size.toDouble) + } + .toVector val pmfVehicleTypeInfo = data .groupBy(record => (record.vehicleType, record.vehicleAlias, record.reservedFor)) .map { case ((vehicleType, vehicleAlias, reservedFor), elems) => @@ -161,13 +168,6 @@ trait ScaleUpCharging extends { ) } .toVector - val pmfActivityType = - data - .groupBy(_.activityType) - .map { case (activityType, elems) => - new CPair[String, java.lang.Double](activityType, elems.size.toDouble) - } - .toVector val vehicleInfoSummary = VehicleInfoSummary( numObservation = numObservation, totPowerInKW = totPowerInKW, @@ -309,11 +309,7 @@ trait ScaleUpCharging extends { * @return */ protected def getPerson(vehicleId: Id[BeamVehicle]): Id[Person] = { - val vehicleIdArray = vehicleId.toString.split("-") - val personIdString = if (vehicleIdArray.length > 1 && vehicleIdArray(0).startsWith(VIRTUAL_ALIAS)) { - vehicleIdArray.drop(1).mkString("-") - } else vehicleId.toString - Id.create(VIRTUAL_ALIAS + "-" + personIdString, classOf[Person]) + Id.create(vehicleId.toString, classOf[Person]) } /** @@ -370,9 +366,9 @@ object ScaleUpCharging { def getEnergy(rand: Random): Double = logNormalDistribution(meanEnergy, varianceEnergy, rand) private def logNormalDistribution(mean: Double, variance: Double, rand: Random) /* mean and variance of Y */ = { - val phi = Math.sqrt(variance + Math.pow(mean, 2)) - val mu = Math.log(Math.pow(mean, 2) / phi) /* mean of log(Y) */ - val sigma = Math.sqrt(Math.log(Math.pow(phi, 2) / Math.pow(mean, 2))) /* std dev of log(Y) */ + val phi = Math.sqrt(variance + (mean * mean)) + val mu = if (mean <= 0) 0.0 else Math.log((mean * mean) / phi) /* mean of log(Y) */ + val sigma = if (phi <= 0) 0.0 else Math.sqrt(Math.log((phi * phi) / (mean * mean))) /* std dev of log(Y) */ val x = MathUtils.roundUniformly(Math.max(mu + (rand.nextGaussian() * sigma), 0.0), rand).toInt Math.exp(x) } From 7344b7416cd0a48b91cca32635d1c4948b7746fb Mon Sep 17 00:00:00 2001 From: frikit Date: Fri, 22 Jul 2022 20:36:11 +0100 Subject: [PATCH 250/307] Fix for display long legend text for NonArrivedAgentsAtTheEndOfSimulation.png --- .../java/beam/analysis/plots/PersonTravelTimeAnalysis.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/beam/analysis/plots/PersonTravelTimeAnalysis.java b/src/main/java/beam/analysis/plots/PersonTravelTimeAnalysis.java index 80458b7ff48..20e4a46d1d6 100644 --- a/src/main/java/beam/analysis/plots/PersonTravelTimeAnalysis.java +++ b/src/main/java/beam/analysis/plots/PersonTravelTimeAnalysis.java @@ -342,6 +342,9 @@ private void createNonArrivalAgentAtTheEndOfSimulationGraph(int iterationNumber) final JFreeChart chart = GraphUtils.createStackedBarChartWithDefaultSettings(defaultCategoryDataset, graphTitle, "modes", "count", false); CategoryPlot plot = chart.getCategoryPlot(); + + plot.getDomainAxis().setMaximumCategoryLabelLines(3); + GraphUtils.plotLegendItems(plot, defaultCategoryDataset.getRowCount()); String graphImageFile = ioCotroller.getIterationFilename(iterationNumber, "NonArrivedAgentsAtTheEndOfSimulation.png"); GraphUtils.saveJFreeChartAsPNG(chart, graphImageFile, GraphsStatsAgentSimEventsListener.GRAPH_WIDTH, GraphsStatsAgentSimEventsListener.GRAPH_HEIGHT); From fe49b6b55580a18aa703a3d6b22cf41438b7f8b9 Mon Sep 17 00:00:00 2001 From: GrigoryD Date: Tue, 26 Jul 2022 15:36:40 +0200 Subject: [PATCH 251/307] [issue-3523] fix beam doesnt stop when exception occurs --- .gitignore | 1 + src/main/java/beam/utils/DebugLib.java | 6 +++-- .../scheduler/BeamAgentScheduler.scala | 2 +- src/main/scala/beam/sim/RunBeam.scala | 23 ++++++++++++++----- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 2655be93f77..140922f446e 100755 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,4 @@ src/main/scala/beam/sandbox test/scala/beam/sandbox log-path_IS_UNDEFINED/ .Rproj.user +thread_dump_from_RunBeam.txt.gz diff --git a/src/main/java/beam/utils/DebugLib.java b/src/main/java/beam/utils/DebugLib.java index 375c3ce063d..41c7556830b 100755 --- a/src/main/java/beam/utils/DebugLib.java +++ b/src/main/java/beam/utils/DebugLib.java @@ -38,10 +38,12 @@ public static void busyWait(int nanos) { while(System.nanoTime() - start < nanos); } - public static List currentThreadDump() { + /* + Dumps all current threads + */ + public static List currentThreadsDump() { ThreadMXBean bean = ManagementFactory.getThreadMXBean(); ThreadInfo[] infos = bean.dumpAllThreads(true, true); return Arrays.stream(infos).map(Object::toString).collect(Collectors.toList()); } - } diff --git a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala index 0bc64449146..cc21e45ebc1 100644 --- a/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala +++ b/src/main/scala/beam/agentsim/scheduler/BeamAgentScheduler.scala @@ -416,7 +416,7 @@ class BeamAgentScheduler( ) FileUtils.writeToFile( s"$outputDir/scheduler_shutdown_thread_dump.txt.gz", - DebugLib.currentThreadDump().asScala.iterator + DebugLib.currentThreadsDump().asScala.iterator ) } } diff --git a/src/main/scala/beam/sim/RunBeam.scala b/src/main/scala/beam/sim/RunBeam.scala index 8ca0315d83e..1cb29512182 100755 --- a/src/main/scala/beam/sim/RunBeam.scala +++ b/src/main/scala/beam/sim/RunBeam.scala @@ -1,7 +1,7 @@ package beam.sim -import beam.utils.MathUtils import beam.api.{BeamCustomizationAPI, DefaultAPIImplementation} +import beam.utils.{DebugLib, FileUtils, MathUtils} import ch.qos.logback.classic.util.ContextInitializer import org.matsim.core.controler.AbstractModule @@ -23,10 +23,22 @@ object RunBeam extends BeamHelper { println(s"Heap size: ${MathUtils.formatBytes(Runtime.getRuntime.totalMemory())}") println(s"Heap max memory: ${MathUtils.formatBytes(Runtime.getRuntime.maxMemory())}") println(s"Heap free memory: ${MathUtils.formatBytes(Runtime.getRuntime.freeMemory())}") - - runBeamUsing(args, None) - logger.info("Exiting BEAM") - System.exit(0) + // this try-catch is needed in case an exception is thrown and the application hangs with some threads locked + // e.g. for this method LoggingEventsManager#handleBlocking() + try { + runBeamUsing(args, None) + } catch { + case e: Exception => + { + val threadDumpFileName = "thread_dump_from_RunBeam.txt.gz" + logger.error(s"Exception occurred: {}", e.getMessage) + FileUtils.writeToFile(threadDumpFileName,DebugLib.currentThreadsDump().asScala.iterator) + logger.info("Thread dump has been saved to the file {}", threadDumpFileName) + System.exit(2) + } + logger.info("Exiting BEAM") + System.exit(0) + } } def configureDefaultAPI: AbstractModule = { @@ -38,5 +50,4 @@ object RunBeam extends BeamHelper { } abstractModule } - } From 40aa39ea22300e1846cfd1bab6f477ee3090e53f Mon Sep 17 00:00:00 2001 From: GrigoryD Date: Tue, 26 Jul 2022 16:02:00 +0200 Subject: [PATCH 252/307] [issue-3523] scalafmt --- src/main/scala/beam/sim/RunBeam.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/sim/RunBeam.scala b/src/main/scala/beam/sim/RunBeam.scala index 1cb29512182..fe38081b623 100755 --- a/src/main/scala/beam/sim/RunBeam.scala +++ b/src/main/scala/beam/sim/RunBeam.scala @@ -32,7 +32,7 @@ object RunBeam extends BeamHelper { { val threadDumpFileName = "thread_dump_from_RunBeam.txt.gz" logger.error(s"Exception occurred: {}", e.getMessage) - FileUtils.writeToFile(threadDumpFileName,DebugLib.currentThreadsDump().asScala.iterator) + FileUtils.writeToFile(threadDumpFileName, DebugLib.currentThreadsDump().asScala.iterator) logger.info("Thread dump has been saved to the file {}", threadDumpFileName) System.exit(2) } From bcd3fc467649002a19a235b041382465f62c4aef Mon Sep 17 00:00:00 2001 From: GrigoryD Date: Wed, 27 Jul 2022 16:38:54 +0200 Subject: [PATCH 253/307] [issue-3523] add cp thread dump to final path --- aws/src/main/python/beam_lambda/lambda_function.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 4d156f1713e..de8a323de46 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -57,6 +57,7 @@ - sudo cp "$file.zip" "$finalPath" - done; - sudo cp /home/ubuntu/git/beam/gc_* "$finalPath" + - sudo cp /home/ubuntu/git/beam/thread_dump_from_RunBeam.txt.gz "$finalPath" - sudo cp /var/log/cloud-init-output.log "$finalPath" - sudo gzip /home/ubuntu/cpu_ram_usage.csv - sudo cp /home/ubuntu/cpu_ram_usage* "$finalPath" From 38fd555853b4e127f069d8f31f902afacd649bcf Mon Sep 17 00:00:00 2001 From: GrigoryD Date: Wed, 27 Jul 2022 16:47:18 +0200 Subject: [PATCH 254/307] [issue-3523] improve javadoc for try-catch in RunBeam --- src/main/scala/beam/sim/RunBeam.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/sim/RunBeam.scala b/src/main/scala/beam/sim/RunBeam.scala index fe38081b623..ef24077fbfa 100755 --- a/src/main/scala/beam/sim/RunBeam.scala +++ b/src/main/scala/beam/sim/RunBeam.scala @@ -23,8 +23,9 @@ object RunBeam extends BeamHelper { println(s"Heap size: ${MathUtils.formatBytes(Runtime.getRuntime.totalMemory())}") println(s"Heap max memory: ${MathUtils.formatBytes(Runtime.getRuntime.maxMemory())}") println(s"Heap free memory: ${MathUtils.formatBytes(Runtime.getRuntime.freeMemory())}") - // this try-catch is needed in case an exception is thrown and the application hangs with some threads locked - // e.g. for this method LoggingEventsManager#handleBlocking() + // this try-catch is needed in case an exception is thrown and the application hangs with some threads locked + // e.g. we've noticed, that this method LoggingEventsManager#handleBlocking() is likely to have some code + // that hangs a process and the application cannot be killed, see https://github.com/LBNL-UCB-STI/beam/issues/3524 try { runBeamUsing(args, None) } catch { From 44a13ed53efbd438900b19515103280849073b99 Mon Sep 17 00:00:00 2001 From: GrigoryD Date: Wed, 27 Jul 2022 16:49:25 +0200 Subject: [PATCH 255/307] [issue-3523] move sys.exit out of try-catch --- src/main/scala/beam/sim/RunBeam.scala | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/scala/beam/sim/RunBeam.scala b/src/main/scala/beam/sim/RunBeam.scala index ef24077fbfa..4d23b05d3ea 100755 --- a/src/main/scala/beam/sim/RunBeam.scala +++ b/src/main/scala/beam/sim/RunBeam.scala @@ -30,16 +30,14 @@ object RunBeam extends BeamHelper { runBeamUsing(args, None) } catch { case e: Exception => - { - val threadDumpFileName = "thread_dump_from_RunBeam.txt.gz" - logger.error(s"Exception occurred: {}", e.getMessage) - FileUtils.writeToFile(threadDumpFileName, DebugLib.currentThreadsDump().asScala.iterator) - logger.info("Thread dump has been saved to the file {}", threadDumpFileName) - System.exit(2) - } - logger.info("Exiting BEAM") - System.exit(0) + val threadDumpFileName = "thread_dump_from_RunBeam.txt.gz" + logger.error(s"Exception occurred: {}", e.getMessage) + FileUtils.writeToFile(threadDumpFileName, DebugLib.currentThreadsDump().asScala.iterator) + logger.info("Thread dump has been saved to the file {}", threadDumpFileName) + System.exit(2) } + logger.info("Exiting BEAM") + System.exit(0) } def configureDefaultAPI: AbstractModule = { From 8a19f3ca5a2981bcfd38eda5ee1243d1bdf15042 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Thu, 28 Jul 2022 15:13:59 +0300 Subject: [PATCH 256/307] a fix for terminateEC2, stopEC2 and startEC2 commands --- aws/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/build.gradle b/aws/build.gradle index 73df38ae148..aeb94769f83 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -296,7 +296,7 @@ def buildPayload(command) { return """{ "instance_ids": "${project.findProperty('instanceIds')}", "region": "${project.findProperty('region') ?: defaultRegion}", - "budget_override": ${ext.getParameterValue('budgetOverride') ?: false} + "budget_override": ${project.findProperty('budgetOverride') ?: false}, "command": "$command" }""" } From 2a4798f0c8b5840a1b0265d7e225fabcda09e6ac Mon Sep 17 00:00:00 2001 From: GrigoryD Date: Thu, 28 Jul 2022 19:43:42 +0200 Subject: [PATCH 257/307] [issue-3523] fix lambda copy thread dump --- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index de8a323de46..9c6a7b54099 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -57,8 +57,8 @@ - sudo cp "$file.zip" "$finalPath" - done; - sudo cp /home/ubuntu/git/beam/gc_* "$finalPath" - - sudo cp /home/ubuntu/git/beam/thread_dump_from_RunBeam.txt.gz "$finalPath" - sudo cp /var/log/cloud-init-output.log "$finalPath" + - sudo cp /home/ubuntu/git/beam/thread_dump_from_RunBeam.txt.gz "$finalPath" - sudo gzip /home/ubuntu/cpu_ram_usage.csv - sudo cp /home/ubuntu/cpu_ram_usage* "$finalPath" - sudo aws --region "$S3_REGION" s3 cp "$finalPath" s3://beam-outputs/"$finalPath" --recursive; From 8b888999e00ea211339cb6e919c9581f1bcabbc1 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Thu, 28 Jul 2022 21:12:01 +0600 Subject: [PATCH 258/307] Refactor `jupyterEC2` task to use `simulateBeam` lambda --- aws/build.gradle | 30 ++- .../python/beam_lambda/lambda_function.py | 226 ++++++++++-------- .../lambda_function.py | 144 ----------- 3 files changed, 139 insertions(+), 261 deletions(-) delete mode 100644 aws/src/main/python/start-jupyter-on-instance/lambda_function.py diff --git a/aws/build.gradle b/aws/build.gradle index 73df38ae148..bfeb8cd3501 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -246,18 +246,26 @@ task terminateEC2(type: AWSLambdaInvokeTask) { task jupyterEC2(type: AWSLambdaInvokeTask) { doFirst { - functionName = "start-jupyter-on-instance" + functionName = "simulateBeam" invocationType = InvocationType.RequestResponse - payload = """ - { - "budget_override": "${project.findProperty('budgetOverride') ?: false}", - "instance_type": "${project.findProperty('instanceType') ?: 'r5.xlarge'}", - "title": "${project.findProperty('title') ?: 'jupyter-notebook'}", - "region": "${project.findProperty('region') ?: defaultRegion}", - "storage_size": ${project.findProperty('storageSize') ?: 128}, - "token": "${project.findProperty("jupyterToken") ?: UUID.randomUUID().toString()}" - } - """ + payload = """{ + "title": "${(project.findProperty('title') ?: 'jupyter') + '_' + getCurrentGitUserEmail()}", + "git_user_email": "${getCurrentGitUserEmail()}", + "branch": "develop", + "storage_size": ${project.findProperty('storageSize') ?: 128}, + "instance_type": "${project.findProperty('instanceType') ?: 'r5.xlarge'}", + "region": "${project.findProperty('region') ?: defaultRegion}", + "shutdown_behaviour": "terminate", + "command": "deploy", + "run_grafana" : false, + "run_helics" : false, + "run_jupyter" : true, + "run_beam": false, + "jupyter_token" : "${project.findProperty("jupyterToken") ?: UUID.randomUUID().toString()}", + "is_spot" : false, + "budget_override": ${project.findProperty('budgetOverride') ?: false} + }""" + } doLast { printResult(payload, invokeResult) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index de8a323de46..f18a24f9b61 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -158,7 +158,10 @@ runcmd: - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh - - sudo chmod +x /home/ubuntu/beam_stuck_guard.sh + - if [ "$RUN_BEAM" = "True" ] + - then + - sudo chmod +x /home/ubuntu/beam_stuck_guard.sh + - fi - cd /home/ubuntu - ./write-cpu-ram-usage.sh 20 > cpu_ram_usage.csv & - cd /home/ubuntu/git @@ -168,8 +171,6 @@ - ln -sf /var/log/cloud-init-output.log /home/ubuntu/git/beam/cloud-init-output.log - sudo chmod 644 /var/log/cloud-init-output.log - sudo chmod 644 /home/ubuntu/git/beam/cloud-init-output.log - - echo "-------------------Starting Beam Sim----------------------" - - echo $(date +%s) > /tmp/.starttime - cd /home/ubuntu/git/beam - if [ "$COMMIT" = "HEAD" ] - then @@ -214,114 +215,120 @@ - done - done - - rm -rf /home/ubuntu/git/beam/test/input/sf-light/r5/network.dat - - hello_msg=$(printf "Run Started \\n Run Name** $TITLED** \\n Instance ID %s \\n Instance type **%s** \\n Host name **%s** \\n Web browser ** http://%s:8000 ** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname)) - - start_json=$(printf "{ - \\"command\\":\\"add\\", - \\"type\\":\\"beam\\", - \\"sheet_id\\":\\"$SHEET_ID\\", - \\"run\\":{ - \\"status\\":\\"Run Started\\", - \\"name\\":\\"$TITLED\\", - \\"instance_id\\":\\"%s\\", - \\"instance_type\\":\\"%s\\", - \\"host_name\\":\\"%s\\", - \\"browser\\":\\"http://%s:8000\\", - \\"branch\\":\\"$BRANCH\\", - \\"commit\\":\\"$RESOLVED_COMMIT\\", - \\"data_branch\\":\\"$DATA_BRANCH\\", - \\"data_commit\\":\\"$RESOLVED_DATA_COMMIT\\", - \\"region\\":\\"$REGION\\", - \\"batch\\":\\"$UID\\", - \\"s3_link\\":\\"%s\\", - \\"max_ram\\":\\"$MAX_RAM\\", - \\"profiler_type\\":\\"$PROFILER\\", - \\"config_file\\":\\"$CONFIG\\", - \\"sigopt_client_id\\":\\"$SIGOPT_CLIENT_ID\\", - \\"sigopt_dev_id\\":\\"$SIGOPT_DEV_ID\\" - } - }" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname)) - - echo $start_json - - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$start_json" - - chmod +x /tmp/slack.sh - - echo "notification sent..." - - echo "notification saved..." - - crontab /tmp/cron_jobs - - crontab -l - - echo "notification scheduled..." - - if [ "$RUN_JUPYTER" = "True" ] - then - echo "Starting Jupyter" - sudo ./gradlew jupyterStart -Puser=root -PjupyterToken=$JUPYTER_TOKEN - fi - - - 'echo "gradlew assemble: $(date)"' - - ./gradlew assemble - - 'echo "sudo chown -R ubuntu:ubuntu ."' - - sudo chown -R ubuntu:ubuntu . - - echo "looping config ..." - - export MAXRAM=$MAX_RAM - - export SIGOPT_CLIENT_ID="$SIGOPT_CLIENT_ID" - - export SIGOPT_DEV_ID="$SIGOPT_DEV_ID" - - export GOOGLE_API_KEY="$GOOGLE_API_KEY" - - echo $MAXRAM - - /tmp/slack.sh "$hello_msg" - - - s3p="" - - for cf in $CONFIG - - do - - echo "-------------------running $cf----------------------" - - $RUN_SCRIPT - - done - - echo "-------------------running Health Analysis Script----------------------" - - python3 src/main/python/general_analysis/simulation_health_analysis.py - - while IFS="," read -r metric count - - do - - export $metric=$count - - done < RunHealthAnalysis.txt - - - curl -H "Authorization:Bearer $SLACK_TOKEN" -F file=@RunHealthAnalysis.txt -F initial_comment="Beam Health Analysis" -F channels="$SLACK_CHANNEL" "https://slack.com/api/files.upload" - - s3glip="" - - if [ "$S3_PUBLISH" = "True" ] + + - if [ "$RUN_BEAM" = "True" ] - then - - s3glip="\\n S3 output url ${s3p#","}" + + - echo "-------------------Starting Beam Sim----------------------" + - echo $(date +%s) > /tmp/.starttime + - rm -rf /home/ubuntu/git/beam/test/input/sf-light/r5/network.dat + - hello_msg=$(printf "Run Started \\n Run Name** $TITLED** \\n Instance ID %s \\n Instance type **%s** \\n Host name **%s** \\n Web browser ** http://%s:8000 ** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname)) + - start_json=$(printf "{ + \\"command\\":\\"add\\", + \\"type\\":\\"beam\\", + \\"sheet_id\\":\\"$SHEET_ID\\", + \\"run\\":{ + \\"status\\":\\"Run Started\\", + \\"name\\":\\"$TITLED\\", + \\"instance_id\\":\\"%s\\", + \\"instance_type\\":\\"%s\\", + \\"host_name\\":\\"%s\\", + \\"browser\\":\\"http://%s:8000\\", + \\"branch\\":\\"$BRANCH\\", + \\"commit\\":\\"$RESOLVED_COMMIT\\", + \\"data_branch\\":\\"$DATA_BRANCH\\", + \\"data_commit\\":\\"$RESOLVED_DATA_COMMIT\\", + \\"region\\":\\"$REGION\\", + \\"batch\\":\\"$UID\\", + \\"s3_link\\":\\"%s\\", + \\"max_ram\\":\\"$MAX_RAM\\", + \\"profiler_type\\":\\"$PROFILER\\", + \\"config_file\\":\\"$CONFIG\\", + \\"sigopt_client_id\\":\\"$SIGOPT_CLIENT_ID\\", + \\"sigopt_dev_id\\":\\"$SIGOPT_DEV_ID\\" + } + }" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname)) + - echo $start_json + - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$start_json" + - chmod +x /tmp/slack.sh + - echo "notification sent..." + - echo "notification saved..." + - crontab /tmp/cron_jobs + - crontab -l + - echo "notification scheduled..." + + - 'echo "gradlew assemble: $(date)"' + - ./gradlew assemble + - 'echo "sudo chown -R ubuntu:ubuntu ."' + - sudo chown -R ubuntu:ubuntu . + - echo "looping config ..." + - export MAXRAM=$MAX_RAM + - export SIGOPT_CLIENT_ID="$SIGOPT_CLIENT_ID" + - export SIGOPT_DEV_ID="$SIGOPT_DEV_ID" + - export GOOGLE_API_KEY="$GOOGLE_API_KEY" + - echo $MAXRAM + - /tmp/slack.sh "$hello_msg" + + - s3p="" + - for cf in $CONFIG + - do + - echo "-------------------running $cf----------------------" + - $RUN_SCRIPT + - done + - echo "-------------------running Health Analysis Script----------------------" + - python3 src/main/python/general_analysis/simulation_health_analysis.py + - while IFS="," read -r metric count + - do + - export $metric=$count + - done < RunHealthAnalysis.txt + + - curl -H "Authorization:Bearer $SLACK_TOKEN" -F file=@RunHealthAnalysis.txt -F initial_comment="Beam Health Analysis" -F channels="$SLACK_CHANNEL" "https://slack.com/api/files.upload" + - s3glip="" + - if [ "$S3_PUBLISH" = "True" ] + - then + - s3glip="\\n S3 output url ${s3p#","}" + - fi + - bye_msg=$(printf "Run Completed \\n Run Name** $TITLED** \\n Instance ID %s \\n Instance type **%s** \\n Host name **%s** \\n Web browser ** http://%s:8000 ** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT %s \\n Shutdown in $SHUTDOWN_WAIT minutes" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname) "$s3glip") + - echo "$bye_msg" + - stop_json=$(printf "{ + \\"command\\":\\"add\\", + \\"type\\":\\"beam\\", + \\"sheet_id\\":\\"$SHEET_ID\\", + \\"run\\":{ + \\"status\\":\\"Run Completed\\", + \\"name\\":\\"$TITLED\\", + \\"instance_id\\":\\"%s\\", + \\"instance_type\\":\\"%s\\", + \\"host_name\\":\\"%s\\", + \\"browser\\":\\"http://%s:8000\\", + \\"branch\\":\\"$BRANCH\\", + \\"commit\\":\\"$RESOLVED_COMMIT\\", + \\"data_branch\\":\\"$DATA_BRANCH\\", + \\"data_commit\\":\\"$RESOLVED_DATA_COMMIT\\", + \\"region\\":\\"$REGION\\", + \\"batch\\":\\"$UID\\", + \\"s3_link\\":\\"%s\\", + \\"max_ram\\":\\"$MAX_RAM\\", + \\"profiler_type\\":\\"$PROFILER\\", + \\"config_file\\":\\"$CONFIG\\", + \\"stacktrace\\":\\"$stacktrace\\", + \\"died_actors\\":\\"$actorDied\\", + \\"error\\":\\"$error\\", + \\"warning\\":\\"$warn\\", + \\"sigopt_client_id\\":\\"$SIGOPT_CLIENT_ID\\", + \\"sigopt_dev_id\\":\\"$SIGOPT_DEV_ID\\" + } + }" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname) "${s3p#","}") + - /tmp/slack.sh "$bye_msg" + - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$stop_json" + - $END_SCRIPT + - sudo shutdown -h +$SHUTDOWN_WAIT - fi - - bye_msg=$(printf "Run Completed \\n Run Name** $TITLED** \\n Instance ID %s \\n Instance type **%s** \\n Host name **%s** \\n Web browser ** http://%s:8000 ** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT %s \\n Shutdown in $SHUTDOWN_WAIT minutes" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname) "$s3glip") - - echo "$bye_msg" - - stop_json=$(printf "{ - \\"command\\":\\"add\\", - \\"type\\":\\"beam\\", - \\"sheet_id\\":\\"$SHEET_ID\\", - \\"run\\":{ - \\"status\\":\\"Run Completed\\", - \\"name\\":\\"$TITLED\\", - \\"instance_id\\":\\"%s\\", - \\"instance_type\\":\\"%s\\", - \\"host_name\\":\\"%s\\", - \\"browser\\":\\"http://%s:8000\\", - \\"branch\\":\\"$BRANCH\\", - \\"commit\\":\\"$RESOLVED_COMMIT\\", - \\"data_branch\\":\\"$DATA_BRANCH\\", - \\"data_commit\\":\\"$RESOLVED_DATA_COMMIT\\", - \\"region\\":\\"$REGION\\", - \\"batch\\":\\"$UID\\", - \\"s3_link\\":\\"%s\\", - \\"max_ram\\":\\"$MAX_RAM\\", - \\"profiler_type\\":\\"$PROFILER\\", - \\"config_file\\":\\"$CONFIG\\", - \\"stacktrace\\":\\"$stacktrace\\", - \\"died_actors\\":\\"$actorDied\\", - \\"error\\":\\"$error\\", - \\"warning\\":\\"$warn\\", - \\"sigopt_client_id\\":\\"$SIGOPT_CLIENT_ID\\", - \\"sigopt_dev_id\\":\\"$SIGOPT_DEV_ID\\" - } - }" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname) "${s3p#","}") - - /tmp/slack.sh "$bye_msg" - - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$stop_json" - - $END_SCRIPT - - sudo shutdown -h +$SHUTDOWN_WAIT ''')) instance_types = ['t2.nano', 't2.micro', 't2.small', 't2.medium', 't2.large', 't2.xlarge', 't2.2xlarge', @@ -776,6 +783,7 @@ def get_param(param_name): region = get_param('region') shutdown_behaviour = get_param('shutdown_behaviour') is_spot = event.get('is_spot', False) + run_beam = event.get('run_beam', True) if missing_parameters: return "Unable to start, missing parameters: " + ", ".join(missing_parameters) @@ -860,6 +868,7 @@ def get_param(param_name): .replace('$SLACK_CHANNEL', os.environ['SLACK_CHANNEL']) \ .replace('$SHEET_ID', os.environ['SHEET_ID']) \ .replace('$RUN_JUPYTER', str(run_jupyter)) \ + .replace('$RUN_BEAM', str(run_beam)) \ .replace('$JUPYTER_TOKEN', jupyter_token) if is_spot: min_cores = event.get('min_cores', 0) @@ -870,7 +879,9 @@ def get_param(param_name): else: instance_id = deploy(script, instance_type, region.replace("-", "_")+'_', shutdown_behaviour, runName, volume_size, git_user_email, deploy_type_tag, budget_override) host = get_dns(instance_id) - txt += 'Started batch: {batch} with run name: {titled} for branch/commit {branch}/{commit} at host {dns} (InstanceID: {instance_id}). '.format(branch=branch, titled=runName, commit=commit_id, dns=host, batch=uid, instance_id=instance_id) + + if run_beam: + txt += 'Started batch: {batch} with run name: {titled} for branch/commit {branch}/{commit} at host {dns} (InstanceID: {instance_id}). '.format(branch=branch, titled=runName, commit=commit_id, dns=host, batch=uid, instance_id=instance_id) if run_grafana: txt += ' Grafana will be available at http://{dns}:3003/d/dvib8mbWz/beam-simulation-global-view.'.format(dns=host) @@ -878,9 +889,12 @@ def get_param(param_name): if run_helics: txt += ' Helics scripts with recorder will be run in parallel with BEAM.' - if run_jupyter: + if run_jupyter and run_beam: txt += ' Jupyter will be run in parallel with BEAM. Url: http://{dns}:8888/?token={token}'.format(dns=host, token=jupyter_token) + if run_jupyter and not run_beam: + txt += ' Jupyter is starting. Url: http://{dns}:8888/?token={token}'.format(dns=host, token=jupyter_token) + runNum += 1 else: txt = 'Unable to start bach for branch/commit {branch}/{commit}. '.format(branch=branch, commit=commit_id) diff --git a/aws/src/main/python/start-jupyter-on-instance/lambda_function.py b/aws/src/main/python/start-jupyter-on-instance/lambda_function.py deleted file mode 100644 index a19a5cbc673..00000000000 --- a/aws/src/main/python/start-jupyter-on-instance/lambda_function.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding=utf-8 -import boto3 -import time -import logging -import os -from botocore.errorfactory import ClientError - -logger = logging.getLogger() -logger.setLevel(logging.INFO) - -regions = ['us-east-1', 'us-east-2', 'us-west-2'] - -s3 = boto3.client('s3') -ec2 = None - -initscript = ((''' -#cloud-config -runcmd: - - pip install setuptools - - pip install jupyter - - su -c "JUPYTER_TOKEN=$TOKEN jupyter-notebook --no-browser --ip=$(ec2metadata --public-hostname) --log-level=ERROR" - ubuntu - - sudo shutdown -h +30 -''')) - -instance_types = ['t2.nano', 't2.micro', 't2.small', 't2.medium', 't2.large', 't2.xlarge', 't2.2xlarge', - 'm4.large', 'm4.xlarge', 'm4.2xlarge', 'm4.4xlarge', 'm4.10xlarge', 'm4.16xlarge', - 'm5.large', 'm5.xlarge', 'm5.2xlarge', 'm5.4xlarge', 'm5.12xlarge', 'm5.24xlarge', - 'c4.large', 'c4.xlarge', 'c4.2xlarge', 'c4.4xlarge', 'c4.8xlarge', - 'f1.2xlarge', 'f1.16xlarge', - 'g2.2xlarge', 'g2.8xlarge', - 'g3.4xlarge', 'g3.8xlarge', 'g3.16xlarge', - 'p2.xlarge', 'p2.8xlarge', 'p2.16xlarge', - 'p3.2xlarge', 'p3.8xlarge', 'p3.16xlarge', - 'r4.large', 'r4.xlarge', 'r4.2xlarge', 'r4.4xlarge', 'r4.8xlarge', 'r4.16xlarge', - 'r3.large', 'r3.xlarge', 'r3.2xlarge', 'r3.4xlarge', 'r3.8xlarge', - 'x1.16xlarge', 'x1.32xlarge', - 'x1e.xlarge', 'x1e.2xlarge', 'x1e.4xlarge', 'x1e.8xlarge', 'x1e.16xlarge', 'x1e.32xlarge', - 'd2.xlarge', 'd2.2xlarge', 'd2.4xlarge', 'd2.8xlarge', - 'i2.xlarge', 'i2.2xlarge', 'i2.4xlarge', 'i2.8xlarge', - 'h1.2xlarge', 'h1.4xlarge', 'h1.8xlarge', 'h1.16xlarge', - 'i3.large', 'i3.xlarge', 'i3.2xlarge', 'i3.4xlarge', 'i3.8xlarge', 'i3.16xlarge', 'i3.metal', - 'c5.large', 'c5.xlarge', 'c5.2xlarge', 'c5.4xlarge', 'c5.9xlarge', 'c5.18xlarge', - 'c5d.large', 'c5d.xlarge', 'c5d.2xlarge', 'c5d.4xlarge', 'c5d.9xlarge', 'c5d.18xlarge', 'c5d.24xlarge', - 'r5.large', 'r5.xlarge', 'r5.2xlarge', 'r5.4xlarge', 'r5.8xlarge', 'r5.12xlarge', 'r5.24xlarge', - 'r5d.large', 'r5d.xlarge', 'r5d.2xlarge', 'r5d.4xlarge', 'r5d.12xlarge', 'r5d.24xlarge', - 'm5d.large', 'm5d.xlarge', 'm5d.2xlarge', 'm5d.4xlarge', 'm5d.12xlarge', 'm5d.24xlarge', - 'z1d.large', 'z1d.xlarge', 'z1d.2xlarge', 'z1d.3xlarge', 'z1d.6xlarge', 'z1d.12xlarge', - 'x2gd.metal', 'x2gd.16xlarge'] - -def init_ec2(region): - global ec2 - ec2 = boto3.client('ec2', region_name=region) - -def get_dns(instance_id): - host = None - while host is None: - time.sleep(2) - instances = ec2.describe_instances(InstanceIds=[instance_id]) - for r in instances['Reservations']: - for i in r['Instances']: - dns = i['PublicDnsName'] - if dns != '': - host = dns - return host - -def deploy(script, instance_type, region_prefix, instance_name, volume_size, budget_override): - res = ec2.run_instances(BlockDeviceMappings=[ - { - 'DeviceName': '/dev/sda1', - 'Ebs': { - 'VolumeSize': volume_size, - 'VolumeType': 'gp2' - } - } - ], - ImageId=os.environ[region_prefix + 'IMAGE_ID'], - InstanceType=instance_type, - UserData=script, - KeyName=os.environ[region_prefix + 'KEY_NAME'], - MinCount=1, - MaxCount=1, - SecurityGroupIds=[os.environ[region_prefix + 'SECURITY_GROUP']], - IamInstanceProfile={'Name': os.environ['IAM_ROLE'] }, - InstanceInitiatedShutdownBehavior='terminate', - TagSpecifications=[ - { - 'ResourceType': 'instance', - 'Tags': [ - { - 'Key': 'Name', - 'Value': instance_name - }, { - 'Key': 'BudgetOverride', - 'Value': str(budget_override) - } ] - } ]) - return res['Instances'][0]['InstanceId'] - -def deploy_handler(event, context): - missing_parameters = [] - - def parameter_wasnt_specified(parameter_value): - # in gradle if parameter wasn't specified then project.findProperty return 'null' - return parameter_value is None or parameter_value == 'null' - - def get_param(param_name): - param_value = event.get(param_name) - if parameter_wasnt_specified(param_value): - missing_parameters.append(param_name) - return param_value - - budget_override = event.get('budget_override', False) - runName = get_param('title') - instance_type = get_param('instance_type') - region = get_param('region') - volume_size = event.get('storage_size', 64) - token = event.get('token') - - if missing_parameters: - return "Unable to start, missing parameters: " + ", ".join(missing_parameters) - - if region not in regions: - return "Unable to start run, {region} region not supported.".format(region=region) - - if instance_type not in instance_types: - return "Unable to start run, {instance_type} instance type not supported.".format(instance_type=instance_type) - - if volume_size < 64 or volume_size > 256: - volume_size = 64 - - init_ec2(region) - - script = initscript.replace("$TOKEN", token) - - instance_id = deploy(script, instance_type, region.replace("-", "_")+'_', runName, volume_size, budget_override) - host = get_dns(instance_id) - txt = 'Started Jupyter with run name: {titled} (InstanceID: {instance_id}), url: http://{dns}:8888/?token={token}'.format(titled=runName, dns=host, instance_id=instance_id, token=token) - - return txt - -def lambda_handler(event, context): - logger.info("Incoming event: " + str(event)) - - return deploy_handler(event, context) From 6f406b36a79c90bbe918d8bdd4125aaa0495f505 Mon Sep 17 00:00:00 2001 From: frikit Date: Fri, 29 Jul 2022 21:50:04 +0100 Subject: [PATCH 259/307] Upgrade gradle 7.1.1 to 7.5 upgrade sphinx 1.0.3.Final to 2.10.1 upgrade to latest beam utils 2.17 to 2.19 upgrade scala 2.12.10 to 2.12.16(beam-utils has the same version now) Fix deprecated warnings from scala for new format method remove deprecated jcenter per gradle docs upgradedocker compose plugin --- build.gradle | 8 +- gradle/wrapper/gradle-wrapper.jar | Bin 55616 -> 60756 bytes gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 268 +++++++++++------- gradlew.bat | 39 +-- metrics2.0/build.gradle | 8 +- .../MeansOfTransportationTableReader.scala | 2 +- .../scripts/synthpop/HouseholdReader.scala | 4 +- .../scripts/synthpop/WorkForceSampler.scala | 2 +- 9 files changed, 187 insertions(+), 146 deletions(-) diff --git a/build.gradle b/build.gradle index e42f1b2c8b3..c3acd4cba0e 100755 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { gradlePluginPortal() } dependencies { - classpath group: 'kr.motd.gradle', name: 'sphinx-gradle-plugin', version: '1.0.3.Final' + classpath group: 'kr.motd.gradle', name: 'sphinx-gradle-plugin', version: '2.10.1' classpath "jp.classmethod.aws.reboot:gradle-aws-plugin-reboot:0.45" classpath "com.github.viswaramamoorthy:gradle-util-plugins:0.1.0-RELEASE" } @@ -139,7 +139,7 @@ configurations.all { dependencies { - implementation(group: 'com.github.LBNL-UCB-STI', name: 'beam-utilities', version: 'v0.2.17') { + implementation(group: 'com.github.LBNL-UCB-STI', name: 'beam-utilities', version: 'v0.2.19') { exclude group: 'com.github.LBNL-UCB-STI', module: 'r5' exclude group: 'org.matsim', module: 'matsim' } @@ -225,11 +225,11 @@ dependencies { ///////////////////////////////// // CORE Scala // - implementation "org.scala-lang:scala-library:2.12.13" + implementation "org.scala-lang:scala-library:2.12.16" implementation group: 'org.scala-lang.modules', name: "scala-xml_${scalaBinaryVersion}", version: '1.0.6' // NEEDED FOR USING REPL // - implementation "org.scala-lang:scala-compiler:2.12.13" + implementation "org.scala-lang:scala-compiler:2.12.16" // TEST Scala // testImplementation group: 'org.scalatest', name: "scalatest_${scalaBinaryVersion}", version: '3.2.9' diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 5c2d1cf016b3885f6930543d57b744ea8c220a1a..249e5832f090a2944b7473328c07c9755baa3196 100755 GIT binary patch delta 27732 zcmaI7Q*hv2@GY8&Ik9cqoJ?%nw(VbR+qO0F#I|kQp5T1vp7Zj*b?d(Es=fQEYpw3J zx_56Q*y1`^J?#$|1*eXTDi{zD`lM)50ie*SFoGmclsAGzhFPN@i5P~=he!}bWEUi= zIq~PU-Ox4xx!k@>S)y1ZeiIomQ7z)w{GbZu?cB&hD4imT;|v zXIFMR?!`sc>i-gI`T28nJ0U>#4&JH%GFOg-;dI*4q7YhPq_0^GqqY#Vz5o|<#l%Q- ztJ}-l3-j1^_7kHOa!r?4S2j0e3YfjM8|y6**neui3ocsl*`AS-hAy=YWDq!*cRosF z%e@(Wpr@nqsGK$y>9&Sa)dB0qnu4;@+ZEcNM-1YFHk$+yI6Cx%4KfVt$fU&7ppmAT zZrZ_J&a(ff zfKSU$r)oacl(q^Uz5cC8M&8ndf_*=9Yqhg3$vTjVew^4XFJ|LCBii^7#>{lnu8F;p z62*3S*NqjM(4v(N3JA~GYS{*i(ggO&dIIax$G-s3@C@K@q)+27=pJx zHP%Qe?N%Bd*N58gZNPRH?RCBqc*?<|<;jS_Ya48RJASeG0EEA0Z-qZ3`r_C>z~h*s zD3Y3l<>6Vwar`3ls9)Pd^>@>7NIWt_k+T;a@Z{BRX%Tvc?ZJ<|+m@&=oY=;duNksS z$E?Znd!|Gk0)aR?#8xsCv1m zC+A}wltW*VKwlpF2L!Nm%Za_&b5I!y?9yBeUQNPTM+j<8rvm%>PCGs5e6@SOJcRlH zb{;Y`W?@v({<3f**<^=Eh!yVNB33Mv&*TSgWM(E9)cUXNiZnI12=gAY<%Kc^(p3a; zS#A!!`AN*7OskADThMo~KQq;sVkF}sesNi3G#LB>ycd}H4Z+hGW$E;DlEQRHVsSrP zDA<^lD{0k5LMUiNQ%FEF%ORC3p5LK#P@5c7k(=0=#V1Y0B0VF^=LUTwb%-81ta!M}q@EBVAqj@cEBD)ay~fa@?tB$s9r z_PYI8)gPZfieGmMs<=a{0(tu_-#CoWUMZE$|~tXd&`X+T_u~hLj2oMTOjvt8Uo>M-)euc-EN!{5b^> zEzeY}HYl)>KC{55I9fNh*H4lfjzyWw`oH{M_BNy6PfA$Mx< z>9+~}mPhH2$PR6c3GU|10cM)*ZaT$2{bDjj%e9lmUKgCV)79#HNnDc96W9X`Arz(G z`47xbGz=0$Hslo@v+RQ8PVOi@?h&=OX=axxnili3gcjaLGQYYxQf>3cCUz@Q$#&!D z!+wFWckfG6UD3iOyS}`EYPrL*DpTc=sY^JOkP%{uqq{?9Mp{Q6ZJ*=l3&S>LN)0o0 zN>(UJ&|{C_HBQPJ>cO(J>tp~shbNK15*EhjS%2w#im}FG@p3uBLHSh`HGbGGRvR%A z-cZaz`330%6-J!V7+0#&awA%*yjM5skJt$qm+m}?!STqtoG-9vUg^|#W*KBgLq`-HfQJoh4QKt_pt%^Bkpwii0ocG(BsCLciasj$mP-or75BvHYMlUaj=m}Uq14MxNEaQPxv6GG&`&Co1mwBI<1E^%;&jyyZF~#( zYRSD)#p)@{R!Zs3&1fzGrG&422iq4zGY`D1ceUvKR9cle zGz&Sy2mW-*hyZQhwEB{|@&a#oZSlKe+Th9~k`@>p=&~s*Tv6a3gt!xgvIVK#kQ>R0 zRCBTI1Qy9`BP>B4NSqQoss%BkQh0DYP6EKAhBr0jce_QEC8g!JrN~iH= zaRti#8p-G`K~@q_%z3|agPWGeMAR*jU#k_5ggI->l(l5vxZISyAXH=aTRu)jng&zK zhG6&x_BtK_1!*vFSP&3sXb=#P-yj>q433Qdomi7D%=vK_16U@aP~c#dqFka_QKFQT z+ajeNq*$DlZQGNGM{t|uEM|~l$32;_Qyp_C{z*x!=3J1x2wLTlt3qCOCL{p!6UK~hE^Wp^3Tj?;DlM%pb{DBsx= zliBv&+`O#beqUer=)FX0WNf7K62dA%a3m;3SdT`~FI=JA*Kkwi;IYiHPAVGx<|=wtfSdHrYyO0T<9SI1 z7Hg#!uBlqQdgu;JsHX@_y;8?k<3>o|iIc43^APjGW?t}9x@g!c`m#e%&ly5_&qwJ2-QJYA(bU&HINA;2fQAi`fe zK&b^;js)I+j$zd%apFGV|0UXFlL!CR`vh}+Yrfcdi;!FLbz{K`qK}wRN<8{J*X9ml z`3bW9q>$dy{Ut2AkSnS-Yk_KDgIr?+b43>dqTNsqZc8byLg4_nCGxx4Zed*XM;LN1 ze*YPI2WH^z?wE$7D-L-p4#Ijmsgy>5vvS&?P~&UtN^I_GL6L$qZ+Xj<#p>$ zKUS}4X4#l6D}NJ@q*KswmK}^cL~u`l+#nO^U3Vn$&%4z~WY;^ED8u!ue$Xk&)<>xS zjnAabIh>|N-vdyX=qOp#kN?2tn$+tr1~_e~AbrKw9JV#i^OQ>B6752kN%}-MTW76W zN+;??;9_nev|p|@ z{ktmTuljt*)As{o3JYVAGrj{ykY)+3A5BOiHq;cuNE>JitimIVoPr&xROqA-28LZ@ zafvq%+sF?%1QMD3U1PhVsW`Y`@!YZBbL^wNd_oQB?AKCchSXZCyu_+-GT5usl&7w` z4A0$FJ8L(%=k+*b2HN`_oagmFT@lo~whGg-)=lDcVK28oUZu zLUQJG@L;K$E-D+;d~Wa)hp)kgv)bO>r?bS`+DUKX=dD(ym6<6ra}5Yhi5JN-Z^AeA zvRHwYy2y*Jt3~$a?e8Lqt+zidv@JHwyj;8NJ?cX$g%(B>*ACC1`=S4|0M6pRmwr02 zBm>j9W3=B$W?P$Zd^yMi)mX<^`+ql$IJ zl22#NT@AQyt9Fg+& zINW+JhR1QK_-i0K)#XU*NDG|gDm0ZNQcD=P2=S&C{mux^oz!3d4dgXH_xJVQ_Q`ws6^$ZdiGVQ(-{QBO)!HPpONTG#EaFn?D?I+ zP!x7Z(+s4+S)&wF2e7ooB6Y=LbxT?tmO{FB1J=W8jX;yY0nO@C3v|JBKP8yr(POGw z;uuRSDOS7qfS!bdcrKwbQX)|EtO5)P^}>wK%?7aR_Ygyl6CODant!p}e|pVzM(`dO zyp8_&!(FempRTtBzgX&thIbpJ_QMg$J+zU%AJQc*{+xkUPCydL>w=tvFn5G1%$wdf zruJvF_)<#z{sGYh9?}Df;B%=oJqrl}LV*kd!k;wfOP2H)h6hY(oVlZ_qJ976m?~cQ zA)P=Y>L_xW=n@dft7a`)-7H#zLCXL?7XP!D)zxf15cj$>JW@i@LD&(KPpNv>YZLK1 z^yHP(gX{b+Yf`Z-sO8&X+ROH)`^ytK@bU1}3Ziuv6797~Ui8CVx=mb+nj;xiomGUQV3uP`~edhExJlq1gia-9BEJwN8iY(~Z%f-h*nPukzhIYU(ZXMHgpzEv&EqVbgsw6!JgY#X~bAXrXN@J^~v zI14z;zBLq{-}n2lXcXi#W2tL)lnX%}XRtcjc{kgk8KE47rf;f8O{nRj;dk^~>k0;2 zHnAaQo&4`=X)4GXTEC1lnvy!agN_gBsB7%o23UbusxT!U?}|xj?s1(7{MoBNzbmMO z^|)B`JkOFauZU>Lx`+(Jf-xcd{(Yb5I9{6S>80A}j!&@YX?bc+Pr%j=SUM1ey=YnT z*6Q0k7*sttWOC!9=|rS-U81FDRb9JnEVnpDJS<7WG7Oo*7Fwvy2A0647O3_)=@jmY zRU-r8Ia)a~DAnsYD?#N9h_zWtE_Ls^N;TU1ixn`^?kWpTs_GksRhboLiLDu0$_$<> zcAM2Bl1*uMuvM+neO0UU^^IF9PkqGh+Nm=5b9kM^a+x?ldX3wP_N|UOfCjJ zs)Tr*ekMbGI#wZeWD3pSGHRK@*WL;EA4JVmb{YCsCP*S;kF>>^Dp9=$zUZs^3V*@X zQ{Yy~IAwn+9*9_z^z13{|sdQ$o+JyUOx)9wgPng>yP0gI(z{I9Cx_mfgCL|KJ8>x^Bxk zBdN%{F!Z5AFGw9E5ve1aP=3Br7yad+i7h1af-m_LN9GA^w77)spBpBPFO(HWikPM} zcr%O>$E|@Q{$a#8K1iSvxxy^p6@b%#h#CH=L9#u#6x`H*5^e23zni0>yqBY~f^svs zp6W%p%qjAM-^MU|O`q7W!9NEuk9s%kV$r-;CC_rEFX`iaqU>$gG5w>OerMna9iM#4 z{;=jr8yZ$r4Rjr}xF+7$IM-AZ-uCyvOym;G?1|HIM6%r%c8QGRgRAsC(}eS?hh0gs zt2)CI8iRm4^8w=lv*q+y2a}e_WeaT*XU-#!OLAt4)ErURn$Z(DnKc2(&6?i!omHZQ z6^1Z#4Tj9op!KfyU{m}bU0{m;%uh=s2(DAEtp;Pu1v*8O{2=W^gvisgINU($ldHEE zSLFPyx|48%;X)P#2OMdNDOq>;G(tS);tY6h8w#Ha4nv%n2R7C_C=8EXoZ8`0c1m9I z@#s+9@?$&=W)3^d^#Q>5{TdxXS@!r|PF7#lm0<|N4$rHX{)kq*gZrE4H{f{3>xTmDsyp^Ss3-e0M%}k$?dwDy9JUjTt4zew=k)OixeBa(wn=jAasw9MyY;z-HxD`K`nvV2Ky=)e+LBtp@jIa*8cwmYFRoc+gLg<7~2>+JBO%fD=!G5eWhZc zNVP$zpbeH2A^o|7r75S{{{sZFKC$F8N^6cAWiFb~?q~f1`|@WLC`TMUEx-Aq8fhvJ zTAEG|ck16i0X_i$>h z+o<6C<_&FD7=>AiFtnewm1u*_Wrz*^}ye*--Mofy}|=6eEWqh0Tv zVkbb+d(f;~k%e?>fB7K#zz~nEPv*bQz<1?pUeI-J;o*gnMy;adkx21K$ih_YNg*sM z1~8H>ZCvg@lSN$~ipalzlaW>*bz;ye8d*@oJ`urAkjz`Q;wM@q(U-P!@QvSGD#rw9 zw3IVp)<#-HjsWbmS{KS?TzIAWnxv0ukPFsA=7@j!5~EFu{=r;=>EhJqO_z$S1%bI} zZTvhHB^)!u69L#geu^1gxVO&M$L2ChOs$ixB>ssZvmk_r zSE?<@y!_+>4?El&OnX9xw{=86Mo5^KGrp#nM96lzItFA-IGA?V>BmY|{?y1e+x5C# zadcD{xx!stFwNU1$o<{u`z7f5V$I^GMh&bX^Es#FL1TWtK>vSYD205XwEYJN2=;#>mJuW=ffPMS z?gtt`#{7T45~DO>_a9jJ7usBzOM@RpJ(C6XB`vM{IKm-R69gIPlw1Q=WiE*`#<9f@ zU_Q`rIfxo|!Ct8b8&F}ObzPX937w~x+Fzz;^mhOdkI26u4{c51ojYCgoj#wAYX zq;o2!$;OM%#C6U8oVl;xP_Ztl8Jy`;rC@Pat9*&0KzF>YQdEk-+UQUmmYXyH7pO@l zp1+qXoPzkC?wAHiZ9;AvsOkkQ&zO>oli-v2`PKpX(x(P|BdAW$D_Twlh3}$A+Z!SB z?B4Yq*%X916#9Dip$?n9AP!4D^j9sGCT`Z{=gZUcCQ{Vfu=xfM_xAM;8w88~17QFD zwf)$Gi%@LkRJ1wJ&F>p`FzsBQd-tybIif?3JJ*j{hB+nHbLD%Oxj&7Yzm2bHt@6xI z6-Djkh?Kp~wuFkjUK*lPDhI8GbOv~8!ZucW5xjmV>J9bT|Ib8Q{-CQO{EsNf{xcWp zlj2D+{>w8Su%V2qj`fZ2yjD*a&P)>#*dQbcg39{Tp*F-p zw;u{ciG`$%*cgwK+-EgH&xhJ>fZemsmX^l;t4Hn$r}3YECoMWMT-i4Ep1Fkc>1yG@A}-G9uVPa<*qYL(d0Ol+ zM))J`N*GTe3El53+!FXMZAd4HycsBKPz=xP)XYwA+ZHlqPajgxZdFGRwEr}NQW`BT zFtsP?r7PoV2(^op>!J+ALhdj~wqbl=U(;zr0HGQ|{!?l2x$g4>ab)hCly0W`nJ2Wdb{VEHt>rw@9hwS%A~W=lTX6M(LUPxdF@Da4^jhr|&|GR%aX~pO+JLVV0vaJ66`MfsC;)9CTEGCOngxBpuZX zT@$5 z{GwC^-+CO38l`ZT)km&|Mk`QhLrE0^(BGAY(BHE@FZP;e4OKlZ?1t^`Gr-rW!C{M1 zf&X!+4Y9Kq5O{OvUwVliX0sa}NO(&+FiT6r^e9jVSl+j2ARJv<=7?#LNvG=0TQtg3 zv+LSKV{PE+aQ^yoTS=IK99c3pL5nMR;96dJ9F({iUb*udfpZxQO%SEua zrq?FxbPXE&5Z65L9V;!X2Azv7Yc?d!UUxHH#mTvH_o5e!w;HakD~uc~y)2(M%pbD>E670f&NVD5fsaC~sMh?`t{ zI`(#Hp2*`>#nQfc;oGUF4{F1vgU1cza|NmDV~w#t!RN&(?%LqjCgi> zXOAGx6Ta^#K}QL?WjHdH0#}Yo1=W&OykHs3GczcSP;AmBQHLWXq&YR8(+MPOB4H^A zA}ZDoKJaJo5ooS4lg(}}`79YDlM#~wKfqBjubhXNYylX zJHiG-XWN?Kcc{SYVp{iU(gLPF52=uAsqaF@7wMPR9Cpr}qZt1Sik}NC7k<)MJLk)$ zbN5Z>$>kO$0DMCC(!P$0fZDSaq7TeROC+(6W!v_0qn-eFW~hm6MCuHgZNYOC(T1CX z)4kdhg&w?4h6LxvBylj747llR4nw_Y!h?4-=zFX#7<@g66|Y^F;ggj!X=x#O)KuoF z1qF0?ihBVDTz^)EneCTc`SiNaz0vhmsvtUXpw&YN^qz+zua+t|yo2>o?0S3egMnqY zt6jc=?9?ZO}6bueM#{xVX1eneXomb;t8XxOQrhc+^pcb(^n-uX|`GnvAWb9FpY|Vy=U1 zQY(AXgo>(^)Hh+8;ZOYBoJFj4uOo$n7OV|}aR!)BVolZ@vKS{LNwreEIq5noIk~n< z_0bld9&y1eDraffmSo-}ovdY!?aF#=OdOUC+ougW8F(`^Sd=BvFX5dhn)j>d(YPz` zLTs)TV(%2R{V~D#i!*d+Gse=9Vy*zHb=t2AXUk<%fRB$6o4?Rc4Ubaw8|+3SU2Lu& zCL3rzZTDR2jSjI+XJ?}1znO2i{++cKuH|}q%DTYLS)Vr8qD(T4>oL>+ugz``Oo#K9 zSoj%G$q~8Pm8IWABj?HaIO)#g<#al`K&7eiOZOlx-tVxY{^s zD|ee19u*L+!+LGeE*RF{larO%${#Pg?*za&ITaL)>P!Zi**h5J{@GcvMs>GV;wfp_ zj4+RxDqBc@v|JYW=sm}`m?*FDAab!j&f2Df+=YZ5zQM z{N5^fffEz)$fMB#AQU|I;xsq6gx-RoFUhtb@T}cXKSQzYix1wS5`W5g+Vbo{I+|przSVs!pRuI^a*talaep3 z;S&XU*@$yU0VXBXY9j{mpCJtY^kFVIm0oy>KLdVzL>PXQtd>Nu7T7l7_DM@nyOExf z+DlBmFLnROyqHC~Q`0Ivsgiq>%mJJj>`FVmSLU!dbB2idD|QAXjWFcS^Y+RQvllrH zP_AAh!Yp778FCiS&~A!6MZO{D-hTSxH;f>ny&@qupR?!*f~^5aq~e%G$EL*a4bY*Q zSem8A+1OI!*d&;w_t+?vq|!Hk7Cbc3DO%|n%S4#jlM30$D}Sudl7p$Co~ak&7S>v4 zs*IhAbX7lXpLHLQ&-z>>A>geGPGD}7#EsfaZk8>YpIg9mmClB@NBZD1R&p}x3Q)xh zJ^a7g^4!3hje`GLa=-t$hVB1y4GEyS<*Y1<_I)LLDr?8dHYio0QGvqz-zt^pN4{u& zalXO3VNZTD=tfq~2OM%Rab}#7z2*RcuBt^=#jdcIl*fPoM91Y`tYN@4n-xjb zpGqKdw=0v;<$#33MJF;JsjoP80@BN2ND!2e);{mFt?~dzIIYJ{HOVtHpztEa*;GE+ zCS&7Pq=e+}W^w1TULs#+PSkpNhDNR|K(+gLGm+nFY5~$MaFvxfnHhb8333;v_>K%&kd%1RZ5V(0AiP!9^t9ngGl zGU?v)Dk_&f6dqAuvKeayQo|M_yg+r#?CMopBlmk3<@Emt8Rn zhkPBXEPge9=w|9kM@b=4$IoNYIi1uWffon!`s3}%9?g=?1u|tY*$J@EB&*X6x!9P~ zROE&hn;&&5N7wX2fb+_rssb4v!7%`p` zYvQ{1~k zyZHDoxJgNZ(J+2{Pr$26ldskeS(4b|TuG6#M{XT^o-H$Gau#uxMH|{zIy3YKPA4=N z-!LxQyJsQnzCTF%z(Eu*Djrga8S|IXelXT8LEr7)veci1yXLRdJ1eIHh35pSPm zIq5U$PwQ6*en5Gk$H<0IqYIsb{~oskMZA=dq=Ao5X@pk$^sjthx7RNT2?+1VZmQlJ zw0+cff4&m?S=Q_!LXDxkwxAw^eS4K#`FNR7P(4w`ZHg+S0{cDuM69)FQqe?`;$;bT z*>CZD{;-N7^M5ad9(aR$3PAyqEYQ^5EW+9b{~kEoVuUQXROgvggCORi8-Jra1(*`p z3wa_c9u1Gm6*-(S5)|CNGx;`rL;O$S73Uy7NsR&mQvRPsMf`uE3=RArc|D{FgLX5;dF)|^AlI@#@Jaq;!iO{v)!B6*T^ljU>g`;zN@-F}k$ zkmr2;NB?`unGpq;qxn*#UYY|uPJf;C@ST3PTKHAWetV3H5_+6EzNe)5$@bjM8?yz3 zN*X>Vrb+Xe)C)gm>+y^;z@LGQ8ns%W&6UHZd0G7Q9_)qdtFF+YXfv2Zo6Aiwu8 z^a46ZhdiY;NB1zB)wMaW)Fs5m4!csRb5gLRb3<}h7nuKFdGk7T?N&HSAR0EMcYg%2IH4RA`AjgFA zdk=|dyJrRz{8OcI_n_+kox)k!C3z(G`wGSE>Uq|6v*_Lo@iV!#e6z|yBK}?FTHUis zh!TDKc(2M+@aRft_-9C+qDR^IN@bVy(S^#g>NdR#9$IIZDu)VzlBdQIatbNUjiP6r z29~Oa${tn{M)Xj$iMEP-Ni^C*`$Y^fKR)})$jb;&=*Zv2jZG+rQ=wu`W{P8Aav$Kb zyW7#sZ8SJJnr}D!o9^ajdvU9&#(QP?d0U~r4A&;d`_b3SSS1dDGj!5~jAL_BWf>!` zM26qYZmG!90>k{i<=K99cDs`nZF75i@HdnqJM+}~=7zJXy*E{JRSj4pe!uZ-ZB1Ec z=ieFtk@xZ(&h5|3w5o8k7-x@I%^oRj1^a#u6az=`ifk~(_^opR&H_&(zUXiSe*X3yWjjBs`6rks}wv_3D7^?re#_JA|D_R8hq=8 zEHWii)lYJ~oC-aM*p%Br1`dDwY}DLr3dNEq!VAcg$or@|o-yHcLA=7n1{&kbn8Ymu zIx>FU%3f|a%#c&ZXJ~uLjqw$T*F!wivU|b(E41)ft~px)Gwc62XHFk?AR5h^4$$hL zd-?9a%X>AoB+J{Ok?<0Ck1^O3PfARt@>e;~6RrCJ2D1|3l61AB*Vxe+Vl1WN4MaICi5H;=yZ~rT z=Yp^>2~5hR#n5oWqeUHY@?)l>a-17ZgP}8-d?NC6q6euEch08Sxj98aYh{g8Oj6% zjag8`ha`CkBKGIlDcV2R!rf9d4s1_Q??U0ew)Tl9D3 zfG=X<6?SmU!5~vvS0zwLpR+ zeI}``D6JHhixa@ceAhh8c{c^SQ+P+*t$GmmV2c9;BL3%mE9J3$kr6JxDnI59=VAPv zxix2h$Me-IB6X1{+BgG{Xg1)XwC<5#gvtl=7EXV5C>NETS{j%RvY{ftB>bm$*uMA( ze@`PXE|OupWm_(ssmnIZT*2-X+~xSB4eRfAvUfv?m%-yNoQ6Hd4!_)ECM-9#m#CUa zkY?uv#P8p;+J7a-f0NH`mfd}R_>1+(1Nn1|r~I#SR62}zrFTHkhp7&+`K<0i*efm0 zFS^XS`xUk?9zgg&{51>qSLL0epUlC?TT6AT2+HMH2##I7CUd~27Y!2f8Fz+Ux>(!q z)92uRd8-e4KdFPVw+$JOO#FpcY(Jrc8|aO^f5b3hYnAvd+$XZC4K)UhX<#vP~)r!b3{ zTh?M7<`9hck?iy~kt=liouH6>X|(@plAqYG5pson=>yC+w1qv}3$M=@<$Wf6 zU*9Y+mOoIi&fY|^ycU9Sebdy&NSpz^Chr(oCKKi$QJ{djq&rl9uP;j@FTDp2XjTy< zN~cC@WN&1Ei`{?%*uIVpro5P4J#EB>l2DQR*$7V0AfxpM|Cc~C?awVD(AEOgWtbSC zw+_T3X^jw>jeO3^Cv#@ie_Fqjtkozr<@4WuYT1?Vy|sUToz(|U&(D8PFSg}9A_ttW zQ=r|K^J{=8ESR#O0wNn8Rt(2w>|j5_g{v~Bqp@9+-3y8u3^Wt{l9nSF3g=VKn*y!T zii!a+h?mi4pP)j7!3kF3LV`TPu?J!Sm0$pd+v?VLEkMhLdpX;DFRM!I*rcll-n}#b zYKwf@D93i$R26C#cWI?yhagT#EycHFfKH9*1p%1oF2{sOE5}GH2mH4~Y4!$)>Zu

M_+HO@PRmF-k=L41(VIe85|-uRLG6KFZi}j^yT{^1$UUa3)6IwCX84M{VQ6Hc%3VaS`7TtVy@|H$qL+P%cuO^EU2CEG!J?qx50QP)6du>c>W%+< z;MgEq!babR@x$E`+4wRYo3|aD4u08dHo0e%&Q0iUB42dLmUT}q-{_wGngEET6nAxw zR1^LAT@Y?p`cNJVZ`2XMcUY!kfaG&c7t$pso;#{uHo&boEg^&$pL& z;3FYVUe(zFPh)pSJSG^@!Q}>I1wvwJ9#_F@h{}ZGv`Is{R7g4#VCZPF9W+p1zojQN z1w4ejb|oj6xMJW0h$^eFiy|}E4^%XjfovakzZ1ty-2-=g%3AC)Zm>VD#%wQKssXmS z4spT+?>-XbRsk@z`G8Ufik+6Yb2&PdWzkV{u2qFDPX5q3=}AjR_QpAxoRrB;xJ%Y4 z3>1&4eEtaeRMFapdmk0UKf0a%8Rf_37z!|J@R`U=^9bJu`NSUZ+N$It2q%}!@e#{C zL4@4CD7jhgB&ZB>&g*>9=7h=$Wg1)CwtlsD#j~?SQ9XqoSzyHG;VDVDmacAMb{{^c zvqlVyh6%<%+5z#h8T*r-n+q-Q75hCFVgF{nNyAgeZnzohQ^t*Tgg`^_qrn#4-8rf1 z89XPg;2~@Cz@@L3iypgoSbD@lvvnt@;J-?dsnz2gUAb3}E*rT6lSYFLTI1v?8hUSJyqMrHt8Ys;=Q_@oIU^2p1cUJHO^aSp*bgTTko;S8B~xc2S-waXzc# zJ4>@Jy14BBmQj7rWOd2dam`fep%qSB$t%r$hyR0D0>n~?+HlFKlh~}hX|XO+Ot)^Y z#Oj4|yrwXBoU15%Iub`B?KA#*f~OOR+Ae(wQ1)p@dG^gSpQwZIheGn`&mnI{IPJjE z*|2235)r%xJ+3WMEhbHO2U`h(zG8X;wFP5~&OlZmVFTCCXil>$q-r$7E0^mvmmJiD z6<|N}2AT=~?MU1N9?YDYy~7}VIh)MAoDqGJZh^?!9g4c3=81DYu<#7ByU=pZ+IFF= zsTmv#7#O3YtYa-xuX4*$LchUv>PXK7l%Zt~THx^`KCVg6EWm|-6I;BHc$spIVDp3= z9uL}K&Q8pVBTI}MA@Sn|ooZsy?ZKV>djxY51fW`0I@)seextR=L#GMuR|ytFN4t;m z2272kRVtSY7p$Op=@xLJc_|mPnt;Nh@*>Znf_%&9(6uv^XZqhuDGDSf!(=xYBwkXh zokrFR*~=5bsG=Fye+NKJf&Y9n^ga~Lr}1;QG*8bmFi)sDAE__~AtxKP;Mg}u^%Idj z1N!A(u%7TP@XF}Hy0_PvVRI4-@CC8Ab>eO9ppJeP&+?W8i9Y`#Ec46oBYV3zd)Y;z zy=jYZg{YDqyy3f=d_c=4QZkW7cs{+T{T0-Bc2O51hrRv|V#z|(LQHh-qi$Yg4#KRg z{7Y=3X7x8u`lNpp1d#&PCe<{-CMgTRBMM}1kOb_^zoW! z$Bvo6#fWeBHbj_+gZl#eK`b;hQ^&7tCq&Y?SMdUOdKMZhRIhN9xq6dUO$<)`9mvs% z?i{1uVy9uD_)sNTc*5Z7!7T8C>rRcaGQbv+sH*?+NzQ>(36xIAZSDQ}7di_We43u? zyhdWZUvH%s^r7!=&t`3($oTU;KRJQ(A)SU5JvX zDD#g_d#GPX<(1DGgknY7eC$S z2ci--zxA|=3AmqpEfXdz)oDM2y3kzbAd7E>nfm3lgujDxJB3PsQlJ5UBfKtL!n05^ zWHYgi?Z)V!5J7=8$-x7m!A5K_Y(IpAq%$smW=WcvFRy8WKIN}##d)pJJ_$5LN;Rwn7sk8SeHs2zUEHxZb8qU@R5B9C>*BomyYu<)%kSoD?VInB$=~&LgrvEDpSW)T&ZFK_ z;(m7&un?B&H^lxOEzLzDEEb6={&w+9q&NBy<#95^*A*OQ%(qEQ8k;tLIxykU=8SyZ zKk;^9hh5i8n{lYhq8H;G=z);b%@MxRP`xtY0k%ELYhT&>*Mk+cJ0#7%MiAV-N)XNd z#E>NXpT|FZmhA}lF)TCMeGg8=n}pkKqHWAU;9t$$RJ`eL#) z?=PA{hfLBSt`$qg+-izs{7qM3=XfFv222CibY!D$cS+T+h-85NmnTMz0X)HzKUKMrWmJU{I&7k($O?g5CK)}A& zDDhexoPF%}qH-Zr|pOKD@=4yu( z=jE1*YW&&7b6#nXC8gNgmf-%#qikr$xf%JXH5PAel-SS)w0sMg^x!hnkqiEiuotVN zhMfE1jFKMTZdeJ0*E}Y;T1W_ykJ);d7oO~;CK(o(oLVd2i|2t1s$vX3XijmE;?eKr zR%Y=+vSO^AT=*+k<90_=Fv85K6%011N;Zv_zeYJ7O6bgy%diA|IU7<4E_U+o8QAQ++khPoPwwOSx29E;nvRQx39-cn>aI4<5h0K5!~aZMDyaWM5r>WOV(b_adj`p+VXn+mr=) z!(#$HSzL`vuI1`I;Q;%^1l2P)Pma~KdzJTiFb|=G84#H)vBc z#`H@0vfR#E+OEo*C4se}&taIM?b|JC3)RQDoO#8rps)6WX6!nsJ=tw0d$67d!F`Ol z;rN+6_QILX-diQ^7O)M60DlKwlV0l|mtzHy_<#s7R?$kS&xSp8yrGQslB#_xeUjZQ z=g|x4sBNgFgZEiz6)Q@bSPk5{f_-EkFq_?g@U;hln{6O4f9B+ihUe9T+%I3oQ#n3D zBa-DbP$oxTn%{u2;`lhTwFP|UuT!fgmT1x=DqWjclq$1kIX3QSKN&A=Dr^qq=#lb1q5pJM!uFY4>$)Zf z)U(t=7Kc*;8pufj=e#1c>+ceuxpQ_UM^5Fw_)yxOb1yWt zl}-~_vtXv?4)FkRm->tsQGARLRsrwjZRF$_#TDsDEE{)=ny3CS)6tuniSM zHr@Z4Qsq`%e7ZZ^nsZSf&|{b-6oMY|5>O`b6phA!an;paI_R zgsaY#{DC3V7;)U?eM5Dv6xhxLYUfD8<z%58}B@#G7H{M0+=M>y0lG5D(R`E#yULX@u)s%8)j1ROLD4ObXqoDJ8dX{N?2=c*$7^PC@u83`B4QZ>AF{$9LJ0lB zG3uc{2bCE&dRsrQp$?+oo?rc$0)y_V9r?Z#YQIMKr}hxUjs%i(aCI}avy-&8Ft`18 zIxIECPz6^UFMI>oV%Tnny5RT(Q!LL^tdEj`HAs|+r6k5-ld-v0hh||49CfJtMdR2C zkt%==C~!Qf4RJNDs@Pc1UQJ}JdFNi{WH0}`ydCC%p%dc8l2HyXh70RJ8-L4oz&Pgo zlBlL5t3(4yPwx2EcrEi2pp{ok{>sr;?q6{;I1gq2?mBGmZKi)GQVWfCtLxjn&d>z< zD0fO%UOC~1+*kbIYdcQE4D~OXX+IldzxChZvimq)N!UVcG>M|9Lm?F4LM_Bn^w9^X zA;ZFVQ#LY}rcPL^Km4W7cihu(x5Cu5WlUIRZ|gniXRE#5t$wo-a=%Y=cfWJRaIS!R z>3yte0La^`eMA$gj&p<9Z%0Q>rkFUoV5}^ujJG zhRrB0CL_j80SiKqi|x>fCt-FNwgp*l(I2de+Z8$4PwUWXAYak6wkphs8b(b+Nl7F| zZmeg$7)G>wn8(opPJpRtpJ`Toe(H$(aeWPFPGOuN}qm`}B)biaxjT5P9Ome4tfW z2hnnT_RFQfYJb#L&bP!nk-h1t(TPo1685RhUMy!f?(_bsc+bHN>^9jfjqR{0%iHK> zw)fj6xsA;1W_l+g{tZYHB-faK9<}Xjf!qstFfbrC7#PaG&z=$gPTW@OA^RC<&Wkc| zrSo}vug#PkLc(5U@Y>FHx_yWSX3V5;vndhIj$I^o(84wjr1RMWm{pSu)v%NNv8$<> z;WL`x7$X~ADkT{=gGm6};dz68&#oI2ACo&~7B&`*eNKHn-`%o4H+EzSU2Y&!P!)td z)hH95;Q^yT#p%pSQQWgA5V)du%0{Kf8dF@{Ifqog&I<(&g%tMUKhc+6BKs9^GaL$K zD!8{N?aOj$@4U?}acZlog|yC0YYMDQ&l6A29`e^f4`1bQ(4c+;<_odSc-1S5=j31F z7*(hXbAT7Y#k%ZDWr-Lr)w$Z%e$k4xbB8p36=(sVo@w`)+L^W-?Z-B8%LSy{($T)p z0;x`gxr=h3_8}z!ww-HYzT+m+VN<6NZj$16k_UFl)ocOltTg)E>lNp`q9Dk0_1ikb zQq2y@49vqToZRwrUE*A}g#80IflPtw9p1QA_Z7;yMdyfIHt)j}`Xc8~%KEMPJ9Sh0 z7v3`ZKk5n;bFyV2rGZg}$J0dwG-9yQ=7&Sq{$ z)nwF!E@Ri*c+gGckh7@G7SY$wZeVZV#|%tjl;}F3l4zIi@1~H?{-}YCfi_2~ia_l_ z{X<`QmfW)DSIOn*`UR_bwjwnb*B$7<$CH1RdsR9YLY$V+DfjiU>jSa%j4*9`UBe*QjBxAY z+xOPq)}0^7#pao6k~!O-m%UY^(bv=uI@hspGrw}`kanXkv7XMhVivXekXQyg%+P1g zrSE7O$W%#1y|K|>QAzC{KeHdK3G(dJ1GjW3SeQqNC{ZJN9h zmBH5K;>d}5e6DUHT)@w_Rc1Y3VRPUp$zCo_6u!}i zqorTbsBV(pVvY|kT|FA~B5FR-K-_!3MaxA7kgF6+2hxljiw+%O`9^Fc!~2e5nBxbP3OD$* z2}fdi`p9@cb~f|cf<705IKydh%gGsqJxBQwWv|bz=VE)G(O9DyW{gVDKdS=y+t^4Y zi9@P#8ZJ(-SaR%m;l1F=v<8x$GM%891U927@*JBuj=ydkBEfYq-$w<%ZigZ|Egsyy zac1@iAi|+IJ+f*e7-=!{DB!S#D>kvK7RR$qe4QGE{VprfvWI9Hq<7@T?t@Jr_OJU(f#I{#{%x?A+>(u>ZTH zc;I@Sr3+2o7cmTte2)Y`Apc~YYHNE5E`Ste;pM8Z!v5c^O16Bg| zuecuJsEg_i?pomx5Drz-_7d{$g6V5Lg#^XpNGP+UZ91evgg|dKf-jdfbDBSTa+tXM z(uWW|x4}TUT-cKKTf4bw#$53IFe|&qF&ndFkv~tTLk=s~!8@PzJW;4Eg0OtT>nq!b zIB^vS7{Nc7o#$Z3ElM1=X(O-l?vnrRuL`4Ow@z_wNGgIMNcxlQ6MTr{CJB01l;gr3 zfp^>d=IWhC$m!;)T1Xe>3L#RxAo?%r4R~x9I;li!U48AizR^vN^H11JE>^BtM0k`e zr(3l|Pnun;o3-cr=v@)r@qxQWL)K5|A>E_5#2uebx$Xi2#4`L5ZZ9VhFd;08`&lJ- z=zD3zy=}##ptj!l)>O2iZ4WH`TKjNwaju033*@5x)`1@H-f*`XjFoc}hPUF7qxX6V zSMY=%7q2HJQ{PT}4R3bkv^xtBF*yqnvObgaqnJ&Pu%Pz$z>ygUfj-BD1`9pnmfA1g&xhn`sP;PHm@!ECzVVK*L(V|1ON$Q?`y{~L zDZG>(36jaD5KNMfrpq#O$U!2QU`q@sJC*32`3PjiRSo%&J(j|i_1VI=eF}}KGElKj z89&CH9xWi*QQDt7wpOY9FS2;OWdZ4|A50qf{m>Tnq&F{T;v`Spon~iTPgT7esipfS zVm`Wl5{{_DGXbn{IWqXpttfVI?OewA_a|#mevmxXmwccN5Px2IW%pT{_=Q8=oOdlx6+_)zcehW7A$jyHWO*yrQi<|kvG;!hqU+nbBA|WNfO!xlaI2Bk(uxp^B z$mH5tfJ82Ls%S+q?mqME#;495ZGUZ;itl(=AU)jvooABn*|nGVgRKl(mM`5Q*DT1` z$Gv954ux=}0ft5d<|M=C4Z|j}v+1`KbgVio05h`LNupEGIFHmlc1=`=m~OEmM4j)*@);%mvel$hCV-3AjeH#7}B zTKbx^nA*WAM~4>I=8IMwc@-EO*{dLzZnEjK{4g*&l$^x4yGuFs^&H_Gk(uC-%~I-5 zyOS<4n_G2*Wr2rNA;-6VB2C9Zbi>xHwpM&C#`p=VPOloRgi#s@Ruz}bf{;Jl@T8X$ zMTZOs;Lm5AT!a@{>n%<4%$>1;o5#^s%S02=QXKcBE|RlgcrJK7G9Kx|viQ8cnEmzX3j@wq z=-ug>xBp5M+A~v<`1UZt_E8yh5?)mT=x=qS9P3C>M4hs({_1amLVwNUs}Y~k)__WS z(=JhCvTaCXJ0_wruf}j;uSj^I=o)`CvVum(AgN%MBsj>%wrp&vtv40?;J^h1VAf+*rSf^vRLC+;1$)zGi|N)trHw!pN(a2);~nHm zDzo>dWTcuzjXoz=$JSgHJCO+0@A#72ybYk*2rtPuCUkvj7Yja4pod<%1ax^fCTIU^ z6JogOyFG+zdTlit_9Kjl=O@DvC4y`*Le+QJyXt}LMKO_wW*xgw2j=7$R3XAqw(uj4 z!f{OyykS(p+XbWd+J&H>wCn5uc#el8ZeWn4NNfV?9Rg6^_I(fG zNNq(GdERzF#sg#OSHb9MFx8HWY7KlXi?u+u1j9^u^z`Q`pstAa%>IFZ6Ya66%3??~ zMtK(un|EDHutQ!Z)w0`&H|konCc_L`JGzQUJK2}cC2z!=&CK(RgXzd7o(Cro^=(u@tEF-OiKb{451go3jTv#fwxJ5z+be)C|)uCF(S>m%4on>)w#+S z>&jt4Pf?eTz?){VF0@pKF9XBA;W?jn_P(OhGl;z_4ekZ0mn&bB7dKaH#PY(|dziiF z$eTsP%~ctOb#pzW(RfcW*cFpMv9{#S$&+V{3d`5ux@xk{`&TpK&|mh&Zgo>HbZX%YCF1RgE8UQ$-uTnj5+SLYPW*ZHWy+F{Jr0$=CN zW*u}AKuMBH&k^*vWRLX_53jVm9f|XTv$Qne|9w6`~ zcWN0G7>!-SUdmR{O_1LowB?ZzeIsZ6$aHY}`rEiw{q{StGj9~=Z65U0`~-88RkYyp zV0ffUbnw?Fu|xQ8i@E*G96>8FNIKntzQ1rH-!1 z#w>Km*s^zBEZ`Yy>e|XKHrFRk3wV_*easz-Eg;qShFk1HS!$bLHjvd0ne6n`$5dNv!d3w`7#%WjeP#p);S zEg7mxxP}$^T{%>!dv&c(@R%@*l@`@vwrakUHjgV+AfK4gXeQr>uKgSZp|d9KI=^$_ z!h*3}Cx|Wok7@2Cqlm`NpzT8?qAdy2mf%uPC0xBOO z=~S@8m(-AB>8dri@#=r#MR-x=c3e^BM5_1^9e^woah$S0+V=2?-M|z}=!I2Kcpx;r zTA}NLeu)?gdpcs;6m11r9r$D|F<3|i3BjRYxpnq%o`_fo% zgKLHX?dJ4Fsz2&R8j;k9j;xQpJkYpNh4lrpxg2@0=P9#?N+AqFN+Guw{Oy4ZkT9Vn zkHT)!pPE8)2KAhm+yH!qJc-Uz6ta_-P{k0zHSZDYMaCou}<*mZkF6W5tJ&= zf*NOzW9siEc;DOgI-g3sR*r6kHwVnl$Qh-$Or}CkVi$_nGp+qJKQnJmZE#&7^zfqw zm3s0|mS?1tCMJLstZ`HdUke%jS^-;LPGr#ezsZruH-|#s;B|;;~X}AbXZ;^94rPZG1?DC z!;ob)8O5u{h)!TK&w&NIF`!0JykB<{Yhcgsrp@k#Y|RoB_w#Tv-wp1fJY&MY1=q<> zSJy9|HBY^#orLUEcv!X+OVtyr9vg+Q^&#KDFW&2>{ez20{FAPHfU3(8o@mqY98*AR zeCUr@?9-liJ6jUo?9vmiqI*B%7>B=6hBEYV7^d|8Xu>Q+8{47QodzG8qa2d^u^I#> zz#G2DzW1a-n3mRJy%TLTkZ%W|9O9V#75@T{I0b+yl|(^mtMdI~Si+e_an;ZTuWpt* z)k-3)4Lor?aYkmw;4b^s;x%G$yVCsh2UR$VCm2!rtTlpq=12}MSIfPLtYv>+kT-l? z{5|UjqUoOAP+l;5iQ&YXR?TI3_K#rGy17k0p+x684$1muwiCI*#P#GP#pc(0sGUlk z*7vc!%WKwt%?w7C7*FJoZtjiJsXoFb23Yi&j%N}NNV69e91F* z-l_%a6sager}fT0BSibLMRuS|KQw%NM9x-^P!iGhLtv>9>SeAG=?!?JF%2PYaBoPq zMn~JmflbjpfFNPMqMzAGkGhhGF{9{T<9X$6sDMvlx(32f$^7>D^?^HaJM3%e0J_zU zQO|CcM7CIB!EhmO|B4W%nbiCLMa#+CY8Hfhd7O|1kvdTk1uS_ zMl-$xKPXpMk2{E5&pJvVhn&J+B-I>+&nkE=oeeW3OFRyi{#SlyYQD4H+Jv_P5H!)Gm zV+Lv?lr0NhW8|%QEF;t{_ZyJpKqkN;bLP?oXu!iJIk}uxVG9Bj#g;G)>B#Xa4dT^3 zfB&9-ULLg@))uwAJDUD|;Nt6(o#jJS;K-cCeMJ`Ys2(Se%&VsDvcMZoLoPPmMuOes zYNP{xQ9)M+GrO*?%0laru;d04=Aj}ZOH97lic)e71(dLZ3Ze%KI>)$5gt&HRL$R}z zit+{ED@60v&KA&gI05|K@DZV|7K!x1JOS zJazWQIUdOx4Lllmqh_t?L?nv~?nrGbwfbg-&!o1^r>3`Z5>;jIR}+^#-40x_^|TX z*r(82xTdnsKt9LwiUZr*I;;LFG0+&AFEG;sJQy;lkFJK>7^+ybbkRSH{b(NyTXo@N z6U!sLb%+wEPt#`35fPsaq6~efFl9VChF{AlfL>f>tVzGX`ksqy`DaF9n%EK2>lsKT zoOb^!4qPQr{Rh;>bVFJbZ^GCQo$Gv^OkQDQVgvesK0H39h&|Ggo*w|7E_~5kPW!A` zdz#uaYW#=h2I4I;9O?7s(AsSgWCrKl$Xt2Z9WrFX^T^N$PBv22bSGMs2&joAfdtC1v{#s4j>)5^- zY-Pa+=so=;F%a%SaF9b5$8j=e;8_LCKXuznVZscbK>>t!L#$3U3Hdk`HYUC~&8~N| zK?)wx)ks|5`QU!)CsX1kVtA*}t~em2Zlp#4LeuOC+S_oI!~`B^ZU4#*_;wQ=d#Nyi zn{WQ5wA)q^)mhugH$#+nz>v*a8>Qj>7N9-`s4Sp!1_`c@{nEgf2J{g+x18*(f7@+y zu-J+!pw|qg3mhR#`J9fAu^cM6yJ54^HmTLlkp_$(kK15@-*wh!PZ!*7!xs{8GbPLd zy(ca3g>tsX-9tmZI0FDb@^w*hxVt^a{fMv~+&;>*E<)9dJm*xbJ8~@*zU>rRS#=;# z<+Mhnd0o)^oeE~E2(CVHljogN>S4b}6bHp=75v~83gikj=ZxLdL7S8CAT}qTC`H10 z<3y8F)@Lk9NusiVl@*W4V1uRdz=x#=+Sab-3FU({YlKKO-Y^SLXLDcO0m}+1!&j9N zc>QTs{ci0p-K##Dt2@E2DF_GUn4tSE9=Ban%kEI_;?pchE~ym6CxzO|3cOQp&pLj$ z-osDNSg6&WBO*)P0%0ey8ohw7zrD|;%pMvMlth7Jj1P7F2tNw`#h61tKdCbd>gC72 z+UV-*o_<(4`zvNyNecle?iMevvJfQsw^A>q!l+#zPREKv|#`VfgG>Bml{PULrNE3|*a;r9! zM+%#gEA`q#O&NPE-&wEI9ih_;F9BN`#<%`E9$1Qk(DnSCfgaTpAvX4>zc361g#@P6 zi3omZP)md+J5u32!>}DkjX3%5>F=vwjxoKJu=qBoVRPx)dJHBD<-l2@f&0Zs1~qpx z`9#|HXpkkar9QHV8OiU~gfsgXte%C^wVlH76M<=R$NDElql1<;Hn?$$xG`k-^(*xM z{GAQ~3=A{4e1sNULPH2P7{?<051ai3JxBBM{%0u)!a@a~SP{GdAhJX-^m(^>qoh>aG9l{LY#sxzoNWqj&gkZZDa}4jd`P~}x zr56i43n2zD6a03eLU{pBq%TbxuqBj`^uNS+7#P8Sw&G=76r@k~Tcqqm4Bj8X0`EbI z0ne1bU34?lr2m0eqr$)l{SkLT^ILQfNb)_$&}W z`}VhXdiFhlh6gO3!2}ka69X{vgM;SG0sMl$J(%-?03P9&CeQCFlIDp4oMJB~2l(r} z0Dw~R_XsL^*x`>F~IHpZ&&65JL$hTg9I-%t#(ZR2LJuD4MjmUvM(ZPFyi7H z0FpkKs)rh^|I)-ae`&J6>{Kl9_#!djoh5jG(Gq}e4OUrF0G|z`QT+=@`0oV^=0toG z_&WT>578n{(r;#0WSR4ej@#o z*Y?ja|N5*W?Ej&+f!~Z0k^aH^`mgRq80Yx6kQf}jga!6Sz(V_{zbNR|?RV!3*#^ux zN=W(#^X4Db%ep9N#r+@Q|3u(`%g3-t|A1Hg5oGW4cMuggV-$<@k4NMG5Sj%1EkpvB zj1z$GM~ML=iT`n35)u4sBCyUFF`zZ+w|n(9<%^3M(EZnoNdi6_qXpZI69YmrfA?mO zQ;_~q4E@Js_F4ZPnH>}S^zyy_qgv??A#CyALL{{RS-b?^8X+M4qgv#TsL|5DqY%MT z6K?=(9ly;ud9>d<>%Z4fFfjao#6@-g7K%)wgQb;-z&|IjNdGv8|3hrw`?pva@Ok8S zGgpfYTsz4O7@YiVo=r*tdLVx{5ozChS(v-KIlBD2@Jdwy{-rbv28QqDMS}|iL$dNO G>;C}_dM#G~ delta 22714 zcmV)LK)Juv+5^C{1F$Or4XW8@*aHOs0O|<<04pTw zK!b{dHxe$1wboX!v`W1o0WAS+MB5I@A&gFD(#gb2?-zUh2fp^DPhG2h3AC=-)z|)u z{);|o_nFB+5`wEN)|oT=?A!P4efH${GOj3? z!d0q7E&2j*mCWsE53!n}+H1!u7+?OJcbt zmfIb8SHXLDUxwa+WwFgGID~=>&Ja0gScW^n5K1H$8Kg*^Ve#2&X_-6o`m#xq zXvWU#=A!Nx;=L}E+*PB(kj&UlFZMzkhUS@Q|%DTGaa%Y?& zToGG_V~M5A9sQo3Hg&6*&bp3a6~}#vVW%${CLj0m(VZei*xN>#LGeRgu}hT8?q*|# zPXF|(?ojr5+j98>chb}=m5i+yI0@svg~i?U!d#}|NEnwWYfr?mry;f{5~0QU40l)U z0z+Seg2R7TOrCes{uycZHWT--9FP}lb$f1Tg7kM0SNXd$df8Kxu|mNvKFIU3YuHvr zMvqELh zn@0`Fb}h9wO4zj*=B9|+M6&UEOpP}ed#bLP*`k>t&7PKW1?>_mayR?1;__1SMGQQ& zT6njZyVrGxTQoD0!ORFEZDS<{M?-7OuR4ERCkl4utB!CKyvLft`cjd6g}ak&#zkM^ z1>rhP+SljB@x<0)wFO`uT2P)h+t@5^u}QvY&_oRDo_&|P`fQ^w|6Vlts*93aMO4(h zxG@YzTLwxSL>_8tTyZX@WFonxnPfsZtBdK}%=N|u?{1ZmO-Xm@ijc>ic0ArBpeuj2 zLrN_`+mO}<=tktW&KK#EJV4)O@fQLUBaqf(^p>V4qi1+%4eVFi?7(qaBc58Gn^iT~8B16g{&oY+bfkS8YY)LqOc3c8g!p)R>SO5|e63P!hw_&`#Pl%T6<$ zTKbPn&_rK^XyOm>M;Y&wf(}! z#H+|EkG8l9&AA^;>PFb2+=h~S-LZ|s zC4bYkwO3@AI|s<%Y|6H(iuKU+o<2?$j1L!SOp?Yqo){(@S~m+#)9>4sP&V$lC?KFq z{F^xDGQcE@HdbAl?gLZgp^Zljh5x%uhU|&4Q;C_8O*3SA#E8fBV6)rOVwYjU%tc8; z>Mp~wUm1XC6~^^a{%nZh$q?W_QZuJxWPd`-a)YZir8t>L`uXiLLvBck?XsEh^oTYw zPp`&>`4X_qAVDvHP64en1B|U4!1_uX3mN*4_ktgB31&V$06bi!HHj>8eex@cnq2M& z67Rg^A;!FM&pt%z8!jBc`EnxX5e?WU*-v!-OcMJ8(zzpP0;Vz5mwrmC)%V4Q`#Z`W z0s6ko?mDJ>v>QGA46gJ_Thw|Um*L==fn`#E08mQ<1PTBE2nYZG06_pXwmh4_4gdh0 z9RL6!0F$BUBY&M)34C0~S^t01?!Kqh)8X~GzOqj2Sk`GfjvdR16HC5i%aW{>Og^VQ=sK2P|i^97HC@c zKeLB+rL9QoUo>y#n{Vd3|1-1s+_zr(41k^T)*#m7*MEZO!Dp-3yP=xbRP*bq`3*Ju zITODb#BbrZ4SYU`Abux^-^K3*@eF=nHGiOZ{!lf46vPhvv4Jlb_>&-(<4=PK;m?A2 z9$!?`UsBDVoA`?$-jBaj&0iV#vikmY5YORng7{l}MKym{MQML;;va(eNBon4e>U-Y z5S#HYet)Qc^?-@52Jx@>w`%-5{v(KI@t-FCOHuw??esN8`I>>RD}DY)HUF!c|5MF3 zRP%;vzNwmTDV=VbLbLisOsO!X(hy$|`|(**{QOFQEMlmhNjFJV5M2^9r8(4Sz*dbwd*QFRvWU$lz*@(YYkav%K9LNWP>RiO}Rzw8=)q$ z$&_17xy_W#rff0gc2l;R(x5ijW=NwUO#-Vck#OA3xSdKlDM6^uOgclpN zy`(Fs8|*pW(|fAt+|Z%^Xjg9!*}Bi$7wxvVotS8gdTuN+u}@IbnM|ZSJK+u4@w8(~ zvwxtrufO+5|DkB~T<1}4B9N|1k?!)Hp}6|s@SWc|qmWJ%U3CC+2?C;7+i6z?($KsBbVAx}0N;RfSDJ!#N%t?8%M1M|J zZRuJjz@f{d&a|53;`+SIu7u~f2|G^Z(r$dguH9T#n@&0Ife9yXS%M^*c)U8rn{8dEHK8!kc6)^EuX;Oe-PG=VRm|f8NawSNXV#+O8=P%i2gdqe@jO zP?=17f>i}`deh!?+N0AQdy3N)F@G*!S(xog%ugE9Vo0kYZH8<&WQQR;sc*_2cLv>< zVB-Q`Z(Hb3IwWSu9h6O_pU>U zQC$JIHqD zMP1SE>~#;>Zak*ARu*v;5-HEPr-(72Bg@X}q7@o4yY&R4vP-axMLn91+nzI6@Wid< z15#?X_FO_EnmNr)FC|@C6DrwGXRBaEL)jgIiZ+bALOZ*sW?G3zzYzY96!TB4xqDc?)UPT*M^{-;c-WzDduU zZk<+Op)@z-PD^&McMXn&tua!3waazu{u zTw1~aOSJ!j02eoLYsZKOR)64E(Mwq}E)#+)rw;V@boCsG45pZ9k)s0xeG!csky6-*BriH{ z#7+}KE3@w7(z;tnxGElb5%QIT{(V6>H4 zsKh1R*uy!HTD`CaI?}PYuFybMJ>{KA3qOyKSQ1lKo|g-j#D9hPP_NduQf$1nL&KCM z31O)Q=fQ_Szo5=7nU;rgxm3J%b74ho7JLShS%q?PiXq4l*OHX5iv5EFhg+D}X}MU! zmtVTP3@!;Gih8;A@>INaB$gO!J!pHjH#6-Jl<9qa8ZDdV23}UR4j!BC3=wpGvwj|0 zu_>o$&-?SarhmL$CNQbUrI zt+|p>wZ#Ldl-QTUJr%gimdvOs)IipHF$Zf_Zj^(oy6kXjo?;|ZtyvTevR6X3HL$JQ zl4{$MiZpCV?bH8lE9zSEuslL6DO2HH2Mc$Z4ND=|4u4kW_I%yt@P>$8?u@7T<&V{3 zOh^>57Z-DPNrDVay2(q~OV_&MijU4DJo|D{s8^Ofx=QnJhId0st7a(>k7=DZqtCD< z&DK|ed3zST9fB#xJLrtt={OUAUD0t^!l(DBQDSYE#H{P;^M~F1g)cC5VJzmR^tJOe z3&~4re}5D>=kIvS8WvwP!wuzcTxzbC<|c{*v39|pB^S65t?G9kO7nI)@2IV1?m6Y} z)U~vL&tIA#Sl+VB8bAN@=RKo;CZZBTkIcd95<=e!lQ*vQC zpt)79Q=6vm;;lpN@+T1ADPB575s3+9>+%Knvt!4U&i+eo%wqx?^lev{qEzx}O8RI# znNrs##w0pA=_sr**gu*~dD&hcK`_^|Rj5q%PNp4&!>XtbyY|GCzQ|3#sa#o1>H6N5 zDSsOR^r;Z*LiG-9TslVz$e(?tH*_u)D}R-J^UspNc+#D+y#*$e@l+WTa$MMi_2_}X zfq^h$IM4nC02PR1EvAqtjFTKs7mXi6NWC7|52*)){-$$ZJ|p-IlJ_!Z*gnkBApG$0 zTh-Vk%`LN#7xgxeXvPY*n_%Kryp_GiEF-=TZ__{PRcS$@drDM=?kQoFTEwF{5r6OG zjQSyPW8*9;8k?@6va#hFe2rn>HTWBwuOYw*V_xn?8Vziwv@P84cGO}kR-l27*oF<% zLg}(AyJJC@jRjpcYBMWz&(pf7p3=%kDj!ift$MYVz>1K09aT3_JBQ$~%%b`_ETv1O z)}>ajZ=nxbu^ijAY%9AiC;RQ1SAUk1_yc$cMP$8NsTbBYXHb(t?WxA5=2_Iu+nC+= z4(_{){X6x(k?fL!O?9|}AJnqy@I%^*Kg_<5lqmb}$_uO9gn<6puZ9n!c7M}#)Mv1) zJurvR@En#8Q}Bvetn3K~GFa8_YitVpX0e(sU(;@ceW7sJ$Y5>Qm%+Mr|9`Rue9CM$ z)o8=+VAY=Lsy#Jff7r}mQ&V%uyv~HJRtB%Es`(_E0%!@F zl`E?;Viz42k;e~qkk5s@paPPz*!MI zAby;aD%fISM5n-yQkz=5f_LLb7}TA37LPM=4NAVkxhI$|53<&OjDJ;>`ZoMHdqK*4 z1V4eFL^XB1jQ6ltLu+2cPtjJNN{oC;v6o9J_OdBeA=P*i??a`iw9c;Zi;1UblV2zI ztEjrkjcW|7H?YINGk*r2HSm4|&lz~$K)-<#5Fh2-WQ{JxC7SCS=(tHu1B)36Q8#H# z$qW=-41C}w3$A|AO#UAk*xaN&W%n&A98>+ck*m_<^r9-SO>@{W+?c^mVRHxncJc2{ z{_W=9o>|;=wNSSKz2HI-4s62D(xvkvK1j|F;lnu*znFv9{eO*3v)J3y@)~?EhT5Ab zD}#Mc!_rB7H(0v&kXe1PO@S8y=t8*TYve=lU9@BKyLv&;ctBG?F zqTW5ky?LD8U%-+51svIr7Z_kV33uV=G&a6nV|K+GsAh~-6pYwRCcf{pP$_W=4RGdh zy5nF5hfXwy4u5BGBy_a$)9A|JSWk24xEgo+I3BJHorsdy?rRaw_hiu9?hpIIeopob zS2l(EGB`Vy~N9tEUSJN)FeykQ5Mr(bQ=12u|M`)Ob)QQk(wmr=^a0`)cT`pgE#2lz^&)`f; zHeaqXyMNAJEo96peNw)c0eq6WzmH|~6k+a}qDiU{z01XxZ04kHv$QG0Emh#`26359uyQkBY1?kK8p}CzmZ~j;3y%`>P{NXDAR*3}) zo}pqho~c5`v*hq>Ioz$_IVvh7xdMOBRq#9o&-dd6e!Nf;&Z~G4UhKz9{CKH?dsNg) z##&sEi!W30a=b#pD^<*N$*)rJYTPSf?~}u8)mpAj~w3X$3;Ibsi?&Joni#Rwi!@i0aed`Q7%73*-Aog0HIBj;{&K>e$=T7HL1Sucv+Qkand@a$tXhz|>YVnX>hyy=HBBnLaG+^odaii&sr4J1mR#S&FJ>brE>aiq^@+J5yFf)IAsMKUfx^4{+ zug+sxK+Pg=*DZl+mm_92ZHvVXu2v6OCKv6Pk&+Yv#WGF1Ek@poA>B$D{8*T;XEYvb zYBduHJ=rgf-RR=ONOO)1SAG z?9)<3uym1YU)qkvo5p|X(oPp^AC>Ji6ST7;ZVn7cW#@WDA>u4@UrmISRhc;OPDR#cmL|DO?zk!kLV%>Pm8zUQoo|P#n(MtU~!RriDw` z{BdTb)Ge10NyBd1x3`OHf^y~;5PQxgZT)P{9`c0p5^a~+8rOeQsW#*IHZz^_9fR!D(N0}qHc^Gq^s z>irt_qDR9Mk=9@%rQs;(*U&_#Lc=%lE&9LsP%?)mbMP4ovQBf^mZu50e2`h7;oJC* zg70eh9==bWQv!eGr_wRQ7Fhj%96Jp^zz;S22tQWv6Ah2zr_7@9L)59K1{p*RKf})z z{6fPo@hc56JVnD0PH8xSrz-fhhTq_~0&_gf>XPL+9_Qh97tT=SmC~WVEA-$P|8CtL zY)Pez1hdAHe7~2&9|Y<>n76W4rEE^5znE~YL4U-b1hjwrJfcbN&K2Y3PQw0K!Cy4| z6@Sz4cNyG&;F^Yi;u_1toy-eskw8_!mVe>ja^GVL{-fb>{8ynMA;c6#lxe~z$`w(e z2}SssPd7M0^wfAx>`f=_Si;CH5?@qmLX}$hj#GI}R0&OBbE}?Ans%t)ppglNFcg*N zZixO09XEfiP}V0Q*7?wJ%S?o#Y)QxTlo6_5oT^_@kcZvJP8d;J6H`UC6j!5&X_}}N z0Y%hlVmi{SG&errnwWuWikPX1SzZVA%QXV)j_OC~cxjw#N%> zokUg6LtzEk&`>lNnC>M;-aFEEi>w%da4`gZuyEq;OB;9~4itAnw-Br;X`z#9=Y<9r z^_YLsV0hotYKvu)cKC+CUIlfmD|xOKlut*1VmMaN^g~{0<0-!$76vmy@*p@J7?!R zt9Q^c&&YeD;~g2kp6H``LzugJj^*Pv{KX?H=Ag9doP{nz7-dy8+ciy~)^F4XTfiy`(hpSMayIaTrrBIV}4)Ryf2E_H)!+ z1{}Z>_*;oS93&Svi+iY46=_#TP!?G_0^d#!<-0~v(KigG*%$O>;6D)bm0w0>Us<54 zr_UGAdNP=rLG?JfMv|vV@_|v*a%Z5qJXkLG)&+fy8BA}k7{QEYC8&^EF^YegWSN!0 z>_`^@}6Ha3mc$0w%xt_Q*y#N~|f; zGCFb;;l9Q|!!R00u#`T`l9uL?#vM{k#ei+7LkE`7d}-877YY`Yfb)NK)GX^KV6(YGf4a`<4#l_Nx@p9N3V-#``c^5(Arjm$A98 ztg&YVTZVDRRXV8UA#8sYxERT*)i#Xwiw<%PlV=?^(OVr1f0?7(5(WqSs$t3ms9_yX z(LA1@FvGct+I3LRP6k=(-pIh!aNlX1;jE53&*B`l@1#{{@g#oDW2(8UPv&1Oe0vqF zdkmEd?h17&6spQcXV&08Cl7!Hje)8Rw%v>AZsa-X$e>fIJ%Tze>Bh3WQ1?@;fjP{z zad$3oa?ll81~G?X_@d2?n@T$vn8~ESz8}ORlH?50itN_ziGC z;q_w&000RP001JB(8v~(aOw|#omcsP9AzDT-s~~c&4i|b2A8%FrO?fmWP8xorUxxa zE0IlFk|v>{D3jgkW}3;&Iy>6~4?OTz6fX#;Cq+dm*lbg(fTE~~3d*nk9ezFn>hsR* zZZ?~3Z2e*1^Lsq+`+dIOclNb^zwjb}O?Yb=8$&inWs{T5q-;#t9E)LpGo}<+F{qeU zV8;-{l$t8NYuwE5H!VZpiu5u4xSledl$`Gn zXqGZrv*7iauE3R*nQKlIJ=3vAT&t>N8(wN;sGmwJq*%tWkD9rnt4le7&a~s^QaM-8 zT1M)GtLO8En;HxH-da)W$Lrk;PwJbtY#lC63$z8!EZxqfhACiw=co|%Ce6ay4Fanh zdFi(co^DxEZl`IR-fn^W6H5s$yo5%x%2_Y@P>WG_jtYc(oh)yCdD^s%!Q%9U;U3Z_ zWE|SkGAyIIYsz_fF)U9hp!M4}&0Bh*U~qcv5+_-^k%tb`5~I|b=&TQJ%$v?vLm$e@ z2n&u@R^|E+>^qr%G4kcG#HMw3%5Vem7TYkgg+AwmZ8>_DisPh5K|gBr)zd@soP63i zZdjxc@wNumxo@S?l$8iw$MFQ(7asalzH;!6I+dLZ53-vkT82G6Gc};+eH8_dDtJu6 z;{;tjK|#S20#{Y8!H>m(iDO1aLRdCz=4{<7x^%a9u|N%f0P;FhbX~*tQoX!b>8=5u z*sxP{Ge&S%S~(ouQjFo=XJ;&@KoSfX-lUUN@T7+C;(Ho);}#8DuvNo0*}NayHS}PI zhMm}@VGq7fTeYq<`~dv|SJ#v4)}m=;4Ohbt@gogS;WWeB?M!KSTF&?2#~OZupK5qU zHb0YVKgY9w3eISF4$lijy7Rj0Y50ZQK8sm;tpu9JJEX;uf^!tKoOj!mGHO+~_kb!;|Xd8L!lFPtnlt@dpKe)bJYqq~Ue^S;JrO zR|+>EAeqza6s>HB?RXtU`(88OLFROL4m;5;pbi;-dcm=KX!Q+wqBrq34S$#ZZwrHu$Ju0f66D$c_ zpJ-HnMeEC9vsvh?ki&<|ni4e&0nX*bxp$)ASVhk`sC$#V7(J6Q3atAZSozbJUC|pH zWB#sIH83_`>=aq(MqHECH?iicKqMpRlX@6Xn?l#Tur`gyX;GU zltnJ6nS;g&xr7dW`EG{5&4{+P$_Ex;zpdQ!ne}_Vw0_UW*6;Zm^DjY&zdhJX?OQn- zM-vqGHzwE5LL_gRMN_hC7NKN3Jd1EL9+^cX8IR5)nmh;PIZ8I6mu-~#zy|cOZRZ*- zU>`mJ_#^3wub6zPxJN%tZzCf8h_^0(Ks}s1i>4BmT|n&cIWz||t%R1gE7+8<{2V{3 zxEd;9#SGT0FQIJ)?OYIYG1$0r4p*HCG}|755`h9mS(_SUYz5KQEOnM@qP%#Q4x3f81PG-e?Nk zCQjp?o=BbPBuxegrSZ1)!8BB!-n77BjarvPM2Fo~fq0~XBgD-cdFz3%cw`PKn%yuK zkDP%Jy<$j=@b6jJXNQed{-4i(1X;SBEKQS}N65=8IXOvIK1fbJL{^?9Q(h%k-XKT* zLCts2C)Qw}Scm;0iQ7akZWlv1NXuz4h5_*a2F0^DAfCsNcm>1absQ3JV$^5h5iFzK zTkt_Z=1PTBE2nYZG06_o>RH!U}EffF%bSsnLrzU@$SqXep)zv>Iv%Jah*a9I8>xcxh zhaCxsgd|8b2}oFs6yas&B^j9|&b%QBwQ4O^YqhOgEn3&AXr)z95+I6e)mq%Dt=dhi zw$`ejw*40Uil+bb-ppi@3^Np2d; z(`5e13Qu=&zMCH484AyI(*!PX(;hCAo+4?A6)thpRL*sCDVMpalFQ|DmNc`anKO(I z@?3@Ixp=<93uMMZH_hZzq<@i%E9ALY*j;}jW2d?)kC(dmGeIHy)bsVG%Ka46$)nvg)?1TCq4BFHz>Ty#j9O>mUOIf(=u+9X04lE<8=zJS9pWG zp6#YuZgSH~K1bn=ZmJjREBR|K-XtIAN;5~{&2DPsEedOHZf2h}emAX?9^Fk%oa=w$ z7J0TxGsn$s9B}b@F5W6^2eUcEVG%Ck;&yqSFFZvRj=8B-6xzzhF#4F|(ri<>!%ac1 zm8MfBb}77F;jg>te3{$M7s!Hdh`blN=@Y(4J};8Di^Vh-Df~?)wKg2qqg6pI7Sm%) zp6Z$vmFw!(ZmzCvT)U=r`MR~Ws~UecudZCXk}0R|JZ+m+9@N6E<&8!(5N=(}G`uPj zju~3mSg!@+x{EJiat0%(TN$a}X2t7Xg5K#1#$$nP`iekMuk`u!Sge0u3u`8C z<(Vkd9CZQ6IhO>&0b?oCxdmS$*OyCjY_<#6Guf*mew}G#T_CJC#6!(`bghO#u|UM9 z1=nlQfP5!9?M7PwmYbAuXR%E%2=3j!sID1$bs%OiEy^gt2I~ofwgg(^QOyWM!ix(n zqX#18q7yNNFMXV;@VH4qB0qn&j|Q6K^1Ut^WEx?S59>zxx;3?!lAAuIu}zyZe?enB z#56i6qF1L4D*P>U*A4Dwns-bsPam=hJ1eqtbs(Bzs$XW+-29wCyL>~Jz=_^2%VG-e zfLSo;iwB|JG=`@Y45U(+$$M;VdM6VH@K*~Mo3^!I2od*)p~z46o|zH!f>L&)F4il zz-xS}-$I4%U!!Y&D;mZOe!T_X3Ta{Zmx>jU zXu_)${tomTh;4regprgWxUHb@9LN}nHE6Op+ph<837*jm%ECk?7B`axSjLyj*9O_5 zI^a8IV@9tBs18C@pb91cBfM7vTJF}01Q<%mf&G9p0==19c=@sA{t zRcZYa=Y&*1l6_tpv6^r^q^AP4&1B2&*Cksh+mnGWZ|HySCWi`Nq40MVz7iqc7isTG z3r0+31sQ`>X7()TL31_}T(+QS(XE-rb^i z^(z06Z&3M1d;`+)(S@2mTZrvc`9{78BBVGenSm^U0TyeK~nEfDr<;Vw*zBB4eknw5EL64}*jM7%8s zy?+opS) zbv^7gv{1XGZEr`wXe-MPn+16^fFkO7r@#Etf=e1H!s+^h1#V)%bY z_z<#nf3&QOMzt;pnJPa@Z>anjKd$l<^7bTbMz0H!-OYh;!tn$?Pa!)Wt;`t!yJYR{ z@U?{^C`D`w=g(L97w`~Jd0ORX_*s>IDM%cbx%|R0Jwryd##DZee$nT;;f&YuiX#>kFm0yx+Q@($^(o*sPP+xf2;Cq`~VX1>Y%R01WsN#?27Bbws5RKiwU(3Eo_L> z#W6=}>liyPL&-{Nj3eJor zj!N(IJ1V~`2>1*CHEEh5b(qTUNu>Lm;A7HY>#Z74pp8!txamV;xc9}5e^=?B^e>e^ z;Hy;rkZ(uuJbJ80iJR;ZpGJ8%=fsb}NgSBwON+}BzvM8Qj-B+nZ^Xdb1Et}{!Nu3; zA^tKz|7kTT)7VV);sAcvwncv<9o88T^}7_!1+}&EoOzr#6kriY+kyHRRZuwiiemhr zNoj}vu>~2A`QBq$f@$-KT*-W;`;DAIY@4ThUIpd^2m>x%tZWYfhe1G7g0K$~&dzY&FFb$7<%=EI^9#N< zE-$PFcky<=W=Khe4hwQlf5JEH1%-0`GJ0SPHLoCt8IhI!H!-;dwHdMF#1W{~XfrV_ zdx_5E06VduYUupb)7fI?3-cT_gxJQRn$5_5ZYD;2rvF?#CPO#W(Jo&>xr)*|1ExVO1LMn#ve|NvBUm&qQVNH}xM6`~0R#CTVcA4~S_I8Y z3jqUf5yxjfxyycI`iBx%LelFJzo;|seU_XMW`^7zNf4?}UZ|y+5;5L%z2OO0Pks*! zyjJgGxzkA&Eavg=xLhK6FXcJv@m}sFBCS>+S)C}9nPwap{l!Ufti&jBT5ieKHKu-F zNgG&f28p^z2cmx@>Yx5S(&uE{LqTDqcdlwViUZb~_j54|Fd6TtJO$~d8F)K1vQ3NC zN1}R7P!GWd0RFJB-f1L02OA^h%?i|I-KRN2TdjLtPd|)?TmzM-%R1n$>u7j&_<|A9 zlA{ArTc?v~I~5Xtax_<2k*khq8-$$=#GQY&1RFL+U;nUR1n~l%kS-#oaWr z9?htRqKAKI1YSm0*gf`c%BgV3V@!n;{lh)ZUK-m}yZl-o_?9;3Vm2Ju-4 z8H+%<1iY5gL@ER4vrIl$TDztATuN8dHQ>lWi|AUq4piJUkFJM)ZCG1GKcthm~rU2`woPbXDmd$PM}n*BB!=21q?>ZX%7cogZHzF~)pclEvCQMxH#)M7K$ zvVwm`qum6y&!v&H8PM1Q6KXV-nrSBapeR3`Lak6ofKI3LXbo+}j3B;3bUsC>3w;++ z)Kp;$1eDdcLrK|m2F<5C=qKb7p;KzTl=6 zLNgSq{EUVVu*rk;Py%DW0x>~nLlI2jXed2EGZ2%!Nax#RF*{v%-Pd0*MYVZVs-)NUkBnYpelH1zi%|8l+$2hiOsitP-1@; zR<5LO>Vb0hqgOQ*Cp`zyBWlQ|tRpmCp@UNfh}cUHCq#S+Ius^qN}r~xqLLmeudtVj z-^{v^<^oc)H{{GwOi79xo9yVA+t}nNZESLS>>^o(V=v7UM9#PGrv-abuqiUJd;Z3BkNl9NrkDAd- z-o%r#%(ur(kGtQDZ~Si%OqcU573e<+OWd`_jt3U-+EI_f;$1=8)3bhr~rRl&BFGJ z@O~OVp0r>ATN$WOk!m8@`p~3+d{Ch$8A_P^DFlAX z3}3&%-_!Jr6{fR>W20>J9|r7BMGV^0OLdMCSdpzMD2k$Jq^lTp?n!(o0RCcuvm7Zu*)a z43BQw)J^BgV9sW|?16;2fYIgDXg;r{bqS!IOL=JTf+_BX;_gApx)*;l?gPknQw8F| zazum;P~;ZcgUGZOQRN}5?**l9XsZWs>;<*`2;2u?j)O4U!=UyEaB~Rm|CnjSb^vk% z9P?TFC3L$5$?G{YG_=uVIt=)^u-h7Xo?d{lE9gvm(e$b-F!yEpHTtfHSzo4COgJA- z0pKt&DF7IQoquD(ITwHY{5A#W8gjY%u&*m=dHk5W7NZ^M^(&4ipS`$^kN&E4dyE6(wElb&@aIqbV_yHg&VW3u}s zSbvJf0b=6;Fj2-hi$X#Sl}6C-Os^D{U4)Q2UO32-p8^uQ?uUOO9C$7)Ha)5gkCuAd z(#a*rO(zwZ=q#B$2k`76yX3VS$zj{Q!zSK_sk8f8nr7w-(fna-{5*on3$VqDaI%+> zhn}Z7(4Me358LHq)*tCl5Ml(vs^l3P*36(c=`B-$g(*8Mq(7T>5CMjh?QE^c*AFSSZ$ZnIz=kgRZ?WQ71;wlW|Sv>Yh3lk!Bk68Q*2yl#rX zFJ9@Tb~x4fO#{YyDB43Ylqw#(bQvCJ55>j7w(X+fmaA>^D39*yyG}OkkWQER=5al` z2SRQ_nvH_HC>iF{4WLT}cNwa;%Tfw#0N4nYaYHqupbCEvlrf#&hVtH_Qz7XxdJmM| z2dxi~x<3S^50I5UL`M1u^gc!`{{+-NhT=X!_45x?*=wMe>2x;zh5ibSZ9-x29{mj# zABDX3KK&g#LuV;vUjvF(2D=7y1@u?r%bMqgQ+`DM1!=?-8Y!RCD1|;&sPzbyD-`Ub z*`%c5Ttv=Un+GeslV_$U1jzvLvbm}t)>O`n`lHysab4w?&|vp!0bY(+SZ@(tX%%zX#WrK{!>(Y|3<}&3^Ux$>mecqQ(Zu=F$I}h0cHdrjH?qBmVC_Lb=?}^e7j0`ZU3G z4OWS!m7-$ga94j>>om8RXtLn7rqE{z78LsbgfSE_E9FEgcY^p4Fm5?;Ii51hA@Mjf zY1Nuwk;dXLs4v4}=W#8@d`>K`NCYgWS%76;Z3QG}N-C!%73gHKEfXF4?h~YAXGcQK ztD#jL35zbM8HWhlo{W^NvdxvELJ+q8-N2LSN5uaDv)#P90t#<#84xAGQWNk@UY^YQo56_xXe-jKOgpI5vk`tkoi6=?d z2qi4p+9Au=syWP6mJ)(bX)5(WBAA+6-p!P@`Ogr3TiB8L-IQHVxwdtGcO~xQt(u5~ zf3Mk4x8yhor%3h;EM`mR%Sce>Of<$~i4Ux2ILLa2RMoMb(P3Cu@npgp^KH6{(G3b$e`!3M)OK_* zZkUWFJbe)C-UnYk0Cw=q+UKkrtdO|!n%_i!08mQ<1PTBE2nYZG06_p9O4#BS2LJ$D z4gdfq0F$BXB7ZJpY+-YAl~!qE8&?%QV@n!Y9>jK->nrHBoEX z!CP_C)*V|Dc@lY~jz){g;JbqVVi?~G>MHMe8 zI67Te(|_}mX34S5)v{w2ECpKHvJ877ua`G1`%v{;lMR#=YZBYl_5^#yx+FmOP8k%Vcs35$mmy8)*0vXQItS7eGg#z8My_G6| zaDU}XSInY<+4x(t_b&Wwka@Li=P&7{bxMq(CtX|xRFq%S$EAcNmR^>nLt0u|x)cx; zrKLkcx?!b}hKG=p7U^z5T0o?m1(r~{MC32^t-RsucX#*f%=F}`tuhcJBwo{m==G@#31Lf#jPj$2A4Fw|u z{Nz}vf^L70ZTDc#r@EB0ZH$TOQa67w!C#h0bNXsS>4B+Rl92i4vmmPOfMo>Pkdtz2G61InoGdwt&0RM8RBkW4Qzxq^*nrm8F1IKu1IHWd?t*w@Z~>9*&qKRde5 zhq{kCgRy;fW!7js?J5M9sz!-9qpn%*K6?7J^H8GYG~l%=nJa#)bf)wuKm*l3-iIu_ z=^uOU1@D7->|ADbkaR5}?#V3Bz_9OJYjPdWE6n>JPk-9@jLN2;AL<&1w0TfQ5Ua_9 zlcV&Ixy>dQ+f97zGIyO@A-MJZ-C?rERO}aA{PFtwv!Zj%tidN;1pkBe+rI z9f@C#qspj}UKrnUR)P(MP2+cn_w?@kV@_58|4Qe})F0mDbKg4Dl}{`5IK9*-&^$zN zG#q2USDD>5n^ZcI|BIQ);=MyYVa0n)IHUs-HYEmPa{4QtIP-YfDS4{gBbSeP+Dq?FODsb zgSFNvlB$D*I7+XhSO zbY8ljterql_*Jfjd}d|e=AGnbmuJI*=_FrMm|=~DzFSlq_i7G#P&-tJJ=j5_lMAK| zXgzZ?&Y{Lzv=9*2m0e{GA*;-{m7rE{DJ5#A8Ov>jR+w2B)O<_T5$bhuvD@))O3uv==1Rs7{J() z6r%U(js}?)F=Q@`*_x=0G%u9^%H>snq6li%=@nTd|R2XSx z?(RFEI4@Eq-ok?i!-+-1Sh4t+WV@JS`w?*JF#VnSr_n6b^R;1Vn(OM`g*j|VK`Btd z=^0CZ*3zx*OnXWl*ND1sVWV0lD4RHP>Uyebj?2GZup1glppV1 zstB?#ut-DQBy=+L!Na#ssVK9r$%W}_>3VgPBB>AJ2|789o()$A8FH5tOdV{SuOryu zk%BpJ8@hz_K^5pWp?_zhI#;8qZP*w7zR~s3SPoMCkRLUIt(+YRWY~HmcPP0ZPkfh8 z&gAtR;i?+It+fBDxXO9BIYiwcEv7@MU(qA6wICtRBvX@DHvEa^^xcYASCt2^&I+B~ zUQfnW~^dNpn8~4>Y4FFBV~!=cmu<=A%#%bbCz>!YJe{NoWQqg9EY;QPlDo z1}~sEMzr3!m0Nu&0SZ!eba(JqIVb8ms zDM%-E^16xmi?hC$^p0vt^Sca{mYD4!d90m3k1dLm&$s4V4U5&8|1SaX-A_T89|*U2qswvWb?Ixdua;8l-Q2!!(54kP}-`QmB-tZ} zy&XAy!3V`zdsl&nyl2|cELZFcvdB~30@mEdsE^v*8f7Lwv#SCYJan5#DPP&+sM}Kx zbBEu~Xhgmi4?9H;tWeGm5XvIi2IXb%kaW^^Z822P@7`mA*E0sr>A8q1KhX~C-Xo|A zCYZ!$7csVqJjhtxWOA~4tR;aP6v^oLt!bfev(s{3dB7f1s!#v5Yw&4?G@d86!Y9pp z+MD5Cp@n=3#~6FWj7u*$qJK%gDU#X&u0XZd47V@|3;O$4ZlT+EWPmX+B!Nd#EI|7* z&2N9xUQi;xnx-scj_PT86VgyXBz()Sb1~5*g9SU?z}ZRvP958a0Xb(1dokuAb>rN) z(MA>Pc}9+jf@|@K#?9q+c?l^lF%z@khirnE`ADhrt<0DAv!uikSLZum3|B7(^V?B( zHWLy^I+>I;!a`W7^$dwt@he>XSSW|!2rkfRH39XEXa%lQ@LEx{!I?rI#zfl6?gRF55j z;vk!8qC^~y>&4O##Q~K?r6qc*R1QOYT+JFoN%wvbE%$U*>QgWph2Q_>;f|}x)J*0X zoDzyTC6ONNzip?kWR(+wTaj@^jI- z5>y*6na4-{C@R$Y5)lI5|M(ERN0HeX5oDVAwP`3`Jf&!L!xvxVP^_N{Uv1VR!e{IK zigdfhCoiQIYsZWq{Z^@;C0%Dzf?T0wW$mUaa5|H@5+S=5+vmP{Tji3Xh#41ZhYghy zwWi{XS7Wb_`g(-qZSL!VH^N)2T>VOA6!jD)p}gL7wtMlIgr3WgfcLtFezmKkV8(mv z$L3Sx#H8Z(=KE)jS-feUEp%z3yb-45?;OEV=z zfvE*0f){!TVhr zy|mU|=OJ&of9ZD5%Y(`BIEjNhtqh$mwz zX&pfyUZo_mSBAq+`xoImwW}vb)N&F~zvd_>)wTp!f-&Q=_cmN@R0^!&Ca54BrIpeR zHIPd*Qi?Sy{Oa7B+ksdiUC6IA2LTEOpNnk1%0n_Dm{p~fRkO*9-n*+y;QqJ_hKKi% zK=A_=G973eWprOF?Qiy<{@9_4oy#N>-IqHBxxPr!ln502N{iiVe~T*fuG`p=GamhD zliUj;twz5TZhlxl>zKNALQavlQWHKlL(7&?Qr51s)@B}CMz_1*fiAwwBCpW6O1&E_cnWUo~*?lWV}<1dIuWvkQb z037X>itDe$OB&w6rRM0y9Kyd0{`wJ;E6x#xH8U)+w7UnCB-s2!93XpFGZ~Q;J55)^ zQs6f}wT_z_sUK5gLI}>a|W?s&+k5`urvx z{)i{*r?kMwCDP(0(>LZ})>D}_j-2)~0Z)$|J_)syE40;_#RxX2-rZz|g6caxhq z9wwWJ%cs{*+?Dd~A++|%08GTjPHW}5GDw#a4;wySw-f8>z47^w(X6;e+gA3i5J)9# zvtQp3;l0L=$Za~w;NU89m=e315)*RB6c%VX#H7w}CYJ9YLFgvzaU)X-=~hp>l*26- zU#knGkMZVX?pVSkX)Nq}Xa#;jC~Vpr)VD(B1n4F%2xeF48`-uDkHqW7AHBTC?)8Bf)k?Pl6#f zdJo;fWd^zi`6*fDHO9)dPx|X@)Tk<61cr4vj2);>JpbumfqV)6Zd8Q4vxgp z$~M(berZ;HSYXAH$@uKq-Qn=&N>aJfqch3BmV@v@I-yH5%{olL#uEh%=bEk-RzEajpvu1PnrcGmTn z%ev~hUE6qm|MXjvEb_=(*L!+%vq|T_%7%M5k%m^i+{M-|O+G}f;*F}WgbL;_P8pKJ z&VNHPD0ff1B+oy_tM2)yq`~I$UDJ8qGJkk(9)@6bh4h%&c7L@g8sDy@YN+eL$r-K8 z;=4@eRAh}44dV13Y<>=N+fTL1IxiHv9oTxCw+l%@At`C}g(}87R>2PUcU;R zjzoBB-HpxH%l!C3p_YV|n_g-b)C5^DT9>o;t_D}{-J&wvdGM*FylJHIh{e|QmyH+x zhH}*}ruEK2*1#cMab5Tomi9F^cZO2$a>lzVNq@sM--k}N-wB?Qn-b&cd&ja+wl)@9 z5=T6a@3F19@-HK^9%Yr5sXQC~AY1=V$~73l-jJJWzo6lSp=dV)X~QI0p7#$SJ1M{8 z-^uYrJts_fBuC!_^nllFilOzNFjvOe~>Rr5JikF_Yp>irdpU&pR zw}upCpD)Zkv{$3njI0R?YG>#i!HIibyl!xMPI0=21+z-q7OP>aWFGQD+^Wx>o+61u z>?!#esiWAaW~oH8JUY|e9!-BG9wab=`tt}jrA<90affH(wfWv{Ho6wzL*Llvkw!k9Tr?V5go_WC2^fXp8@_kzO^NKg5z1{r1s6_*AeH zuu5NWyPm-5FKm`I#>Q7rA81_D##M2tDgC@*YLa$BOg;tUqSEpL<^}GcXn+DaC1zPM zQ-n?(0(3z?ENTo6X~+J3>KJHWfdP-D7y(=qO>KaHG$odWe#T_&M-@s^ipbHN%bQ@C^)D-h#mYDuVxG41Gy==6?f!*Tgdd2WVXjo*NOvHa+~W8mqtbGD z5J;~1J2e1s?DByepQ4Ql05Q9qpa25^HGCIX*nt3NyD*TqF`9(~e0vZ;8A$~H?_LPn z5c3~n=zB0}4RC{5fvp8jkdO_K3FZQ17CAxwHh}%21gOjgcuPbL@DRX&MYQyu9h#Lw zlMp}$2?K4u1e}pZpa5q;O9~F`BE>*UE;r=2bvW>R2?k>EMzhR7B^>u=?f>3!`7?`x zKw=;C{);uJ!5{s_4wx;|!v6{w|3J|be*fymX#27v2rKl4WM2`6|M!`Z1Or3rFMNIY z4JdO(2}B-uL*k+oL1c+&k^`_2rUYV8oFHiO4eKBZ0n}F@fRe=j{)O4!-2CV-L4w9Y z0Gm}9h&3H85(b)AIYEqBX!0)LC-W~=p*0u?l7kj81JC9ErI3UcS>)Y_Cf0c2za5p5 z6a&Ma<9C|p&nO7YE<}TvfcxuwptDB6d0iWX{Sn|d=LIyE(93A`zjNZ~2Ix1eK$krL zhmFMV6=DDXuKgdw1%ab|e>wW(0zdq>Xa8pu1Tyvi1t \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -105,84 +140,101 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index c42c57956b0..f127cfd49d4 100755 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,19 +25,22 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -51,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -61,38 +64,26 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/metrics2.0/build.gradle b/metrics2.0/build.gradle index 12a022c42a3..d84fe9679b8 100644 --- a/metrics2.0/build.gradle +++ b/metrics2.0/build.gradle @@ -1,13 +1,11 @@ buildscript { repositories { - jcenter() mavenLocal() mavenCentral() maven { url "https://plugins.gradle.org/m2/" } } dependencies { - // 0.9.5 because starting from plugin version 0.10.0, Gradle 4.9 or newer is required - classpath 'com.avast.gradle:gradle-docker-compose-plugin:0.9.5' + classpath 'com.avast.gradle:gradle-docker-compose-plugin:0.16.8' } } @@ -19,7 +17,7 @@ task grafanaStart { description 'Starts Grafana and Influx DB docker container.' group 'Grafana' - // the whole logic comes from 'com.avast.gradle:gradle-docker-compose-plugin:0.9.5' + // the whole logic comes from 'com.avast.gradle:gradle-docker-compose-plugin' dependsOn(composeUp) doLast { @@ -98,7 +96,7 @@ task grafanaStop { dependsOn(GrafanaInfluxDBContainerStop) dependsOn(GrafanaInfluxDBContainerRM) - // the whole logic used to come from 'com.avast.gradle:gradle-docker-compose-plugin:0.9.5' + // the whole logic used to come from 'com.avast.gradle:gradle-docker-compose-plugin' // but it appears that, sometimes, after switching branches and\or restarting pc // composeDown is unable to stop container // dependsOn(composeDown) diff --git a/src/main/scala/scripts/ctpp/readers/flow/MeansOfTransportationTableReader.scala b/src/main/scala/scripts/ctpp/readers/flow/MeansOfTransportationTableReader.scala index 6231f64bde7..cc1329fc03f 100644 --- a/src/main/scala/scripts/ctpp/readers/flow/MeansOfTransportationTableReader.scala +++ b/src/main/scala/scripts/ctpp/readers/flow/MeansOfTransportationTableReader.scala @@ -66,7 +66,7 @@ object MeansOfTransportationTableReader { val totalModes = modeToSum.map(_._2).sum println(s"The sum of all modes: $totalModes") modeToSum.foreach { case (mode, sum) => - val pct = (100 * sum.toDouble / totalModes).formatted("%.2f") + val pct = "%.2f".format(100 * sum.toDouble / totalModes) println(s"$mode => $sum, $pct %") } } diff --git a/src/main/scala/scripts/synthpop/HouseholdReader.scala b/src/main/scala/scripts/synthpop/HouseholdReader.scala index bcc55cc53d0..83d4f5a2ae8 100644 --- a/src/main/scala/scripts/synthpop/HouseholdReader.scala +++ b/src/main/scala/scripts/synthpop/HouseholdReader.scala @@ -50,10 +50,10 @@ class HouseholdReader(val pathToHouseholdFile: String) extends StrictLogging { val state = State(GenericCsvReader.getIfNotNull(rec, "state")) val countyAsInt = GenericCsvReader.getIfNotNull(rec, "county").toInt // In order to match with Shape file we need to format it. In shape file COUNTYFP attribute consist of 3 digits (possibly zeros) - val county = County(countyAsInt.formatted("%03d")) + val county = County("%03d".format(countyAsInt)) // In order to match with Shape file we need to format it. In shape file TRACTCE attribute consist of 6 digits (possibly zeros) - val tract = GenericCsvReader.getIfNotNull(rec, "tract").toInt.formatted("%06d") + val tract = "%06d".format(GenericCsvReader.getIfNotNull(rec, "tract").toInt) val blockGroupId = GenericCsvReader.getIfNotNull(rec, "block group") val geoId = BlockGroupGeoId(state = state, county = county, tract = tract, blockGroup = blockGroupId) diff --git a/src/main/scala/scripts/synthpop/WorkForceSampler.scala b/src/main/scala/scripts/synthpop/WorkForceSampler.scala index 3e18a8c7615..5201e5f1464 100644 --- a/src/main/scala/scripts/synthpop/WorkForceSampler.scala +++ b/src/main/scala/scripts/synthpop/WorkForceSampler.scala @@ -42,7 +42,7 @@ class WorkForceSampler(val dbInfo: CTPPDatabaseInfo, val stateCode: String, val workerAgeToStats.foreach { case (ageRng, stat) => val ratio = stat.totalWorkers.toDouble / stat.totalPeople logger.info( - s"$ageRng => Total people: ${stat.totalPeople}, total workers: ${stat.totalWorkers}, ratio: ${ratio.formatted("%.3f")}" + s"$ageRng => Total people: ${stat.totalPeople}, total workers: ${stat.totalWorkers}, ratio: ${"%.3f".format(ratio)}" ) } From 28dc035f42e80ead29409ca554ebecb91f942976 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Sun, 31 Jul 2022 17:00:29 +0300 Subject: [PATCH 260/307] bigger timer --- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 9c6a7b54099..923ed924fcc 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -145,7 +145,7 @@ if [[ -z "${last_completed}" ]]; then last_completed=$(tac $log_file | grep -m 1 -Eo '^[0-9]{2}:[0-9]{2}:[0-9]{2}') fi - beam_status=$(python3 -c "import datetime as dt; diff = dt.datetime.now() - dt.datetime.combine(dt.datetime.today(), dt.time.fromisoformat('$last_completed')); diff = diff + dt.timedelta(days = 1) if diff < dt.timedelta(0) else diff; x = 'OK' if diff < dt.timedelta(hours=3) else 'Bad'; print(x)") + beam_status=$(python3 -c "import datetime as dt; diff = dt.datetime.now() - dt.datetime.combine(dt.datetime.today(), dt.time.fromisoformat('$last_completed')); diff = diff + dt.timedelta(days = 1) if diff < dt.timedelta(0) else diff; x = 'OK' if diff < dt.timedelta(hours=5) else 'Bad'; print(x)") pid=$(pgrep -f RunBeam) if [ "$beam_status" == 'Bad' ] && [ "$pid" != "" ]; then jstack $pid | gzip > "$out_dir/kill_thread_dump.txt.gz" From e9978ad16bbcbd6e438af9c167552206bf818313 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 1 Aug 2022 16:14:03 +0600 Subject: [PATCH 261/307] Fixes --- aws/build.gradle | 7 ++++--- aws/src/main/python/beam_lambda/lambda_function.py | 7 ++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index bfeb8cd3501..7c38bcddae4 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -251,11 +251,12 @@ task jupyterEC2(type: AWSLambdaInvokeTask) { payload = """{ "title": "${(project.findProperty('title') ?: 'jupyter') + '_' + getCurrentGitUserEmail()}", "git_user_email": "${getCurrentGitUserEmail()}", - "branch": "develop", - "storage_size": ${project.findProperty('storageSize') ?: 128}, + "branch": "${ext.getParameterValue('beamBranch') ?: getCurrentGitBranch()}", + "storage_size": ${project.findProperty('storageSize') ?: 256}, "instance_type": "${project.findProperty('instanceType') ?: 'r5.xlarge'}", "region": "${project.findProperty('region') ?: defaultRegion}", - "shutdown_behaviour": "terminate", + "shutdown_behaviour": "${project.findProperty('shutdownBehaviour')}", + "shutdown_wait": "${project.findProperty('shutdownWait') ?: 480}", "command": "deploy", "run_grafana" : false, "run_helics" : false, diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index f18a24f9b61..469c019ccdb 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -158,10 +158,7 @@ runcmd: - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh - - if [ "$RUN_BEAM" = "True" ] - - then - - sudo chmod +x /home/ubuntu/beam_stuck_guard.sh - - fi + - sudo chmod +x /home/ubuntu/beam_stuck_guard.sh - cd /home/ubuntu - ./write-cpu-ram-usage.sh 20 > cpu_ram_usage.csv & - cd /home/ubuntu/git @@ -327,8 +324,8 @@ - /tmp/slack.sh "$bye_msg" - curl -X POST "https://ca4ircx74d.execute-api.us-east-2.amazonaws.com/production/spreadsheet" -H "Content-Type:application/json" --data "$stop_json" - $END_SCRIPT - - sudo shutdown -h +$SHUTDOWN_WAIT - fi + - sudo shutdown -h +$SHUTDOWN_WAIT ''')) instance_types = ['t2.nano', 't2.micro', 't2.small', 't2.medium', 't2.large', 't2.xlarge', 't2.2xlarge', From c3ee6cd2d9c0729b31d7d28cc82bf10970f558ca Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 1 Aug 2022 16:23:39 +0600 Subject: [PATCH 262/307] Fixes --- aws/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index 64839a1749f..15bd4f83fb0 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -251,11 +251,11 @@ task jupyterEC2(type: AWSLambdaInvokeTask) { payload = """{ "title": "${(project.findProperty('title') ?: 'jupyter') + '_' + getCurrentGitUserEmail()}", "git_user_email": "${getCurrentGitUserEmail()}", - "branch": "${ext.getParameterValue('beamBranch') ?: getCurrentGitBranch()}", + "branch": "${project.findProperty('beamBranch') ?: getCurrentGitBranch()}", "storage_size": ${project.findProperty('storageSize') ?: 256}, "instance_type": "${project.findProperty('instanceType') ?: 'r5.xlarge'}", "region": "${project.findProperty('region') ?: defaultRegion}", - "shutdown_behaviour": "${project.findProperty('shutdownBehaviour')}", + "shutdown_behaviour": "${project.findProperty('shutdownBehaviour') ?: "terminate"}", "shutdown_wait": "${project.findProperty('shutdownWait') ?: 480}", "command": "deploy", "run_grafana" : false, From 261977da3c5a1a9a6aecd897fb46f0df9f1e23c7 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 1 Aug 2022 18:04:49 +0600 Subject: [PATCH 263/307] Fixes --- aws/build.gradle | 2 +- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/build.gradle b/aws/build.gradle index 15bd4f83fb0..ea4452da83c 100755 --- a/aws/build.gradle +++ b/aws/build.gradle @@ -256,7 +256,7 @@ task jupyterEC2(type: AWSLambdaInvokeTask) { "instance_type": "${project.findProperty('instanceType') ?: 'r5.xlarge'}", "region": "${project.findProperty('region') ?: defaultRegion}", "shutdown_behaviour": "${project.findProperty('shutdownBehaviour') ?: "terminate"}", - "shutdown_wait": "${project.findProperty('shutdownWait') ?: 480}", + "shutdown_wait": ${project.findProperty('shutdownWait') ?: 480}, "command": "deploy", "run_grafana" : false, "run_helics" : false, diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index c74af579197..58eb1cf2557 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -852,7 +852,7 @@ def get_param(param_name): .replace('$CONFIG', arg) \ .replace('$MAIN_CLASS', execute_class) \ .replace('$UID', uid) \ - .replace('$SHUTDOWN_WAIT', shutdown_wait) \ + .replace('$SHUTDOWN_WAIT', str(shutdown_wait)) \ .replace('$TITLED', runName) \ .replace('$MAX_RAM', str(max_ram)) \ .replace('$S3_PUBLISH', str(s3_publish)) \ From 340c2535ebb76efe46bae3767d3354a10c7b9821 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Mon, 1 Aug 2022 17:05:40 -0700 Subject: [PATCH 264/307] assign each linkId to a TAZ using input shapefile, and use links to look up start/end TAZ for skims --- src/main/resources/beam-template.conf | 1 + .../beam/agentsim/agents/PersonAgent.scala | 53 +- .../agentsim/infrastructure/taz/TAZ.scala | 9 +- .../infrastructure/taz/TAZTreeMap.scala | 61 +- src/main/scala/beam/sim/BeamHelper.scala | 8 +- .../scala/beam/sim/config/BeamConfig.scala | 5564 ++++++----------- 6 files changed, 2080 insertions(+), 3616 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 91f17c5abfd..5eea602fd77 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -178,6 +178,7 @@ beam.agentsim.agents.parking.minNumberOfSameTypeZones = "int | 10" #TAZ params beam.agentsim.taz.filePath = ${beam.inputDirectory}"/taz-centers.csv" +beam.agentsim.taz.tazIdFieldName = "tazId" beam.agentsim.taz.parkingFilePath = "" beam.agentsim.taz.parkingStallCountScalingFactor = "double | 1.0" beam.agentsim.taz.parkingCostScalingFactor = "double | 1.0" diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 8cb3af04b35..d4581ba0ea0 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1378,9 +1378,24 @@ class PersonAgent( ) ) data.failedTrips.foreach(uncompletedTrip => - generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data)) + generateSkimData( + tick, + uncompletedTrip, + failedTrip = true, + currentActivityIndex, + currentActivity(data), + nextActivity(data) + ) ) val correctedTrip = correctTripEndTime(data.currentTrip.get, tick, body.id, body.beamVehicleType.id) + generateSkimData( + tick, + correctedTrip, + failedTrip = false, + currentActivityIndex, + currentActivity(data), + nextActivity(data) + ) resetFuelConsumed() val activityStartEvent = new ActivityStartEvent( tick, @@ -1429,6 +1444,7 @@ class PersonAgent( trip: EmbodiedBeamTrip, failedTrip: Boolean, currentActivityIndex: Int, + currentActivity: Activity, nextActivity: Option[Activity] ): Unit = { val correctedTrip = correctTripEndTime(trip, tick, body.id, body.beamVehicleType.id) @@ -1452,14 +1468,33 @@ class PersonAgent( ) eventsManager.processEvent(odSkimmerEvent) if (beamServices.beamConfig.beam.exchange.output.activitySimSkimsEnabled) { - val (origin, destination) = beamScenario.exchangeGeoMap match { - case Some(geoMap) => - val origGeo = geoMap.getTAZ(origCoord) - val destGeo = geoMap.getTAZ(destCoord) - (origGeo.tazId.toString, destGeo.tazId.toString) - case None => - (odSkimmerEvent.origin, odSkimmerEvent.destination) - } + val startLink = currentActivity.getLinkId + val endLinkOption = nextActivity.map(_.getLinkId) + val (origin, destination) = + if (beamScenario.tazTreeMap.tazListContainsGeoms && endLinkOption.isDefined) { + val origGeo = beamScenario.tazTreeMap + .getTAZfromLink(startLink) + .map(_.tazId.toString) + .getOrElse("NA") + val destGeo = beamScenario.tazTreeMap + .getTAZfromLink(endLinkOption.get) + .map(_.tazId.toString) + .getOrElse("NA") + (origGeo, destGeo) + } else { + + beamScenario.exchangeGeoMap match { + case Some(geoMap) => + val origGeo = geoMap.getTAZ(origCoord) + val destGeo = geoMap.getTAZ(destCoord) + logger.warn( + s"Could not find linkId->taz mapping so falling back on default: Trip from $origGeo to $destGeo" + ) + (origGeo.tazId.toString, destGeo.tazId.toString) + case None => + (odSkimmerEvent.origin, odSkimmerEvent.destination) + } + } val asSkimmerEvent = ActivitySimSkimmerEvent( origin, destination, diff --git a/src/main/scala/beam/agentsim/infrastructure/taz/TAZ.scala b/src/main/scala/beam/agentsim/infrastructure/taz/TAZ.scala index 5b6a9c2938f..4aa218ed2f2 100644 --- a/src/main/scala/beam/agentsim/infrastructure/taz/TAZ.scala +++ b/src/main/scala/beam/agentsim/infrastructure/taz/TAZ.scala @@ -5,6 +5,7 @@ import beam.router.BeamRouter.Location import beam.sim.common.GeoUtils import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.collections.QuadTree +import com.vividsolutions.jts.geom.Geometry import scala.collection.JavaConverters._ @@ -14,9 +15,9 @@ import scala.collection.JavaConverters._ * @param coord location of the centroid of this TAZ * @param areaInSquareMeters area of TAZ */ -class TAZ(val tazId: Id[TAZ], val coord: Coord, val areaInSquareMeters: Double) { - def this(tazIdString: String, coord: Coord, area: Double) { - this(Id.create(tazIdString, classOf[TAZ]), coord, area) +class TAZ(val tazId: Id[TAZ], val coord: Coord, val areaInSquareMeters: Double, val geometry: Option[Geometry]) { + def this(tazIdString: String, coord: Coord, area: Double, geometry: Option[Geometry] = None) { + this(Id.create(tazIdString, classOf[TAZ]), coord, area, geometry) } } @@ -25,7 +26,7 @@ object TAZ { val DefaultTAZId: Id[TAZ] = Id.create("default", classOf[TAZ]) val EmergencyTAZId: Id[TAZ] = Id.create("emergency", classOf[TAZ]) - val DefaultTAZ: TAZ = new TAZ(DefaultTAZId, new Coord(), 0) + val DefaultTAZ: TAZ = new TAZ(DefaultTAZId, coord = new Coord(), areaInSquareMeters = 0, geometry = None) def isSpecialTazId(tazId: Id[TAZ]): Boolean = tazId == DefaultTAZId || tazId == EmergencyTAZId diff --git a/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala b/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala index 679ea79d2eb..06019ea6463 100755 --- a/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala +++ b/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala @@ -1,11 +1,14 @@ package beam.agentsim.infrastructure.taz +import beam.agentsim.infrastructure.taz.TAZTreeMap.logger import beam.utils.SnapCoordinateUtils.SnapLocationHelper import beam.utils.matsim_conversion.ShapeUtils import beam.utils.matsim_conversion.ShapeUtils.{HasQuadBounds, QuadTreeBounds} import com.vividsolutions.jts.geom.Geometry +import org.matsim.api.core.v01.network.{Link, Network} import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.collections.QuadTree +import org.matsim.core.utils.geometry.GeometryUtils import org.matsim.core.utils.gis.ShapeFileReader import org.opengis.feature.simple.SimpleFeature import org.slf4j.LoggerFactory @@ -30,6 +33,16 @@ class TAZTreeMap(val tazQuadTree: QuadTree[TAZ], val useCache: Boolean = false) private val stringIdToTAZMapping: mutable.HashMap[String, TAZ] = mutable.HashMap() val idToTAZMapping: mutable.HashMap[Id[TAZ], TAZ] = mutable.HashMap() private val cache: TrieMap[(Double, Double), TAZ] = TrieMap() + private val linkIdToTAZMapping: mutable.HashMap[Id[Link], Id[TAZ]] = mutable.HashMap.empty[Id[Link], Id[TAZ]] + private val unmatchedLinkIds: mutable.ListBuffer[Id[Link]] = mutable.ListBuffer.empty[Id[Link]] + lazy val tazListContainsGeoms: Boolean = tazQuadTree.values().asScala.headOption.exists(_.geometry.isDefined) + + def getTAZfromLink(linkId: Id[Link]): Option[TAZ] = { + linkIdToTAZMapping.get(linkId) match { + case Some(tazId) => getTAZ(tazId) + case _ => None + } + } def getTAZs: Iterable[TAZ] = { tazQuadTree.values().asScala @@ -67,6 +80,39 @@ class TAZTreeMap(val tazQuadTree: QuadTree[TAZ], val useCache: Boolean = false) def getTAZInRadius(loc: Coord, radius: Double): util.Collection[TAZ] = { tazQuadTree.getDisk(loc.getX, loc.getY, radius) } + + def mapNetworkToTAZs(network: Network): Unit = { + if (tazListContainsGeoms) { + network.getLinks.asScala.foreach { + case (id, link) => + val linkEndCoord = link.getToNode.getCoord + val foundTaz = TAZTreeMap.ringSearch( + tazQuadTree, + linkEndCoord, + 100, + 1000000, + radiusMultiplication = 1.5 + ) { taz => + if (taz.geometry.exists(_.contains(GeometryUtils.createGeotoolsPoint(linkEndCoord)))) { Some(taz) } + else None + } + foundTaz match { + case Some(taz) => + linkIdToTAZMapping += (id -> taz.tazId) + case _ => + unmatchedLinkIds += id + } + case _ => + } + logger.info( + "Matched " + + linkIdToTAZMapping.size.toString + + " links to TAZs, failed to match " + + unmatchedLinkIds.size.toString + + " links" + ) + } + } } object TAZTreeMap { @@ -99,12 +145,12 @@ object TAZTreeMap { f.getDefaultGeometry match { case g: Geometry => val taz = new TAZ( - f.getAttribute(tazIDFieldName).asInstanceOf[String], + String.valueOf(f.getAttribute(tazIDFieldName)), new Coord(g.getCoordinate.x, g.getCoordinate.y), - g.getArea + g.getArea, + Some(g) ) tazQuadTree.put(taz.coord.getX, taz.coord.getY, taz) - case _ => } } tazQuadTree @@ -173,9 +219,14 @@ object TAZTreeMap { new TAZTreeMap(tazQuadTree) } - def getTazTreeMap(filePath: String): TAZTreeMap = { + def getTazTreeMap(filePath: String, tazIDFieldName: Option[String] = None): TAZTreeMap = { try { - TAZTreeMap.fromCsv(filePath) + if (filePath.endsWith(".shp")) { + TAZTreeMap.fromShapeFile(filePath, tazIDFieldName.get) + } else { + TAZTreeMap.fromCsv(filePath) + } + } catch { case fe: FileNotFoundException => logger.error("No TAZ file found at given file path (using defaultTazTreeMap): %s" format filePath, fe) diff --git a/src/main/scala/beam/sim/BeamHelper.scala b/src/main/scala/beam/sim/BeamHelper.scala index c41a2b841a2..5ff26b68a65 100755 --- a/src/main/scala/beam/sim/BeamHelper.scala +++ b/src/main/scala/beam/sim/BeamHelper.scala @@ -298,9 +298,11 @@ trait BeamHelper extends LazyLogging { val networkCoordinator = buildNetworkCoordinator(beamConfig) val gtfs = GTFSUtils.loadGTFS(beamConfig.beam.routing.r5.directory) val trainStopQuadTree = GTFSUtils.toQuadTree(GTFSUtils.trainStations(gtfs), new GeoUtilsImpl(beamConfig)) - val tazMap = TAZTreeMap.getTazTreeMap(beamConfig.beam.agentsim.taz.filePath) - val exchangeGeo = beamConfig.beam.exchange.output.geo.filePath.map(TAZTreeMap.getTazTreeMap) - + val tazMap = + TAZTreeMap.getTazTreeMap(beamConfig.beam.agentsim.taz.filePath, Some(beamConfig.beam.agentsim.taz.tazIdFieldName)) + tazMap.mapNetworkToTAZs(networkCoordinator.network) + val exchangeGeo = beamConfig.beam.exchange.output.geo.filePath + .map(TAZTreeMap.getTazTreeMap(_, Some(beamConfig.beam.agentsim.taz.tazIdFieldName))) val (freightCarriers, fixedActivitiesDurationsFromFreight) = readFreights(beamConfig, networkCoordinator.transportNetwork.streetLayer, vehicleTypes, outputDirMaybe) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 6cc3107ba92..89f892f0aee 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,5183 +3,3557 @@ package beam.sim.config case class BeamConfig( - beam: BeamConfig.Beam, - matsim: BeamConfig.Matsim + beam : BeamConfig.Beam, + matsim : BeamConfig.Matsim ) - object BeamConfig { - case class Beam( - actorSystemName: java.lang.String, - agentsim: BeamConfig.Beam.Agentsim, - calibration: BeamConfig.Beam.Calibration, - cluster: BeamConfig.Beam.Cluster, - debug: BeamConfig.Beam.Debug, - exchange: BeamConfig.Beam.Exchange, - experimental: BeamConfig.Beam.Experimental, - input: BeamConfig.Beam.Input, - inputDirectory: java.lang.String, - logger: BeamConfig.Beam.Logger, - metrics: BeamConfig.Beam.Metrics, - output: BeamConfig.Beam.Output, - outputs: BeamConfig.Beam.Outputs, - physsim: BeamConfig.Beam.Physsim, - replanning: BeamConfig.Beam.Replanning, - router: BeamConfig.Beam.Router, - routing: BeamConfig.Beam.Routing, - sim: BeamConfig.Beam.Sim, - spatial: BeamConfig.Beam.Spatial, - urbansim: BeamConfig.Beam.Urbansim, - useLocalWorker: scala.Boolean, - warmStart: BeamConfig.Beam.WarmStart + actorSystemName : java.lang.String, + agentsim : BeamConfig.Beam.Agentsim, + calibration : BeamConfig.Beam.Calibration, + cluster : BeamConfig.Beam.Cluster, + debug : BeamConfig.Beam.Debug, + exchange : BeamConfig.Beam.Exchange, + experimental : BeamConfig.Beam.Experimental, + input : BeamConfig.Beam.Input, + inputDirectory : java.lang.String, + logger : BeamConfig.Beam.Logger, + metrics : BeamConfig.Beam.Metrics, + output : BeamConfig.Beam.Output, + outputs : BeamConfig.Beam.Outputs, + physsim : BeamConfig.Beam.Physsim, + replanning : BeamConfig.Beam.Replanning, + router : BeamConfig.Beam.Router, + routing : BeamConfig.Beam.Routing, + sim : BeamConfig.Beam.Sim, + spatial : BeamConfig.Beam.Spatial, + urbansim : BeamConfig.Beam.Urbansim, + useLocalWorker : scala.Boolean, + warmStart : BeamConfig.Beam.WarmStart ) - object Beam { - case class Agentsim( - agentSampleSizeAsFractionOfPopulation: scala.Double, - agents: BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime: java.lang.String, - firstIteration: scala.Int, - fractionOfPlansWithSingleActivity: scala.Double, - h3taz: BeamConfig.Beam.Agentsim.H3taz, - lastIteration: scala.Int, - populationAdjustment: java.lang.String, - randomSeedForPopulationSampling: scala.Option[scala.Int], - scenarios: BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow: scala.Int, - simulationName: java.lang.String, - snapLocationAndRemoveInvalidInputs: scala.Boolean, - taz: BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters: scala.Int, - thresholdForWalkingInMeters: scala.Int, - timeBinSize: scala.Int, - toll: BeamConfig.Beam.Agentsim.Toll, - tuning: BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation : scala.Double, + agents : BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime : java.lang.String, + firstIteration : scala.Int, + fractionOfPlansWithSingleActivity : scala.Double, + h3taz : BeamConfig.Beam.Agentsim.H3taz, + lastIteration : scala.Int, + populationAdjustment : java.lang.String, + randomSeedForPopulationSampling : scala.Option[scala.Int], + scenarios : BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow : scala.Int, + simulationName : java.lang.String, + snapLocationAndRemoveInvalidInputs : scala.Boolean, + taz : BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters : scala.Int, + thresholdForWalkingInMeters : scala.Int, + timeBinSize : scala.Int, + toll : BeamConfig.Beam.Agentsim.Toll, + tuning : BeamConfig.Beam.Agentsim.Tuning ) - object Agentsim { - case class Agents( - activities: BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType: java.lang.String, - freight: BeamConfig.Beam.Agentsim.Agents.Freight, - households: BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking: BeamConfig.Beam.Agentsim.Agents.Parking, - plans: BeamConfig.Beam.Agentsim.Agents.Plans, - population: BeamConfig.Beam.Agentsim.Agents.Population, - ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles + activities : BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType : java.lang.String, + freight : BeamConfig.Beam.Agentsim.Agents.Freight, + households : BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking : BeamConfig.Beam.Agentsim.Agents.Parking, + plans : BeamConfig.Beam.Agentsim.Agents.Plans, + population : BeamConfig.Beam.Agentsim.Agents.Population, + ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles ) - object Agents { - case class Activities( - activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] ) - object Activities { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = - if (c.hasPathOrNull("activityTypeToFixedDurationMap")) - scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) - else None + activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None ) } } - + case class Freight( - carrierParkingFilePath: scala.Option[java.lang.String], - carriersFilePath: java.lang.String, - convertWgs2Utm: scala.Boolean, - enabled: scala.Boolean, - generateFixedActivitiesDurations: scala.Boolean, - name: java.lang.String, - plansFilePath: java.lang.String, - reader: java.lang.String, - replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath: java.lang.String + carrierParkingFilePath : scala.Option[java.lang.String], + carriersFilePath : java.lang.String, + convertWgs2Utm : scala.Boolean, + enabled : scala.Boolean, + generateFixedActivitiesDurations : scala.Boolean, + name : java.lang.String, + plansFilePath : java.lang.String, + reader : java.lang.String, + replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath : java.lang.String ) - object Freight { - case class Replanning( - departureTime: scala.Int, - disableAfterIteration: scala.Int, - strategy: java.lang.String + departureTime : scala.Int, + disableAfterIteration : scala.Int, + strategy : java.lang.String ) - object Replanning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = - if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = - if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") - else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = - c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = - if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") - else "/test/input/beamville/freight/payload-plans.csv", - reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - toursFilePath = - if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") - else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", + reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath: java.lang.String, - inputHouseholdAttributesFilePath: java.lang.String + inputFilePath : java.lang.String, + inputHouseholdAttributesFilePath : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = - if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") - else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = - if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") - else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - bikeMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier, - defaultValueOfTime: scala.Double, - highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts: scala.Int, - minimumValueOfTime: scala.Double, - modeChoiceClass: java.lang.String, - modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - multinomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit, - overrideAutomationForVOTT: scala.Boolean, - overrideAutomationLevel: scala.Int, - poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] + bikeMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier, + defaultValueOfTime : scala.Double, + highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts : scala.Int, + minimumValueOfTime : scala.Double, + modeChoiceClass : java.lang.String, + modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + multinomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit, + overrideAutomationForVOTT : scala.Boolean, + overrideAutomationLevel : scala.Int, + poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] ) - object ModalBehaviors { - case class BikeMultiplier( - commute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute, - noncommute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute + commute : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute, + noncommute : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute ) - object BikeMultiplier { - case class Commute( - ageGT50: scala.Double, - ageLE50: scala.Double + ageGT50 : scala.Double, + ageLE50 : scala.Double ) - object Commute { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( - ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, - ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ageGT50 = if(c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if(c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 ) } } - + case class Noncommute( - ageGT50: scala.Double, - ageLE50: scala.Double + ageGT50 : scala.Double, + ageLE50 : scala.Double ) - object Noncommute { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( - ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, - ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ageGT50 = if(c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if(c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( - commute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( - if (c.hasPathOrNull("commute")) c.getConfig("commute") - else com.typesafe.config.ConfigFactory.parseString("commute{}") - ), - noncommute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( - if (c.hasPathOrNull("noncommute")) c.getConfig("noncommute") - else com.typesafe.config.ConfigFactory.parseString("noncommute{}") - ) + commute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute(if(c.hasPathOrNull("commute")) c.getConfig("commute") else com.typesafe.config.ConfigFactory.parseString("commute{}")), + noncommute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute(if(c.hasPathOrNull("noncommute")) c.getConfig("noncommute") else com.typesafe.config.ConfigFactory.parseString("noncommute{}")) ) } } - + case class HighTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) - object HighTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class Lccm( - filePath: java.lang.String + filePath : java.lang.String ) - object Lccm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) - object LowTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class ModeVotMultiplier( - CAV: scala.Double, - bike: scala.Double, - drive: scala.Double, - rideHail: scala.Double, - rideHailPooled: scala.Double, - rideHailTransit: scala.Double, - transit: scala.Double, - waiting: scala.Double, - walk: scala.Double + CAV : scala.Double, + bike : scala.Double, + drive : scala.Double, + rideHail : scala.Double, + rideHailPooled : scala.Double, + rideHailTransit : scala.Double, + transit : scala.Double, + waiting : scala.Double, + walk : scala.Double ) - object ModeVotMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MultinomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params, - utility_scale_factor: scala.Double + params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params, + utility_scale_factor : scala.Double ) - object MultinomialLogit { - case class Params( - bike_intercept: scala.Double, - bike_transit_intercept: scala.Double, - car_intercept: scala.Double, - cav_intercept: scala.Double, - drive_transit_intercept: scala.Double, - ride_hail_intercept: scala.Double, - ride_hail_pooled_intercept: scala.Double, - ride_hail_transit_intercept: scala.Double, - transfer: scala.Double, - transit_crowding: scala.Double, - transit_crowding_VOT_multiplier: scala.Double, - transit_crowding_VOT_threshold: scala.Double, - transit_crowding_percentile: scala.Double, - walk_intercept: scala.Double, - walk_transit_intercept: scala.Double + bike_intercept : scala.Double, + bike_transit_intercept : scala.Double, + car_intercept : scala.Double, + cav_intercept : scala.Double, + drive_transit_intercept : scala.Double, + ride_hail_intercept : scala.Double, + ride_hail_pooled_intercept : scala.Double, + ride_hail_transit_intercept : scala.Double, + transfer : scala.Double, + transit_crowding : scala.Double, + transit_crowding_VOT_multiplier : scala.Double, + transit_crowding_VOT_threshold : scala.Double, + transit_crowding_percentile : scala.Double, + walk_intercept : scala.Double, + walk_transit_intercept : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( - bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = - if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = - if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = - if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = - if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") - else 0.0, - ride_hail_transit_intercept = - if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") - else 0.0, - transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = - if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) - c.getDouble("transit_crowding_VOT_multiplier") - else 0.0, - transit_crowding_VOT_threshold = - if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") - else 0.5, - transit_crowding_percentile = - if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") - else 90.0, - walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = - if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, + ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, + transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, + transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, + transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, + walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ), - utility_scale_factor = - if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), + utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object PoolingMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - bikeMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( - if (c.hasPathOrNull("bikeMultiplier")) c.getConfig("bikeMultiplier") - else com.typesafe.config.ConfigFactory.parseString("bikeMultiplier{}") - ), - defaultValueOfTime = - if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") - ), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - if (c.hasPathOrNull("lccm")) c.getConfig("lccm") - else com.typesafe.config.ConfigFactory.parseString("lccm{}") - ), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") - ), - maximumNumberOfReplanningAttempts = - if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") - else 3, - minimumValueOfTime = - if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = - if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") - else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") - else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") - ), - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( - if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") - else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") - ), - overrideAutomationForVOTT = - c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = - if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") - else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") - ), - transitVehicleTypeVOTMultipliers = - if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) - scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) - else None - ) - } - } - + bikeMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier(if(c.hasPathOrNull("bikeMultiplier")) c.getConfig("bikeMultiplier") else com.typesafe.config.ConfigFactory.parseString("bikeMultiplier{}")), + defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), + maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, + minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")), + overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), + transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None + ) + } + } + case class ModeIncentive( - filePath: java.lang.String + filePath : java.lang.String ) - object ModeIncentive { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - fractionOfSameTypeZones: scala.Double, - maxSearchRadius: scala.Double, - minNumberOfSameTypeZones: scala.Int, - minSearchRadius: scala.Double, - multinomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, - rangeAnxietyBuffer: scala.Double, - searchMaxDistanceRelativeToEllipseFoci: scala.Double + fractionOfSameTypeZones : scala.Double, + maxSearchRadius : scala.Double, + minNumberOfSameTypeZones : scala.Int, + minSearchRadius : scala.Double, + multinomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, + rangeAnxietyBuffer : scala.Double, + searchMaxDistanceRelativeToEllipseFoci : scala.Double ) - object Parking { - case class MultinomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params ) - object MultinomialLogit { - case class Params( - distanceMultiplier: scala.Double, - enrouteDetourMultiplier: scala.Double, - homeActivityPrefersResidentialParkingMultiplier: scala.Double, - parkingPriceMultiplier: scala.Double, - rangeAnxietyMultiplier: scala.Double + distanceMultiplier : scala.Double, + enrouteDetourMultiplier : scala.Double, + homeActivityPrefersResidentialParkingMultiplier : scala.Double, + parkingPriceMultiplier : scala.Double, + rangeAnxietyMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( - distanceMultiplier = - if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = - if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = - if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) - c.getDouble("homeActivityPrefersResidentialParkingMultiplier") - else 1.0, - parkingPriceMultiplier = - if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = - if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, + parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - fractionOfSameTypeZones = - if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, - maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minNumberOfSameTypeZones = - if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, - minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( - if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") - else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") - ), - rangeAnxietyBuffer = - if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = - if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) - c.getDouble("searchMaxDistanceRelativeToEllipseFoci") - else 4.0 + fractionOfSameTypeZones = if(c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, + maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minNumberOfSameTypeZones = if(c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, + minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")), + rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath: java.lang.String, - inputPlansFilePath: java.lang.String, - merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath : java.lang.String, + inputPlansFilePath : java.lang.String, + merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) - object Plans { - case class Merge( - fraction: scala.Double + fraction : scala.Double ) - object Merge { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = - if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") - else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = - if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") - else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - if (c.hasPathOrNull("merge")) c.getConfig("merge") - else com.typesafe.config.ConfigFactory.parseString("merge{}") - ) + inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) ) } } - + case class Population( - industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling: scala.Boolean + industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling : scala.Boolean ) - object Population { - case class IndustryRemovalProbabilty( - enabled: scala.Boolean, - inputFilePath: java.lang.String, - removalStrategy: java.lang.String + enabled : scala.Boolean, + inputFilePath : java.lang.String, + removalStrategy : java.lang.String ) - object IndustryRemovalProbabilty { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = - if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") - else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") - ), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath: java.lang.String + filePath : java.lang.String ) - object PtFare { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost: scala.Double, - defaultCostPerMile: scala.Double, - defaultCostPerMinute: scala.Double, - human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations: scala.Boolean, - name: java.lang.String, - pooledBaseCost: scala.Double, - pooledCostPerMile: scala.Double, - pooledCostPerMinute: scala.Double, - rangeBufferForDispatchInMeters: scala.Int, - repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost : scala.Double, + defaultCostPerMile : scala.Double, + defaultCostPerMinute : scala.Double, + human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations : scala.Boolean, + name : java.lang.String, + pooledBaseCost : scala.Double, + pooledCostPerMile : scala.Double, + pooledCostPerMinute : scala.Double, + rangeBufferForDispatchInMeters : scala.Int, + repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) - object RideHail { - case class AllocationManager( - alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm: java.lang.String, - maxExcessRideTime: scala.Double, - maxWaitingTimeInSec: scala.Int, - name: java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, - repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds: scala.Int + alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm : java.lang.String, + maxExcessRideTime : scala.Double, + maxWaitingTimeInSec : scala.Int, + name : java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, + repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds : scala.Int ) - object AllocationManager { - case class AlonsoMora( - maxRequestsPerVehicle: scala.Int + maxRequestsPerVehicle : scala.Int ) - object AlonsoMora { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = - if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, - demandWeight: scala.Double, - distanceWeight: scala.Double, - keepMaxTopNScores: scala.Int, - minDemandPercentageInRadius: scala.Double, - minScoreThresholdForRepositioning: scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, - percentageOfVehiclesToReposition: scala.Double, - produceDebugImages: scala.Boolean, - repositionCircleRadiusInMeters: scala.Double, - repositioningMethod: java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, - waitingTimeWeight: scala.Double + allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, + demandWeight : scala.Double, + distanceWeight : scala.Double, + keepMaxTopNScores : scala.Int, + minDemandPercentageInRadius : scala.Double, + minScoreThresholdForRepositioning : scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, + percentageOfVehiclesToReposition : scala.Double, + produceDebugImages : scala.Boolean, + repositionCircleRadiusInMeters : scala.Double, + repositioningMethod : java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, + waitingTimeWeight : scala.Double ) - object RepositionLowWaitingTimes { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( - "allowIncreasingRadiusIfDemandInRadiusLow" - ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = - if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") - else 0.1, - minScoreThresholdForRepositioning = - if (c.hasPathOrNull("minScoreThresholdForRepositioning")) - c.getDouble("minScoreThresholdForRepositioning") - else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = - if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) - c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") - else 1, - percentageOfVehiclesToReposition = - if (c.hasPathOrNull("percentageOfVehiclesToReposition")) - c.getDouble("percentageOfVehiclesToReposition") - else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = - if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") - else 3000, - repositioningMethod = - if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = - if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) - c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") - else 1200, - waitingTimeWeight = - if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, + minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, + percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, + repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, + waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") - else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") - ), - matchingAlgorithm = - if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") - else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = - if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = - if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) - c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") - else 1, - repositionLowWaitingTimes = - BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") - else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") - ), - requestBufferTimeoutInSeconds = - if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), + matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, + repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), + requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int, - valueOfTime: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int, + valueOfTime : scala.Int ) - object Cav { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 16090, - valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, + valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) - object Charging { - case class VehicleChargingManager( - defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager ) - object VehicleChargingManager { - case class DefaultVehicleChargingManager( - multinomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit + multinomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit ) - object DefaultVehicleChargingManager { - case class MultinomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params ) - object MultinomialLogit { - case class Params( - chargingTimeMultiplier: scala.Double, - drivingTimeMultiplier: scala.Double, - insufficientRangeMultiplier: scala.Double, - queueingTimeMultiplier: scala.Double + chargingTimeMultiplier : scala.Double, + drivingTimeMultiplier : scala.Double, + insufficientRangeMultiplier : scala.Double, + queueingTimeMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit - .Params( - chargingTimeMultiplier = - if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") - else -0.01666667, - drivingTimeMultiplier = - if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") - else -0.01666667, - insufficientRangeMultiplier = - if (c.hasPathOrNull("insufficientRangeMultiplier")) - c.getDouble("insufficientRangeMultiplier") - else -60.0, - queueingTimeMultiplier = - if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") - else -0.01666667 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params( + chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, + drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, + insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, + queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MultinomialLogit( - params = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit - .Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - multinomialLogit = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MultinomialLogit( - if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") - else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - if (c.hasPathOrNull("defaultVehicleChargingManager")) - c.getConfig("defaultVehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") - ) + defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") - ) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) ) } } - + case class Human( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int ) - object Human { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 ) } } - + case class Initialization( - filePath: java.lang.String, - initType: java.lang.String, - parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath : java.lang.String, + initType : java.lang.String, + parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) - object Initialization { - case class Parking( - filePath: java.lang.String + filePath : java.lang.String ) - object Parking { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet: scala.Double, - initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId: java.lang.String, - vehicleTypePrefix: java.lang.String + fractionOfInitialVehicleFleet : scala.Double, + initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId : java.lang.String, + vehicleTypePrefix : java.lang.String ) - object Procedural { - case class InitialLocation( - home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name: java.lang.String + home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name : java.lang.String ) - object InitialLocation { - case class Home( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object Home { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - if (c.hasPathOrNull("home")) c.getConfig("home") - else com.typesafe.config.ConfigFactory.parseString("home{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") - else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") - ), - vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = - if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - if (c.hasPathOrNull("procedural")) c.getConfig("procedural") - else com.typesafe.config.ConfigFactory.parseString("procedural{}") - ) + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) ) } } - + case class IterationStats( - timeBinSizeInSec: scala.Double + timeBinSizeInSec : scala.Double ) - object IterationStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name: java.lang.String, - timeout: scala.Int + demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name : java.lang.String, + timeout : scala.Int ) - object RepositioningManager { - case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider: scala.Double, - horizon: scala.Int, - numberOfClustersForDemand: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDemandForCAVs: scala.Double + fractionOfClosestClustersToConsider : scala.Double, + horizon : scala.Int, + numberOfClustersForDemand : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDemandForCAVs : scala.Double ) - object DemandFollowingRepositioningManager { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = - if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) - c.getDouble("fractionOfClosestClustersToConsider") - else 0.2, - horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = - if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 1, - sensitivityOfRepositioningToDemandForCAVs = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) - c.getDouble("sensitivityOfRepositioningToDemandForCAVs") - else 1 + fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, + horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, + sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDistance: scala.Double + predictionHorizon : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDistance : scala.Double ) - object InverseSquareDistanceRepositioningFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 0.4, - sensitivityOfRepositioningToDistance = - if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) - c.getDouble("sensitivityOfRepositioningToDistance") - else 0.9 + predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, + sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - if (c.hasPathOrNull("demandFollowingRepositioningManager")) - c.getConfig("demandFollowingRepositioningManager") - else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") - ), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager - .InverseSquareDistanceRepositioningFactor( - if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) - c.getConfig("inverseSquareDistanceRepositioningFactor") - else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object RideHailManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel: scala.Double, - numberOfCategories: scala.Int, - priceAdjustmentStrategy: java.lang.String, - surgeLevelAdaptionStep: scala.Double + minimumSurgeLevel : scala.Double, + numberOfCategories : scala.Int, + priceAdjustmentStrategy : java.lang.String, + surgeLevelAdaptionStep : scala.Double ) - object SurgePricing { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = - if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") - else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = - if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") - else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") - ), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - if (c.hasPathOrNull("cav")) c.getConfig("cav") - else com.typesafe.config.ConfigFactory.parseString("cav{}") - ), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - if (c.hasPathOrNull("charging")) c.getConfig("charging") - else com.typesafe.config.ConfigFactory.parseString("charging{}") - ), - defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = - if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = - if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - if (c.hasPathOrNull("human")) c.getConfig("human") - else com.typesafe.config.ConfigFactory.parseString("human{}") - ), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - if (c.hasPathOrNull("initialization")) c.getConfig("initialization") - else com.typesafe.config.ConfigFactory.parseString("initialization{}") - ), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") - else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") - ), - linkFleetStateAcrossIterations = - c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = - if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - rangeBufferForDispatchInMeters = - if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") - else 10000, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") - else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") - ), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") - else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") - ), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") - else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") - ) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), + defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), + linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) + ) + } + } + case class RideHailTransit( - modesToConsider: java.lang.String + modesToConsider : java.lang.String ) - object RideHailTransit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - multinomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit + carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + multinomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit ) - object TripBehaviors { - case class CarUsage( - minDistanceToTrainStop: scala.Double + minDistanceToTrainStop : scala.Double ) - object CarUsage { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = - if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MultinomialLogit( - activity_file_path: java.lang.String, - additional_trip_utility: scala.Double, - destination_nest_scale_factor: scala.Double, - generate_secondary_activities: scala.Boolean, - intercept_file_path: java.lang.String, - max_destination_choice_set_size: scala.Int, - max_destination_distance_meters: scala.Double, - mode_nest_scale_factor: scala.Double, - trip_nest_scale_factor: scala.Double + activity_file_path : java.lang.String, + additional_trip_utility : scala.Double, + destination_nest_scale_factor : scala.Double, + generate_secondary_activities : scala.Boolean, + intercept_file_path : java.lang.String, + max_destination_choice_set_size : scala.Int, + max_destination_distance_meters : scala.Double, + mode_nest_scale_factor : scala.Double, + trip_nest_scale_factor : scala.Double ) - object MultinomialLogit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( - activity_file_path = - if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = - if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = - if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") - else 1.0, - generate_secondary_activities = - c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = - if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = - if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") - else 20, - max_destination_distance_meters = - if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") - else 32000, - mode_nest_scale_factor = - if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = - if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, + generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, + max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, + mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") - else com.typesafe.config.ConfigFactory.parseString("carUsage{}") - ), - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( - if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") - else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") - ) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")) ) } } - + case class Vehicles( - downsamplingMethod: java.lang.String, - dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet: scala.Double, - fractionOfPeopleWithBicycle: scala.Double, - fuelTypesFilePath: java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, - linkSocAcrossIterations: scala.Boolean, - linkToGradePercentFilePath: java.lang.String, - meanPrivateVehicleStartingSOC: scala.Double, - meanRidehailVehicleStartingSOC: scala.Double, - sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile: java.lang.String, - vehicleAdjustmentMethod: java.lang.String, - vehicleTypesFilePath: java.lang.String, - vehiclesFilePath: java.lang.String + downsamplingMethod : java.lang.String, + dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet : scala.Double, + fractionOfPeopleWithBicycle : scala.Double, + fuelTypesFilePath : java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, + linkSocAcrossIterations : scala.Boolean, + linkToGradePercentFilePath : java.lang.String, + meanPrivateVehicleStartingSOC : scala.Double, + meanRidehailVehicleStartingSOC : scala.Double, + sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile : java.lang.String, + vehicleAdjustmentMethod : java.lang.String, + vehicleTypesFilePath : java.lang.String, + vehiclesFilePath : java.lang.String ) - object Vehicles { - case class DummySharedBike( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedBike { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedCar { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond: scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, - noRefuelThresholdOffsetInMeters: scala.Double, - remainingDistanceWrtBatteryCapacityThreshold: scala.Int + estimateOfMeanChargingDurationInSecond : scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, + noRefuelThresholdOffsetInMeters : scala.Double, + remainingDistanceWrtBatteryCapacityThreshold : scala.Int ) - object Enroute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = - if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) - c.getInt("estimateOfMeanChargingDurationInSecond") - else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = - if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) - c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") - else 500, - noRefuelThresholdOffsetInMeters = - if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") - else 32186.9, - remainingDistanceWrtBatteryCapacityThreshold = - if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) - c.getInt("remainingDistanceWrtBatteryCapacityThreshold") - else 2 + estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, + noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, + remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving - ], - fixed_non_reserving_fleet_by_taz: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz - ], - inexhaustible_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving - ], - managerType: java.lang.String, - name: java.lang.String, - parkingFilePath: java.lang.String, - reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], + fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], + inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], + managerType : java.lang.String, + name : java.lang.String, + parkingFilePath : java.lang.String, + reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) - object SharedFleets$Elm { - case class FixedNonReserving( - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String ) - object FixedNonReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize: scala.Int, - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String, - vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] + fleetSize : scala.Int, + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String, + vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] ) - object FixedNonReservingFleetByTaz { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = - if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) - else None + fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object InexhaustibleReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm - ], - name: java.lang.String, - repositionTimeBin: scala.Int, - statTimeBin: scala.Int + min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], + name : java.lang.String, + repositionTimeBin : scala.Int, + statTimeBin : scala.Int ) - object Reposition { - case class MinAvailabilityUndersupplyAlgorithm( - matchLimit: scala.Int + matchLimit : scala.Int ) - object MinAvailabilityUndersupplyAlgorithm { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm( - matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( + matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = - if (c.hasPathOrNull("min-availability-undersupply-algorithm")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) - ) - else None, - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = - if (c.hasPathOrNull("fixed-non-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReserving(c.getConfig("fixed-non-reserving")) - ) - else None, - fixed_non_reserving_fleet_by_taz = - if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) - ) - else None, - inexhaustible_reserving = - if (c.hasPathOrNull("inexhaustible-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) - ) - else None, - managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = - if (c.hasPathOrNull("reposition")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) - ) - else None + fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, + fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, + inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, + managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = - if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") - else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") - else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") - ), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") - else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") - ), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - if (c.hasPathOrNull("enroute")) c.getConfig("enroute") - else com.typesafe.config.ConfigFactory.parseString("enroute{}") - ), - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 1.0, - fractionOfPeopleWithBicycle = - if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = - if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") - else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( - "generateEmergencyHouseholdVehicleWhenPlansRequireIt" - ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = - c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = - if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = - if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") - else 1.0, - meanRidehailVehicleStartingSOC = - if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") - else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = - if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") - else "", - vehicleAdjustmentMethod = - if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = - if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") - else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = - if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") - else "/test/input/beamville/vehicles.csv" - ) - } - - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, + fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, + meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", + vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" + ) + } + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Agentsim.Agents.Vehicles - .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities( - if (c.hasPathOrNull("activities")) c.getConfig("activities") - else com.typesafe.config.ConfigFactory.parseString("activities{}") - ), - bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight( - if (c.hasPathOrNull("freight")) c.getConfig("freight") - else com.typesafe.config.ConfigFactory.parseString("freight{}") - ), - households = BeamConfig.Beam.Agentsim.Agents.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") - else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") - ), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") - else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") - ), - parking = BeamConfig.Beam.Agentsim.Agents.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - plans = BeamConfig.Beam.Agentsim.Agents.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - population = BeamConfig.Beam.Agentsim.Agents.Population( - if (c.hasPathOrNull("population")) c.getConfig("population") - else com.typesafe.config.ConfigFactory.parseString("population{}") - ), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( - if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") - else com.typesafe.config.ConfigFactory.parseString("ptFare{}") - ), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( - if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") - else com.typesafe.config.ConfigFactory.parseString("rideHail{}") - ), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") - else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") - ), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") - else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") - ), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), + bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), + households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), + parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor: scala.Double, - chargingPointCountScalingFactor: scala.Double, - chargingPointFilePath: java.lang.String, - helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds: scala.Int + chargingPointCostScalingFactor : scala.Double, + chargingPointCountScalingFactor : scala.Double, + chargingPointFilePath : java.lang.String, + helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds : scala.Int ) - object ChargingNetworkManager { - case class Helics( - bufferSize: scala.Int, - connectionEnabled: scala.Boolean, - coreInitString: java.lang.String, - coreType: java.lang.String, - dataInStreamPoint: java.lang.String, - dataOutStreamPoint: java.lang.String, - federateName: java.lang.String, - feedbackEnabled: scala.Boolean, - intLogLevel: scala.Int, - timeDeltaProperty: scala.Double + bufferSize : scala.Int, + connectionEnabled : scala.Boolean, + coreInitString : java.lang.String, + coreType : java.lang.String, + dataInStreamPoint : java.lang.String, + dataOutStreamPoint : java.lang.String, + federateName : java.lang.String, + feedbackEnabled : scala.Boolean, + intLogLevel : scala.Int, + timeDeltaProperty : scala.Double ) - object Helics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = - if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") - else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = - if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") - else "GridFed/PhysicalBounds", - dataOutStreamPoint = - if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", + dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled: scala.Boolean, - expansionFactor_charge_activity: scala.Double, - expansionFactor_home_activity: scala.Double, - expansionFactor_init_activity: scala.Double, - expansionFactor_wherever_activity: scala.Double, - expansionFactor_work_activity: scala.Double + enabled : scala.Boolean, + expansionFactor_charge_activity : scala.Double, + expansionFactor_home_activity : scala.Double, + expansionFactor_init_activity : scala.Double, + expansionFactor_wherever_activity : scala.Double, + expansionFactor_work_activity : scala.Double ) - object ScaleUp { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = - if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") - else 1.0, - expansionFactor_home_activity = - if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") - else 1.0, - expansionFactor_init_activity = - if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") - else 1.0, - expansionFactor_wherever_activity = - if (c.hasPathOrNull("expansionFactor_wherever_activity")) - c.getDouble("expansionFactor_wherever_activity") - else 1.0, - expansionFactor_work_activity = - if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") - else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, + expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, + expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, + expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, + expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = - if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") - else 1.0, - chargingPointCountScalingFactor = - if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") - else 1.0, - chargingPointFilePath = - if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - if (c.hasPathOrNull("helics")) c.getConfig("helics") - else com.typesafe.config.ConfigFactory.parseString("helics{}") - ), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") - else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") - ), - timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, + chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, + chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), + timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution: scala.Int, - upperBoundResolution: scala.Int + lowerBoundResolution : scala.Int, + upperBoundResolution : scala.Int ) - object H3taz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile: java.lang.String + frequencyAdjustmentFile : java.lang.String ) - object Scenarios { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = - if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") - else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay: scala.Int, - interval: scala.Int + initialDelay : scala.Int, + interval : scala.Int ) - object ScheduleMonitorTask { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath: java.lang.String, - parkingCostScalingFactor: scala.Double, - parkingFilePath: java.lang.String, - parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor: scala.Double + filePath : java.lang.String, + parkingCostScalingFactor : scala.Double, + parkingFilePath : java.lang.String, + parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor : scala.Double, + tazIdFieldName : java.lang.String ) - object Taz { - case class ParkingManager( - displayPerformanceTimings: scala.Boolean, - method: java.lang.String, - parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings : scala.Boolean, + method : java.lang.String, + parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) - object ParkingManager { - case class Parallel( - numberOfClusters: scala.Int + numberOfClusters : scala.Int ) - object Parallel { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - if (c.hasPathOrNull("parallel")) c.getConfig("parallel") - else com.typesafe.config.ConfigFactory.parseString("parallel{}") - ) + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = - if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( - if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") - else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") - ), - parkingStallCountScalingFactor = - if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") - else 1.0 + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), + parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0, + tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "tazId" ) } } - + case class Toll( - filePath: java.lang.String + filePath : java.lang.String ) - object Toll { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules: scala.Double, - rideHailPrice: scala.Double, - tollPrice: scala.Double, - transitCapacity: scala.Option[scala.Double], - transitPrice: scala.Double + fuelCapacityInJoules : scala.Double, + rideHailPrice : scala.Double, + tollPrice : scala.Double, + transitCapacity : scala.Option[scala.Double], + transitPrice : scala.Double ) - object Tuning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = - if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = - if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) - c.getDouble("agentSampleSizeAsFractionOfPopulation") - else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents( - if (c.hasPathOrNull("agents")) c.getConfig("agents") - else com.typesafe.config.ConfigFactory.parseString("agents{}") - ), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( - if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") - else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") - ), - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = - if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") - else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz( - if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") - else com.typesafe.config.ConfigFactory.parseString("h3taz{}") - ), - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = - if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - randomSeedForPopulationSampling = - if (c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) - else None, - scenarios = BeamConfig.Beam.Agentsim.Scenarios( - if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") - else com.typesafe.config.ConfigFactory.parseString("scenarios{}") - ), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") - else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") - ), - schedulerParallelismWindow = - if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - snapLocationAndRemoveInvalidInputs = - c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), - taz = BeamConfig.Beam.Agentsim.Taz( - if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") - ), - thresholdForMakingParkingChoiceInMeters = - if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) - c.getInt("thresholdForMakingParkingChoiceInMeters") - else 100, - thresholdForWalkingInMeters = - if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll( - if (c.hasPathOrNull("toll")) c.getConfig("toll") - else com.typesafe.config.ConfigFactory.parseString("toll{}") - ), - tuning = BeamConfig.Beam.Agentsim.Tuning( - if (c.hasPathOrNull("tuning")) c.getConfig("tuning") - else com.typesafe.config.ConfigFactory.parseString("tuning{}") - ) + agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + randomSeedForPopulationSampling = if(c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) else None, + scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), + schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + snapLocationAndRemoveInvalidInputs = c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), + taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), + thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, + thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), + tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) ) } } - + case class Calibration( - counts: BeamConfig.Beam.Calibration.Counts, - google: BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio: scala.Double, - mode: BeamConfig.Beam.Calibration.Mode, - objectiveFunction: java.lang.String, - roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, - studyArea: BeamConfig.Beam.Calibration.StudyArea + counts : BeamConfig.Beam.Calibration.Counts, + google : BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio : scala.Double, + mode : BeamConfig.Beam.Calibration.Mode, + objectiveFunction : java.lang.String, + roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, + studyArea : BeamConfig.Beam.Calibration.StudyArea ) - object Calibration { - case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Int, - inputCountsFile: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Int, + inputCountsFile : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes ) - object Google { - case class TravelTimes( - enable: scala.Boolean, - iterationInterval: scala.Int, - minDistanceInMeters: scala.Double, - numDataPointsOver24Hours: scala.Int, - offPeakEnabled: scala.Boolean, - queryDate: java.lang.String, - tolls: scala.Boolean + enable : scala.Boolean, + iterationInterval : scala.Int, + minDistanceInMeters : scala.Double, + numDataPointsOver24Hours : scala.Int, + offPeakEnabled : scala.Boolean, + queryDate : java.lang.String, + tolls : scala.Boolean ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = - if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = - if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class Mode( - benchmarkFilePath: java.lang.String + benchmarkFilePath : java.lang.String ) - object Mode { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) - object RoadNetwork { - case class TravelTimes( - zoneBoundariesFilePath: java.lang.String, - zoneODTravelTimesFilePath: java.lang.String + zoneBoundariesFilePath : java.lang.String, + zoneODTravelTimesFilePath : java.lang.String ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = - if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = - if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class StudyArea( - enabled: scala.Boolean, - lat: scala.Double, - lon: scala.Double, - radius: scala.Double + enabled : scala.Boolean, + lat : scala.Double, + lon : scala.Double, + radius : scala.Double ) - object StudyArea { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - google = BeamConfig.Beam.Calibration.Google( - if (c.hasPathOrNull("google")) c.getConfig("google") - else com.typesafe.config.ConfigFactory.parseString("google{}") - ), - meanToCountsWeightRatio = - if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode( - if (c.hasPathOrNull("mode")) c.getConfig("mode") - else com.typesafe.config.ConfigFactory.parseString("mode{}") - ), - objectiveFunction = - if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") - else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( - if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") - else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") - ), - studyArea = BeamConfig.Beam.Calibration.StudyArea( - if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") - else com.typesafe.config.ConfigFactory.parseString("studyArea{}") - ) + counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), + meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), + objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), + studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) ) } } - + case class Cluster( - clusterType: scala.Option[java.lang.String], - enabled: scala.Boolean + clusterType : scala.Option[java.lang.String], + enabled : scala.Boolean ) - object Cluster { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor: BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval: scala.Int, - clearRoutedOutstandingWorkEnabled: scala.Boolean, - debugActorTimerIntervalInSec: scala.Int, - debugEnabled: scala.Boolean, - maxSimulationStepTimeBeforeConsideredStuckMin: scala.Int, - memoryConsumptionDisplayTimeoutInSec: scala.Int, - messageLogging: scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork: scala.Int, - stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation: BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives: scala.Boolean, - writeRealizedModeChoiceFile: scala.Boolean + actor : BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval : scala.Int, + clearRoutedOutstandingWorkEnabled : scala.Boolean, + debugActorTimerIntervalInSec : scala.Int, + debugEnabled : scala.Boolean, + maxSimulationStepTimeBeforeConsideredStuckMin : scala.Int, + memoryConsumptionDisplayTimeoutInSec : scala.Int, + messageLogging : scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork : scala.Int, + stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation : BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives : scala.Boolean, + writeRealizedModeChoiceFile : scala.Boolean ) - object Debug { - case class Actor( - logDepth: scala.Int + logDepth : scala.Int ) - object Actor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs: scala.Long, - checkMaxNumberOfMessagesEnabled: scala.Boolean, - defaultTimeoutMs: scala.Long, - enabled: scala.Boolean, - overallSimulationTimeoutMs: scala.Long, - thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs : scala.Long, + checkMaxNumberOfMessagesEnabled : scala.Boolean, + defaultTimeoutMs : scala.Long, + enabled : scala.Boolean, + overallSimulationTimeoutMs : scala.Long, + thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) - object StuckAgentDetection { - case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs: scala.Long, - triggerType: java.lang.String + actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs : scala.Long, + triggerType : java.lang.String ) - object Thresholds$Elm { - case class ActorTypeToMaxNumberOfMessages( - population: scala.Option[scala.Int], - rideHailAgent: scala.Option[scala.Int], - rideHailManager: scala.Option[scala.Int], - transitDriverAgent: scala.Option[scala.Int] + population : scala.Option[scala.Int], + rideHailAgent : scala.Option[scala.Int], + rideHailManager : scala.Option[scala.Int], + transitDriverAgent : scala.Option[scala.Int] ) - object ActorTypeToMaxNumberOfMessages { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = - if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = - BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") - else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") - ), - markAsStuckAfterMs = - if (c.hasPathOrNull("markAsStuckAfterMs")) - c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 20000, - triggerType = - if (c.hasPathOrNull("triggerType")) c.getString("triggerType") - else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), + markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, + triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = - if (c.hasPathOrNull("checkIntervalMs")) - c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 200, - checkMaxNumberOfMessagesEnabled = - !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = - if (c.hasPathOrNull("defaultTimeoutMs")) - c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = - if (c.hasPathOrNull("overallSimulationTimeoutMs")) - c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, + checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Debug.StuckAgentDetection - .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class TriggerMeasurer( - enabled: scala.Boolean, - writeStuckAgentDetectionConfig: scala.Boolean + enabled : scala.Boolean, + writeStuckAgentDetectionConfig : scala.Boolean ) - object TriggerMeasurer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = - !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram: scala.Boolean + createGCClassHistogram : scala.Boolean ) - object VmInformation { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor( - if (c.hasPathOrNull("actor")) c.getConfig("actor") - else com.typesafe.config.ConfigFactory.parseString("actor{}") - ), - agentTripScoresInterval = - if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = - c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = - if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - maxSimulationStepTimeBeforeConsideredStuckMin = - if (c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) - c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") - else 60, - memoryConsumptionDisplayTimeoutInSec = - if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) - c.getInt("memoryConsumptionDisplayTimeoutInSec") - else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = - if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) - c.getInt("secondsToWaitToClearRoutedOutstandingWork") - else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( - if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") - else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") - ), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( - if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") - else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") - ), - vmInformation = BeamConfig.Beam.Debug.VmInformation( - if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") - else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") - ), - writeModeChoiceAlternatives = - c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = - c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), + agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + maxSimulationStepTimeBeforeConsideredStuckMin = if(c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") else 60, + memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), + vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), + writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output: BeamConfig.Beam.Exchange.Output, - scenario: BeamConfig.Beam.Exchange.Scenario + output : BeamConfig.Beam.Exchange.Output, + scenario : BeamConfig.Beam.Exchange.Scenario ) - object Exchange { - case class Output( - activitySimSkimsEnabled: scala.Boolean, - geo: BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled : scala.Boolean, + geo : BeamConfig.Beam.Exchange.Output.Geo ) - object Output { - case class Geo( - filePath: scala.Option[java.lang.String] + filePath : scala.Option[java.lang.String] ) - object Geo { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = - c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo( - if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") - ) + activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) ) } } - + case class Scenario( - convertWgs2Utm: scala.Boolean, - fileFormat: java.lang.String, - folder: java.lang.String, - modeMap: scala.Option[scala.List[java.lang.String]], - source: java.lang.String, - urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm : scala.Boolean, + fileFormat : java.lang.String, + folder : java.lang.String, + modeMap : scala.Option[scala.List[java.lang.String]], + source : java.lang.String, + urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim ) - object Scenario { - case class Urbansim( - activitySimEnabled: scala.Boolean + activitySimEnabled : scala.Boolean ) - object Urbansim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ) + fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - scenario = BeamConfig.Beam.Exchange.Scenario( - if (c.hasPathOrNull("scenario")) c.getConfig("scenario") - else com.typesafe.config.ConfigFactory.parseString("scenario{}") - ) + output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) ) } } - + case class Experimental( - optimizer: BeamConfig.Beam.Experimental.Optimizer + optimizer : BeamConfig.Beam.Experimental.Optimizer ) - object Experimental { - case class Optimizer( - enabled: scala.Boolean + enabled : scala.Boolean ) - object Optimizer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer( - if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") - else com.typesafe.config.ConfigFactory.parseString("optimizer{}") - ) + optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) ) } } - + case class Input( - lastBaseOutputDir: java.lang.String, - simulationPrefix: java.lang.String + lastBaseOutputDir : java.lang.String, + simulationPrefix : java.lang.String ) - object Input { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn: scala.Boolean + keepConsoleAppenderOn : scala.Boolean ) - object Logger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level: java.lang.String + level : java.lang.String ) - object Metrics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation: scala.Boolean + writePlansAndStopSimulation : scala.Boolean ) - object Output { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = - c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory: scala.Boolean, - baseOutputDirectory: java.lang.String, - collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, - defaultWriteInterval: scala.Int, - displayPerformanceTimings: scala.Boolean, - events: BeamConfig.Beam.Outputs.Events, - generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval: scala.Int, - matsim: BeamConfig.Beam.Outputs.Matsim, - stats: BeamConfig.Beam.Outputs.Stats, - writeAnalysis: scala.Boolean, - writeEventsInterval: scala.Int, - writeGraphs: scala.Boolean, - writePlansInterval: scala.Int, - writeR5RoutesInterval: scala.Int + addTimestampToOutputDirectory : scala.Boolean, + baseOutputDirectory : java.lang.String, + collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, + defaultWriteInterval : scala.Int, + displayPerformanceTimings : scala.Boolean, + events : BeamConfig.Beam.Outputs.Events, + generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval : scala.Int, + matsim : BeamConfig.Beam.Outputs.Matsim, + stats : BeamConfig.Beam.Outputs.Stats, + writeAnalysis : scala.Boolean, + writeEventsInterval : scala.Int, + writeGraphs : scala.Boolean, + writePlansInterval : scala.Int, + writeR5RoutesInterval : scala.Int ) - object Outputs { - case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime: scala.Int, - startTime: scala.Int + endTime : scala.Int, + startTime : scala.Int ) - object GeneralizedLinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles: java.lang.String, - deleteRootFolderFiles: java.lang.String + deleteITERSFolderFiles : java.lang.String, + deleteRootFolderFiles : java.lang.String ) - object Matsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = - if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = - if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize: scala.Int + binSize : scala.Int ) - object Stats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = - !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = - if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = - !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( - "collectAndCreateBeamAnalysisAndGraphs" - ), - defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( - if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") - else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") - ), - generalizedLinkStatsInterval = - if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ), - stats = BeamConfig.Beam.Outputs.Stats( - if (c.hasPathOrNull("stats")) c.getConfig("stats") - else com.typesafe.config.ConfigFactory.parseString("stats{}") - ), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), + defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), + generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), + stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim: BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager: BeamConfig.Beam.Physsim.EventManager, - events: BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia: scala.Boolean, - eventsSampling: scala.Double, - flowCapacityFactor: scala.Double, - initializeRouterWithFreeFlowTimes: scala.Boolean, - inputNetworkFilePath: java.lang.String, - jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize: scala.Int, - linkStatsWriteInterval: scala.Int, - maxLinkLengthToApplySpeedScalingFactor: scala.Double, - name: java.lang.String, - network: BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath: java.lang.String, - parbprsim: BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize: scala.Double, - quick_fix_minCarSpeedInMetersPerSecond: scala.Double, - relaxation: BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim: scala.Boolean, - speedScalingFactor: scala.Double, - storageCapacityFactor: scala.Double, - writeEventsInterval: scala.Int, - writePlansInterval: scala.Int, - writeRouteHistoryInterval: scala.Int + bprsim : BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager : BeamConfig.Beam.Physsim.EventManager, + events : BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia : scala.Boolean, + eventsSampling : scala.Double, + flowCapacityFactor : scala.Double, + initializeRouterWithFreeFlowTimes : scala.Boolean, + inputNetworkFilePath : java.lang.String, + jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize : scala.Int, + linkStatsWriteInterval : scala.Int, + maxLinkLengthToApplySpeedScalingFactor : scala.Double, + name : java.lang.String, + network : BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath : java.lang.String, + parbprsim : BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize : scala.Double, + quick_fix_minCarSpeedInMetersPerSecond : scala.Double, + relaxation : BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim : scala.Boolean, + speedScalingFactor : scala.Double, + storageCapacityFactor : scala.Double, + writeEventsInterval : scala.Int, + writePlansInterval : scala.Int, + writeRouteHistoryInterval : scala.Int ) - object Physsim { - case class Bprsim( - inFlowAggregationTimeWindowInSeconds: scala.Int, - minFlowToUseBPRFunction: scala.Int, - travelTimeFunction: java.lang.String + inFlowAggregationTimeWindowInSeconds : scala.Int, + minFlowToUseBPRFunction : scala.Int, + travelTimeFunction : java.lang.String ) - object Bprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = - if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) - c.getInt("inFlowAggregationTimeWindowInSeconds") - else 900, - minFlowToUseBPRFunction = - if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, + minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor: scala.Double + congestionFactor : scala.Double ) - object CchRoutingAssignment { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax: scala.Int, - departureTimeShiftMin: scala.Int, - fractionOfEventsToDuplicate: scala.Double + departureTimeShiftMax : scala.Int, + departureTimeShiftMin : scala.Int, + fractionOfEventsToDuplicate : scala.Double ) - object DuplicatePTE { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = - if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = - if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = - if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads: scala.Int, - `type`: java.lang.String + numberOfThreads : scala.Int, + `type` : java.lang.String ) - object EventManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) - object Jdeqsim { - case class AgentSimPhysSimInterfaceDebugger( - enabled: scala.Boolean + enabled : scala.Boolean ) - object AgentSimPhysSimInterfaceDebugger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, - capacityPlansWriteInterval: scala.Int, - enabled: scala.Boolean, - minRoadCapacity: scala.Int, - minSpeedMetersPerSec: scala.Int, - speedAdjustmentFactor: scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, + capacityPlansWriteInterval : scala.Int, + enabled : scala.Boolean, + minRoadCapacity : scala.Int, + minSpeedMetersPerSec : scala.Int, + speedAdjustmentFactor : scala.Double ) - object Cacc { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = - if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) - c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") - else 1.3, - capacityPlansWriteInterval = - if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = - if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = - if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, + capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( - if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") - else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") - ), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - if (c.hasPathOrNull("cacc")) c.getConfig("cacc") - else com.typesafe.config.ConfigFactory.parseString("cacc{}") - ) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) ) } } - + case class Network( - maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties, - removeIslands: scala.Boolean + maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties, + removeIslands : scala.Boolean ) - object Network { - case class MaxSpeedInference( - enabled: scala.Boolean, - `type`: java.lang.String + enabled : scala.Boolean, + `type` : java.lang.String ) - object MaxSpeedInference { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled: scala.Boolean, - livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled : scala.Boolean, + livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) - object OverwriteRoadTypeProperties { - case class LivingStreet( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object LivingStreet { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Minor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Motorway { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object MotorwayLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Primary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object PrimaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Residential { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Secondary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object SecondaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Tertiary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TertiaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Trunk { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TrunkLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Unclassified { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") - else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") - ), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - if (c.hasPathOrNull("minor")) c.getConfig("minor") - else com.typesafe.config.ConfigFactory.parseString("minor{}") - ), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - if (c.hasPathOrNull("motorway")) c.getConfig("motorway") - else com.typesafe.config.ConfigFactory.parseString("motorway{}") - ), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") - else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") - ), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - if (c.hasPathOrNull("primary")) c.getConfig("primary") - else com.typesafe.config.ConfigFactory.parseString("primary{}") - ), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") - else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") - ), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - if (c.hasPathOrNull("residential")) c.getConfig("residential") - else com.typesafe.config.ConfigFactory.parseString("residential{}") - ), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - if (c.hasPathOrNull("secondary")) c.getConfig("secondary") - else com.typesafe.config.ConfigFactory.parseString("secondary{}") - ), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") - else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") - ), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") - else com.typesafe.config.ConfigFactory.parseString("tertiary{}") - ), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") - else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") - ), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - if (c.hasPathOrNull("trunk")) c.getConfig("trunk") - else com.typesafe.config.ConfigFactory.parseString("trunk{}") - ), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") - else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") - ), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") - else com.typesafe.config.ConfigFactory.parseString("unclassified{}") - ) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( - if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") - else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") - ), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") - else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") - ), - removeIslands = !c.hasPathOrNull("removeIslands") || c.getBoolean("removeIslands") + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")), + removeIslands = !c.hasPathOrNull("removeIslands") || c.getBoolean("removeIslands") ) } } - + case class Parbprsim( - numberOfClusters: scala.Int, - syncInterval: scala.Int + numberOfClusters : scala.Int, + syncInterval : scala.Int ) - object Parbprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier: scala.Double, - enabled: scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime: scala.Int + additionalTravelTimeMultiplier : scala.Double, + enabled : scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime : scala.Int ) - object PickUpDropOffAnalysis { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = - if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") - else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = - if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) - c.getInt("secondsFromPickUpPropOffToAffectTravelTime") - else 600 + additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 ) } } - + case class Relaxation( - experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type`: java.lang.String + experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type` : java.lang.String ) - object Relaxation { - case class Experiment20( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment20 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment21 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment30 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment40 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment50 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment51 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment52 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( - if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") - else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") - ), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( - if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") - else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") - ), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( - if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") - else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") - ), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( - if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") - else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") - ), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( - if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") - else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") - ), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( - if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") - else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") - ), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( - if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") - else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") - ), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim( - if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") - else com.typesafe.config.ConfigFactory.parseString("bprsim{}") - ), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( - if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") - else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") - ), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( - if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") - else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") - ), - eventManager = BeamConfig.Beam.Physsim.EventManager( - if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") - else com.typesafe.config.ConfigFactory.parseString("eventManager{}") - ), - events = BeamConfig.Beam.Physsim.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - eventsForFullVersionOfVia = - !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = - !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = - if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") - else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( - if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") - else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") - ), - linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = - if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = - if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) - c.getDouble("maxLinkLengthToApplySpeedScalingFactor") - else 50.0, - name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - overwriteLinkParamPath = - if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim( - if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") - else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") - ), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") - else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") - ), - ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = - if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) - c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") - else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation( - if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") - else com.typesafe.config.ConfigFactory.parseString("relaxation{}") - ), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = - if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = - if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), + eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), + events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), + linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, + name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), + ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1: scala.Double, - ModuleProbability_2: scala.Double, - ModuleProbability_3: scala.Double, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - clearModes: BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation: scala.Double, - maxAgentPlanMemorySize: scala.Int + ModuleProbability_1 : scala.Double, + ModuleProbability_2 : scala.Double, + ModuleProbability_3 : scala.Double, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + clearModes : BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation : scala.Double, + maxAgentPlanMemorySize : scala.Int ) - object Replanning { - case class ClearModes( - iteration: scala.Int, - modes: scala.Option[scala.List[java.lang.String]], - strategy: java.lang.String + iteration : scala.Int, + modes : scala.Option[scala.List[java.lang.String]], + strategy : java.lang.String ) - object ClearModes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes( - if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") - else com.typesafe.config.ConfigFactory.parseString("clearModes{}") - ), - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getDouble("fractionOfIterationsToDisableInnovation") - else Double.PositiveInfinity, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim: BeamConfig.Beam.Router.Skim + skim : BeamConfig.Beam.Router.Skim ) - object Router { - case class Skim( - activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims: scala.Int, - origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval: scala.Int, - writeSkimsInterval: scala.Int + activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims : scala.Int, + origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval : scala.Int, + writeSkimsInterval : scala.Int ) - object Skim { - case class ActivitySimSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object ActivitySimSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object DriveTimeSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") - else "skimsTravelTimeObservedVsSimulated", - name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", + name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String, - poolingTravelTimeOveheadFactor: scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, - writeFullSkimsInterval: scala.Int + fileBaseName : java.lang.String, + name : java.lang.String, + poolingTravelTimeOveheadFactor : scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, + writeFullSkimsInterval : scala.Int ) - object OriginDestinationSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = - if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") - else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = - if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) - c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") - else 0, - writeFullSkimsInterval = - if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, + writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName: java.lang.String, - geoHierarchy: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + geoHierarchy : java.lang.String, + name : java.lang.String ) - object TazSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object TransitCrowdingSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") - else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") - ), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") - else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") - ), - keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") - else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") - ), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( - if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") - else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") - ), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") - else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") - ), - writeAggregatedSkimsInterval = - if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), + keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), + writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim( - if (c.hasPathOrNull("skim")) c.getConfig("skim") - else com.typesafe.config.ConfigFactory.parseString("skim{}") - ) + skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) ) } } - + case class Routing( - baseDate: java.lang.String, - carRouter: java.lang.String, - gh: BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS: scala.Int, - overrideNetworkTravelTimesUsingSkims: scala.Boolean, - r5: BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor: scala.Double, - startingIterationForTravelTimesMSA: scala.Int, - transitOnStreetNetwork: scala.Boolean, - writeRoutingStatistic: scala.Boolean + baseDate : java.lang.String, + carRouter : java.lang.String, + gh : BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS : scala.Int, + overrideNetworkTravelTimesUsingSkims : scala.Boolean, + r5 : BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor : scala.Double, + startingIterationForTravelTimesMSA : scala.Int, + transitOnStreetNetwork : scala.Boolean, + writeRoutingStatistic : scala.Boolean ) - object Routing { - case class Gh( - useAlternativeRoutes: scala.Boolean + useAlternativeRoutes : scala.Boolean ) - object Gh { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath: java.lang.String, - bikeLaneScaleFactor: scala.Double, - departureWindow: scala.Double, - directory: java.lang.String, - directory2: scala.Option[java.lang.String], - linkRadiusMeters: scala.Double, - mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples: scala.Int, - osmMapdbFile: java.lang.String, - travelTimeNoiseFraction: scala.Double + bikeLaneLinkIdsFilePath : java.lang.String, + bikeLaneScaleFactor : scala.Double, + departureWindow : scala.Double, + directory : java.lang.String, + directory2 : scala.Option[java.lang.String], + linkRadiusMeters : scala.Double, + mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples : scala.Int, + osmMapdbFile : java.lang.String, + travelTimeNoiseFraction : scala.Double ) - object R5 { - case class MNetBuilder( - fromCRS: java.lang.String, - toCRS: java.lang.String + fromCRS : java.lang.String, + toCRS : java.lang.String ) - object MNetBuilder { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike: scala.Int + bike : scala.Int ) - object MaxDistanceLimitByModeInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = - if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = - if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( - if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") - else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") - ), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") - ), - numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmMapdbFile = - if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") - else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = - if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), + numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh( - if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") - ), - minimumPossibleSkimBasedTravelTimeInS = - if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) - c.getInt("minimumPossibleSkimBasedTravelTimeInS") - else 60, - overrideNetworkTravelTimesUsingSkims = - c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( - "overrideNetworkTravelTimesUsingSkims" - ), - r5 = BeamConfig.Beam.Routing.R5( - if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") - ), - skimTravelTimesScalingFactor = - if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = - if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") - else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), + minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, + overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), + r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), + skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric: BeamConfig.Beam.Sim.Metric, - termination: BeamConfig.Beam.Sim.Termination + metric : BeamConfig.Beam.Sim.Metric, + termination : BeamConfig.Beam.Sim.Termination ) - object Sim { - case class Metric( - collector: BeamConfig.Beam.Sim.Metric.Collector + collector : BeamConfig.Beam.Sim.Metric.Collector ) - object Metric { - case class Collector( - influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics: java.lang.String + influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics : java.lang.String ) - object Collector { - case class InfluxDbSimulationMetricCollector( - connectionString: java.lang.String, - database: java.lang.String + connectionString : java.lang.String, + database : java.lang.String ) - object InfluxDbSimulationMetricCollector { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = - if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = - BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - if (c.hasPathOrNull("influxDbSimulationMetricCollector")) - c.getConfig("influxDbSimulationMetricCollector") - else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") - ), - metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), + metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector( - if (c.hasPathOrNull("collector")) c.getConfig("collector") - else com.typesafe.config.ConfigFactory.parseString("collector{}") - ) + collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) ) } } - + case class Termination( - criterionName: java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName : java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) - object Termination { - case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration: scala.Int, - minLastIteration: scala.Int, - relativeTolerance: scala.Double + maxLastIteration : scala.Int, + minLastIteration : scala.Int, + relativeTolerance : scala.Double ) - object TerminateAtRideHailFleetStoredElectricityConvergence { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = - if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = - BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) - c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") - else - com.typesafe.config.ConfigFactory - .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") - ) + criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric( - if (c.hasPathOrNull("metric")) c.getConfig("metric") - else com.typesafe.config.ConfigFactory.parseString("metric{}") - ), - termination = BeamConfig.Beam.Sim.Termination( - if (c.hasPathOrNull("termination")) c.getConfig("termination") - else com.typesafe.config.ConfigFactory.parseString("termination{}") - ) + metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), + termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) ) } } - + case class Spatial( - boundingBoxBuffer: scala.Int, - localCRS: java.lang.String + boundingBoxBuffer : scala.Int, + localCRS : java.lang.String ) - object Spatial { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear ) - object Urbansim { - case class BackgroundODSkimsCreator( - calculationTimeoutHours: scala.Int, - enabled: scala.Boolean, - maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes: scala.Int, - peakHours: scala.Option[scala.List[scala.Double]], - routerType: java.lang.String, - skimsGeoType: java.lang.String, - skimsKind: java.lang.String + calculationTimeoutHours : scala.Int, + enabled : scala.Boolean, + maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes : scala.Int, + peakHours : scala.Option[scala.List[scala.Double]], + routerType : java.lang.String, + skimsGeoType : java.lang.String, + skimsKind : java.lang.String ) - object BackgroundODSkimsCreator { - case class MaxTravelDistanceInMeters( - bike: scala.Int, - walk: scala.Int + bike : scala.Int, + walk : scala.Int ) - object MaxTravelDistanceInMeters { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive: scala.Boolean, - transit: scala.Boolean, - walk: scala.Boolean + drive : scala.Boolean, + transit : scala.Boolean, + walk : scala.Boolean ) - object ModesToBuild { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = - if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") - ), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") - else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") - ), - numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), + numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes: scala.Double, - bike: scala.Double, - car: scala.Double, - drive_transit: scala.Double, - walk: scala.Double, - walk_transit: scala.Double + allModes : scala.Double, + bike : scala.Double, + car : scala.Double, + drive_transit : scala.Double, + walk : scala.Double, + walk_transit : scala.Double ) - object FractionOfModesToClear { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") - else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") - ), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( - if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") - else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") - ) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) ) } } - + case class WarmStart( - path: java.lang.String, - prepareData: scala.Boolean, - samplePopulationIntegerFlag: scala.Int, - skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type`: java.lang.String + path : java.lang.String, + prepareData : scala.Boolean, + samplePopulationIntegerFlag : scala.Int, + skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type` : java.lang.String ) - object WarmStart { - case class SkimsFilePaths$Elm( - skimType: java.lang.String, - skimsFilePath: java.lang.String + skimType : java.lang.String, + skimsFilePath : java.lang.String ) - object SkimsFilePaths$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if (c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = - if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = - if (c.hasPathOrNull("skimsFilePaths")) - scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) - else None, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if(c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim( - if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") - else com.typesafe.config.ConfigFactory.parseString("agentsim{}") - ), - calibration = BeamConfig.Beam.Calibration( - if (c.hasPathOrNull("calibration")) c.getConfig("calibration") - else com.typesafe.config.ConfigFactory.parseString("calibration{}") - ), - cluster = BeamConfig.Beam.Cluster( - if (c.hasPathOrNull("cluster")) c.getConfig("cluster") - else com.typesafe.config.ConfigFactory.parseString("cluster{}") - ), - debug = BeamConfig.Beam.Debug( - if (c.hasPathOrNull("debug")) c.getConfig("debug") - else com.typesafe.config.ConfigFactory.parseString("debug{}") - ), - exchange = BeamConfig.Beam.Exchange( - if (c.hasPathOrNull("exchange")) c.getConfig("exchange") - else com.typesafe.config.ConfigFactory.parseString("exchange{}") - ), - experimental = BeamConfig.Beam.Experimental( - if (c.hasPathOrNull("experimental")) c.getConfig("experimental") - else com.typesafe.config.ConfigFactory.parseString("experimental{}") - ), - input = BeamConfig.Beam.Input( - if (c.hasPathOrNull("input")) c.getConfig("input") - else com.typesafe.config.ConfigFactory.parseString("input{}") - ), - inputDirectory = - if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger( - if (c.hasPathOrNull("logger")) c.getConfig("logger") - else com.typesafe.config.ConfigFactory.parseString("logger{}") - ), - metrics = BeamConfig.Beam.Metrics( - if (c.hasPathOrNull("metrics")) c.getConfig("metrics") - else com.typesafe.config.ConfigFactory.parseString("metrics{}") - ), - output = BeamConfig.Beam.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - outputs = BeamConfig.Beam.Outputs( - if (c.hasPathOrNull("outputs")) c.getConfig("outputs") - else com.typesafe.config.ConfigFactory.parseString("outputs{}") - ), - physsim = BeamConfig.Beam.Physsim( - if (c.hasPathOrNull("physsim")) c.getConfig("physsim") - else com.typesafe.config.ConfigFactory.parseString("physsim{}") - ), - replanning = BeamConfig.Beam.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - router = BeamConfig.Beam.Router( - if (c.hasPathOrNull("router")) c.getConfig("router") - else com.typesafe.config.ConfigFactory.parseString("router{}") - ), - routing = BeamConfig.Beam.Routing( - if (c.hasPathOrNull("routing")) c.getConfig("routing") - else com.typesafe.config.ConfigFactory.parseString("routing{}") - ), - sim = BeamConfig.Beam.Sim( - if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") - ), - spatial = BeamConfig.Beam.Spatial( - if (c.hasPathOrNull("spatial")) c.getConfig("spatial") - else com.typesafe.config.ConfigFactory.parseString("spatial{}") - ), - urbansim = BeamConfig.Beam.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart( - if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") - else com.typesafe.config.ConfigFactory.parseString("warmStart{}") - ) + actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), + calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), + cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), + debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), + exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), + experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), + input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), + inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), + metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), + output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), + physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), + replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), + routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), + sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), + spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), + urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) ) } } - + case class Matsim( - conversion: BeamConfig.Matsim.Conversion, - modules: BeamConfig.Matsim.Modules + conversion : BeamConfig.Matsim.Conversion, + modules : BeamConfig.Matsim.Modules ) - object Matsim { - case class Conversion( - defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles: scala.Boolean, - matsimNetworkFile: java.lang.String, - osmFile: java.lang.String, - populationFile: java.lang.String, - scenarioDirectory: java.lang.String, - shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile: java.lang.String + defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles : scala.Boolean, + matsimNetworkFile : java.lang.String, + osmFile : java.lang.String, + populationFile : java.lang.String, + scenarioDirectory : java.lang.String, + shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile : java.lang.String ) - object Conversion { - case class DefaultHouseholdIncome( - currency: java.lang.String, - period: java.lang.String, - value: scala.Int + currency : java.lang.String, + period : java.lang.String, + value : scala.Int ) - object DefaultHouseholdIncome { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if (c.hasPathOrNull("period")) c.getString("period") else "year", - value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if(c.hasPathOrNull("period")) c.getString("period") else "year", + value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile: java.lang.String, - tazIdFieldName: java.lang.String + shapeFile : java.lang.String, + tazIdFieldName : java.lang.String ) - object ShapeConfig { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") - else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") - ), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = - if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = - if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = - if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") - else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( - if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") - else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") - ), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode: BeamConfig.Matsim.Modules.ChangeMode, - controler: BeamConfig.Matsim.Modules.Controler, - counts: BeamConfig.Matsim.Modules.Counts, - global: BeamConfig.Matsim.Modules.Global, - households: BeamConfig.Matsim.Modules.Households, - linkStats: BeamConfig.Matsim.Modules.LinkStats, - network: BeamConfig.Matsim.Modules.Network, - parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, - plans: BeamConfig.Matsim.Modules.Plans, - qsim: BeamConfig.Matsim.Modules.Qsim, - strategy: BeamConfig.Matsim.Modules.Strategy, - transit: BeamConfig.Matsim.Modules.Transit, - vehicles: BeamConfig.Matsim.Modules.Vehicles + changeMode : BeamConfig.Matsim.Modules.ChangeMode, + controler : BeamConfig.Matsim.Modules.Controler, + counts : BeamConfig.Matsim.Modules.Counts, + global : BeamConfig.Matsim.Modules.Global, + households : BeamConfig.Matsim.Modules.Households, + linkStats : BeamConfig.Matsim.Modules.LinkStats, + network : BeamConfig.Matsim.Modules.Network, + parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, + plans : BeamConfig.Matsim.Modules.Plans, + qsim : BeamConfig.Matsim.Modules.Qsim, + strategy : BeamConfig.Matsim.Modules.Strategy, + transit : BeamConfig.Matsim.Modules.Transit, + vehicles : BeamConfig.Matsim.Modules.Vehicles ) - object Modules { - case class ChangeMode( - modes: java.lang.String + modes : java.lang.String ) - object ChangeMode { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat: java.lang.String, - firstIteration: scala.Int, - lastIteration: scala.Int, - mobsim: java.lang.String, - outputDirectory: java.lang.String, - overwriteFiles: java.lang.String + eventsFileFormat : java.lang.String, + firstIteration : scala.Int, + lastIteration : scala.Int, + mobsim : java.lang.String, + outputDirectory : java.lang.String, + overwriteFiles : java.lang.String ) - object Controler { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = - if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Double, - inputCountsFile: java.lang.String, - outputformat: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Double, + inputCountsFile : java.lang.String, + outputformat : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem: java.lang.String, - randomSeed: scala.Int + coordinateSystem : java.lang.String, + randomSeed : scala.Int ) - object Global { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile: java.lang.String, - inputHouseholdAttributesFile: java.lang.String + inputFile : java.lang.String, + inputHouseholdAttributesFile : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = - if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = - if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") - else "/test/input/beamville/householdAttributes.xml" + inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations: scala.Int, - writeLinkStatsInterval: scala.Int + averageLinkStatsOverIterations : scala.Int, + writeLinkStatsInterval : scala.Int ) - object LinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = - if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = - if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile: java.lang.String + inputNetworkFile : java.lang.String ) - object Network { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = - if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") - else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents: scala.Int, - numberOfThreads: scala.Int, - oneThreadPerHandler: scala.Boolean, - synchronizeOnSimSteps: scala.Boolean + estimatedNumberOfEvents : scala.Int, + numberOfThreads : scala.Int, + oneThreadPerHandler : scala.Boolean, + synchronizeOnSimSteps : scala.Boolean ) - object ParallelEventHandling { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = - if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta: scala.Long, - earlyDeparture: scala.Long, - lateArrival: scala.Long, - learningRate: scala.Long, - parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing: scala.Long, - traveling: scala.Long, - waiting: scala.Long, - writeExperiencedPlans: scala.Boolean + BrainExpBeta : scala.Long, + earlyDeparture : scala.Long, + lateArrival : scala.Long, + learningRate : scala.Long, + parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing : scala.Long, + traveling : scala.Long, + waiting : scala.Long, + writeExperiencedPlans : scala.Boolean ) - object PlanCalcScore { - case class Parameterset$Elm( - activityType: java.lang.String, - priority: scala.Int, - scoringThisActivityAtAll: scala.Boolean, - `type`: java.lang.String, - typicalDuration: java.lang.String, - typicalDurationScoreComputation: java.lang.String + activityType : java.lang.String, + priority : scala.Int, + scoringThisActivityAtAll : scala.Boolean, + `type` : java.lang.String, + typicalDuration : java.lang.String, + typicalDurationScoreComputation : java.lang.String ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = - !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = - if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") - else "uniform" + activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = - if (c.hasPathOrNull("BrainExpBeta")) - c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) - else 2, - earlyDeparture = - if (c.hasPathOrNull("earlyDeparture")) - c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, - lateArrival = - if (c.hasPathOrNull("lateArrival")) - c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) - else -18, - learningRate = - if (c.hasPathOrNull("learningRate")) - c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) - else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = - if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) - else 6, - traveling = - if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) - else -6, - waiting = - if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, + BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, + earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, + learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, + traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, + waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.PlanCalcScore - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Plans( - inputPersonAttributesFile: java.lang.String, - inputPlansFile: java.lang.String + inputPersonAttributesFile : java.lang.String, + inputPlansFile : java.lang.String ) - object Plans { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = - if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") - else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = - if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") - else "/test/input/beamville/population.xml" + inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime: java.lang.String, - snapshotperiod: java.lang.String, - startTime: java.lang.String + endTime : java.lang.String, + snapshotperiod : java.lang.String, + startTime : java.lang.String ) - object Qsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1: scala.Int, - ModuleProbability_2: scala.Int, - ModuleProbability_3: scala.Int, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - fractionOfIterationsToDisableInnovation: scala.Int, - maxAgentPlanMemorySize: scala.Int, - parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval: java.lang.String + ModuleProbability_1 : scala.Int, + ModuleProbability_2 : scala.Int, + ModuleProbability_3 : scala.Int, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + fractionOfIterationsToDisableInnovation : scala.Int, + maxAgentPlanMemorySize : scala.Int, + parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval : java.lang.String ) - object Strategy { - case class Parameterset$Elm( - disableAfterIteration: scala.Int, - strategyName: java.lang.String, - `type`: java.lang.String, - weight: scala.Int + disableAfterIteration : scala.Int, + strategyName : java.lang.String, + `type` : java.lang.String, + weight : scala.Int ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getInt("fractionOfIterationsToDisableInnovation") - else 999999, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = - if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") - else "WorstPlanForRemovalSelector" - ) - } - - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" + ) + } + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.Strategy - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Transit( - transitModes: java.lang.String, - useTransit: scala.Boolean, - vehiclesFile: java.lang.String + transitModes : java.lang.String, + useTransit : scala.Boolean, + vehiclesFile : java.lang.String ) - object Transit { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile: java.lang.String + vehiclesFile : java.lang.String ) - object Vehicles { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode( - if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") - else com.typesafe.config.ConfigFactory.parseString("changeMode{}") - ), - controler = BeamConfig.Matsim.Modules.Controler( - if (c.hasPathOrNull("controler")) c.getConfig("controler") - else com.typesafe.config.ConfigFactory.parseString("controler{}") - ), - counts = BeamConfig.Matsim.Modules.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - global = BeamConfig.Matsim.Modules.Global( - if (c.hasPathOrNull("global")) c.getConfig("global") - else com.typesafe.config.ConfigFactory.parseString("global{}") - ), - households = BeamConfig.Matsim.Modules.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - linkStats = BeamConfig.Matsim.Modules.LinkStats( - if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") - else com.typesafe.config.ConfigFactory.parseString("linkStats{}") - ), - network = BeamConfig.Matsim.Modules.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( - if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") - else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") - ), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( - if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") - else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") - ), - plans = BeamConfig.Matsim.Modules.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - qsim = BeamConfig.Matsim.Modules.Qsim( - if (c.hasPathOrNull("qsim")) c.getConfig("qsim") - else com.typesafe.config.ConfigFactory.parseString("qsim{}") - ), - strategy = BeamConfig.Matsim.Modules.Strategy( - if (c.hasPathOrNull("strategy")) c.getConfig("strategy") - else com.typesafe.config.ConfigFactory.parseString("strategy{}") - ), - transit = BeamConfig.Matsim.Modules.Transit( - if (c.hasPathOrNull("transit")) c.getConfig("transit") - else com.typesafe.config.ConfigFactory.parseString("transit{}") - ), - vehicles = BeamConfig.Matsim.Modules.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) + changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), + controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), + counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), + households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), + network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), + plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), + strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), + transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), + vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion( - if (c.hasPathOrNull("conversion")) c.getConfig("conversion") - else com.typesafe.config.ConfigFactory.parseString("conversion{}") - ), - modules = BeamConfig.Matsim.Modules( - if (c.hasPathOrNull("modules")) c.getConfig("modules") - else com.typesafe.config.ConfigFactory.parseString("modules{}") - ) + conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), + modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam( - if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") - ), - matsim = BeamConfig.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ) + beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), + matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) ) } - private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - - private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - - private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { + private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ( - (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number] - ) throw $_expE(cv, "double") + if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - - private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { + private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException( - cv.origin.lineNumber + + new java.lang.RuntimeException(cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) - ) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) } - - private def $_str(cv: com.typesafe.config.ConfigValue) = + private def $_str(cv:com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } + From c323c8382e63e4a319981b57bf8c8e4c811b11b7 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 2 Aug 2022 10:22:29 +0300 Subject: [PATCH 265/307] Update lambda_function.py bigger timeout for stuck guard --- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 58eb1cf2557..f57be472c0a 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -145,7 +145,7 @@ if [[ -z "${last_completed}" ]]; then last_completed=$(tac $log_file | grep -m 1 -Eo '^[0-9]{2}:[0-9]{2}:[0-9]{2}') fi - beam_status=$(python3 -c "import datetime as dt; diff = dt.datetime.now() - dt.datetime.combine(dt.datetime.today(), dt.time.fromisoformat('$last_completed')); diff = diff + dt.timedelta(days = 1) if diff < dt.timedelta(0) else diff; x = 'OK' if diff < dt.timedelta(hours=5) else 'Bad'; print(x)") + beam_status=$(python3 -c "import datetime as dt; diff = dt.datetime.now() - dt.datetime.combine(dt.datetime.today(), dt.time.fromisoformat('$last_completed')); diff = diff + dt.timedelta(days = 1) if diff < dt.timedelta(0) else diff; x = 'OK' if diff < dt.timedelta(hours=8) else 'Bad'; print(x)") pid=$(pgrep -f RunBeam) if [ "$beam_status" == 'Bad' ] && [ "$pid" != "" ]; then jstack $pid | gzip > "$out_dir/kill_thread_dump.txt.gz" From 695cbda7d3fb7820d249611d0e1cd96bdd0651c2 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 2 Aug 2022 13:58:09 +0300 Subject: [PATCH 266/307] Update lambda_function.py even bigger timeout --- aws/src/main/python/beam_lambda/lambda_function.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index f57be472c0a..07f7e46d656 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -145,7 +145,7 @@ if [[ -z "${last_completed}" ]]; then last_completed=$(tac $log_file | grep -m 1 -Eo '^[0-9]{2}:[0-9]{2}:[0-9]{2}') fi - beam_status=$(python3 -c "import datetime as dt; diff = dt.datetime.now() - dt.datetime.combine(dt.datetime.today(), dt.time.fromisoformat('$last_completed')); diff = diff + dt.timedelta(days = 1) if diff < dt.timedelta(0) else diff; x = 'OK' if diff < dt.timedelta(hours=8) else 'Bad'; print(x)") + beam_status=$(python3 -c "import datetime as dt; diff = dt.datetime.now() - dt.datetime.combine(dt.datetime.today(), dt.time.fromisoformat('$last_completed')); diff = diff + dt.timedelta(days = 1) if diff < dt.timedelta(0) else diff; x = 'OK' if diff < dt.timedelta(hours=10) else 'Bad'; print(x)") pid=$(pgrep -f RunBeam) if [ "$beam_status" == 'Bad' ] && [ "$pid" != "" ]; then jstack $pid | gzip > "$out_dir/kill_thread_dump.txt.gz" From 03f8815838988e8ad700041ab5e896fe68cc3f0a Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 2 Aug 2022 08:51:53 -0700 Subject: [PATCH 267/307] fmt --- .../scala/beam/sim/config/BeamConfig.scala | 5566 +++++++++++------ 1 file changed, 3597 insertions(+), 1969 deletions(-) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 89f892f0aee..04f0205a5bf 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,3557 +3,5185 @@ package beam.sim.config case class BeamConfig( - beam : BeamConfig.Beam, - matsim : BeamConfig.Matsim + beam: BeamConfig.Beam, + matsim: BeamConfig.Matsim ) + object BeamConfig { + case class Beam( - actorSystemName : java.lang.String, - agentsim : BeamConfig.Beam.Agentsim, - calibration : BeamConfig.Beam.Calibration, - cluster : BeamConfig.Beam.Cluster, - debug : BeamConfig.Beam.Debug, - exchange : BeamConfig.Beam.Exchange, - experimental : BeamConfig.Beam.Experimental, - input : BeamConfig.Beam.Input, - inputDirectory : java.lang.String, - logger : BeamConfig.Beam.Logger, - metrics : BeamConfig.Beam.Metrics, - output : BeamConfig.Beam.Output, - outputs : BeamConfig.Beam.Outputs, - physsim : BeamConfig.Beam.Physsim, - replanning : BeamConfig.Beam.Replanning, - router : BeamConfig.Beam.Router, - routing : BeamConfig.Beam.Routing, - sim : BeamConfig.Beam.Sim, - spatial : BeamConfig.Beam.Spatial, - urbansim : BeamConfig.Beam.Urbansim, - useLocalWorker : scala.Boolean, - warmStart : BeamConfig.Beam.WarmStart + actorSystemName: java.lang.String, + agentsim: BeamConfig.Beam.Agentsim, + calibration: BeamConfig.Beam.Calibration, + cluster: BeamConfig.Beam.Cluster, + debug: BeamConfig.Beam.Debug, + exchange: BeamConfig.Beam.Exchange, + experimental: BeamConfig.Beam.Experimental, + input: BeamConfig.Beam.Input, + inputDirectory: java.lang.String, + logger: BeamConfig.Beam.Logger, + metrics: BeamConfig.Beam.Metrics, + output: BeamConfig.Beam.Output, + outputs: BeamConfig.Beam.Outputs, + physsim: BeamConfig.Beam.Physsim, + replanning: BeamConfig.Beam.Replanning, + router: BeamConfig.Beam.Router, + routing: BeamConfig.Beam.Routing, + sim: BeamConfig.Beam.Sim, + spatial: BeamConfig.Beam.Spatial, + urbansim: BeamConfig.Beam.Urbansim, + useLocalWorker: scala.Boolean, + warmStart: BeamConfig.Beam.WarmStart ) + object Beam { + case class Agentsim( - agentSampleSizeAsFractionOfPopulation : scala.Double, - agents : BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime : java.lang.String, - firstIteration : scala.Int, - fractionOfPlansWithSingleActivity : scala.Double, - h3taz : BeamConfig.Beam.Agentsim.H3taz, - lastIteration : scala.Int, - populationAdjustment : java.lang.String, - randomSeedForPopulationSampling : scala.Option[scala.Int], - scenarios : BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow : scala.Int, - simulationName : java.lang.String, - snapLocationAndRemoveInvalidInputs : scala.Boolean, - taz : BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters : scala.Int, - thresholdForWalkingInMeters : scala.Int, - timeBinSize : scala.Int, - toll : BeamConfig.Beam.Agentsim.Toll, - tuning : BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation: scala.Double, + agents: BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime: java.lang.String, + firstIteration: scala.Int, + fractionOfPlansWithSingleActivity: scala.Double, + h3taz: BeamConfig.Beam.Agentsim.H3taz, + lastIteration: scala.Int, + populationAdjustment: java.lang.String, + randomSeedForPopulationSampling: scala.Option[scala.Int], + scenarios: BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow: scala.Int, + simulationName: java.lang.String, + snapLocationAndRemoveInvalidInputs: scala.Boolean, + taz: BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters: scala.Int, + thresholdForWalkingInMeters: scala.Int, + timeBinSize: scala.Int, + toll: BeamConfig.Beam.Agentsim.Toll, + tuning: BeamConfig.Beam.Agentsim.Tuning ) + object Agentsim { + case class Agents( - activities : BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType : java.lang.String, - freight : BeamConfig.Beam.Agentsim.Agents.Freight, - households : BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking : BeamConfig.Beam.Agentsim.Agents.Parking, - plans : BeamConfig.Beam.Agentsim.Agents.Plans, - population : BeamConfig.Beam.Agentsim.Agents.Population, - ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles + activities: BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType: java.lang.String, + freight: BeamConfig.Beam.Agentsim.Agents.Freight, + households: BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking: BeamConfig.Beam.Agentsim.Agents.Parking, + plans: BeamConfig.Beam.Agentsim.Agents.Plans, + population: BeamConfig.Beam.Agentsim.Agents.Population, + ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles ) + object Agents { + case class Activities( - activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] ) + object Activities { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None + activityTypeToFixedDurationMap = + if (c.hasPathOrNull("activityTypeToFixedDurationMap")) + scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) + else None ) } } - + case class Freight( - carrierParkingFilePath : scala.Option[java.lang.String], - carriersFilePath : java.lang.String, - convertWgs2Utm : scala.Boolean, - enabled : scala.Boolean, - generateFixedActivitiesDurations : scala.Boolean, - name : java.lang.String, - plansFilePath : java.lang.String, - reader : java.lang.String, - replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath : java.lang.String + carrierParkingFilePath: scala.Option[java.lang.String], + carriersFilePath: java.lang.String, + convertWgs2Utm: scala.Boolean, + enabled: scala.Boolean, + generateFixedActivitiesDurations: scala.Boolean, + name: java.lang.String, + plansFilePath: java.lang.String, + reader: java.lang.String, + replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath: java.lang.String ) + object Freight { + case class Replanning( - departureTime : scala.Int, - disableAfterIteration : scala.Int, - strategy : java.lang.String + departureTime: scala.Int, + disableAfterIteration: scala.Int, + strategy: java.lang.String ) + object Replanning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", - reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = + if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = + if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") + else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = + c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = + if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") + else "/test/input/beamville/freight/payload-plans.csv", + reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + toursFilePath = + if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") + else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath : java.lang.String, - inputHouseholdAttributesFilePath : java.lang.String + inputFilePath: java.lang.String, + inputHouseholdAttributesFilePath: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = + if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") + else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = + if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") + else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - bikeMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier, - defaultValueOfTime : scala.Double, - highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts : scala.Int, - minimumValueOfTime : scala.Double, - modeChoiceClass : java.lang.String, - modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - multinomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit, - overrideAutomationForVOTT : scala.Boolean, - overrideAutomationLevel : scala.Int, - poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] + bikeMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier, + defaultValueOfTime: scala.Double, + highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts: scala.Int, + minimumValueOfTime: scala.Double, + modeChoiceClass: java.lang.String, + modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit, + overrideAutomationForVOTT: scala.Boolean, + overrideAutomationLevel: scala.Int, + poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] ) + object ModalBehaviors { + case class BikeMultiplier( - commute : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute, - noncommute : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute + commute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute, + noncommute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute ) + object BikeMultiplier { + case class Commute( - ageGT50 : scala.Double, - ageLE50 : scala.Double + ageGT50: scala.Double, + ageLE50: scala.Double ) + object Commute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( - ageGT50 = if(c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, - ageLE50 = if(c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 ) } } - + case class Noncommute( - ageGT50 : scala.Double, - ageLE50 : scala.Double + ageGT50: scala.Double, + ageLE50: scala.Double ) + object Noncommute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( - ageGT50 = if(c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, - ageLE50 = if(c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( - commute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute(if(c.hasPathOrNull("commute")) c.getConfig("commute") else com.typesafe.config.ConfigFactory.parseString("commute{}")), - noncommute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute(if(c.hasPathOrNull("noncommute")) c.getConfig("noncommute") else com.typesafe.config.ConfigFactory.parseString("noncommute{}")) + commute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( + if (c.hasPathOrNull("commute")) c.getConfig("commute") + else com.typesafe.config.ConfigFactory.parseString("commute{}") + ), + noncommute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( + if (c.hasPathOrNull("noncommute")) c.getConfig("noncommute") + else com.typesafe.config.ConfigFactory.parseString("noncommute{}") + ) ) } } - + case class HighTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) + object HighTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class Lccm( - filePath : java.lang.String + filePath: java.lang.String ) + object Lccm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) + object LowTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class ModeVotMultiplier( - CAV : scala.Double, - bike : scala.Double, - drive : scala.Double, - rideHail : scala.Double, - rideHailPooled : scala.Double, - rideHailTransit : scala.Double, - transit : scala.Double, - waiting : scala.Double, - walk : scala.Double + CAV: scala.Double, + bike: scala.Double, + drive: scala.Double, + rideHail: scala.Double, + rideHailPooled: scala.Double, + rideHailTransit: scala.Double, + transit: scala.Double, + waiting: scala.Double, + walk: scala.Double ) + object ModeVotMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MultinomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params, - utility_scale_factor : scala.Double + params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params, + utility_scale_factor: scala.Double ) + object MultinomialLogit { + case class Params( - bike_intercept : scala.Double, - bike_transit_intercept : scala.Double, - car_intercept : scala.Double, - cav_intercept : scala.Double, - drive_transit_intercept : scala.Double, - ride_hail_intercept : scala.Double, - ride_hail_pooled_intercept : scala.Double, - ride_hail_transit_intercept : scala.Double, - transfer : scala.Double, - transit_crowding : scala.Double, - transit_crowding_VOT_multiplier : scala.Double, - transit_crowding_VOT_threshold : scala.Double, - transit_crowding_percentile : scala.Double, - walk_intercept : scala.Double, - walk_transit_intercept : scala.Double + bike_intercept: scala.Double, + bike_transit_intercept: scala.Double, + car_intercept: scala.Double, + cav_intercept: scala.Double, + drive_transit_intercept: scala.Double, + ride_hail_intercept: scala.Double, + ride_hail_pooled_intercept: scala.Double, + ride_hail_transit_intercept: scala.Double, + transfer: scala.Double, + transit_crowding: scala.Double, + transit_crowding_VOT_multiplier: scala.Double, + transit_crowding_VOT_threshold: scala.Double, + transit_crowding_percentile: scala.Double, + walk_intercept: scala.Double, + walk_transit_intercept: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( - bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, - ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, - transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, - transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, - transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, - walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = + if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = + if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = + if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = + if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") + else 0.0, + ride_hail_transit_intercept = + if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") + else 0.0, + transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = + if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) + c.getDouble("transit_crowding_VOT_multiplier") + else 0.0, + transit_crowding_VOT_threshold = + if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") + else 0.5, + transit_crowding_percentile = + if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") + else 90.0, + walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = + if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), - utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ), + utility_scale_factor = + if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object PoolingMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - bikeMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier(if(c.hasPathOrNull("bikeMultiplier")) c.getConfig("bikeMultiplier") else com.typesafe.config.ConfigFactory.parseString("bikeMultiplier{}")), - defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), - maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, - minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")), - overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), - transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None - ) - } - } - + bikeMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( + if (c.hasPathOrNull("bikeMultiplier")) c.getConfig("bikeMultiplier") + else com.typesafe.config.ConfigFactory.parseString("bikeMultiplier{}") + ), + defaultValueOfTime = + if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( + if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") + ), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( + if (c.hasPathOrNull("lccm")) c.getConfig("lccm") + else com.typesafe.config.ConfigFactory.parseString("lccm{}") + ), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( + if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") + ), + maximumNumberOfReplanningAttempts = + if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") + else 3, + minimumValueOfTime = + if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = + if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") + else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( + if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") + else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") + ), + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") + ), + overrideAutomationForVOTT = + c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = + if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( + if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") + else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") + ), + transitVehicleTypeVOTMultipliers = + if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) + scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) + else None + ) + } + } + case class ModeIncentive( - filePath : java.lang.String + filePath: java.lang.String ) + object ModeIncentive { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - fractionOfSameTypeZones : scala.Double, - maxSearchRadius : scala.Double, - minNumberOfSameTypeZones : scala.Int, - minSearchRadius : scala.Double, - multinomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, - rangeAnxietyBuffer : scala.Double, - searchMaxDistanceRelativeToEllipseFoci : scala.Double + fractionOfSameTypeZones: scala.Double, + maxSearchRadius: scala.Double, + minNumberOfSameTypeZones: scala.Int, + minSearchRadius: scala.Double, + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, + rangeAnxietyBuffer: scala.Double, + searchMaxDistanceRelativeToEllipseFoci: scala.Double ) + object Parking { + case class MultinomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params ) + object MultinomialLogit { + case class Params( - distanceMultiplier : scala.Double, - enrouteDetourMultiplier : scala.Double, - homeActivityPrefersResidentialParkingMultiplier : scala.Double, - parkingPriceMultiplier : scala.Double, - rangeAnxietyMultiplier : scala.Double + distanceMultiplier: scala.Double, + enrouteDetourMultiplier: scala.Double, + homeActivityPrefersResidentialParkingMultiplier: scala.Double, + parkingPriceMultiplier: scala.Double, + rangeAnxietyMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( - distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, - parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = + if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = + if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = + if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) + c.getDouble("homeActivityPrefersResidentialParkingMultiplier") + else 1.0, + parkingPriceMultiplier = + if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = + if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - fractionOfSameTypeZones = if(c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, - maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minNumberOfSameTypeZones = if(c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, - minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")), - rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 + fractionOfSameTypeZones = + if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, + maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minNumberOfSameTypeZones = + if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, + minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") + ), + rangeAnxietyBuffer = + if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = + if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) + c.getDouble("searchMaxDistanceRelativeToEllipseFoci") + else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath : java.lang.String, - inputPlansFilePath : java.lang.String, - merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath: java.lang.String, + inputPlansFilePath: java.lang.String, + merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) + object Plans { + case class Merge( - fraction : scala.Double + fraction: scala.Double ) + object Merge { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) + inputPersonAttributesFilePath = + if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") + else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = + if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") + else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( + if (c.hasPathOrNull("merge")) c.getConfig("merge") + else com.typesafe.config.ConfigFactory.parseString("merge{}") + ) ) } } - + case class Population( - industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling : scala.Boolean + industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling: scala.Boolean ) + object Population { + case class IndustryRemovalProbabilty( - enabled : scala.Boolean, - inputFilePath : java.lang.String, - removalStrategy : java.lang.String + enabled: scala.Boolean, + inputFilePath: java.lang.String, + removalStrategy: java.lang.String ) + object IndustryRemovalProbabilty { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = + if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( + if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") + else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") + ), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath : java.lang.String + filePath: java.lang.String ) + object PtFare { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost : scala.Double, - defaultCostPerMile : scala.Double, - defaultCostPerMinute : scala.Double, - human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations : scala.Boolean, - name : java.lang.String, - pooledBaseCost : scala.Double, - pooledCostPerMile : scala.Double, - pooledCostPerMinute : scala.Double, - rangeBufferForDispatchInMeters : scala.Int, - repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost: scala.Double, + defaultCostPerMile: scala.Double, + defaultCostPerMinute: scala.Double, + human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations: scala.Boolean, + name: java.lang.String, + pooledBaseCost: scala.Double, + pooledCostPerMile: scala.Double, + pooledCostPerMinute: scala.Double, + rangeBufferForDispatchInMeters: scala.Int, + repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) + object RideHail { + case class AllocationManager( - alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm : java.lang.String, - maxExcessRideTime : scala.Double, - maxWaitingTimeInSec : scala.Int, - name : java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, - repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds : scala.Int + alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm: java.lang.String, + maxExcessRideTime: scala.Double, + maxWaitingTimeInSec: scala.Int, + name: java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, + repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds: scala.Int ) + object AllocationManager { + case class AlonsoMora( - maxRequestsPerVehicle : scala.Int + maxRequestsPerVehicle: scala.Int ) + object AlonsoMora { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = + if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, - demandWeight : scala.Double, - distanceWeight : scala.Double, - keepMaxTopNScores : scala.Int, - minDemandPercentageInRadius : scala.Double, - minScoreThresholdForRepositioning : scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, - percentageOfVehiclesToReposition : scala.Double, - produceDebugImages : scala.Boolean, - repositionCircleRadiusInMeters : scala.Double, - repositioningMethod : java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, - waitingTimeWeight : scala.Double + allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, + demandWeight: scala.Double, + distanceWeight: scala.Double, + keepMaxTopNScores: scala.Int, + minDemandPercentageInRadius: scala.Double, + minScoreThresholdForRepositioning: scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, + percentageOfVehiclesToReposition: scala.Double, + produceDebugImages: scala.Boolean, + repositionCircleRadiusInMeters: scala.Double, + repositioningMethod: java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, + waitingTimeWeight: scala.Double ) + object RepositionLowWaitingTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, - minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, - percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, - repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, - waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( + "allowIncreasingRadiusIfDemandInRadiusLow" + ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = + if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") + else 0.1, + minScoreThresholdForRepositioning = + if (c.hasPathOrNull("minScoreThresholdForRepositioning")) + c.getDouble("minScoreThresholdForRepositioning") + else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = + if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) + c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") + else 1, + percentageOfVehiclesToReposition = + if (c.hasPathOrNull("percentageOfVehiclesToReposition")) + c.getDouble("percentageOfVehiclesToReposition") + else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = + if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") + else 3000, + repositioningMethod = + if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = + if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) + c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") + else 1200, + waitingTimeWeight = + if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), - matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, - repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), - requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( + if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") + else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") + ), + matchingAlgorithm = + if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") + else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = + if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = + if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) + c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") + else 1, + repositionLowWaitingTimes = + BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( + if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") + else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") + ), + requestBufferTimeoutInSeconds = + if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Int ) + object Cav { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 16090, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) + object Charging { + case class VehicleChargingManager( - defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager ) + object VehicleChargingManager { + case class DefaultVehicleChargingManager( - multinomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit ) + object DefaultVehicleChargingManager { + case class MultinomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params ) + object MultinomialLogit { + case class Params( - chargingTimeMultiplier : scala.Double, - drivingTimeMultiplier : scala.Double, - insufficientRangeMultiplier : scala.Double, - queueingTimeMultiplier : scala.Double + chargingTimeMultiplier: scala.Double, + drivingTimeMultiplier: scala.Double, + insufficientRangeMultiplier: scala.Double, + queueingTimeMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params( - chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, - drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, - insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, - queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit + .Params( + chargingTimeMultiplier = + if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") + else -0.01666667, + drivingTimeMultiplier = + if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") + else -0.01666667, + insufficientRangeMultiplier = + if (c.hasPathOrNull("insufficientRangeMultiplier")) + c.getDouble("insufficientRangeMultiplier") + else -60.0, + queueingTimeMultiplier = + if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") + else -0.01666667 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MultinomialLogit( + params = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit + .Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + multinomialLogit = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")) + defaultVehicleChargingManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + if (c.hasPathOrNull("defaultVehicleChargingManager")) + c.getConfig("defaultVehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( + if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") + ) ) } } - + case class Human( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int ) + object Human { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180 ) } } - + case class Initialization( - filePath : java.lang.String, - initType : java.lang.String, - parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath: java.lang.String, + initType: java.lang.String, + parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) + object Initialization { + case class Parking( - filePath : java.lang.String + filePath: java.lang.String ) + object Parking { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet : scala.Double, - initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId : java.lang.String, - vehicleTypePrefix : java.lang.String + fractionOfInitialVehicleFleet: scala.Double, + initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId: java.lang.String, + vehicleTypePrefix: java.lang.String ) + object Procedural { + case class InitialLocation( - home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name : java.lang.String + home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name: java.lang.String ) + object InitialLocation { + case class Home( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object Home { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( + if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") + else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") + ), + vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = + if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( + if (c.hasPathOrNull("procedural")) c.getConfig("procedural") + else com.typesafe.config.ConfigFactory.parseString("procedural{}") + ) ) } } - + case class IterationStats( - timeBinSizeInSec : scala.Double + timeBinSizeInSec: scala.Double ) + object IterationStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name : java.lang.String, - timeout : scala.Int + demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name: java.lang.String, + timeout: scala.Int ) + object RepositioningManager { + case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider : scala.Double, - horizon : scala.Int, - numberOfClustersForDemand : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDemandForCAVs : scala.Double + fractionOfClosestClustersToConsider: scala.Double, + horizon: scala.Int, + numberOfClustersForDemand: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDemandForCAVs: scala.Double ) + object DemandFollowingRepositioningManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, - horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, - sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 + fractionOfClosestClustersToConsider = + if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) + c.getDouble("fractionOfClosestClustersToConsider") + else 0.2, + horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = + if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 1, + sensitivityOfRepositioningToDemandForCAVs = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) + c.getDouble("sensitivityOfRepositioningToDemandForCAVs") + else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDistance : scala.Double + predictionHorizon: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDistance: scala.Double ) + object InverseSquareDistanceRepositioningFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, - sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 + predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 0.4, + sensitivityOfRepositioningToDistance = + if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) + c.getDouble("sensitivityOfRepositioningToDistance") + else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( + if (c.hasPathOrNull("demandFollowingRepositioningManager")) + c.getConfig("demandFollowingRepositioningManager") + else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") + ), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager + .InverseSquareDistanceRepositioningFactor( + if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) + c.getConfig("inverseSquareDistanceRepositioningFactor") + else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object RideHailManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel : scala.Double, - numberOfCategories : scala.Int, - priceAdjustmentStrategy : java.lang.String, - surgeLevelAdaptionStep : scala.Double + minimumSurgeLevel: scala.Double, + numberOfCategories: scala.Int, + priceAdjustmentStrategy: java.lang.String, + surgeLevelAdaptionStep: scala.Double ) + object SurgePricing { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = + if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") + else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = + if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), - defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), - linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( + if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") + else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") + ), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( + if (c.hasPathOrNull("cav")) c.getConfig("cav") + else com.typesafe.config.ConfigFactory.parseString("cav{}") + ), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( + if (c.hasPathOrNull("charging")) c.getConfig("charging") + else com.typesafe.config.ConfigFactory.parseString("charging{}") + ), + defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = + if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = + if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( + if (c.hasPathOrNull("human")) c.getConfig("human") + else com.typesafe.config.ConfigFactory.parseString("human{}") + ), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( + if (c.hasPathOrNull("initialization")) c.getConfig("initialization") + else com.typesafe.config.ConfigFactory.parseString("initialization{}") + ), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( + if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") + else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") + ), + linkFleetStateAcrossIterations = + c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = + if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + rangeBufferForDispatchInMeters = + if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") + else 10000, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( + if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") + else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") + ), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( + if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") + else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") + ), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( + if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") + else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") + ) + ) + } + } + case class RideHailTransit( - modesToConsider : java.lang.String + modesToConsider: java.lang.String ) + object RideHailTransit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - multinomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit + carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit ) + object TripBehaviors { + case class CarUsage( - minDistanceToTrainStop : scala.Double + minDistanceToTrainStop: scala.Double ) + object CarUsage { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = + if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MultinomialLogit( - activity_file_path : java.lang.String, - additional_trip_utility : scala.Double, - destination_nest_scale_factor : scala.Double, - generate_secondary_activities : scala.Boolean, - intercept_file_path : java.lang.String, - max_destination_choice_set_size : scala.Int, - max_destination_distance_meters : scala.Double, - mode_nest_scale_factor : scala.Double, - trip_nest_scale_factor : scala.Double + activity_file_path: java.lang.String, + additional_trip_utility: scala.Double, + destination_nest_scale_factor: scala.Double, + generate_secondary_activities: scala.Boolean, + intercept_file_path: java.lang.String, + max_destination_choice_set_size: scala.Int, + max_destination_distance_meters: scala.Double, + mode_nest_scale_factor: scala.Double, + trip_nest_scale_factor: scala.Double ) + object MultinomialLogit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( - activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, - generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, - max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, - mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = + if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = + if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = + if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") + else 1.0, + generate_secondary_activities = + c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = + if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = + if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") + else 20, + max_destination_distance_meters = + if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") + else 32000, + mode_nest_scale_factor = + if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = + if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( + if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") + else com.typesafe.config.ConfigFactory.parseString("carUsage{}") + ), + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") + ) ) } } - + case class Vehicles( - downsamplingMethod : java.lang.String, - dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet : scala.Double, - fractionOfPeopleWithBicycle : scala.Double, - fuelTypesFilePath : java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, - linkSocAcrossIterations : scala.Boolean, - linkToGradePercentFilePath : java.lang.String, - meanPrivateVehicleStartingSOC : scala.Double, - meanRidehailVehicleStartingSOC : scala.Double, - sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile : java.lang.String, - vehicleAdjustmentMethod : java.lang.String, - vehicleTypesFilePath : java.lang.String, - vehiclesFilePath : java.lang.String + downsamplingMethod: java.lang.String, + dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet: scala.Double, + fractionOfPeopleWithBicycle: scala.Double, + fuelTypesFilePath: java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, + linkSocAcrossIterations: scala.Boolean, + linkToGradePercentFilePath: java.lang.String, + meanPrivateVehicleStartingSOC: scala.Double, + meanRidehailVehicleStartingSOC: scala.Double, + sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile: java.lang.String, + vehicleAdjustmentMethod: java.lang.String, + vehicleTypesFilePath: java.lang.String, + vehiclesFilePath: java.lang.String ) + object Vehicles { + case class DummySharedBike( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedBike { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedCar { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond : scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, - noRefuelThresholdOffsetInMeters : scala.Double, - remainingDistanceWrtBatteryCapacityThreshold : scala.Int + estimateOfMeanChargingDurationInSecond: scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, + noRefuelThresholdOffsetInMeters: scala.Double, + remainingDistanceWrtBatteryCapacityThreshold: scala.Int ) + object Enroute { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, - noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, - remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 + estimateOfMeanChargingDurationInSecond = + if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) + c.getInt("estimateOfMeanChargingDurationInSecond") + else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = + if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) + c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") + else 500, + noRefuelThresholdOffsetInMeters = + if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") + else 32186.9, + remainingDistanceWrtBatteryCapacityThreshold = + if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) + c.getInt("remainingDistanceWrtBatteryCapacityThreshold") + else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], - fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], - inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], - managerType : java.lang.String, - name : java.lang.String, - parkingFilePath : java.lang.String, - reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving + ], + fixed_non_reserving_fleet_by_taz: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz + ], + inexhaustible_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving + ], + managerType: java.lang.String, + name: java.lang.String, + parkingFilePath: java.lang.String, + reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) + object SharedFleets$Elm { + case class FixedNonReserving( - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String ) + object FixedNonReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize : scala.Int, - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String, - vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] + fleetSize: scala.Int, + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String, + vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] ) + object FixedNonReservingFleetByTaz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None + fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = + if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) + else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object InexhaustibleReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], - name : java.lang.String, - repositionTimeBin : scala.Int, - statTimeBin : scala.Int + min_availability_undersupply_algorithm: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm + ], + name: java.lang.String, + repositionTimeBin: scala.Int, + statTimeBin: scala.Int ) + object Reposition { + case class MinAvailabilityUndersupplyAlgorithm( - matchLimit : scala.Int + matchLimit: scala.Int ) + object MinAvailabilityUndersupplyAlgorithm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( - matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm( + matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = + if (c.hasPathOrNull("min-availability-undersupply-algorithm")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) + ) + else None, + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, - fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, - inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, - managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None + fixed_non_reserving = + if (c.hasPathOrNull("fixed-non-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReserving(c.getConfig("fixed-non-reserving")) + ) + else None, + fixed_non_reserving_fleet_by_taz = + if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) + ) + else None, + inexhaustible_reserving = + if (c.hasPathOrNull("inexhaustible-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) + ) + else None, + managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = + if (c.hasPathOrNull("reposition")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) + ) + else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, - fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, - meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", - vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" - ) - } - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = + if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") + else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( + if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") + else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") + ), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( + if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") + else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") + ), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( + if (c.hasPathOrNull("enroute")) c.getConfig("enroute") + else com.typesafe.config.ConfigFactory.parseString("enroute{}") + ), + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 1.0, + fractionOfPeopleWithBicycle = + if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = + if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") + else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( + "generateEmergencyHouseholdVehicleWhenPlansRequireIt" + ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = + c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = + if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = + if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") + else 1.0, + meanRidehailVehicleStartingSOC = + if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") + else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = + if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") + else "", + vehicleAdjustmentMethod = + if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = + if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") + else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = + if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") + else "/test/input/beamville/vehicles.csv" + ) + } + + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Agentsim.Agents.Vehicles + .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), - bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), - households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), - parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities( + if (c.hasPathOrNull("activities")) c.getConfig("activities") + else com.typesafe.config.ConfigFactory.parseString("activities{}") + ), + bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight( + if (c.hasPathOrNull("freight")) c.getConfig("freight") + else com.typesafe.config.ConfigFactory.parseString("freight{}") + ), + households = BeamConfig.Beam.Agentsim.Agents.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( + if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") + else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") + ), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( + if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") + else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") + ), + parking = BeamConfig.Beam.Agentsim.Agents.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + plans = BeamConfig.Beam.Agentsim.Agents.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + population = BeamConfig.Beam.Agentsim.Agents.Population( + if (c.hasPathOrNull("population")) c.getConfig("population") + else com.typesafe.config.ConfigFactory.parseString("population{}") + ), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( + if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") + else com.typesafe.config.ConfigFactory.parseString("ptFare{}") + ), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( + if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") + else com.typesafe.config.ConfigFactory.parseString("rideHail{}") + ), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( + if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") + else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") + ), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( + if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") + else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") + ), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor : scala.Double, - chargingPointCountScalingFactor : scala.Double, - chargingPointFilePath : java.lang.String, - helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds : scala.Int + chargingPointCostScalingFactor: scala.Double, + chargingPointCountScalingFactor: scala.Double, + chargingPointFilePath: java.lang.String, + helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds: scala.Int ) + object ChargingNetworkManager { + case class Helics( - bufferSize : scala.Int, - connectionEnabled : scala.Boolean, - coreInitString : java.lang.String, - coreType : java.lang.String, - dataInStreamPoint : java.lang.String, - dataOutStreamPoint : java.lang.String, - federateName : java.lang.String, - feedbackEnabled : scala.Boolean, - intLogLevel : scala.Int, - timeDeltaProperty : scala.Double + bufferSize: scala.Int, + connectionEnabled: scala.Boolean, + coreInitString: java.lang.String, + coreType: java.lang.String, + dataInStreamPoint: java.lang.String, + dataOutStreamPoint: java.lang.String, + federateName: java.lang.String, + feedbackEnabled: scala.Boolean, + intLogLevel: scala.Int, + timeDeltaProperty: scala.Double ) + object Helics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", - dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = + if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") + else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = + if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") + else "GridFed/PhysicalBounds", + dataOutStreamPoint = + if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled : scala.Boolean, - expansionFactor_charge_activity : scala.Double, - expansionFactor_home_activity : scala.Double, - expansionFactor_init_activity : scala.Double, - expansionFactor_wherever_activity : scala.Double, - expansionFactor_work_activity : scala.Double + enabled: scala.Boolean, + expansionFactor_charge_activity: scala.Double, + expansionFactor_home_activity: scala.Double, + expansionFactor_init_activity: scala.Double, + expansionFactor_wherever_activity: scala.Double, + expansionFactor_work_activity: scala.Double ) + object ScaleUp { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, - expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, - expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, - expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, - expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = + if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") + else 1.0, + expansionFactor_home_activity = + if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") + else 1.0, + expansionFactor_init_activity = + if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") + else 1.0, + expansionFactor_wherever_activity = + if (c.hasPathOrNull("expansionFactor_wherever_activity")) + c.getDouble("expansionFactor_wherever_activity") + else 1.0, + expansionFactor_work_activity = + if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") + else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, - chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, - chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), - timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = + if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") + else 1.0, + chargingPointCountScalingFactor = + if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") + else 1.0, + chargingPointFilePath = + if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( + if (c.hasPathOrNull("helics")) c.getConfig("helics") + else com.typesafe.config.ConfigFactory.parseString("helics{}") + ), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( + if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") + else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") + ), + timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution : scala.Int, - upperBoundResolution : scala.Int + lowerBoundResolution: scala.Int, + upperBoundResolution: scala.Int ) + object H3taz { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile : java.lang.String + frequencyAdjustmentFile: java.lang.String ) + object Scenarios { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = + if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") + else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay : scala.Int, - interval : scala.Int + initialDelay: scala.Int, + interval: scala.Int ) + object ScheduleMonitorTask { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath : java.lang.String, - parkingCostScalingFactor : scala.Double, - parkingFilePath : java.lang.String, - parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor : scala.Double, - tazIdFieldName : java.lang.String + filePath: java.lang.String, + parkingCostScalingFactor: scala.Double, + parkingFilePath: java.lang.String, + parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor: scala.Double, + tazIdFieldName: java.lang.String ) + object Taz { + case class ParkingManager( - displayPerformanceTimings : scala.Boolean, - method : java.lang.String, - parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings: scala.Boolean, + method: java.lang.String, + parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) + object ParkingManager { + case class Parallel( - numberOfClusters : scala.Int + numberOfClusters: scala.Int ) + object Parallel { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( + if (c.hasPathOrNull("parallel")) c.getConfig("parallel") + else com.typesafe.config.ConfigFactory.parseString("parallel{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), - parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0, - tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "tazId" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = + if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( + if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") + else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") + ), + parkingStallCountScalingFactor = + if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") + else 1.0, + tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "tazId" ) } } - + case class Toll( - filePath : java.lang.String + filePath: java.lang.String ) + object Toll { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules : scala.Double, - rideHailPrice : scala.Double, - tollPrice : scala.Double, - transitCapacity : scala.Option[scala.Double], - transitPrice : scala.Double + fuelCapacityInJoules: scala.Double, + rideHailPrice: scala.Double, + tollPrice: scala.Double, + transitCapacity: scala.Option[scala.Double], + transitPrice: scala.Double ) + object Tuning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = + if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - randomSeedForPopulationSampling = if(c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) else None, - scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), - schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - snapLocationAndRemoveInvalidInputs = c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), - taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), - thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, - thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), - tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) + agentSampleSizeAsFractionOfPopulation = + if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) + c.getDouble("agentSampleSizeAsFractionOfPopulation") + else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents( + if (c.hasPathOrNull("agents")) c.getConfig("agents") + else com.typesafe.config.ConfigFactory.parseString("agents{}") + ), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( + if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") + else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") + ), + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = + if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") + else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz( + if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") + else com.typesafe.config.ConfigFactory.parseString("h3taz{}") + ), + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = + if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + randomSeedForPopulationSampling = + if (c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) + else None, + scenarios = BeamConfig.Beam.Agentsim.Scenarios( + if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") + else com.typesafe.config.ConfigFactory.parseString("scenarios{}") + ), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( + if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") + else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") + ), + schedulerParallelismWindow = + if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + snapLocationAndRemoveInvalidInputs = + c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), + taz = BeamConfig.Beam.Agentsim.Taz( + if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") + ), + thresholdForMakingParkingChoiceInMeters = + if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) + c.getInt("thresholdForMakingParkingChoiceInMeters") + else 100, + thresholdForWalkingInMeters = + if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll( + if (c.hasPathOrNull("toll")) c.getConfig("toll") + else com.typesafe.config.ConfigFactory.parseString("toll{}") + ), + tuning = BeamConfig.Beam.Agentsim.Tuning( + if (c.hasPathOrNull("tuning")) c.getConfig("tuning") + else com.typesafe.config.ConfigFactory.parseString("tuning{}") + ) ) } } - + case class Calibration( - counts : BeamConfig.Beam.Calibration.Counts, - google : BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio : scala.Double, - mode : BeamConfig.Beam.Calibration.Mode, - objectiveFunction : java.lang.String, - roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, - studyArea : BeamConfig.Beam.Calibration.StudyArea + counts: BeamConfig.Beam.Calibration.Counts, + google: BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio: scala.Double, + mode: BeamConfig.Beam.Calibration.Mode, + objectiveFunction: java.lang.String, + roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, + studyArea: BeamConfig.Beam.Calibration.StudyArea ) + object Calibration { + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Int, - inputCountsFile : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Int, + inputCountsFile: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes ) + object Google { + case class TravelTimes( - enable : scala.Boolean, - iterationInterval : scala.Int, - minDistanceInMeters : scala.Double, - numDataPointsOver24Hours : scala.Int, - offPeakEnabled : scala.Boolean, - queryDate : java.lang.String, - tolls : scala.Boolean + enable: scala.Boolean, + iterationInterval: scala.Int, + minDistanceInMeters: scala.Double, + numDataPointsOver24Hours: scala.Int, + offPeakEnabled: scala.Boolean, + queryDate: java.lang.String, + tolls: scala.Boolean ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = + if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = + if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class Mode( - benchmarkFilePath : java.lang.String + benchmarkFilePath: java.lang.String ) + object Mode { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) + object RoadNetwork { + case class TravelTimes( - zoneBoundariesFilePath : java.lang.String, - zoneODTravelTimesFilePath : java.lang.String + zoneBoundariesFilePath: java.lang.String, + zoneODTravelTimesFilePath: java.lang.String ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = + if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = + if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class StudyArea( - enabled : scala.Boolean, - lat : scala.Double, - lon : scala.Double, - radius : scala.Double + enabled: scala.Boolean, + lat: scala.Double, + lon: scala.Double, + radius: scala.Double ) + object StudyArea { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), - meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), - objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), - studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) + counts = BeamConfig.Beam.Calibration.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + google = BeamConfig.Beam.Calibration.Google( + if (c.hasPathOrNull("google")) c.getConfig("google") + else com.typesafe.config.ConfigFactory.parseString("google{}") + ), + meanToCountsWeightRatio = + if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode( + if (c.hasPathOrNull("mode")) c.getConfig("mode") + else com.typesafe.config.ConfigFactory.parseString("mode{}") + ), + objectiveFunction = + if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") + else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( + if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") + else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") + ), + studyArea = BeamConfig.Beam.Calibration.StudyArea( + if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") + else com.typesafe.config.ConfigFactory.parseString("studyArea{}") + ) ) } } - + case class Cluster( - clusterType : scala.Option[java.lang.String], - enabled : scala.Boolean + clusterType: scala.Option[java.lang.String], + enabled: scala.Boolean ) + object Cluster { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor : BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval : scala.Int, - clearRoutedOutstandingWorkEnabled : scala.Boolean, - debugActorTimerIntervalInSec : scala.Int, - debugEnabled : scala.Boolean, - maxSimulationStepTimeBeforeConsideredStuckMin : scala.Int, - memoryConsumptionDisplayTimeoutInSec : scala.Int, - messageLogging : scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork : scala.Int, - stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation : BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives : scala.Boolean, - writeRealizedModeChoiceFile : scala.Boolean + actor: BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval: scala.Int, + clearRoutedOutstandingWorkEnabled: scala.Boolean, + debugActorTimerIntervalInSec: scala.Int, + debugEnabled: scala.Boolean, + maxSimulationStepTimeBeforeConsideredStuckMin: scala.Int, + memoryConsumptionDisplayTimeoutInSec: scala.Int, + messageLogging: scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork: scala.Int, + stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation: BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives: scala.Boolean, + writeRealizedModeChoiceFile: scala.Boolean ) + object Debug { + case class Actor( - logDepth : scala.Int + logDepth: scala.Int ) + object Actor { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs : scala.Long, - checkMaxNumberOfMessagesEnabled : scala.Boolean, - defaultTimeoutMs : scala.Long, - enabled : scala.Boolean, - overallSimulationTimeoutMs : scala.Long, - thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs: scala.Long, + checkMaxNumberOfMessagesEnabled: scala.Boolean, + defaultTimeoutMs: scala.Long, + enabled: scala.Boolean, + overallSimulationTimeoutMs: scala.Long, + thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) + object StuckAgentDetection { + case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs : scala.Long, - triggerType : java.lang.String + actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs: scala.Long, + triggerType: java.lang.String ) + object Thresholds$Elm { + case class ActorTypeToMaxNumberOfMessages( - population : scala.Option[scala.Int], - rideHailAgent : scala.Option[scala.Int], - rideHailManager : scala.Option[scala.Int], - transitDriverAgent : scala.Option[scala.Int] + population: scala.Option[scala.Int], + rideHailAgent: scala.Option[scala.Int], + rideHailManager: scala.Option[scala.Int], + transitDriverAgent: scala.Option[scala.Int] ) + object ActorTypeToMaxNumberOfMessages { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = + if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), - markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, - triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = + BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( + if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") + else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") + ), + markAsStuckAfterMs = + if (c.hasPathOrNull("markAsStuckAfterMs")) + c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 20000, + triggerType = + if (c.hasPathOrNull("triggerType")) c.getString("triggerType") + else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, - checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = + if (c.hasPathOrNull("checkIntervalMs")) + c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 200, + checkMaxNumberOfMessagesEnabled = + !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = + if (c.hasPathOrNull("defaultTimeoutMs")) + c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = + if (c.hasPathOrNull("overallSimulationTimeoutMs")) + c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Debug.StuckAgentDetection + .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class TriggerMeasurer( - enabled : scala.Boolean, - writeStuckAgentDetectionConfig : scala.Boolean + enabled: scala.Boolean, + writeStuckAgentDetectionConfig: scala.Boolean ) + object TriggerMeasurer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = + !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram : scala.Boolean + createGCClassHistogram: scala.Boolean ) + object VmInformation { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), - agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - maxSimulationStepTimeBeforeConsideredStuckMin = if(c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") else 60, - memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), - vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), - writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor( + if (c.hasPathOrNull("actor")) c.getConfig("actor") + else com.typesafe.config.ConfigFactory.parseString("actor{}") + ), + agentTripScoresInterval = + if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = + c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = + if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + maxSimulationStepTimeBeforeConsideredStuckMin = + if (c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) + c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") + else 60, + memoryConsumptionDisplayTimeoutInSec = + if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) + c.getInt("memoryConsumptionDisplayTimeoutInSec") + else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = + if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) + c.getInt("secondsToWaitToClearRoutedOutstandingWork") + else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( + if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") + else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") + ), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( + if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") + else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") + ), + vmInformation = BeamConfig.Beam.Debug.VmInformation( + if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") + else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") + ), + writeModeChoiceAlternatives = + c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = + c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output : BeamConfig.Beam.Exchange.Output, - scenario : BeamConfig.Beam.Exchange.Scenario + output: BeamConfig.Beam.Exchange.Output, + scenario: BeamConfig.Beam.Exchange.Scenario ) + object Exchange { + case class Output( - activitySimSkimsEnabled : scala.Boolean, - geo : BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled: scala.Boolean, + geo: BeamConfig.Beam.Exchange.Output.Geo ) + object Output { + case class Geo( - filePath : scala.Option[java.lang.String] + filePath: scala.Option[java.lang.String] ) + object Geo { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")) + activitySimSkimsEnabled = + c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo( + if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") + ) ) } } - + case class Scenario( - convertWgs2Utm : scala.Boolean, - fileFormat : java.lang.String, - folder : java.lang.String, - modeMap : scala.Option[scala.List[java.lang.String]], - source : java.lang.String, - urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm: scala.Boolean, + fileFormat: java.lang.String, + folder: java.lang.String, + modeMap: scala.Option[scala.List[java.lang.String]], + source: java.lang.String, + urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim ) + object Scenario { + case class Urbansim( - activitySimEnabled : scala.Boolean + activitySimEnabled: scala.Boolean ) + object Urbansim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) + fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) + output = BeamConfig.Beam.Exchange.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + scenario = BeamConfig.Beam.Exchange.Scenario( + if (c.hasPathOrNull("scenario")) c.getConfig("scenario") + else com.typesafe.config.ConfigFactory.parseString("scenario{}") + ) ) } } - + case class Experimental( - optimizer : BeamConfig.Beam.Experimental.Optimizer + optimizer: BeamConfig.Beam.Experimental.Optimizer ) + object Experimental { + case class Optimizer( - enabled : scala.Boolean + enabled: scala.Boolean ) + object Optimizer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) + optimizer = BeamConfig.Beam.Experimental.Optimizer( + if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") + else com.typesafe.config.ConfigFactory.parseString("optimizer{}") + ) ) } } - + case class Input( - lastBaseOutputDir : java.lang.String, - simulationPrefix : java.lang.String + lastBaseOutputDir: java.lang.String, + simulationPrefix: java.lang.String ) + object Input { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn : scala.Boolean + keepConsoleAppenderOn: scala.Boolean ) + object Logger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level : java.lang.String + level: java.lang.String ) + object Metrics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation : scala.Boolean + writePlansAndStopSimulation: scala.Boolean ) + object Output { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = + c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory : scala.Boolean, - baseOutputDirectory : java.lang.String, - collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, - defaultWriteInterval : scala.Int, - displayPerformanceTimings : scala.Boolean, - events : BeamConfig.Beam.Outputs.Events, - generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval : scala.Int, - matsim : BeamConfig.Beam.Outputs.Matsim, - stats : BeamConfig.Beam.Outputs.Stats, - writeAnalysis : scala.Boolean, - writeEventsInterval : scala.Int, - writeGraphs : scala.Boolean, - writePlansInterval : scala.Int, - writeR5RoutesInterval : scala.Int + addTimestampToOutputDirectory: scala.Boolean, + baseOutputDirectory: java.lang.String, + collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, + defaultWriteInterval: scala.Int, + displayPerformanceTimings: scala.Boolean, + events: BeamConfig.Beam.Outputs.Events, + generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval: scala.Int, + matsim: BeamConfig.Beam.Outputs.Matsim, + stats: BeamConfig.Beam.Outputs.Stats, + writeAnalysis: scala.Boolean, + writeEventsInterval: scala.Int, + writeGraphs: scala.Boolean, + writePlansInterval: scala.Int, + writeR5RoutesInterval: scala.Int ) + object Outputs { + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime : scala.Int, - startTime : scala.Int + endTime: scala.Int, + startTime: scala.Int ) + object GeneralizedLinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles : java.lang.String, - deleteRootFolderFiles : java.lang.String + deleteITERSFolderFiles: java.lang.String, + deleteRootFolderFiles: java.lang.String ) + object Matsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = + if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = + if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize : scala.Int + binSize: scala.Int ) + object Stats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), - defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), - generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), - stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = + !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = + if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = + !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( + "collectAndCreateBeamAnalysisAndGraphs" + ), + defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( + if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") + else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") + ), + generalizedLinkStatsInterval = + if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ), + stats = BeamConfig.Beam.Outputs.Stats( + if (c.hasPathOrNull("stats")) c.getConfig("stats") + else com.typesafe.config.ConfigFactory.parseString("stats{}") + ), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim : BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager : BeamConfig.Beam.Physsim.EventManager, - events : BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia : scala.Boolean, - eventsSampling : scala.Double, - flowCapacityFactor : scala.Double, - initializeRouterWithFreeFlowTimes : scala.Boolean, - inputNetworkFilePath : java.lang.String, - jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize : scala.Int, - linkStatsWriteInterval : scala.Int, - maxLinkLengthToApplySpeedScalingFactor : scala.Double, - name : java.lang.String, - network : BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath : java.lang.String, - parbprsim : BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize : scala.Double, - quick_fix_minCarSpeedInMetersPerSecond : scala.Double, - relaxation : BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim : scala.Boolean, - speedScalingFactor : scala.Double, - storageCapacityFactor : scala.Double, - writeEventsInterval : scala.Int, - writePlansInterval : scala.Int, - writeRouteHistoryInterval : scala.Int + bprsim: BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager: BeamConfig.Beam.Physsim.EventManager, + events: BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia: scala.Boolean, + eventsSampling: scala.Double, + flowCapacityFactor: scala.Double, + initializeRouterWithFreeFlowTimes: scala.Boolean, + inputNetworkFilePath: java.lang.String, + jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize: scala.Int, + linkStatsWriteInterval: scala.Int, + maxLinkLengthToApplySpeedScalingFactor: scala.Double, + name: java.lang.String, + network: BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath: java.lang.String, + parbprsim: BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize: scala.Double, + quick_fix_minCarSpeedInMetersPerSecond: scala.Double, + relaxation: BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim: scala.Boolean, + speedScalingFactor: scala.Double, + storageCapacityFactor: scala.Double, + writeEventsInterval: scala.Int, + writePlansInterval: scala.Int, + writeRouteHistoryInterval: scala.Int ) + object Physsim { + case class Bprsim( - inFlowAggregationTimeWindowInSeconds : scala.Int, - minFlowToUseBPRFunction : scala.Int, - travelTimeFunction : java.lang.String + inFlowAggregationTimeWindowInSeconds: scala.Int, + minFlowToUseBPRFunction: scala.Int, + travelTimeFunction: java.lang.String ) + object Bprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, - minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = + if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) + c.getInt("inFlowAggregationTimeWindowInSeconds") + else 900, + minFlowToUseBPRFunction = + if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor : scala.Double + congestionFactor: scala.Double ) + object CchRoutingAssignment { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax : scala.Int, - departureTimeShiftMin : scala.Int, - fractionOfEventsToDuplicate : scala.Double + departureTimeShiftMax: scala.Int, + departureTimeShiftMin: scala.Int, + fractionOfEventsToDuplicate: scala.Double ) + object DuplicatePTE { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = + if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = + if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = + if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads : scala.Int, - `type` : java.lang.String + numberOfThreads: scala.Int, + `type`: java.lang.String ) + object EventManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) + object Jdeqsim { + case class AgentSimPhysSimInterfaceDebugger( - enabled : scala.Boolean + enabled: scala.Boolean ) + object AgentSimPhysSimInterfaceDebugger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, - capacityPlansWriteInterval : scala.Int, - enabled : scala.Boolean, - minRoadCapacity : scala.Int, - minSpeedMetersPerSec : scala.Int, - speedAdjustmentFactor : scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, + capacityPlansWriteInterval: scala.Int, + enabled: scala.Boolean, + minRoadCapacity: scala.Int, + minSpeedMetersPerSec: scala.Int, + speedAdjustmentFactor: scala.Double ) + object Cacc { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, - capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = + if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) + c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") + else 1.3, + capacityPlansWriteInterval = + if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = + if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = + if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( + if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") + else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") + ), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( + if (c.hasPathOrNull("cacc")) c.getConfig("cacc") + else com.typesafe.config.ConfigFactory.parseString("cacc{}") + ) ) } } - + case class Network( - maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties, - removeIslands : scala.Boolean + maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties, + removeIslands: scala.Boolean ) + object Network { + case class MaxSpeedInference( - enabled : scala.Boolean, - `type` : java.lang.String + enabled: scala.Boolean, + `type`: java.lang.String ) + object MaxSpeedInference { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled : scala.Boolean, - livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled: scala.Boolean, + livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) + object OverwriteRoadTypeProperties { + case class LivingStreet( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object LivingStreet { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Minor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Motorway { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object MotorwayLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Primary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object PrimaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Residential { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Secondary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object SecondaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Tertiary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TertiaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Trunk { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TrunkLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Unclassified { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( + if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") + else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") + ), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( + if (c.hasPathOrNull("minor")) c.getConfig("minor") + else com.typesafe.config.ConfigFactory.parseString("minor{}") + ), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( + if (c.hasPathOrNull("motorway")) c.getConfig("motorway") + else com.typesafe.config.ConfigFactory.parseString("motorway{}") + ), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( + if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") + else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") + ), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( + if (c.hasPathOrNull("primary")) c.getConfig("primary") + else com.typesafe.config.ConfigFactory.parseString("primary{}") + ), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( + if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") + else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") + ), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( + if (c.hasPathOrNull("residential")) c.getConfig("residential") + else com.typesafe.config.ConfigFactory.parseString("residential{}") + ), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( + if (c.hasPathOrNull("secondary")) c.getConfig("secondary") + else com.typesafe.config.ConfigFactory.parseString("secondary{}") + ), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( + if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") + else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") + ), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( + if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") + else com.typesafe.config.ConfigFactory.parseString("tertiary{}") + ), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( + if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") + else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") + ), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( + if (c.hasPathOrNull("trunk")) c.getConfig("trunk") + else com.typesafe.config.ConfigFactory.parseString("trunk{}") + ), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( + if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") + else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") + ), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( + if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") + else com.typesafe.config.ConfigFactory.parseString("unclassified{}") + ) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")), - removeIslands = !c.hasPathOrNull("removeIslands") || c.getBoolean("removeIslands") + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( + if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") + else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") + ), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( + if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") + else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") + ), + removeIslands = !c.hasPathOrNull("removeIslands") || c.getBoolean("removeIslands") ) } } - + case class Parbprsim( - numberOfClusters : scala.Int, - syncInterval : scala.Int + numberOfClusters: scala.Int, + syncInterval: scala.Int ) + object Parbprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier : scala.Double, - enabled : scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime : scala.Int + additionalTravelTimeMultiplier: scala.Double, + enabled: scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime: scala.Int ) + object PickUpDropOffAnalysis { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 + additionalTravelTimeMultiplier = + if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") + else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = + if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) + c.getInt("secondsFromPickUpPropOffToAffectTravelTime") + else 600 ) } } - + case class Relaxation( - experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type` : java.lang.String + experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type`: java.lang.String ) + object Relaxation { + case class Experiment20( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment20 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment21 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment30 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment40 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment50 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment51 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment52 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( + if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") + else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") + ), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( + if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") + else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") + ), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( + if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") + else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") + ), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( + if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") + else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") + ), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( + if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") + else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") + ), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( + if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") + else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") + ), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( + if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") + else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") + ), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), - eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), - events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), - linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, - name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), - ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim( + if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") + else com.typesafe.config.ConfigFactory.parseString("bprsim{}") + ), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( + if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") + else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") + ), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( + if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") + else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") + ), + eventManager = BeamConfig.Beam.Physsim.EventManager( + if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") + else com.typesafe.config.ConfigFactory.parseString("eventManager{}") + ), + events = BeamConfig.Beam.Physsim.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + eventsForFullVersionOfVia = + !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = + !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = + if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") + else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( + if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") + else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") + ), + linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = + if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = + if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) + c.getDouble("maxLinkLengthToApplySpeedScalingFactor") + else 50.0, + name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + overwriteLinkParamPath = + if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim( + if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") + else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") + ), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( + if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") + else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") + ), + ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = + if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) + c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") + else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation( + if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") + else com.typesafe.config.ConfigFactory.parseString("relaxation{}") + ), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = + if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = + if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1 : scala.Double, - ModuleProbability_2 : scala.Double, - ModuleProbability_3 : scala.Double, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - clearModes : BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation : scala.Double, - maxAgentPlanMemorySize : scala.Int + ModuleProbability_1: scala.Double, + ModuleProbability_2: scala.Double, + ModuleProbability_3: scala.Double, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + clearModes: BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation: scala.Double, + maxAgentPlanMemorySize: scala.Int ) + object Replanning { + case class ClearModes( - iteration : scala.Int, - modes : scala.Option[scala.List[java.lang.String]], - strategy : java.lang.String + iteration: scala.Int, + modes: scala.Option[scala.List[java.lang.String]], + strategy: java.lang.String ) + object ClearModes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes( + if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") + else com.typesafe.config.ConfigFactory.parseString("clearModes{}") + ), + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getDouble("fractionOfIterationsToDisableInnovation") + else Double.PositiveInfinity, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim : BeamConfig.Beam.Router.Skim + skim: BeamConfig.Beam.Router.Skim ) + object Router { + case class Skim( - activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims : scala.Int, - origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval : scala.Int, - writeSkimsInterval : scala.Int + activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims: scala.Int, + origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval: scala.Int, + writeSkimsInterval: scala.Int ) + object Skim { + case class ActivitySimSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object ActivitySimSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object DriveTimeSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", - name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") + else "skimsTravelTimeObservedVsSimulated", + name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String, - poolingTravelTimeOveheadFactor : scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, - writeFullSkimsInterval : scala.Int + fileBaseName: java.lang.String, + name: java.lang.String, + poolingTravelTimeOveheadFactor: scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, + writeFullSkimsInterval: scala.Int ) + object OriginDestinationSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, - writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = + if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") + else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = + if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) + c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") + else 0, + writeFullSkimsInterval = + if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName : java.lang.String, - geoHierarchy : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + geoHierarchy: java.lang.String, + name: java.lang.String ) + object TazSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object TransitCrowdingSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), - keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), - writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( + if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") + else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") + ), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( + if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") + else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") + ), + keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( + if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") + else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") + ), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( + if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") + else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") + ), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( + if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") + else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") + ), + writeAggregatedSkimsInterval = + if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) + skim = BeamConfig.Beam.Router.Skim( + if (c.hasPathOrNull("skim")) c.getConfig("skim") + else com.typesafe.config.ConfigFactory.parseString("skim{}") + ) ) } } - + case class Routing( - baseDate : java.lang.String, - carRouter : java.lang.String, - gh : BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS : scala.Int, - overrideNetworkTravelTimesUsingSkims : scala.Boolean, - r5 : BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor : scala.Double, - startingIterationForTravelTimesMSA : scala.Int, - transitOnStreetNetwork : scala.Boolean, - writeRoutingStatistic : scala.Boolean + baseDate: java.lang.String, + carRouter: java.lang.String, + gh: BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS: scala.Int, + overrideNetworkTravelTimesUsingSkims: scala.Boolean, + r5: BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor: scala.Double, + startingIterationForTravelTimesMSA: scala.Int, + transitOnStreetNetwork: scala.Boolean, + writeRoutingStatistic: scala.Boolean ) + object Routing { + case class Gh( - useAlternativeRoutes : scala.Boolean + useAlternativeRoutes: scala.Boolean ) + object Gh { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath : java.lang.String, - bikeLaneScaleFactor : scala.Double, - departureWindow : scala.Double, - directory : java.lang.String, - directory2 : scala.Option[java.lang.String], - linkRadiusMeters : scala.Double, - mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples : scala.Int, - osmMapdbFile : java.lang.String, - travelTimeNoiseFraction : scala.Double + bikeLaneLinkIdsFilePath: java.lang.String, + bikeLaneScaleFactor: scala.Double, + departureWindow: scala.Double, + directory: java.lang.String, + directory2: scala.Option[java.lang.String], + linkRadiusMeters: scala.Double, + mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples: scala.Int, + osmMapdbFile: java.lang.String, + travelTimeNoiseFraction: scala.Double ) + object R5 { + case class MNetBuilder( - fromCRS : java.lang.String, - toCRS : java.lang.String + fromCRS: java.lang.String, + toCRS: java.lang.String ) + object MNetBuilder { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike : scala.Int + bike: scala.Int ) + object MaxDistanceLimitByModeInMeters { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), - numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = + if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = + if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( + if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") + else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") + ), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( + if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") + ), + numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmMapdbFile = + if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") + else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = + if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), - minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, - overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), - r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), - skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh( + if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") + ), + minimumPossibleSkimBasedTravelTimeInS = + if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) + c.getInt("minimumPossibleSkimBasedTravelTimeInS") + else 60, + overrideNetworkTravelTimesUsingSkims = + c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( + "overrideNetworkTravelTimesUsingSkims" + ), + r5 = BeamConfig.Beam.Routing.R5( + if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") + ), + skimTravelTimesScalingFactor = + if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = + if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") + else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric : BeamConfig.Beam.Sim.Metric, - termination : BeamConfig.Beam.Sim.Termination + metric: BeamConfig.Beam.Sim.Metric, + termination: BeamConfig.Beam.Sim.Termination ) + object Sim { + case class Metric( - collector : BeamConfig.Beam.Sim.Metric.Collector + collector: BeamConfig.Beam.Sim.Metric.Collector ) + object Metric { + case class Collector( - influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics : java.lang.String + influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics: java.lang.String ) + object Collector { + case class InfluxDbSimulationMetricCollector( - connectionString : java.lang.String, - database : java.lang.String + connectionString: java.lang.String, + database: java.lang.String ) + object InfluxDbSimulationMetricCollector { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = + if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), - metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = + BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( + if (c.hasPathOrNull("influxDbSimulationMetricCollector")) + c.getConfig("influxDbSimulationMetricCollector") + else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") + ), + metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) + collector = BeamConfig.Beam.Sim.Metric.Collector( + if (c.hasPathOrNull("collector")) c.getConfig("collector") + else com.typesafe.config.ConfigFactory.parseString("collector{}") + ) ) } } - + case class Termination( - criterionName : java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName: java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) + object Termination { + case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration : scala.Int, - minLastIteration : scala.Int, - relativeTolerance : scala.Double + maxLastIteration: scala.Int, + minLastIteration: scala.Int, + relativeTolerance: scala.Double ) + object TerminateAtRideHailFleetStoredElectricityConvergence { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) + criterionName = + if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = + BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( + if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) + c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") + else + com.typesafe.config.ConfigFactory + .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), - termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) + metric = BeamConfig.Beam.Sim.Metric( + if (c.hasPathOrNull("metric")) c.getConfig("metric") + else com.typesafe.config.ConfigFactory.parseString("metric{}") + ), + termination = BeamConfig.Beam.Sim.Termination( + if (c.hasPathOrNull("termination")) c.getConfig("termination") + else com.typesafe.config.ConfigFactory.parseString("termination{}") + ) ) } } - + case class Spatial( - boundingBoxBuffer : scala.Int, - localCRS : java.lang.String + boundingBoxBuffer: scala.Int, + localCRS: java.lang.String ) + object Spatial { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear ) + object Urbansim { + case class BackgroundODSkimsCreator( - calculationTimeoutHours : scala.Int, - enabled : scala.Boolean, - maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes : scala.Int, - peakHours : scala.Option[scala.List[scala.Double]], - routerType : java.lang.String, - skimsGeoType : java.lang.String, - skimsKind : java.lang.String + calculationTimeoutHours: scala.Int, + enabled: scala.Boolean, + maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes: scala.Int, + peakHours: scala.Option[scala.List[scala.Double]], + routerType: java.lang.String, + skimsGeoType: java.lang.String, + skimsKind: java.lang.String ) + object BackgroundODSkimsCreator { + case class MaxTravelDistanceInMeters( - bike : scala.Int, - walk : scala.Int + bike: scala.Int, + walk: scala.Int ) + object MaxTravelDistanceInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive : scala.Boolean, - transit : scala.Boolean, - walk : scala.Boolean + drive: scala.Boolean, + transit: scala.Boolean, + walk: scala.Boolean ) + object ModesToBuild { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), - numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = + if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( + if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") + ), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( + if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") + else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") + ), + numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes : scala.Double, - bike : scala.Double, - car : scala.Double, - drive_transit : scala.Double, - walk : scala.Double, - walk_transit : scala.Double + allModes: scala.Double, + bike: scala.Double, + car: scala.Double, + drive_transit: scala.Double, + walk: scala.Double, + walk_transit: scala.Double ) + object FractionOfModesToClear { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( + if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") + else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") + ), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( + if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") + else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") + ) ) } } - + case class WarmStart( - path : java.lang.String, - prepareData : scala.Boolean, - samplePopulationIntegerFlag : scala.Int, - skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type` : java.lang.String + path: java.lang.String, + prepareData: scala.Boolean, + samplePopulationIntegerFlag: scala.Int, + skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type`: java.lang.String ) + object WarmStart { + case class SkimsFilePaths$Elm( - skimType : java.lang.String, - skimsFilePath : java.lang.String + skimType: java.lang.String, + skimsFilePath: java.lang.String ) + object SkimsFilePaths$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if(c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if (c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = + if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = + if (c.hasPathOrNull("skimsFilePaths")) + scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) + else None, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), - calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), - cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), - debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), - exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), - experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), - input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), - inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), - metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), - output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), - physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), - replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), - routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), - sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), - spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), - urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) + actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim( + if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") + else com.typesafe.config.ConfigFactory.parseString("agentsim{}") + ), + calibration = BeamConfig.Beam.Calibration( + if (c.hasPathOrNull("calibration")) c.getConfig("calibration") + else com.typesafe.config.ConfigFactory.parseString("calibration{}") + ), + cluster = BeamConfig.Beam.Cluster( + if (c.hasPathOrNull("cluster")) c.getConfig("cluster") + else com.typesafe.config.ConfigFactory.parseString("cluster{}") + ), + debug = BeamConfig.Beam.Debug( + if (c.hasPathOrNull("debug")) c.getConfig("debug") + else com.typesafe.config.ConfigFactory.parseString("debug{}") + ), + exchange = BeamConfig.Beam.Exchange( + if (c.hasPathOrNull("exchange")) c.getConfig("exchange") + else com.typesafe.config.ConfigFactory.parseString("exchange{}") + ), + experimental = BeamConfig.Beam.Experimental( + if (c.hasPathOrNull("experimental")) c.getConfig("experimental") + else com.typesafe.config.ConfigFactory.parseString("experimental{}") + ), + input = BeamConfig.Beam.Input( + if (c.hasPathOrNull("input")) c.getConfig("input") + else com.typesafe.config.ConfigFactory.parseString("input{}") + ), + inputDirectory = + if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger( + if (c.hasPathOrNull("logger")) c.getConfig("logger") + else com.typesafe.config.ConfigFactory.parseString("logger{}") + ), + metrics = BeamConfig.Beam.Metrics( + if (c.hasPathOrNull("metrics")) c.getConfig("metrics") + else com.typesafe.config.ConfigFactory.parseString("metrics{}") + ), + output = BeamConfig.Beam.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + outputs = BeamConfig.Beam.Outputs( + if (c.hasPathOrNull("outputs")) c.getConfig("outputs") + else com.typesafe.config.ConfigFactory.parseString("outputs{}") + ), + physsim = BeamConfig.Beam.Physsim( + if (c.hasPathOrNull("physsim")) c.getConfig("physsim") + else com.typesafe.config.ConfigFactory.parseString("physsim{}") + ), + replanning = BeamConfig.Beam.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + router = BeamConfig.Beam.Router( + if (c.hasPathOrNull("router")) c.getConfig("router") + else com.typesafe.config.ConfigFactory.parseString("router{}") + ), + routing = BeamConfig.Beam.Routing( + if (c.hasPathOrNull("routing")) c.getConfig("routing") + else com.typesafe.config.ConfigFactory.parseString("routing{}") + ), + sim = BeamConfig.Beam.Sim( + if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") + ), + spatial = BeamConfig.Beam.Spatial( + if (c.hasPathOrNull("spatial")) c.getConfig("spatial") + else com.typesafe.config.ConfigFactory.parseString("spatial{}") + ), + urbansim = BeamConfig.Beam.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart( + if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") + else com.typesafe.config.ConfigFactory.parseString("warmStart{}") + ) ) } } - + case class Matsim( - conversion : BeamConfig.Matsim.Conversion, - modules : BeamConfig.Matsim.Modules + conversion: BeamConfig.Matsim.Conversion, + modules: BeamConfig.Matsim.Modules ) + object Matsim { + case class Conversion( - defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles : scala.Boolean, - matsimNetworkFile : java.lang.String, - osmFile : java.lang.String, - populationFile : java.lang.String, - scenarioDirectory : java.lang.String, - shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile : java.lang.String + defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles: scala.Boolean, + matsimNetworkFile: java.lang.String, + osmFile: java.lang.String, + populationFile: java.lang.String, + scenarioDirectory: java.lang.String, + shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile: java.lang.String ) + object Conversion { + case class DefaultHouseholdIncome( - currency : java.lang.String, - period : java.lang.String, - value : scala.Int + currency: java.lang.String, + period: java.lang.String, + value: scala.Int ) + object DefaultHouseholdIncome { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if(c.hasPathOrNull("period")) c.getString("period") else "year", - value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if (c.hasPathOrNull("period")) c.getString("period") else "year", + value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile : java.lang.String, - tazIdFieldName : java.lang.String + shapeFile: java.lang.String, + tazIdFieldName: java.lang.String ) + object ShapeConfig { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( + if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") + else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") + ), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = + if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = + if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = + if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") + else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( + if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") + else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") + ), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode : BeamConfig.Matsim.Modules.ChangeMode, - controler : BeamConfig.Matsim.Modules.Controler, - counts : BeamConfig.Matsim.Modules.Counts, - global : BeamConfig.Matsim.Modules.Global, - households : BeamConfig.Matsim.Modules.Households, - linkStats : BeamConfig.Matsim.Modules.LinkStats, - network : BeamConfig.Matsim.Modules.Network, - parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, - plans : BeamConfig.Matsim.Modules.Plans, - qsim : BeamConfig.Matsim.Modules.Qsim, - strategy : BeamConfig.Matsim.Modules.Strategy, - transit : BeamConfig.Matsim.Modules.Transit, - vehicles : BeamConfig.Matsim.Modules.Vehicles + changeMode: BeamConfig.Matsim.Modules.ChangeMode, + controler: BeamConfig.Matsim.Modules.Controler, + counts: BeamConfig.Matsim.Modules.Counts, + global: BeamConfig.Matsim.Modules.Global, + households: BeamConfig.Matsim.Modules.Households, + linkStats: BeamConfig.Matsim.Modules.LinkStats, + network: BeamConfig.Matsim.Modules.Network, + parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, + plans: BeamConfig.Matsim.Modules.Plans, + qsim: BeamConfig.Matsim.Modules.Qsim, + strategy: BeamConfig.Matsim.Modules.Strategy, + transit: BeamConfig.Matsim.Modules.Transit, + vehicles: BeamConfig.Matsim.Modules.Vehicles ) + object Modules { + case class ChangeMode( - modes : java.lang.String + modes: java.lang.String ) + object ChangeMode { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat : java.lang.String, - firstIteration : scala.Int, - lastIteration : scala.Int, - mobsim : java.lang.String, - outputDirectory : java.lang.String, - overwriteFiles : java.lang.String + eventsFileFormat: java.lang.String, + firstIteration: scala.Int, + lastIteration: scala.Int, + mobsim: java.lang.String, + outputDirectory: java.lang.String, + overwriteFiles: java.lang.String ) + object Controler { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = + if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Double, - inputCountsFile : java.lang.String, - outputformat : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Double, + inputCountsFile: java.lang.String, + outputformat: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem : java.lang.String, - randomSeed : scala.Int + coordinateSystem: java.lang.String, + randomSeed: scala.Int ) + object Global { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile : java.lang.String, - inputHouseholdAttributesFile : java.lang.String + inputFile: java.lang.String, + inputHouseholdAttributesFile: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" + inputFile = + if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = + if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") + else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations : scala.Int, - writeLinkStatsInterval : scala.Int + averageLinkStatsOverIterations: scala.Int, + writeLinkStatsInterval: scala.Int ) + object LinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = + if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = + if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile : java.lang.String + inputNetworkFile: java.lang.String ) + object Network { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = + if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") + else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents : scala.Int, - numberOfThreads : scala.Int, - oneThreadPerHandler : scala.Boolean, - synchronizeOnSimSteps : scala.Boolean + estimatedNumberOfEvents: scala.Int, + numberOfThreads: scala.Int, + oneThreadPerHandler: scala.Boolean, + synchronizeOnSimSteps: scala.Boolean ) + object ParallelEventHandling { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = + if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta : scala.Long, - earlyDeparture : scala.Long, - lateArrival : scala.Long, - learningRate : scala.Long, - parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing : scala.Long, - traveling : scala.Long, - waiting : scala.Long, - writeExperiencedPlans : scala.Boolean + BrainExpBeta: scala.Long, + earlyDeparture: scala.Long, + lateArrival: scala.Long, + learningRate: scala.Long, + parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing: scala.Long, + traveling: scala.Long, + waiting: scala.Long, + writeExperiencedPlans: scala.Boolean ) + object PlanCalcScore { + case class Parameterset$Elm( - activityType : java.lang.String, - priority : scala.Int, - scoringThisActivityAtAll : scala.Boolean, - `type` : java.lang.String, - typicalDuration : java.lang.String, - typicalDurationScoreComputation : java.lang.String + activityType: java.lang.String, + priority: scala.Int, + scoringThisActivityAtAll: scala.Boolean, + `type`: java.lang.String, + typicalDuration: java.lang.String, + typicalDurationScoreComputation: java.lang.String ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" + activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = + !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = + if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") + else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, - earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, - lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, - learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, - traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, - waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + BrainExpBeta = + if (c.hasPathOrNull("BrainExpBeta")) + c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) + else 2, + earlyDeparture = + if (c.hasPathOrNull("earlyDeparture")) + c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, + lateArrival = + if (c.hasPathOrNull("lateArrival")) + c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) + else -18, + learningRate = + if (c.hasPathOrNull("learningRate")) + c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) + else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = + if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) + else 6, + traveling = + if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) + else -6, + waiting = + if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.PlanCalcScore + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Plans( - inputPersonAttributesFile : java.lang.String, - inputPlansFile : java.lang.String + inputPersonAttributesFile: java.lang.String, + inputPlansFile: java.lang.String ) + object Plans { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" + inputPersonAttributesFile = + if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") + else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = + if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") + else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime : java.lang.String, - snapshotperiod : java.lang.String, - startTime : java.lang.String + endTime: java.lang.String, + snapshotperiod: java.lang.String, + startTime: java.lang.String ) + object Qsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1 : scala.Int, - ModuleProbability_2 : scala.Int, - ModuleProbability_3 : scala.Int, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - fractionOfIterationsToDisableInnovation : scala.Int, - maxAgentPlanMemorySize : scala.Int, - parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval : java.lang.String + ModuleProbability_1: scala.Int, + ModuleProbability_2: scala.Int, + ModuleProbability_3: scala.Int, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + fractionOfIterationsToDisableInnovation: scala.Int, + maxAgentPlanMemorySize: scala.Int, + parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval: java.lang.String ) + object Strategy { + case class Parameterset$Elm( - disableAfterIteration : scala.Int, - strategyName : java.lang.String, - `type` : java.lang.String, - weight : scala.Int + disableAfterIteration: scala.Int, + strategyName: java.lang.String, + `type`: java.lang.String, + weight: scala.Int ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" - ) - } - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getInt("fractionOfIterationsToDisableInnovation") + else 999999, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = + if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") + else "WorstPlanForRemovalSelector" + ) + } + + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.Strategy + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Transit( - transitModes : java.lang.String, - useTransit : scala.Boolean, - vehiclesFile : java.lang.String + transitModes: java.lang.String, + useTransit: scala.Boolean, + vehiclesFile: java.lang.String ) + object Transit { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile : java.lang.String + vehiclesFile: java.lang.String ) + object Vehicles { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), - controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), - counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), - households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), - network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), - plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), - strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), - transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), - vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + changeMode = BeamConfig.Matsim.Modules.ChangeMode( + if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") + else com.typesafe.config.ConfigFactory.parseString("changeMode{}") + ), + controler = BeamConfig.Matsim.Modules.Controler( + if (c.hasPathOrNull("controler")) c.getConfig("controler") + else com.typesafe.config.ConfigFactory.parseString("controler{}") + ), + counts = BeamConfig.Matsim.Modules.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + global = BeamConfig.Matsim.Modules.Global( + if (c.hasPathOrNull("global")) c.getConfig("global") + else com.typesafe.config.ConfigFactory.parseString("global{}") + ), + households = BeamConfig.Matsim.Modules.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + linkStats = BeamConfig.Matsim.Modules.LinkStats( + if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") + else com.typesafe.config.ConfigFactory.parseString("linkStats{}") + ), + network = BeamConfig.Matsim.Modules.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( + if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") + else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") + ), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( + if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") + else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") + ), + plans = BeamConfig.Matsim.Modules.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + qsim = BeamConfig.Matsim.Modules.Qsim( + if (c.hasPathOrNull("qsim")) c.getConfig("qsim") + else com.typesafe.config.ConfigFactory.parseString("qsim{}") + ), + strategy = BeamConfig.Matsim.Modules.Strategy( + if (c.hasPathOrNull("strategy")) c.getConfig("strategy") + else com.typesafe.config.ConfigFactory.parseString("strategy{}") + ), + transit = BeamConfig.Matsim.Modules.Transit( + if (c.hasPathOrNull("transit")) c.getConfig("transit") + else com.typesafe.config.ConfigFactory.parseString("transit{}") + ), + vehicles = BeamConfig.Matsim.Modules.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), - modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) + conversion = BeamConfig.Matsim.Conversion( + if (c.hasPathOrNull("conversion")) c.getConfig("conversion") + else com.typesafe.config.ConfigFactory.parseString("conversion{}") + ), + modules = BeamConfig.Matsim.Modules( + if (c.hasPathOrNull("modules")) c.getConfig("modules") + else com.typesafe.config.ConfigFactory.parseString("modules{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), - matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) + beam = BeamConfig.Beam( + if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") + ), + matsim = BeamConfig.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ) ) } - private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + + private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { + + private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") + if ( + (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number] + ) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { + + private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException(cv.origin.lineNumber + + new java.lang.RuntimeException( + cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) + ) } - private def $_str(cv:com.typesafe.config.ConfigValue) = + + private def $_str(cv: com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } - From c91e65d5d7ad8954e3086713e07ba8da2b635aa2 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 2 Aug 2022 10:29:18 -0700 Subject: [PATCH 268/307] write missed linkIds --- .../beam/agentsim/agents/PersonAgent.scala | 4 -- .../infrastructure/taz/TAZTreeMap.scala | 46 ++++++++++++++++++- src/main/scala/beam/sim/BeamSim.scala | 2 + 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index d4581ba0ea0..b154e5f6ae8 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1482,14 +1482,10 @@ class PersonAgent( .getOrElse("NA") (origGeo, destGeo) } else { - beamScenario.exchangeGeoMap match { case Some(geoMap) => val origGeo = geoMap.getTAZ(origCoord) val destGeo = geoMap.getTAZ(destCoord) - logger.warn( - s"Could not find linkId->taz mapping so falling back on default: Trip from $origGeo to $destGeo" - ) (origGeo.tazId.toString, destGeo.tazId.toString) case None => (odSkimmerEvent.origin, odSkimmerEvent.destination) diff --git a/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala b/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala index 06019ea6463..1db2106b80c 100755 --- a/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala +++ b/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala @@ -5,13 +5,18 @@ import beam.utils.SnapCoordinateUtils.SnapLocationHelper import beam.utils.matsim_conversion.ShapeUtils import beam.utils.matsim_conversion.ShapeUtils.{HasQuadBounds, QuadTreeBounds} import com.vividsolutions.jts.geom.Geometry +import org.matsim.api.core.v01.events.Event import org.matsim.api.core.v01.network.{Link, Network} import org.matsim.api.core.v01.{Coord, Id} import org.matsim.core.utils.collections.QuadTree import org.matsim.core.utils.geometry.GeometryUtils import org.matsim.core.utils.gis.ShapeFileReader +import org.matsim.core.utils.io.IOUtils import org.opengis.feature.simple.SimpleFeature import org.slf4j.LoggerFactory +import org.matsim.core.controler.events.IterationEndsEvent +import org.matsim.core.controler.listener.IterationEndsListener +import org.matsim.core.events.handler.BasicEventHandler import java.io._ import java.util @@ -28,7 +33,9 @@ import scala.collection.mutable * by avoiding unnecessary queries). The caching mechanism is however still useful for debugging and as a quickfix/confirmation if TAZ quadtree queries * suddenly increase due to code change. */ -class TAZTreeMap(val tazQuadTree: QuadTree[TAZ], val useCache: Boolean = false) { +class TAZTreeMap(val tazQuadTree: QuadTree[TAZ], val useCache: Boolean = false) + extends BasicEventHandler + with IterationEndsListener { private val stringIdToTAZMapping: mutable.HashMap[String, TAZ] = mutable.HashMap() val idToTAZMapping: mutable.HashMap[Id[TAZ], TAZ] = mutable.HashMap() @@ -36,11 +43,14 @@ class TAZTreeMap(val tazQuadTree: QuadTree[TAZ], val useCache: Boolean = false) private val linkIdToTAZMapping: mutable.HashMap[Id[Link], Id[TAZ]] = mutable.HashMap.empty[Id[Link], Id[TAZ]] private val unmatchedLinkIds: mutable.ListBuffer[Id[Link]] = mutable.ListBuffer.empty[Id[Link]] lazy val tazListContainsGeoms: Boolean = tazQuadTree.values().asScala.headOption.exists(_.geometry.isDefined) + private val failedLinkLookups: mutable.ListBuffer[Id[Link]] = mutable.ListBuffer.empty[Id[Link]] def getTAZfromLink(linkId: Id[Link]): Option[TAZ] = { linkIdToTAZMapping.get(linkId) match { case Some(tazId) => getTAZ(tazId) - case _ => None + case _ => + failedLinkLookups.append(linkId) + None } } @@ -81,6 +91,38 @@ class TAZTreeMap(val tazQuadTree: QuadTree[TAZ], val useCache: Boolean = false) tazQuadTree.getDisk(loc.getX, loc.getY, radius) } + override def handleEvent(event: Event): Unit = {} + + override def notifyIterationEnds(event: IterationEndsEvent): Unit = { + writeFailedLookupsToCsv(event) + } + + private def writeFailedLookupsToCsv(event: IterationEndsEvent): Unit = { + if (tazListContainsGeoms) { + val filePath = event.getServices.getControlerIO.getIterationFilename( + event.getServices.getIterationNumber, + "linksWithFailedTAZlookup.csv.gz" + ) + val numberOfFailedLookups = failedLinkLookups.size + logger.info( + s"Missed $numberOfFailedLookups TAZ lookups due to unmapped linkIds. Writing list to linksWithFailedTAZlookup" + ) + implicit val writer: BufferedWriter = + IOUtils.getBufferedWriter(filePath) + writer.write("tazId,counts") + writer.write(System.lineSeparator()) + failedLinkLookups.toList.groupBy(identity).mapValues(_.size).foreach { case (linkId, count) => + writer.write(linkId.toString) + writer.write(",") + writer.write(count.toString) + writer.write(System.lineSeparator()) + } + writer.flush() + writer.close() + } + failedLinkLookups.clear() + } + def mapNetworkToTAZs(network: Network): Unit = { if (tazListContainsGeoms) { network.getLinks.asScala.foreach { diff --git a/src/main/scala/beam/sim/BeamSim.scala b/src/main/scala/beam/sim/BeamSim.scala index 3990f223632..79d1819ea92 100755 --- a/src/main/scala/beam/sim/BeamSim.scala +++ b/src/main/scala/beam/sim/BeamSim.scala @@ -425,6 +425,8 @@ class BeamSim @Inject() ( transitOccupancyByStop.notifyIterationEnds(event) } + beamScenario.tazTreeMap.notifyIterationEnds(event) + travelTimeGoogleStatistic.notifyIterationEnds(event) startAndEndEventListeners.foreach(_.notifyIterationEnds(event)) From 2d5e54eac1c06de57ea3bf2af6b69d42f8c839e5 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 2 Aug 2022 10:32:07 -0700 Subject: [PATCH 269/307] update logging for stuck guard --- .../scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala b/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala index 1db2106b80c..040a1737d04 100755 --- a/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala +++ b/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala @@ -147,9 +147,9 @@ class TAZTreeMap(val tazQuadTree: QuadTree[TAZ], val useCache: Boolean = false) case _ => } logger.info( - "Matched " + "Completed mapping links to TAZs. Matched " + linkIdToTAZMapping.size.toString + - " links to TAZs, failed to match " + " links, failed to match " + unmatchedLinkIds.size.toString + " links" ) From e390368a2e5f1ae3b30e729a7ccd86fdea9b6e2f Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 2 Aug 2022 10:47:10 -0700 Subject: [PATCH 270/307] fix header --- .../scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala b/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala index 040a1737d04..62a22ceacc1 100755 --- a/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala +++ b/src/main/scala/beam/agentsim/infrastructure/taz/TAZTreeMap.scala @@ -109,7 +109,7 @@ class TAZTreeMap(val tazQuadTree: QuadTree[TAZ], val useCache: Boolean = false) ) implicit val writer: BufferedWriter = IOUtils.getBufferedWriter(filePath) - writer.write("tazId,counts") + writer.write("linkId,count") writer.write(System.lineSeparator()) failedLinkLookups.toList.groupBy(identity).mapValues(_.size).foreach { case (linkId, count) => writer.write(linkId.toString) From cb7dfa54275f1127bc489397b561880da9b866ca Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 2 Aug 2022 11:29:33 -0700 Subject: [PATCH 271/307] Throw skimmer events for non-chosen itineraries --- src/main/resources/beam-template.conf | 1 + .../beam/agentsim/agents/PersonAgent.scala | 3 +- .../agents/modalbehaviors/ChoosesMode.scala | 24 +- .../scala/beam/sim/config/BeamConfig.scala | 5564 ++++++----------- 4 files changed, 1992 insertions(+), 3600 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 91f17c5abfd..2c01dd8549a 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -416,6 +416,7 @@ beam.exchange { } output { activitySimSkimsEnabled = "boolean | false" + sendNonChosenTripsToSkimmer = "boolean | true" # geo level different than TAZ (in beam taz-centers format) #@optional geo.filePath = string diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 8cb3af04b35..16efa2fe6a3 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1381,6 +1381,7 @@ class PersonAgent( generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data)) ) val correctedTrip = correctTripEndTime(data.currentTrip.get, tick, body.id, body.beamVehicleType.id) + generateSkimData(tick, correctedTrip, failedTrip = false, currentActivityIndex, nextActivity(data)) resetFuelConsumed() val activityStartEvent = new ActivityStartEvent( tick, @@ -1424,7 +1425,7 @@ class PersonAgent( } } - private def generateSkimData( + def generateSkimData( tick: Int, trip: EmbodiedBeamTrip, failedTrip: Boolean, diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index 562b5b6d3fe..b8c036597be 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -1282,7 +1282,7 @@ trait ChoosesMode { val availableModesForTrips: Seq[BeamMode] = availableModesForPerson(matsimPlan.getPerson) .filterNot(mode => choosesModeData.excludeModes.contains(mode)) - val filteredItinerariesForChoice = (choosesModeData.personData.currentTourMode match { + val filteredItinerariesForChoice = choosesModeData.personData.currentTourMode match { case Some(mode) if mode == DRIVE_TRANSIT || mode == BIKE_TRANSIT => val LastTripIndex = currentTour(choosesModeData.personData).trips.size - 1 val tripIndexOfElement = currentTour(choosesModeData.personData) @@ -1311,22 +1311,38 @@ trait ChoosesMode { combinedItinerariesForChoice.filter(_.tripClassifier == mode) case _ => combinedItinerariesForChoice - }).filter(itin => availableModesForTrips.contains(itin.tripClassifier)) + } + + val itinerariesOfCorrectMode = + filteredItinerariesForChoice.filter(itin => availableModesForTrips.contains(itin.tripClassifier)) val attributesOfIndividual = matsimPlan.getPerson.getCustomAttributes .get("beam-attributes") .asInstanceOf[AttributesOfIndividual] - val availableAlts = Some(filteredItinerariesForChoice.map(_.tripClassifier).mkString(":")) + val availableAlts = Some(itinerariesOfCorrectMode.map(_.tripClassifier).mkString(":")) modeChoiceCalculator( - filteredItinerariesForChoice, + itinerariesOfCorrectMode, attributesOfIndividual, nextActivity(choosesModeData.personData), Some(currentActivity(choosesModeData.personData)), Some(matsimPlan.getPerson) ) match { case Some(chosenTrip) => + filteredItinerariesForChoice.foreach { + case possibleTrip + if (possibleTrip != chosenTrip) && + beamScenario.beamConfig.beam.exchange.output.sendNonChosenTripsToSkimmer => + generateSkimData( + possibleTrip.legs.lastOption.map(_.beamLeg.endTime).getOrElse(_currentTick.get), + possibleTrip, + failedTrip = false, + personData.currentActivityIndex, + nextActivity(personData) + ) + case _ => + } val dataForNextStep = choosesModeData.copy( pendingChosenTrip = Some(chosenTrip), availableAlternatives = availableAlts diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 6cc3107ba92..a4c10bf7dd7 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,5183 +3,3557 @@ package beam.sim.config case class BeamConfig( - beam: BeamConfig.Beam, - matsim: BeamConfig.Matsim + beam : BeamConfig.Beam, + matsim : BeamConfig.Matsim ) - object BeamConfig { - case class Beam( - actorSystemName: java.lang.String, - agentsim: BeamConfig.Beam.Agentsim, - calibration: BeamConfig.Beam.Calibration, - cluster: BeamConfig.Beam.Cluster, - debug: BeamConfig.Beam.Debug, - exchange: BeamConfig.Beam.Exchange, - experimental: BeamConfig.Beam.Experimental, - input: BeamConfig.Beam.Input, - inputDirectory: java.lang.String, - logger: BeamConfig.Beam.Logger, - metrics: BeamConfig.Beam.Metrics, - output: BeamConfig.Beam.Output, - outputs: BeamConfig.Beam.Outputs, - physsim: BeamConfig.Beam.Physsim, - replanning: BeamConfig.Beam.Replanning, - router: BeamConfig.Beam.Router, - routing: BeamConfig.Beam.Routing, - sim: BeamConfig.Beam.Sim, - spatial: BeamConfig.Beam.Spatial, - urbansim: BeamConfig.Beam.Urbansim, - useLocalWorker: scala.Boolean, - warmStart: BeamConfig.Beam.WarmStart + actorSystemName : java.lang.String, + agentsim : BeamConfig.Beam.Agentsim, + calibration : BeamConfig.Beam.Calibration, + cluster : BeamConfig.Beam.Cluster, + debug : BeamConfig.Beam.Debug, + exchange : BeamConfig.Beam.Exchange, + experimental : BeamConfig.Beam.Experimental, + input : BeamConfig.Beam.Input, + inputDirectory : java.lang.String, + logger : BeamConfig.Beam.Logger, + metrics : BeamConfig.Beam.Metrics, + output : BeamConfig.Beam.Output, + outputs : BeamConfig.Beam.Outputs, + physsim : BeamConfig.Beam.Physsim, + replanning : BeamConfig.Beam.Replanning, + router : BeamConfig.Beam.Router, + routing : BeamConfig.Beam.Routing, + sim : BeamConfig.Beam.Sim, + spatial : BeamConfig.Beam.Spatial, + urbansim : BeamConfig.Beam.Urbansim, + useLocalWorker : scala.Boolean, + warmStart : BeamConfig.Beam.WarmStart ) - object Beam { - case class Agentsim( - agentSampleSizeAsFractionOfPopulation: scala.Double, - agents: BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime: java.lang.String, - firstIteration: scala.Int, - fractionOfPlansWithSingleActivity: scala.Double, - h3taz: BeamConfig.Beam.Agentsim.H3taz, - lastIteration: scala.Int, - populationAdjustment: java.lang.String, - randomSeedForPopulationSampling: scala.Option[scala.Int], - scenarios: BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow: scala.Int, - simulationName: java.lang.String, - snapLocationAndRemoveInvalidInputs: scala.Boolean, - taz: BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters: scala.Int, - thresholdForWalkingInMeters: scala.Int, - timeBinSize: scala.Int, - toll: BeamConfig.Beam.Agentsim.Toll, - tuning: BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation : scala.Double, + agents : BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime : java.lang.String, + firstIteration : scala.Int, + fractionOfPlansWithSingleActivity : scala.Double, + h3taz : BeamConfig.Beam.Agentsim.H3taz, + lastIteration : scala.Int, + populationAdjustment : java.lang.String, + randomSeedForPopulationSampling : scala.Option[scala.Int], + scenarios : BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow : scala.Int, + simulationName : java.lang.String, + snapLocationAndRemoveInvalidInputs : scala.Boolean, + taz : BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters : scala.Int, + thresholdForWalkingInMeters : scala.Int, + timeBinSize : scala.Int, + toll : BeamConfig.Beam.Agentsim.Toll, + tuning : BeamConfig.Beam.Agentsim.Tuning ) - object Agentsim { - case class Agents( - activities: BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType: java.lang.String, - freight: BeamConfig.Beam.Agentsim.Agents.Freight, - households: BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking: BeamConfig.Beam.Agentsim.Agents.Parking, - plans: BeamConfig.Beam.Agentsim.Agents.Plans, - population: BeamConfig.Beam.Agentsim.Agents.Population, - ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles + activities : BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType : java.lang.String, + freight : BeamConfig.Beam.Agentsim.Agents.Freight, + households : BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking : BeamConfig.Beam.Agentsim.Agents.Parking, + plans : BeamConfig.Beam.Agentsim.Agents.Plans, + population : BeamConfig.Beam.Agentsim.Agents.Population, + ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles ) - object Agents { - case class Activities( - activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] ) - object Activities { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = - if (c.hasPathOrNull("activityTypeToFixedDurationMap")) - scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) - else None + activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None ) } } - + case class Freight( - carrierParkingFilePath: scala.Option[java.lang.String], - carriersFilePath: java.lang.String, - convertWgs2Utm: scala.Boolean, - enabled: scala.Boolean, - generateFixedActivitiesDurations: scala.Boolean, - name: java.lang.String, - plansFilePath: java.lang.String, - reader: java.lang.String, - replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath: java.lang.String + carrierParkingFilePath : scala.Option[java.lang.String], + carriersFilePath : java.lang.String, + convertWgs2Utm : scala.Boolean, + enabled : scala.Boolean, + generateFixedActivitiesDurations : scala.Boolean, + name : java.lang.String, + plansFilePath : java.lang.String, + reader : java.lang.String, + replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath : java.lang.String ) - object Freight { - case class Replanning( - departureTime: scala.Int, - disableAfterIteration: scala.Int, - strategy: java.lang.String + departureTime : scala.Int, + disableAfterIteration : scala.Int, + strategy : java.lang.String ) - object Replanning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = - if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = - if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") - else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = - c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = - if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") - else "/test/input/beamville/freight/payload-plans.csv", - reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - toursFilePath = - if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") - else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", + reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath: java.lang.String, - inputHouseholdAttributesFilePath: java.lang.String + inputFilePath : java.lang.String, + inputHouseholdAttributesFilePath : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = - if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") - else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = - if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") - else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - bikeMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier, - defaultValueOfTime: scala.Double, - highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts: scala.Int, - minimumValueOfTime: scala.Double, - modeChoiceClass: java.lang.String, - modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - multinomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit, - overrideAutomationForVOTT: scala.Boolean, - overrideAutomationLevel: scala.Int, - poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] + bikeMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier, + defaultValueOfTime : scala.Double, + highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts : scala.Int, + minimumValueOfTime : scala.Double, + modeChoiceClass : java.lang.String, + modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + multinomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit, + overrideAutomationForVOTT : scala.Boolean, + overrideAutomationLevel : scala.Int, + poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] ) - object ModalBehaviors { - case class BikeMultiplier( - commute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute, - noncommute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute + commute : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute, + noncommute : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute ) - object BikeMultiplier { - case class Commute( - ageGT50: scala.Double, - ageLE50: scala.Double + ageGT50 : scala.Double, + ageLE50 : scala.Double ) - object Commute { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( - ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, - ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ageGT50 = if(c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if(c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 ) } } - + case class Noncommute( - ageGT50: scala.Double, - ageLE50: scala.Double + ageGT50 : scala.Double, + ageLE50 : scala.Double ) - object Noncommute { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( - ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, - ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ageGT50 = if(c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if(c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( - commute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( - if (c.hasPathOrNull("commute")) c.getConfig("commute") - else com.typesafe.config.ConfigFactory.parseString("commute{}") - ), - noncommute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( - if (c.hasPathOrNull("noncommute")) c.getConfig("noncommute") - else com.typesafe.config.ConfigFactory.parseString("noncommute{}") - ) + commute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute(if(c.hasPathOrNull("commute")) c.getConfig("commute") else com.typesafe.config.ConfigFactory.parseString("commute{}")), + noncommute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute(if(c.hasPathOrNull("noncommute")) c.getConfig("noncommute") else com.typesafe.config.ConfigFactory.parseString("noncommute{}")) ) } } - + case class HighTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) - object HighTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class Lccm( - filePath: java.lang.String + filePath : java.lang.String ) - object Lccm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) - object LowTimeSensitivity { - case class HighCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) - object HighCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - + case class LowCongestion( - highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) - object LowCongestion { - case class HighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object HighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object NonHighwayFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") - else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") - ), - nonHighwayFactor = - BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") - else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") - ) + highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), + nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") - else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") - ), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") - else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") - ) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) ) } } - + case class ModeVotMultiplier( - CAV: scala.Double, - bike: scala.Double, - drive: scala.Double, - rideHail: scala.Double, - rideHailPooled: scala.Double, - rideHailTransit: scala.Double, - transit: scala.Double, - waiting: scala.Double, - walk: scala.Double + CAV : scala.Double, + bike : scala.Double, + drive : scala.Double, + rideHail : scala.Double, + rideHailPooled : scala.Double, + rideHailTransit : scala.Double, + transit : scala.Double, + waiting : scala.Double, + walk : scala.Double ) - object ModeVotMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MultinomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params, - utility_scale_factor: scala.Double + params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params, + utility_scale_factor : scala.Double ) - object MultinomialLogit { - case class Params( - bike_intercept: scala.Double, - bike_transit_intercept: scala.Double, - car_intercept: scala.Double, - cav_intercept: scala.Double, - drive_transit_intercept: scala.Double, - ride_hail_intercept: scala.Double, - ride_hail_pooled_intercept: scala.Double, - ride_hail_transit_intercept: scala.Double, - transfer: scala.Double, - transit_crowding: scala.Double, - transit_crowding_VOT_multiplier: scala.Double, - transit_crowding_VOT_threshold: scala.Double, - transit_crowding_percentile: scala.Double, - walk_intercept: scala.Double, - walk_transit_intercept: scala.Double + bike_intercept : scala.Double, + bike_transit_intercept : scala.Double, + car_intercept : scala.Double, + cav_intercept : scala.Double, + drive_transit_intercept : scala.Double, + ride_hail_intercept : scala.Double, + ride_hail_pooled_intercept : scala.Double, + ride_hail_transit_intercept : scala.Double, + transfer : scala.Double, + transit_crowding : scala.Double, + transit_crowding_VOT_multiplier : scala.Double, + transit_crowding_VOT_threshold : scala.Double, + transit_crowding_percentile : scala.Double, + walk_intercept : scala.Double, + walk_transit_intercept : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( - bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = - if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = - if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = - if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = - if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") - else 0.0, - ride_hail_transit_intercept = - if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") - else 0.0, - transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = - if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) - c.getDouble("transit_crowding_VOT_multiplier") - else 0.0, - transit_crowding_VOT_threshold = - if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") - else 0.5, - transit_crowding_percentile = - if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") - else 90.0, - walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = - if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, + ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, + transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, + transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, + transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, + walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ), - utility_scale_factor = - if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), + utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3: scala.Double, - Level4: scala.Double, - Level5: scala.Double, - LevelLE2: scala.Double + Level3 : scala.Double, + Level4 : scala.Double, + Level5 : scala.Double, + LevelLE2 : scala.Double ) - object PoolingMultiplier { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - bikeMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( - if (c.hasPathOrNull("bikeMultiplier")) c.getConfig("bikeMultiplier") - else com.typesafe.config.ConfigFactory.parseString("bikeMultiplier{}") - ), - defaultValueOfTime = - if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") - ), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - if (c.hasPathOrNull("lccm")) c.getConfig("lccm") - else com.typesafe.config.ConfigFactory.parseString("lccm{}") - ), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") - else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") - ), - maximumNumberOfReplanningAttempts = - if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") - else 3, - minimumValueOfTime = - if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = - if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") - else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") - else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") - ), - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( - if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") - else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") - ), - overrideAutomationForVOTT = - c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = - if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") - else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") - ), - transitVehicleTypeVOTMultipliers = - if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) - scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) - else None - ) - } - } - + bikeMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier(if(c.hasPathOrNull("bikeMultiplier")) c.getConfig("bikeMultiplier") else com.typesafe.config.ConfigFactory.parseString("bikeMultiplier{}")), + defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), + maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, + minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")), + overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), + transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None + ) + } + } + case class ModeIncentive( - filePath: java.lang.String + filePath : java.lang.String ) - object ModeIncentive { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - fractionOfSameTypeZones: scala.Double, - maxSearchRadius: scala.Double, - minNumberOfSameTypeZones: scala.Int, - minSearchRadius: scala.Double, - multinomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, - rangeAnxietyBuffer: scala.Double, - searchMaxDistanceRelativeToEllipseFoci: scala.Double + fractionOfSameTypeZones : scala.Double, + maxSearchRadius : scala.Double, + minNumberOfSameTypeZones : scala.Int, + minSearchRadius : scala.Double, + multinomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, + rangeAnxietyBuffer : scala.Double, + searchMaxDistanceRelativeToEllipseFoci : scala.Double ) - object Parking { - case class MultinomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params ) - object MultinomialLogit { - case class Params( - distanceMultiplier: scala.Double, - enrouteDetourMultiplier: scala.Double, - homeActivityPrefersResidentialParkingMultiplier: scala.Double, - parkingPriceMultiplier: scala.Double, - rangeAnxietyMultiplier: scala.Double + distanceMultiplier : scala.Double, + enrouteDetourMultiplier : scala.Double, + homeActivityPrefersResidentialParkingMultiplier : scala.Double, + parkingPriceMultiplier : scala.Double, + rangeAnxietyMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( - distanceMultiplier = - if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = - if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = - if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) - c.getDouble("homeActivityPrefersResidentialParkingMultiplier") - else 1.0, - parkingPriceMultiplier = - if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = - if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, + parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - fractionOfSameTypeZones = - if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, - maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minNumberOfSameTypeZones = - if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, - minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( - if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") - else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") - ), - rangeAnxietyBuffer = - if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = - if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) - c.getDouble("searchMaxDistanceRelativeToEllipseFoci") - else 4.0 + fractionOfSameTypeZones = if(c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, + maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minNumberOfSameTypeZones = if(c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, + minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")), + rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath: java.lang.String, - inputPlansFilePath: java.lang.String, - merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath : java.lang.String, + inputPlansFilePath : java.lang.String, + merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) - object Plans { - case class Merge( - fraction: scala.Double + fraction : scala.Double ) - object Merge { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = - if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") - else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = - if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") - else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - if (c.hasPathOrNull("merge")) c.getConfig("merge") - else com.typesafe.config.ConfigFactory.parseString("merge{}") - ) + inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) ) } } - + case class Population( - industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling: scala.Boolean + industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling : scala.Boolean ) - object Population { - case class IndustryRemovalProbabilty( - enabled: scala.Boolean, - inputFilePath: java.lang.String, - removalStrategy: java.lang.String + enabled : scala.Boolean, + inputFilePath : java.lang.String, + removalStrategy : java.lang.String ) - object IndustryRemovalProbabilty { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = - if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") - else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") - ), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath: java.lang.String + filePath : java.lang.String ) - object PtFare { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost: scala.Double, - defaultCostPerMile: scala.Double, - defaultCostPerMinute: scala.Double, - human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations: scala.Boolean, - name: java.lang.String, - pooledBaseCost: scala.Double, - pooledCostPerMile: scala.Double, - pooledCostPerMinute: scala.Double, - rangeBufferForDispatchInMeters: scala.Int, - repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost : scala.Double, + defaultCostPerMile : scala.Double, + defaultCostPerMinute : scala.Double, + human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations : scala.Boolean, + name : java.lang.String, + pooledBaseCost : scala.Double, + pooledCostPerMile : scala.Double, + pooledCostPerMinute : scala.Double, + rangeBufferForDispatchInMeters : scala.Int, + repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) - object RideHail { - case class AllocationManager( - alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm: java.lang.String, - maxExcessRideTime: scala.Double, - maxWaitingTimeInSec: scala.Int, - name: java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, - repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds: scala.Int + alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm : java.lang.String, + maxExcessRideTime : scala.Double, + maxWaitingTimeInSec : scala.Int, + name : java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, + repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds : scala.Int ) - object AllocationManager { - case class AlonsoMora( - maxRequestsPerVehicle: scala.Int + maxRequestsPerVehicle : scala.Int ) - object AlonsoMora { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = - if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, - demandWeight: scala.Double, - distanceWeight: scala.Double, - keepMaxTopNScores: scala.Int, - minDemandPercentageInRadius: scala.Double, - minScoreThresholdForRepositioning: scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, - percentageOfVehiclesToReposition: scala.Double, - produceDebugImages: scala.Boolean, - repositionCircleRadiusInMeters: scala.Double, - repositioningMethod: java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, - waitingTimeWeight: scala.Double + allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, + demandWeight : scala.Double, + distanceWeight : scala.Double, + keepMaxTopNScores : scala.Int, + minDemandPercentageInRadius : scala.Double, + minScoreThresholdForRepositioning : scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, + percentageOfVehiclesToReposition : scala.Double, + produceDebugImages : scala.Boolean, + repositionCircleRadiusInMeters : scala.Double, + repositioningMethod : java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, + waitingTimeWeight : scala.Double ) - object RepositionLowWaitingTimes { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( - "allowIncreasingRadiusIfDemandInRadiusLow" - ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = - if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") - else 0.1, - minScoreThresholdForRepositioning = - if (c.hasPathOrNull("minScoreThresholdForRepositioning")) - c.getDouble("minScoreThresholdForRepositioning") - else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = - if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) - c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") - else 1, - percentageOfVehiclesToReposition = - if (c.hasPathOrNull("percentageOfVehiclesToReposition")) - c.getDouble("percentageOfVehiclesToReposition") - else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = - if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") - else 3000, - repositioningMethod = - if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = - if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) - c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") - else 1200, - waitingTimeWeight = - if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, + minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, + percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, + repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, + waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") - else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") - ), - matchingAlgorithm = - if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") - else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = - if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = - if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) - c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") - else 1, - repositionLowWaitingTimes = - BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") - else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") - ), - requestBufferTimeoutInSeconds = - if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), + matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, + repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), + requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int, - valueOfTime: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int, + valueOfTime : scala.Int ) - object Cav { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 16090, - valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, + valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) - object Charging { - case class VehicleChargingManager( - defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager ) - object VehicleChargingManager { - case class DefaultVehicleChargingManager( - multinomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit + multinomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit ) - object DefaultVehicleChargingManager { - case class MultinomialLogit( - params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params + params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params ) - object MultinomialLogit { - case class Params( - chargingTimeMultiplier: scala.Double, - drivingTimeMultiplier: scala.Double, - insufficientRangeMultiplier: scala.Double, - queueingTimeMultiplier: scala.Double + chargingTimeMultiplier : scala.Double, + drivingTimeMultiplier : scala.Double, + insufficientRangeMultiplier : scala.Double, + queueingTimeMultiplier : scala.Double ) - object Params { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit - .Params( - chargingTimeMultiplier = - if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") - else -0.01666667, - drivingTimeMultiplier = - if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") - else -0.01666667, - insufficientRangeMultiplier = - if (c.hasPathOrNull("insufficientRangeMultiplier")) - c.getDouble("insufficientRangeMultiplier") - else -60.0, - queueingTimeMultiplier = - if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") - else -0.01666667 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params( + chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, + drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, + insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, + queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MultinomialLogit( - params = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit - .Params( - if (c.hasPathOrNull("params")) c.getConfig("params") - else com.typesafe.config.ConfigFactory.parseString("params{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit( + params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - multinomialLogit = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager - .MultinomialLogit( - if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") - else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") - ) - ) + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")) + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager - .DefaultVehicleChargingManager( - if (c.hasPathOrNull("defaultVehicleChargingManager")) - c.getConfig("defaultVehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") - ) + defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") - else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") - ) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) ) } } - + case class Human( - noRefuelThresholdInMeters: scala.Int, - refuelRequiredThresholdInMeters: scala.Int + noRefuelThresholdInMeters : scala.Int, + refuelRequiredThresholdInMeters : scala.Int ) - object Human { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = - if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = - if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") - else 32180 + noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 ) } } - + case class Initialization( - filePath: java.lang.String, - initType: java.lang.String, - parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath : java.lang.String, + initType : java.lang.String, + parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) - object Initialization { - case class Parking( - filePath: java.lang.String + filePath : java.lang.String ) - object Parking { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet: scala.Double, - initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId: java.lang.String, - vehicleTypePrefix: java.lang.String + fractionOfInitialVehicleFleet : scala.Double, + initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId : java.lang.String, + vehicleTypePrefix : java.lang.String ) - object Procedural { - case class InitialLocation( - home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name: java.lang.String + home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name : java.lang.String ) - object InitialLocation { - case class Home( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object Home { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - if (c.hasPathOrNull("home")) c.getConfig("home") - else com.typesafe.config.ConfigFactory.parseString("home{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") - else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") - ), - vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = - if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - if (c.hasPathOrNull("procedural")) c.getConfig("procedural") - else com.typesafe.config.ConfigFactory.parseString("procedural{}") - ) + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) ) } } - + case class IterationStats( - timeBinSizeInSec: scala.Double + timeBinSizeInSec : scala.Double ) - object IterationStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name: java.lang.String, - timeout: scala.Int + demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name : java.lang.String, + timeout : scala.Int ) - object RepositioningManager { - case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider: scala.Double, - horizon: scala.Int, - numberOfClustersForDemand: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDemandForCAVs: scala.Double + fractionOfClosestClustersToConsider : scala.Double, + horizon : scala.Int, + numberOfClustersForDemand : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDemandForCAVs : scala.Double ) - object DemandFollowingRepositioningManager { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = - if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) - c.getDouble("fractionOfClosestClustersToConsider") - else 0.2, - horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = - if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 1, - sensitivityOfRepositioningToDemandForCAVs = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) - c.getDouble("sensitivityOfRepositioningToDemandForCAVs") - else 1 + fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, + horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, + sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon: scala.Int, - sensitivityOfRepositioningToDemand: scala.Double, - sensitivityOfRepositioningToDistance: scala.Double + predictionHorizon : scala.Int, + sensitivityOfRepositioningToDemand : scala.Double, + sensitivityOfRepositioningToDistance : scala.Double ) - object InverseSquareDistanceRepositioningFactor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = - if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) - c.getDouble("sensitivityOfRepositioningToDemand") - else 0.4, - sensitivityOfRepositioningToDistance = - if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) - c.getDouble("sensitivityOfRepositioningToDistance") - else 0.9 + predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, + sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = - BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - if (c.hasPathOrNull("demandFollowingRepositioningManager")) - c.getConfig("demandFollowingRepositioningManager") - else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") - ), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager - .InverseSquareDistanceRepositioningFactor( - if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) - c.getConfig("inverseSquareDistanceRepositioningFactor") - else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") - ), - name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), + name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters: scala.Double + radiusInMeters : scala.Double ) - object RideHailManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel: scala.Double, - numberOfCategories: scala.Int, - priceAdjustmentStrategy: java.lang.String, - surgeLevelAdaptionStep: scala.Double + minimumSurgeLevel : scala.Double, + numberOfCategories : scala.Int, + priceAdjustmentStrategy : java.lang.String, + surgeLevelAdaptionStep : scala.Double ) - object SurgePricing { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = - if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") - else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = - if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") - else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") - ), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - if (c.hasPathOrNull("cav")) c.getConfig("cav") - else com.typesafe.config.ConfigFactory.parseString("cav{}") - ), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - if (c.hasPathOrNull("charging")) c.getConfig("charging") - else com.typesafe.config.ConfigFactory.parseString("charging{}") - ), - defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = - if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = - if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - if (c.hasPathOrNull("human")) c.getConfig("human") - else com.typesafe.config.ConfigFactory.parseString("human{}") - ), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - if (c.hasPathOrNull("initialization")) c.getConfig("initialization") - else com.typesafe.config.ConfigFactory.parseString("initialization{}") - ), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") - else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") - ), - linkFleetStateAcrossIterations = - c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = - if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - rangeBufferForDispatchInMeters = - if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") - else 10000, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") - else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") - ), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") - else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") - ), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") - else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") - ) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), + defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), + linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) + ) + } + } + case class RideHailTransit( - modesToConsider: java.lang.String + modesToConsider : java.lang.String ) - object RideHailTransit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - multinomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit + carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + multinomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit ) - object TripBehaviors { - case class CarUsage( - minDistanceToTrainStop: scala.Double + minDistanceToTrainStop : scala.Double ) - object CarUsage { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = - if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MultinomialLogit( - activity_file_path: java.lang.String, - additional_trip_utility: scala.Double, - destination_nest_scale_factor: scala.Double, - generate_secondary_activities: scala.Boolean, - intercept_file_path: java.lang.String, - max_destination_choice_set_size: scala.Int, - max_destination_distance_meters: scala.Double, - mode_nest_scale_factor: scala.Double, - trip_nest_scale_factor: scala.Double + activity_file_path : java.lang.String, + additional_trip_utility : scala.Double, + destination_nest_scale_factor : scala.Double, + generate_secondary_activities : scala.Boolean, + intercept_file_path : java.lang.String, + max_destination_choice_set_size : scala.Int, + max_destination_distance_meters : scala.Double, + mode_nest_scale_factor : scala.Double, + trip_nest_scale_factor : scala.Double ) - object MultinomialLogit { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( - activity_file_path = - if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = - if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = - if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") - else 1.0, - generate_secondary_activities = - c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = - if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = - if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") - else 20, - max_destination_distance_meters = - if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") - else 32000, - mode_nest_scale_factor = - if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = - if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, + generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, + max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, + mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") - else com.typesafe.config.ConfigFactory.parseString("carUsage{}") - ), - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( - if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") - else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") - ) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")) ) } } - + case class Vehicles( - downsamplingMethod: java.lang.String, - dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet: scala.Double, - fractionOfPeopleWithBicycle: scala.Double, - fuelTypesFilePath: java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, - linkSocAcrossIterations: scala.Boolean, - linkToGradePercentFilePath: java.lang.String, - meanPrivateVehicleStartingSOC: scala.Double, - meanRidehailVehicleStartingSOC: scala.Double, - sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile: java.lang.String, - vehicleAdjustmentMethod: java.lang.String, - vehicleTypesFilePath: java.lang.String, - vehiclesFilePath: java.lang.String + downsamplingMethod : java.lang.String, + dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet : scala.Double, + fractionOfPeopleWithBicycle : scala.Double, + fuelTypesFilePath : java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, + linkSocAcrossIterations : scala.Boolean, + linkToGradePercentFilePath : java.lang.String, + meanPrivateVehicleStartingSOC : scala.Double, + meanRidehailVehicleStartingSOC : scala.Double, + sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile : java.lang.String, + vehicleAdjustmentMethod : java.lang.String, + vehicleTypesFilePath : java.lang.String, + vehiclesFilePath : java.lang.String ) - object Vehicles { - case class DummySharedBike( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedBike { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object DummySharedCar { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond: scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, - noRefuelThresholdOffsetInMeters: scala.Double, - remainingDistanceWrtBatteryCapacityThreshold: scala.Int + estimateOfMeanChargingDurationInSecond : scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, + noRefuelThresholdOffsetInMeters : scala.Double, + remainingDistanceWrtBatteryCapacityThreshold : scala.Int ) - object Enroute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = - if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) - c.getInt("estimateOfMeanChargingDurationInSecond") - else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = - if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) - c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") - else 500, - noRefuelThresholdOffsetInMeters = - if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") - else 32186.9, - remainingDistanceWrtBatteryCapacityThreshold = - if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) - c.getInt("remainingDistanceWrtBatteryCapacityThreshold") - else 2 + estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, + noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, + remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving - ], - fixed_non_reserving_fleet_by_taz: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz - ], - inexhaustible_reserving: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving - ], - managerType: java.lang.String, - name: java.lang.String, - parkingFilePath: java.lang.String, - reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], + fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], + inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], + managerType : java.lang.String, + name : java.lang.String, + parkingFilePath : java.lang.String, + reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) - object SharedFleets$Elm { - case class FixedNonReserving( - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String ) - object FixedNonReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize: scala.Int, - maxWalkingDistance: scala.Int, - vehicleTypeId: java.lang.String, - vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] + fleetSize : scala.Int, + maxWalkingDistance : scala.Int, + vehicleTypeId : java.lang.String, + vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] ) - object FixedNonReservingFleetByTaz { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = - if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = - if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) - else None + fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId: java.lang.String + vehicleTypeId : java.lang.String ) - object InexhaustibleReserving { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = - if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm: scala.Option[ - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm - ], - name: java.lang.String, - repositionTimeBin: scala.Int, - statTimeBin: scala.Int + min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], + name : java.lang.String, + repositionTimeBin : scala.Int, + statTimeBin : scala.Int ) - object Reposition { - case class MinAvailabilityUndersupplyAlgorithm( - matchLimit: scala.Int + matchLimit : scala.Int ) - object MinAvailabilityUndersupplyAlgorithm { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm( - matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( + matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = - if (c.hasPathOrNull("min-availability-undersupply-algorithm")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition - .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) - ) - else None, - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = - if (c.hasPathOrNull("fixed-non-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReserving(c.getConfig("fixed-non-reserving")) - ) - else None, - fixed_non_reserving_fleet_by_taz = - if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) - ) - else None, - inexhaustible_reserving = - if (c.hasPathOrNull("inexhaustible-reserving")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm - .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) - ) - else None, - managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = - if (c.hasPathOrNull("reposition")) - scala.Some( - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) - ) - else None + fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, + fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, + inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, + managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = - if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") - else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") - else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") - ), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") - else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") - ), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - if (c.hasPathOrNull("enroute")) c.getConfig("enroute") - else com.typesafe.config.ConfigFactory.parseString("enroute{}") - ), - fractionOfInitialVehicleFleet = - if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") - else 1.0, - fractionOfPeopleWithBicycle = - if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = - if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") - else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( - "generateEmergencyHouseholdVehicleWhenPlansRequireIt" - ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = - c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = - if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = - if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") - else 1.0, - meanRidehailVehicleStartingSOC = - if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") - else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = - if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") - else "", - vehicleAdjustmentMethod = - if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = - if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") - else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = - if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") - else "/test/input/beamville/vehicles.csv" - ) - } - - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), + fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, + fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, + meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", + vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" + ) + } + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Agentsim.Agents.Vehicles - .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities( - if (c.hasPathOrNull("activities")) c.getConfig("activities") - else com.typesafe.config.ConfigFactory.parseString("activities{}") - ), - bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight( - if (c.hasPathOrNull("freight")) c.getConfig("freight") - else com.typesafe.config.ConfigFactory.parseString("freight{}") - ), - households = BeamConfig.Beam.Agentsim.Agents.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") - else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") - ), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") - else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") - ), - parking = BeamConfig.Beam.Agentsim.Agents.Parking( - if (c.hasPathOrNull("parking")) c.getConfig("parking") - else com.typesafe.config.ConfigFactory.parseString("parking{}") - ), - plans = BeamConfig.Beam.Agentsim.Agents.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - population = BeamConfig.Beam.Agentsim.Agents.Population( - if (c.hasPathOrNull("population")) c.getConfig("population") - else com.typesafe.config.ConfigFactory.parseString("population{}") - ), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( - if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") - else com.typesafe.config.ConfigFactory.parseString("ptFare{}") - ), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( - if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") - else com.typesafe.config.ConfigFactory.parseString("rideHail{}") - ), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") - else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") - ), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") - else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") - ), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), + bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), + households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), + parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), + plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor: scala.Double, - chargingPointCountScalingFactor: scala.Double, - chargingPointFilePath: java.lang.String, - helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds: scala.Int + chargingPointCostScalingFactor : scala.Double, + chargingPointCountScalingFactor : scala.Double, + chargingPointFilePath : java.lang.String, + helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds : scala.Int ) - object ChargingNetworkManager { - case class Helics( - bufferSize: scala.Int, - connectionEnabled: scala.Boolean, - coreInitString: java.lang.String, - coreType: java.lang.String, - dataInStreamPoint: java.lang.String, - dataOutStreamPoint: java.lang.String, - federateName: java.lang.String, - feedbackEnabled: scala.Boolean, - intLogLevel: scala.Int, - timeDeltaProperty: scala.Double + bufferSize : scala.Int, + connectionEnabled : scala.Boolean, + coreInitString : java.lang.String, + coreType : java.lang.String, + dataInStreamPoint : java.lang.String, + dataOutStreamPoint : java.lang.String, + federateName : java.lang.String, + feedbackEnabled : scala.Boolean, + intLogLevel : scala.Int, + timeDeltaProperty : scala.Double ) - object Helics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = - if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") - else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = - if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") - else "GridFed/PhysicalBounds", - dataOutStreamPoint = - if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", + dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled: scala.Boolean, - expansionFactor_charge_activity: scala.Double, - expansionFactor_home_activity: scala.Double, - expansionFactor_init_activity: scala.Double, - expansionFactor_wherever_activity: scala.Double, - expansionFactor_work_activity: scala.Double + enabled : scala.Boolean, + expansionFactor_charge_activity : scala.Double, + expansionFactor_home_activity : scala.Double, + expansionFactor_init_activity : scala.Double, + expansionFactor_wherever_activity : scala.Double, + expansionFactor_work_activity : scala.Double ) - object ScaleUp { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = - if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") - else 1.0, - expansionFactor_home_activity = - if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") - else 1.0, - expansionFactor_init_activity = - if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") - else 1.0, - expansionFactor_wherever_activity = - if (c.hasPathOrNull("expansionFactor_wherever_activity")) - c.getDouble("expansionFactor_wherever_activity") - else 1.0, - expansionFactor_work_activity = - if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") - else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, + expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, + expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, + expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, + expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = - if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") - else 1.0, - chargingPointCountScalingFactor = - if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") - else 1.0, - chargingPointFilePath = - if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - if (c.hasPathOrNull("helics")) c.getConfig("helics") - else com.typesafe.config.ConfigFactory.parseString("helics{}") - ), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") - else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") - ), - timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, + chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, + chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), + timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution: scala.Int, - upperBoundResolution: scala.Int + lowerBoundResolution : scala.Int, + upperBoundResolution : scala.Int ) - object H3taz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile: java.lang.String + frequencyAdjustmentFile : java.lang.String ) - object Scenarios { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = - if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") - else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay: scala.Int, - interval: scala.Int + initialDelay : scala.Int, + interval : scala.Int ) - object ScheduleMonitorTask { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath: java.lang.String, - parkingCostScalingFactor: scala.Double, - parkingFilePath: java.lang.String, - parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor: scala.Double + filePath : java.lang.String, + parkingCostScalingFactor : scala.Double, + parkingFilePath : java.lang.String, + parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor : scala.Double ) - object Taz { - case class ParkingManager( - displayPerformanceTimings: scala.Boolean, - method: java.lang.String, - parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings : scala.Boolean, + method : java.lang.String, + parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) - object ParkingManager { - case class Parallel( - numberOfClusters: scala.Int + numberOfClusters : scala.Int ) - object Parallel { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - if (c.hasPathOrNull("parallel")) c.getConfig("parallel") - else com.typesafe.config.ConfigFactory.parseString("parallel{}") - ) + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = - if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( - if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") - else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") - ), - parkingStallCountScalingFactor = - if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") - else 1.0 + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), + parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 ) } } - + case class Toll( - filePath: java.lang.String + filePath : java.lang.String ) - object Toll { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = - if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules: scala.Double, - rideHailPrice: scala.Double, - tollPrice: scala.Double, - transitCapacity: scala.Option[scala.Double], - transitPrice: scala.Double + fuelCapacityInJoules : scala.Double, + rideHailPrice : scala.Double, + tollPrice : scala.Double, + transitCapacity : scala.Option[scala.Double], + transitPrice : scala.Double ) - object Tuning { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = - if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = - if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) - c.getDouble("agentSampleSizeAsFractionOfPopulation") - else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents( - if (c.hasPathOrNull("agents")) c.getConfig("agents") - else com.typesafe.config.ConfigFactory.parseString("agents{}") - ), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( - if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") - else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") - ), - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = - if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") - else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz( - if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") - else com.typesafe.config.ConfigFactory.parseString("h3taz{}") - ), - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = - if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - randomSeedForPopulationSampling = - if (c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) - else None, - scenarios = BeamConfig.Beam.Agentsim.Scenarios( - if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") - else com.typesafe.config.ConfigFactory.parseString("scenarios{}") - ), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") - else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") - ), - schedulerParallelismWindow = - if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - snapLocationAndRemoveInvalidInputs = - c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), - taz = BeamConfig.Beam.Agentsim.Taz( - if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") - ), - thresholdForMakingParkingChoiceInMeters = - if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) - c.getInt("thresholdForMakingParkingChoiceInMeters") - else 100, - thresholdForWalkingInMeters = - if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll( - if (c.hasPathOrNull("toll")) c.getConfig("toll") - else com.typesafe.config.ConfigFactory.parseString("toll{}") - ), - tuning = BeamConfig.Beam.Agentsim.Tuning( - if (c.hasPathOrNull("tuning")) c.getConfig("tuning") - else com.typesafe.config.ConfigFactory.parseString("tuning{}") - ) + agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + randomSeedForPopulationSampling = if(c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) else None, + scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), + schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + snapLocationAndRemoveInvalidInputs = c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), + taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), + thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, + thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), + tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) ) } } - + case class Calibration( - counts: BeamConfig.Beam.Calibration.Counts, - google: BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio: scala.Double, - mode: BeamConfig.Beam.Calibration.Mode, - objectiveFunction: java.lang.String, - roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, - studyArea: BeamConfig.Beam.Calibration.StudyArea + counts : BeamConfig.Beam.Calibration.Counts, + google : BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio : scala.Double, + mode : BeamConfig.Beam.Calibration.Mode, + objectiveFunction : java.lang.String, + roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, + studyArea : BeamConfig.Beam.Calibration.StudyArea ) - object Calibration { - case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Int, - inputCountsFile: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Int, + inputCountsFile : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes ) - object Google { - case class TravelTimes( - enable: scala.Boolean, - iterationInterval: scala.Int, - minDistanceInMeters: scala.Double, - numDataPointsOver24Hours: scala.Int, - offPeakEnabled: scala.Boolean, - queryDate: java.lang.String, - tolls: scala.Boolean + enable : scala.Boolean, + iterationInterval : scala.Int, + minDistanceInMeters : scala.Double, + numDataPointsOver24Hours : scala.Int, + offPeakEnabled : scala.Boolean, + queryDate : java.lang.String, + tolls : scala.Boolean ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = - if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = - if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class Mode( - benchmarkFilePath: java.lang.String + benchmarkFilePath : java.lang.String ) - object Mode { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) - object RoadNetwork { - case class TravelTimes( - zoneBoundariesFilePath: java.lang.String, - zoneODTravelTimesFilePath: java.lang.String + zoneBoundariesFilePath : java.lang.String, + zoneODTravelTimesFilePath : java.lang.String ) - object TravelTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = - if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = - if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") - else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") - ) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) ) } } - + case class StudyArea( - enabled: scala.Boolean, - lat: scala.Double, - lon: scala.Double, - radius: scala.Double + enabled : scala.Boolean, + lat : scala.Double, + lon : scala.Double, + radius : scala.Double ) - object StudyArea { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - google = BeamConfig.Beam.Calibration.Google( - if (c.hasPathOrNull("google")) c.getConfig("google") - else com.typesafe.config.ConfigFactory.parseString("google{}") - ), - meanToCountsWeightRatio = - if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode( - if (c.hasPathOrNull("mode")) c.getConfig("mode") - else com.typesafe.config.ConfigFactory.parseString("mode{}") - ), - objectiveFunction = - if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") - else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( - if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") - else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") - ), - studyArea = BeamConfig.Beam.Calibration.StudyArea( - if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") - else com.typesafe.config.ConfigFactory.parseString("studyArea{}") - ) + counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), + meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), + objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), + studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) ) } } - + case class Cluster( - clusterType: scala.Option[java.lang.String], - enabled: scala.Boolean + clusterType : scala.Option[java.lang.String], + enabled : scala.Boolean ) - object Cluster { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor: BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval: scala.Int, - clearRoutedOutstandingWorkEnabled: scala.Boolean, - debugActorTimerIntervalInSec: scala.Int, - debugEnabled: scala.Boolean, - maxSimulationStepTimeBeforeConsideredStuckMin: scala.Int, - memoryConsumptionDisplayTimeoutInSec: scala.Int, - messageLogging: scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork: scala.Int, - stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation: BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives: scala.Boolean, - writeRealizedModeChoiceFile: scala.Boolean + actor : BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval : scala.Int, + clearRoutedOutstandingWorkEnabled : scala.Boolean, + debugActorTimerIntervalInSec : scala.Int, + debugEnabled : scala.Boolean, + maxSimulationStepTimeBeforeConsideredStuckMin : scala.Int, + memoryConsumptionDisplayTimeoutInSec : scala.Int, + messageLogging : scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork : scala.Int, + stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation : BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives : scala.Boolean, + writeRealizedModeChoiceFile : scala.Boolean ) - object Debug { - case class Actor( - logDepth: scala.Int + logDepth : scala.Int ) - object Actor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs: scala.Long, - checkMaxNumberOfMessagesEnabled: scala.Boolean, - defaultTimeoutMs: scala.Long, - enabled: scala.Boolean, - overallSimulationTimeoutMs: scala.Long, - thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs : scala.Long, + checkMaxNumberOfMessagesEnabled : scala.Boolean, + defaultTimeoutMs : scala.Long, + enabled : scala.Boolean, + overallSimulationTimeoutMs : scala.Long, + thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) - object StuckAgentDetection { - case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs: scala.Long, - triggerType: java.lang.String + actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs : scala.Long, + triggerType : java.lang.String ) - object Thresholds$Elm { - case class ActorTypeToMaxNumberOfMessages( - population: scala.Option[scala.Int], - rideHailAgent: scala.Option[scala.Int], - rideHailManager: scala.Option[scala.Int], - transitDriverAgent: scala.Option[scala.Int] + population : scala.Option[scala.Int], + rideHailAgent : scala.Option[scala.Int], + rideHailManager : scala.Option[scala.Int], + transitDriverAgent : scala.Option[scala.Int] ) - object ActorTypeToMaxNumberOfMessages { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = - if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = - BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") - else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") - ), - markAsStuckAfterMs = - if (c.hasPathOrNull("markAsStuckAfterMs")) - c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 20000, - triggerType = - if (c.hasPathOrNull("triggerType")) c.getString("triggerType") - else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), + markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, + triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = - if (c.hasPathOrNull("checkIntervalMs")) - c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 200, - checkMaxNumberOfMessagesEnabled = - !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = - if (c.hasPathOrNull("defaultTimeoutMs")) - c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = - if (c.hasPathOrNull("overallSimulationTimeoutMs")) - c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) - else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, + checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.Debug.StuckAgentDetection - .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class TriggerMeasurer( - enabled: scala.Boolean, - writeStuckAgentDetectionConfig: scala.Boolean + enabled : scala.Boolean, + writeStuckAgentDetectionConfig : scala.Boolean ) - object TriggerMeasurer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = - !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram: scala.Boolean + createGCClassHistogram : scala.Boolean ) - object VmInformation { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor( - if (c.hasPathOrNull("actor")) c.getConfig("actor") - else com.typesafe.config.ConfigFactory.parseString("actor{}") - ), - agentTripScoresInterval = - if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = - c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = - if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - maxSimulationStepTimeBeforeConsideredStuckMin = - if (c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) - c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") - else 60, - memoryConsumptionDisplayTimeoutInSec = - if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) - c.getInt("memoryConsumptionDisplayTimeoutInSec") - else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = - if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) - c.getInt("secondsToWaitToClearRoutedOutstandingWork") - else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( - if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") - else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") - ), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( - if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") - else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") - ), - vmInformation = BeamConfig.Beam.Debug.VmInformation( - if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") - else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") - ), - writeModeChoiceAlternatives = - c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = - c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), + agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + maxSimulationStepTimeBeforeConsideredStuckMin = if(c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") else 60, + memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), + vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), + writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output: BeamConfig.Beam.Exchange.Output, - scenario: BeamConfig.Beam.Exchange.Scenario + output : BeamConfig.Beam.Exchange.Output, + scenario : BeamConfig.Beam.Exchange.Scenario ) - object Exchange { - case class Output( - activitySimSkimsEnabled: scala.Boolean, - geo: BeamConfig.Beam.Exchange.Output.Geo + activitySimSkimsEnabled : scala.Boolean, + geo : BeamConfig.Beam.Exchange.Output.Geo, + sendNonChosenTripsToSkimmer : scala.Boolean ) - object Output { - case class Geo( - filePath: scala.Option[java.lang.String] + filePath : scala.Option[java.lang.String] ) - object Geo { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = - c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo( - if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") - ) + activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")), + sendNonChosenTripsToSkimmer = !c.hasPathOrNull("sendNonChosenTripsToSkimmer") || c.getBoolean("sendNonChosenTripsToSkimmer") ) } } - + case class Scenario( - convertWgs2Utm: scala.Boolean, - fileFormat: java.lang.String, - folder: java.lang.String, - modeMap: scala.Option[scala.List[java.lang.String]], - source: java.lang.String, - urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm : scala.Boolean, + fileFormat : java.lang.String, + folder : java.lang.String, + modeMap : scala.Option[scala.List[java.lang.String]], + source : java.lang.String, + urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim ) - object Scenario { - case class Urbansim( - activitySimEnabled: scala.Boolean + activitySimEnabled : scala.Boolean ) - object Urbansim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ) + fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - scenario = BeamConfig.Beam.Exchange.Scenario( - if (c.hasPathOrNull("scenario")) c.getConfig("scenario") - else com.typesafe.config.ConfigFactory.parseString("scenario{}") - ) + output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) ) } } - + case class Experimental( - optimizer: BeamConfig.Beam.Experimental.Optimizer + optimizer : BeamConfig.Beam.Experimental.Optimizer ) - object Experimental { - case class Optimizer( - enabled: scala.Boolean + enabled : scala.Boolean ) - object Optimizer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer( - if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") - else com.typesafe.config.ConfigFactory.parseString("optimizer{}") - ) + optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) ) } } - + case class Input( - lastBaseOutputDir: java.lang.String, - simulationPrefix: java.lang.String + lastBaseOutputDir : java.lang.String, + simulationPrefix : java.lang.String ) - object Input { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn: scala.Boolean + keepConsoleAppenderOn : scala.Boolean ) - object Logger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level: java.lang.String + level : java.lang.String ) - object Metrics { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation: scala.Boolean + writePlansAndStopSimulation : scala.Boolean ) - object Output { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = - c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory: scala.Boolean, - baseOutputDirectory: java.lang.String, - collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, - defaultWriteInterval: scala.Int, - displayPerformanceTimings: scala.Boolean, - events: BeamConfig.Beam.Outputs.Events, - generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval: scala.Int, - matsim: BeamConfig.Beam.Outputs.Matsim, - stats: BeamConfig.Beam.Outputs.Stats, - writeAnalysis: scala.Boolean, - writeEventsInterval: scala.Int, - writeGraphs: scala.Boolean, - writePlansInterval: scala.Int, - writeR5RoutesInterval: scala.Int + addTimestampToOutputDirectory : scala.Boolean, + baseOutputDirectory : java.lang.String, + collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, + defaultWriteInterval : scala.Int, + displayPerformanceTimings : scala.Boolean, + events : BeamConfig.Beam.Outputs.Events, + generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval : scala.Int, + matsim : BeamConfig.Beam.Outputs.Matsim, + stats : BeamConfig.Beam.Outputs.Stats, + writeAnalysis : scala.Boolean, + writeEventsInterval : scala.Int, + writeGraphs : scala.Boolean, + writePlansInterval : scala.Int, + writeR5RoutesInterval : scala.Int ) - object Outputs { - case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime: scala.Int, - startTime: scala.Int + endTime : scala.Int, + startTime : scala.Int ) - object GeneralizedLinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles: java.lang.String, - deleteRootFolderFiles: java.lang.String + deleteITERSFolderFiles : java.lang.String, + deleteRootFolderFiles : java.lang.String ) - object Matsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = - if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = - if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize: scala.Int + binSize : scala.Int ) - object Stats { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = - !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = - if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = - !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( - "collectAndCreateBeamAnalysisAndGraphs" - ), - defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = - c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( - if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") - else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") - ), - generalizedLinkStatsInterval = - if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ), - stats = BeamConfig.Beam.Outputs.Stats( - if (c.hasPathOrNull("stats")) c.getConfig("stats") - else com.typesafe.config.ConfigFactory.parseString("stats{}") - ), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), + defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), + generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), + stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim: BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager: BeamConfig.Beam.Physsim.EventManager, - events: BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia: scala.Boolean, - eventsSampling: scala.Double, - flowCapacityFactor: scala.Double, - initializeRouterWithFreeFlowTimes: scala.Boolean, - inputNetworkFilePath: java.lang.String, - jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize: scala.Int, - linkStatsWriteInterval: scala.Int, - maxLinkLengthToApplySpeedScalingFactor: scala.Double, - name: java.lang.String, - network: BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath: java.lang.String, - parbprsim: BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize: scala.Double, - quick_fix_minCarSpeedInMetersPerSecond: scala.Double, - relaxation: BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim: scala.Boolean, - speedScalingFactor: scala.Double, - storageCapacityFactor: scala.Double, - writeEventsInterval: scala.Int, - writePlansInterval: scala.Int, - writeRouteHistoryInterval: scala.Int + bprsim : BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager : BeamConfig.Beam.Physsim.EventManager, + events : BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia : scala.Boolean, + eventsSampling : scala.Double, + flowCapacityFactor : scala.Double, + initializeRouterWithFreeFlowTimes : scala.Boolean, + inputNetworkFilePath : java.lang.String, + jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize : scala.Int, + linkStatsWriteInterval : scala.Int, + maxLinkLengthToApplySpeedScalingFactor : scala.Double, + name : java.lang.String, + network : BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath : java.lang.String, + parbprsim : BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize : scala.Double, + quick_fix_minCarSpeedInMetersPerSecond : scala.Double, + relaxation : BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim : scala.Boolean, + speedScalingFactor : scala.Double, + storageCapacityFactor : scala.Double, + writeEventsInterval : scala.Int, + writePlansInterval : scala.Int, + writeRouteHistoryInterval : scala.Int ) - object Physsim { - case class Bprsim( - inFlowAggregationTimeWindowInSeconds: scala.Int, - minFlowToUseBPRFunction: scala.Int, - travelTimeFunction: java.lang.String + inFlowAggregationTimeWindowInSeconds : scala.Int, + minFlowToUseBPRFunction : scala.Int, + travelTimeFunction : java.lang.String ) - object Bprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = - if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) - c.getInt("inFlowAggregationTimeWindowInSeconds") - else 900, - minFlowToUseBPRFunction = - if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, + minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor: scala.Double + congestionFactor : scala.Double ) - object CchRoutingAssignment { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax: scala.Int, - departureTimeShiftMin: scala.Int, - fractionOfEventsToDuplicate: scala.Double + departureTimeShiftMax : scala.Int, + departureTimeShiftMin : scala.Int, + fractionOfEventsToDuplicate : scala.Double ) - object DuplicatePTE { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = - if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = - if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = - if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads: scala.Int, - `type`: java.lang.String + numberOfThreads : scala.Int, + `type` : java.lang.String ) - object EventManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite: java.lang.String, - fileOutputFormats: java.lang.String + eventsToWrite : java.lang.String, + fileOutputFormats : java.lang.String ) - object Events { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = - if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") - else - "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) - object Jdeqsim { - case class AgentSimPhysSimInterfaceDebugger( - enabled: scala.Boolean + enabled : scala.Boolean ) - object AgentSimPhysSimInterfaceDebugger { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, - capacityPlansWriteInterval: scala.Int, - enabled: scala.Boolean, - minRoadCapacity: scala.Int, - minSpeedMetersPerSec: scala.Int, - speedAdjustmentFactor: scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, + capacityPlansWriteInterval : scala.Int, + enabled : scala.Boolean, + minRoadCapacity : scala.Int, + minSpeedMetersPerSec : scala.Int, + speedAdjustmentFactor : scala.Double ) - object Cacc { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = - if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) - c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") - else 1.3, - capacityPlansWriteInterval = - if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = - if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = - if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, + capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( - if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") - else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") - ), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - if (c.hasPathOrNull("cacc")) c.getConfig("cacc") - else com.typesafe.config.ConfigFactory.parseString("cacc{}") - ) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) ) } } - + case class Network( - maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties, - removeIslands: scala.Boolean + maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties, + removeIslands : scala.Boolean ) - object Network { - case class MaxSpeedInference( - enabled: scala.Boolean, - `type`: java.lang.String + enabled : scala.Boolean, + `type` : java.lang.String ) - object MaxSpeedInference { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled: scala.Boolean, - livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled : scala.Boolean, + livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) - object OverwriteRoadTypeProperties { - case class LivingStreet( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object LivingStreet { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Minor { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Motorway { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object MotorwayLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Primary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object PrimaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Residential { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Secondary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object SecondaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Tertiary { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TertiaryLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Trunk { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object TrunkLink { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha: scala.Option[scala.Double], - beta: scala.Option[scala.Double], - capacity: scala.Option[scala.Int], - lanes: scala.Option[scala.Int], - speed: scala.Option[scala.Double] + alpha : scala.Option[scala.Double], + beta : scala.Option[scala.Double], + capacity : scala.Option[scala.Int], + lanes : scala.Option[scala.Int], + speed : scala.Option[scala.Double] ) - object Unclassified { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") - else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") - ), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - if (c.hasPathOrNull("minor")) c.getConfig("minor") - else com.typesafe.config.ConfigFactory.parseString("minor{}") - ), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - if (c.hasPathOrNull("motorway")) c.getConfig("motorway") - else com.typesafe.config.ConfigFactory.parseString("motorway{}") - ), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") - else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") - ), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - if (c.hasPathOrNull("primary")) c.getConfig("primary") - else com.typesafe.config.ConfigFactory.parseString("primary{}") - ), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") - else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") - ), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - if (c.hasPathOrNull("residential")) c.getConfig("residential") - else com.typesafe.config.ConfigFactory.parseString("residential{}") - ), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - if (c.hasPathOrNull("secondary")) c.getConfig("secondary") - else com.typesafe.config.ConfigFactory.parseString("secondary{}") - ), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") - else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") - ), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") - else com.typesafe.config.ConfigFactory.parseString("tertiary{}") - ), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") - else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") - ), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - if (c.hasPathOrNull("trunk")) c.getConfig("trunk") - else com.typesafe.config.ConfigFactory.parseString("trunk{}") - ), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") - else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") - ), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") - else com.typesafe.config.ConfigFactory.parseString("unclassified{}") - ) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( - if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") - else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") - ), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") - else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") - ), - removeIslands = !c.hasPathOrNull("removeIslands") || c.getBoolean("removeIslands") + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")), + removeIslands = !c.hasPathOrNull("removeIslands") || c.getBoolean("removeIslands") ) } } - + case class Parbprsim( - numberOfClusters: scala.Int, - syncInterval: scala.Int + numberOfClusters : scala.Int, + syncInterval : scala.Int ) - object Parbprsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier: scala.Double, - enabled: scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime: scala.Int + additionalTravelTimeMultiplier : scala.Double, + enabled : scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime : scala.Int ) - object PickUpDropOffAnalysis { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = - if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") - else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = - if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) - c.getInt("secondsFromPickUpPropOffToAffectTravelTime") - else 600 + additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 ) } } - + case class Relaxation( - experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type`: java.lang.String + experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type` : java.lang.String ) - object Relaxation { - case class Experiment20( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment20 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration: scala.Boolean, - clearRoutesEveryIteration: scala.Boolean, - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + clearModesEveryIteration : scala.Boolean, + clearRoutesEveryIteration : scala.Boolean, + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment21 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = - !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = - !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute: scala.Double, - internalNumberOfIterations: scala.Int + fractionOfPopulationToReroute : scala.Double, + internalNumberOfIterations : scala.Int ) - object Experiment30 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = - if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") - else 0.1, - internalNumberOfIterations = - if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, + internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment40 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment50 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment51 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate: scala.Option[scala.List[scala.Double]] + percentToSimulate : scala.Option[scala.List[scala.Double]] ) - object Experiment52 { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = - if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( - if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") - else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") - ), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( - if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") - else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") - ), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( - if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") - else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") - ), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( - if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") - else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") - ), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( - if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") - else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") - ), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( - if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") - else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") - ), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( - if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") - else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") - ), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim( - if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") - else com.typesafe.config.ConfigFactory.parseString("bprsim{}") - ), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( - if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") - else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") - ), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( - if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") - else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") - ), - eventManager = BeamConfig.Beam.Physsim.EventManager( - if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") - else com.typesafe.config.ConfigFactory.parseString("eventManager{}") - ), - events = BeamConfig.Beam.Physsim.Events( - if (c.hasPathOrNull("events")) c.getConfig("events") - else com.typesafe.config.ConfigFactory.parseString("events{}") - ), - eventsForFullVersionOfVia = - !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = - !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = - if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") - else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( - if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") - else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") - ), - linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = - if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = - if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) - c.getDouble("maxLinkLengthToApplySpeedScalingFactor") - else 50.0, - name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - overwriteLinkParamPath = - if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim( - if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") - else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") - ), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") - else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") - ), - ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = - if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) - c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") - else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation( - if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") - else com.typesafe.config.ConfigFactory.parseString("relaxation{}") - ), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = - if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = - if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), + eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), + events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), + eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), + linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, + name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), + ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1: scala.Double, - ModuleProbability_2: scala.Double, - ModuleProbability_3: scala.Double, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - clearModes: BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation: scala.Double, - maxAgentPlanMemorySize: scala.Int + ModuleProbability_1 : scala.Double, + ModuleProbability_2 : scala.Double, + ModuleProbability_3 : scala.Double, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + clearModes : BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation : scala.Double, + maxAgentPlanMemorySize : scala.Int ) - object Replanning { - case class ClearModes( - iteration: scala.Int, - modes: scala.Option[scala.List[java.lang.String]], - strategy: java.lang.String + iteration : scala.Int, + modes : scala.Option[scala.List[java.lang.String]], + strategy : java.lang.String ) - object ClearModes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes( - if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") - else com.typesafe.config.ConfigFactory.parseString("clearModes{}") - ), - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getDouble("fractionOfIterationsToDisableInnovation") - else Double.PositiveInfinity, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim: BeamConfig.Beam.Router.Skim + skim : BeamConfig.Beam.Router.Skim ) - object Router { - case class Skim( - activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims: scala.Int, - origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval: scala.Int, - writeSkimsInterval: scala.Int + activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims : scala.Int, + origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval : scala.Int, + writeSkimsInterval : scala.Int ) - object Skim { - case class ActivitySimSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object ActivitySimSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object DriveTimeSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") - else "skimsTravelTimeObservedVsSimulated", - name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", + name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String, - poolingTravelTimeOveheadFactor: scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, - writeFullSkimsInterval: scala.Int + fileBaseName : java.lang.String, + name : java.lang.String, + poolingTravelTimeOveheadFactor : scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, + writeFullSkimsInterval : scala.Int ) - object OriginDestinationSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = - if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") - else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = - if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) - c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") - else 0, - writeFullSkimsInterval = - if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, + writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName: java.lang.String, - geoHierarchy: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + geoHierarchy : java.lang.String, + name : java.lang.String ) - object TazSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName: java.lang.String, - name: java.lang.String + fileBaseName : java.lang.String, + name : java.lang.String ) - object TransitCrowdingSkimmer { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = - if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") - else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") - ), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") - else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") - ), - keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") - else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") - ), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( - if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") - else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") - ), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") - else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") - ), - writeAggregatedSkimsInterval = - if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), + keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), + writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim( - if (c.hasPathOrNull("skim")) c.getConfig("skim") - else com.typesafe.config.ConfigFactory.parseString("skim{}") - ) + skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) ) } } - + case class Routing( - baseDate: java.lang.String, - carRouter: java.lang.String, - gh: BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS: scala.Int, - overrideNetworkTravelTimesUsingSkims: scala.Boolean, - r5: BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor: scala.Double, - startingIterationForTravelTimesMSA: scala.Int, - transitOnStreetNetwork: scala.Boolean, - writeRoutingStatistic: scala.Boolean + baseDate : java.lang.String, + carRouter : java.lang.String, + gh : BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS : scala.Int, + overrideNetworkTravelTimesUsingSkims : scala.Boolean, + r5 : BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor : scala.Double, + startingIterationForTravelTimesMSA : scala.Int, + transitOnStreetNetwork : scala.Boolean, + writeRoutingStatistic : scala.Boolean ) - object Routing { - case class Gh( - useAlternativeRoutes: scala.Boolean + useAlternativeRoutes : scala.Boolean ) - object Gh { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath: java.lang.String, - bikeLaneScaleFactor: scala.Double, - departureWindow: scala.Double, - directory: java.lang.String, - directory2: scala.Option[java.lang.String], - linkRadiusMeters: scala.Double, - mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples: scala.Int, - osmMapdbFile: java.lang.String, - travelTimeNoiseFraction: scala.Double + bikeLaneLinkIdsFilePath : java.lang.String, + bikeLaneScaleFactor : scala.Double, + departureWindow : scala.Double, + directory : java.lang.String, + directory2 : scala.Option[java.lang.String], + linkRadiusMeters : scala.Double, + mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples : scala.Int, + osmMapdbFile : java.lang.String, + travelTimeNoiseFraction : scala.Double ) - object R5 { - case class MNetBuilder( - fromCRS: java.lang.String, - toCRS: java.lang.String + fromCRS : java.lang.String, + toCRS : java.lang.String ) - object MNetBuilder { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike: scala.Int + bike : scala.Int ) - object MaxDistanceLimitByModeInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = - if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = - if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( - if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") - else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") - ), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") - ), - numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmMapdbFile = - if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") - else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = - if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), + numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh( - if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") - ), - minimumPossibleSkimBasedTravelTimeInS = - if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) - c.getInt("minimumPossibleSkimBasedTravelTimeInS") - else 60, - overrideNetworkTravelTimesUsingSkims = - c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( - "overrideNetworkTravelTimesUsingSkims" - ), - r5 = BeamConfig.Beam.Routing.R5( - if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") - ), - skimTravelTimesScalingFactor = - if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = - if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") - else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), + minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, + overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), + r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), + skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric: BeamConfig.Beam.Sim.Metric, - termination: BeamConfig.Beam.Sim.Termination + metric : BeamConfig.Beam.Sim.Metric, + termination : BeamConfig.Beam.Sim.Termination ) - object Sim { - case class Metric( - collector: BeamConfig.Beam.Sim.Metric.Collector + collector : BeamConfig.Beam.Sim.Metric.Collector ) - object Metric { - case class Collector( - influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics: java.lang.String + influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics : java.lang.String ) - object Collector { - case class InfluxDbSimulationMetricCollector( - connectionString: java.lang.String, - database: java.lang.String + connectionString : java.lang.String, + database : java.lang.String ) - object InfluxDbSimulationMetricCollector { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = - if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = - BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - if (c.hasPathOrNull("influxDbSimulationMetricCollector")) - c.getConfig("influxDbSimulationMetricCollector") - else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") - ), - metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), + metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector( - if (c.hasPathOrNull("collector")) c.getConfig("collector") - else com.typesafe.config.ConfigFactory.parseString("collector{}") - ) + collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) ) } } - + case class Termination( - criterionName: java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName : java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) - object Termination { - case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration: scala.Int, - minLastIteration: scala.Int, - relativeTolerance: scala.Double + maxLastIteration : scala.Int, + minLastIteration : scala.Int, + relativeTolerance : scala.Double ) - object TerminateAtRideHailFleetStoredElectricityConvergence { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = - if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = - BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) - c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") - else - com.typesafe.config.ConfigFactory - .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") - ) + criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric( - if (c.hasPathOrNull("metric")) c.getConfig("metric") - else com.typesafe.config.ConfigFactory.parseString("metric{}") - ), - termination = BeamConfig.Beam.Sim.Termination( - if (c.hasPathOrNull("termination")) c.getConfig("termination") - else com.typesafe.config.ConfigFactory.parseString("termination{}") - ) + metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), + termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) ) } } - + case class Spatial( - boundingBoxBuffer: scala.Int, - localCRS: java.lang.String + boundingBoxBuffer : scala.Int, + localCRS : java.lang.String ) - object Spatial { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear ) - object Urbansim { - case class BackgroundODSkimsCreator( - calculationTimeoutHours: scala.Int, - enabled: scala.Boolean, - maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes: scala.Int, - peakHours: scala.Option[scala.List[scala.Double]], - routerType: java.lang.String, - skimsGeoType: java.lang.String, - skimsKind: java.lang.String + calculationTimeoutHours : scala.Int, + enabled : scala.Boolean, + maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes : scala.Int, + peakHours : scala.Option[scala.List[scala.Double]], + routerType : java.lang.String, + skimsGeoType : java.lang.String, + skimsKind : java.lang.String ) - object BackgroundODSkimsCreator { - case class MaxTravelDistanceInMeters( - bike: scala.Int, - walk: scala.Int + bike : scala.Int, + walk : scala.Int ) - object MaxTravelDistanceInMeters { - - def apply( - c: com.typesafe.config.Config - ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive: scala.Boolean, - transit: scala.Boolean, - walk: scala.Boolean + drive : scala.Boolean, + transit : scala.Boolean, + walk : scala.Boolean ) - object ModesToBuild { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = - if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") - else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") - ), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") - else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") - ), - numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), + numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes: scala.Double, - bike: scala.Double, - car: scala.Double, - drive_transit: scala.Double, - walk: scala.Double, - walk_transit: scala.Double + allModes : scala.Double, + bike : scala.Double, + car : scala.Double, + drive_transit : scala.Double, + walk : scala.Double, + walk_transit : scala.Double ) - object FractionOfModesToClear { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") - else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") - ), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( - if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") - else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") - ) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) ) } } - + case class WarmStart( - path: java.lang.String, - prepareData: scala.Boolean, - samplePopulationIntegerFlag: scala.Int, - skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type`: java.lang.String + path : java.lang.String, + prepareData : scala.Boolean, + samplePopulationIntegerFlag : scala.Int, + skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type` : java.lang.String ) - object WarmStart { - case class SkimsFilePaths$Elm( - skimType: java.lang.String, - skimsFilePath: java.lang.String + skimType : java.lang.String, + skimsFilePath : java.lang.String ) - object SkimsFilePaths$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if (c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = - if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = - if (c.hasPathOrNull("skimsFilePaths")) - scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) - else None, - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if(c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim( - if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") - else com.typesafe.config.ConfigFactory.parseString("agentsim{}") - ), - calibration = BeamConfig.Beam.Calibration( - if (c.hasPathOrNull("calibration")) c.getConfig("calibration") - else com.typesafe.config.ConfigFactory.parseString("calibration{}") - ), - cluster = BeamConfig.Beam.Cluster( - if (c.hasPathOrNull("cluster")) c.getConfig("cluster") - else com.typesafe.config.ConfigFactory.parseString("cluster{}") - ), - debug = BeamConfig.Beam.Debug( - if (c.hasPathOrNull("debug")) c.getConfig("debug") - else com.typesafe.config.ConfigFactory.parseString("debug{}") - ), - exchange = BeamConfig.Beam.Exchange( - if (c.hasPathOrNull("exchange")) c.getConfig("exchange") - else com.typesafe.config.ConfigFactory.parseString("exchange{}") - ), - experimental = BeamConfig.Beam.Experimental( - if (c.hasPathOrNull("experimental")) c.getConfig("experimental") - else com.typesafe.config.ConfigFactory.parseString("experimental{}") - ), - input = BeamConfig.Beam.Input( - if (c.hasPathOrNull("input")) c.getConfig("input") - else com.typesafe.config.ConfigFactory.parseString("input{}") - ), - inputDirectory = - if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger( - if (c.hasPathOrNull("logger")) c.getConfig("logger") - else com.typesafe.config.ConfigFactory.parseString("logger{}") - ), - metrics = BeamConfig.Beam.Metrics( - if (c.hasPathOrNull("metrics")) c.getConfig("metrics") - else com.typesafe.config.ConfigFactory.parseString("metrics{}") - ), - output = BeamConfig.Beam.Output( - if (c.hasPathOrNull("output")) c.getConfig("output") - else com.typesafe.config.ConfigFactory.parseString("output{}") - ), - outputs = BeamConfig.Beam.Outputs( - if (c.hasPathOrNull("outputs")) c.getConfig("outputs") - else com.typesafe.config.ConfigFactory.parseString("outputs{}") - ), - physsim = BeamConfig.Beam.Physsim( - if (c.hasPathOrNull("physsim")) c.getConfig("physsim") - else com.typesafe.config.ConfigFactory.parseString("physsim{}") - ), - replanning = BeamConfig.Beam.Replanning( - if (c.hasPathOrNull("replanning")) c.getConfig("replanning") - else com.typesafe.config.ConfigFactory.parseString("replanning{}") - ), - router = BeamConfig.Beam.Router( - if (c.hasPathOrNull("router")) c.getConfig("router") - else com.typesafe.config.ConfigFactory.parseString("router{}") - ), - routing = BeamConfig.Beam.Routing( - if (c.hasPathOrNull("routing")) c.getConfig("routing") - else com.typesafe.config.ConfigFactory.parseString("routing{}") - ), - sim = BeamConfig.Beam.Sim( - if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") - ), - spatial = BeamConfig.Beam.Spatial( - if (c.hasPathOrNull("spatial")) c.getConfig("spatial") - else com.typesafe.config.ConfigFactory.parseString("spatial{}") - ), - urbansim = BeamConfig.Beam.Urbansim( - if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") - else com.typesafe.config.ConfigFactory.parseString("urbansim{}") - ), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart( - if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") - else com.typesafe.config.ConfigFactory.parseString("warmStart{}") - ) + actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), + calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), + cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), + debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), + exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), + experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), + input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), + inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), + metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), + output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), + outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), + physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), + replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), + router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), + routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), + sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), + spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), + urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) ) } } - + case class Matsim( - conversion: BeamConfig.Matsim.Conversion, - modules: BeamConfig.Matsim.Modules + conversion : BeamConfig.Matsim.Conversion, + modules : BeamConfig.Matsim.Modules ) - object Matsim { - case class Conversion( - defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles: scala.Boolean, - matsimNetworkFile: java.lang.String, - osmFile: java.lang.String, - populationFile: java.lang.String, - scenarioDirectory: java.lang.String, - shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile: java.lang.String + defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles : scala.Boolean, + matsimNetworkFile : java.lang.String, + osmFile : java.lang.String, + populationFile : java.lang.String, + scenarioDirectory : java.lang.String, + shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile : java.lang.String ) - object Conversion { - case class DefaultHouseholdIncome( - currency: java.lang.String, - period: java.lang.String, - value: scala.Int + currency : java.lang.String, + period : java.lang.String, + value : scala.Int ) - object DefaultHouseholdIncome { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if (c.hasPathOrNull("period")) c.getString("period") else "year", - value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if(c.hasPathOrNull("period")) c.getString("period") else "year", + value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile: java.lang.String, - tazIdFieldName: java.lang.String + shapeFile : java.lang.String, + tazIdFieldName : java.lang.String ) - object ShapeConfig { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") - else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") - ), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = - if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = - if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = - if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") - else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( - if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") - else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") - ), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode: BeamConfig.Matsim.Modules.ChangeMode, - controler: BeamConfig.Matsim.Modules.Controler, - counts: BeamConfig.Matsim.Modules.Counts, - global: BeamConfig.Matsim.Modules.Global, - households: BeamConfig.Matsim.Modules.Households, - linkStats: BeamConfig.Matsim.Modules.LinkStats, - network: BeamConfig.Matsim.Modules.Network, - parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, - plans: BeamConfig.Matsim.Modules.Plans, - qsim: BeamConfig.Matsim.Modules.Qsim, - strategy: BeamConfig.Matsim.Modules.Strategy, - transit: BeamConfig.Matsim.Modules.Transit, - vehicles: BeamConfig.Matsim.Modules.Vehicles + changeMode : BeamConfig.Matsim.Modules.ChangeMode, + controler : BeamConfig.Matsim.Modules.Controler, + counts : BeamConfig.Matsim.Modules.Counts, + global : BeamConfig.Matsim.Modules.Global, + households : BeamConfig.Matsim.Modules.Households, + linkStats : BeamConfig.Matsim.Modules.LinkStats, + network : BeamConfig.Matsim.Modules.Network, + parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, + plans : BeamConfig.Matsim.Modules.Plans, + qsim : BeamConfig.Matsim.Modules.Qsim, + strategy : BeamConfig.Matsim.Modules.Strategy, + transit : BeamConfig.Matsim.Modules.Transit, + vehicles : BeamConfig.Matsim.Modules.Vehicles ) - object Modules { - case class ChangeMode( - modes: java.lang.String + modes : java.lang.String ) - object ChangeMode { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat: java.lang.String, - firstIteration: scala.Int, - lastIteration: scala.Int, - mobsim: java.lang.String, - outputDirectory: java.lang.String, - overwriteFiles: java.lang.String + eventsFileFormat : java.lang.String, + firstIteration : scala.Int, + lastIteration : scala.Int, + mobsim : java.lang.String, + outputDirectory : java.lang.String, + overwriteFiles : java.lang.String ) - object Controler { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = - if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations: scala.Int, - countsScaleFactor: scala.Double, - inputCountsFile: java.lang.String, - outputformat: java.lang.String, - writeCountsInterval: scala.Int + averageCountsOverIterations : scala.Int, + countsScaleFactor : scala.Double, + inputCountsFile : java.lang.String, + outputformat : java.lang.String, + writeCountsInterval : scala.Int ) - object Counts { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = - if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem: java.lang.String, - randomSeed: scala.Int + coordinateSystem : java.lang.String, + randomSeed : scala.Int ) - object Global { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile: java.lang.String, - inputHouseholdAttributesFile: java.lang.String + inputFile : java.lang.String, + inputHouseholdAttributesFile : java.lang.String ) - object Households { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = - if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = - if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") - else "/test/input/beamville/householdAttributes.xml" + inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations: scala.Int, - writeLinkStatsInterval: scala.Int + averageLinkStatsOverIterations : scala.Int, + writeLinkStatsInterval : scala.Int ) - object LinkStats { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = - if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = - if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile: java.lang.String + inputNetworkFile : java.lang.String ) - object Network { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = - if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") - else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents: scala.Int, - numberOfThreads: scala.Int, - oneThreadPerHandler: scala.Boolean, - synchronizeOnSimSteps: scala.Boolean + estimatedNumberOfEvents : scala.Int, + numberOfThreads : scala.Int, + oneThreadPerHandler : scala.Boolean, + synchronizeOnSimSteps : scala.Boolean ) - object ParallelEventHandling { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = - if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta: scala.Long, - earlyDeparture: scala.Long, - lateArrival: scala.Long, - learningRate: scala.Long, - parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing: scala.Long, - traveling: scala.Long, - waiting: scala.Long, - writeExperiencedPlans: scala.Boolean + BrainExpBeta : scala.Long, + earlyDeparture : scala.Long, + lateArrival : scala.Long, + learningRate : scala.Long, + parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing : scala.Long, + traveling : scala.Long, + waiting : scala.Long, + writeExperiencedPlans : scala.Boolean ) - object PlanCalcScore { - case class Parameterset$Elm( - activityType: java.lang.String, - priority: scala.Int, - scoringThisActivityAtAll: scala.Boolean, - `type`: java.lang.String, - typicalDuration: java.lang.String, - typicalDurationScoreComputation: java.lang.String + activityType : java.lang.String, + priority : scala.Int, + scoringThisActivityAtAll : scala.Boolean, + `type` : java.lang.String, + typicalDuration : java.lang.String, + typicalDurationScoreComputation : java.lang.String ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = - !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = - if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") - else "uniform" + activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = - if (c.hasPathOrNull("BrainExpBeta")) - c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) - else 2, - earlyDeparture = - if (c.hasPathOrNull("earlyDeparture")) - c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, - lateArrival = - if (c.hasPathOrNull("lateArrival")) - c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) - else -18, - learningRate = - if (c.hasPathOrNull("learningRate")) - c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) - else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = - if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) - else 6, - traveling = - if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) - else -6, - waiting = - if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) - else 0, + BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, + earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, + learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, + traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, + waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.PlanCalcScore - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Plans( - inputPersonAttributesFile: java.lang.String, - inputPlansFile: java.lang.String + inputPersonAttributesFile : java.lang.String, + inputPlansFile : java.lang.String ) - object Plans { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = - if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") - else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = - if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") - else "/test/input/beamville/population.xml" + inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime: java.lang.String, - snapshotperiod: java.lang.String, - startTime: java.lang.String + endTime : java.lang.String, + snapshotperiod : java.lang.String, + startTime : java.lang.String ) - object Qsim { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1: scala.Int, - ModuleProbability_2: scala.Int, - ModuleProbability_3: scala.Int, - ModuleProbability_4: scala.Int, - Module_1: java.lang.String, - Module_2: java.lang.String, - Module_3: java.lang.String, - Module_4: java.lang.String, - fractionOfIterationsToDisableInnovation: scala.Int, - maxAgentPlanMemorySize: scala.Int, - parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval: java.lang.String + ModuleProbability_1 : scala.Int, + ModuleProbability_2 : scala.Int, + ModuleProbability_3 : scala.Int, + ModuleProbability_4 : scala.Int, + Module_1 : java.lang.String, + Module_2 : java.lang.String, + Module_3 : java.lang.String, + Module_4 : java.lang.String, + fractionOfIterationsToDisableInnovation : scala.Int, + maxAgentPlanMemorySize : scala.Int, + parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval : java.lang.String ) - object Strategy { - case class Parameterset$Elm( - disableAfterIteration: scala.Int, - strategyName: java.lang.String, - `type`: java.lang.String, - weight: scala.Int + disableAfterIteration : scala.Int, + strategyName : java.lang.String, + `type` : java.lang.String, + weight : scala.Int ) - object Parameterset$Elm { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = - if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = - if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) - c.getInt("fractionOfIterationsToDisableInnovation") - else 999999, - maxAgentPlanMemorySize = - if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = - if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") - else "WorstPlanForRemovalSelector" - ) - } - - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( - cl: com.typesafe.config.ConfigList - ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, + maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" + ) + } + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala - .map(cv => - BeamConfig.Matsim.Modules.Strategy - .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) - ) - .toList + cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList } } - + case class Transit( - transitModes: java.lang.String, - useTransit: scala.Boolean, - vehiclesFile: java.lang.String + transitModes : java.lang.String, + useTransit : scala.Boolean, + vehiclesFile : java.lang.String ) - object Transit { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile: java.lang.String + vehiclesFile : java.lang.String ) - object Vehicles { - def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode( - if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") - else com.typesafe.config.ConfigFactory.parseString("changeMode{}") - ), - controler = BeamConfig.Matsim.Modules.Controler( - if (c.hasPathOrNull("controler")) c.getConfig("controler") - else com.typesafe.config.ConfigFactory.parseString("controler{}") - ), - counts = BeamConfig.Matsim.Modules.Counts( - if (c.hasPathOrNull("counts")) c.getConfig("counts") - else com.typesafe.config.ConfigFactory.parseString("counts{}") - ), - global = BeamConfig.Matsim.Modules.Global( - if (c.hasPathOrNull("global")) c.getConfig("global") - else com.typesafe.config.ConfigFactory.parseString("global{}") - ), - households = BeamConfig.Matsim.Modules.Households( - if (c.hasPathOrNull("households")) c.getConfig("households") - else com.typesafe.config.ConfigFactory.parseString("households{}") - ), - linkStats = BeamConfig.Matsim.Modules.LinkStats( - if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") - else com.typesafe.config.ConfigFactory.parseString("linkStats{}") - ), - network = BeamConfig.Matsim.Modules.Network( - if (c.hasPathOrNull("network")) c.getConfig("network") - else com.typesafe.config.ConfigFactory.parseString("network{}") - ), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( - if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") - else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") - ), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( - if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") - else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") - ), - plans = BeamConfig.Matsim.Modules.Plans( - if (c.hasPathOrNull("plans")) c.getConfig("plans") - else com.typesafe.config.ConfigFactory.parseString("plans{}") - ), - qsim = BeamConfig.Matsim.Modules.Qsim( - if (c.hasPathOrNull("qsim")) c.getConfig("qsim") - else com.typesafe.config.ConfigFactory.parseString("qsim{}") - ), - strategy = BeamConfig.Matsim.Modules.Strategy( - if (c.hasPathOrNull("strategy")) c.getConfig("strategy") - else com.typesafe.config.ConfigFactory.parseString("strategy{}") - ), - transit = BeamConfig.Matsim.Modules.Transit( - if (c.hasPathOrNull("transit")) c.getConfig("transit") - else com.typesafe.config.ConfigFactory.parseString("transit{}") - ), - vehicles = BeamConfig.Matsim.Modules.Vehicles( - if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") - else com.typesafe.config.ConfigFactory.parseString("vehicles{}") - ) + changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), + controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), + counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), + global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), + households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), + linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), + network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), + plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), + qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), + strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), + transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), + vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion( - if (c.hasPathOrNull("conversion")) c.getConfig("conversion") - else com.typesafe.config.ConfigFactory.parseString("conversion{}") - ), - modules = BeamConfig.Matsim.Modules( - if (c.hasPathOrNull("modules")) c.getConfig("modules") - else com.typesafe.config.ConfigFactory.parseString("modules{}") - ) + conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), + modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam( - if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") - ), - matsim = BeamConfig.Matsim( - if (c.hasPathOrNull("matsim")) c.getConfig("matsim") - else com.typesafe.config.ConfigFactory.parseString("matsim{}") - ) + beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), + matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) ) } - private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - - private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - - private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { + private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ( - (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number] - ) throw $_expE(cv, "double") + if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - - private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { + private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException( - cv.origin.lineNumber + + new java.lang.RuntimeException(cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) - ) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) } - - private def $_str(cv: com.typesafe.config.ConfigValue) = + private def $_str(cv:com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } + From d841da05576a495c559173057a63ea940c56a4f2 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 2 Aug 2022 11:31:47 -0700 Subject: [PATCH 272/307] fmt --- .../scala/beam/sim/config/BeamConfig.scala | 5567 +++++++++++------ 1 file changed, 3598 insertions(+), 1969 deletions(-) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index a4c10bf7dd7..969407871c9 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -3,3557 +3,5186 @@ package beam.sim.config case class BeamConfig( - beam : BeamConfig.Beam, - matsim : BeamConfig.Matsim + beam: BeamConfig.Beam, + matsim: BeamConfig.Matsim ) + object BeamConfig { + case class Beam( - actorSystemName : java.lang.String, - agentsim : BeamConfig.Beam.Agentsim, - calibration : BeamConfig.Beam.Calibration, - cluster : BeamConfig.Beam.Cluster, - debug : BeamConfig.Beam.Debug, - exchange : BeamConfig.Beam.Exchange, - experimental : BeamConfig.Beam.Experimental, - input : BeamConfig.Beam.Input, - inputDirectory : java.lang.String, - logger : BeamConfig.Beam.Logger, - metrics : BeamConfig.Beam.Metrics, - output : BeamConfig.Beam.Output, - outputs : BeamConfig.Beam.Outputs, - physsim : BeamConfig.Beam.Physsim, - replanning : BeamConfig.Beam.Replanning, - router : BeamConfig.Beam.Router, - routing : BeamConfig.Beam.Routing, - sim : BeamConfig.Beam.Sim, - spatial : BeamConfig.Beam.Spatial, - urbansim : BeamConfig.Beam.Urbansim, - useLocalWorker : scala.Boolean, - warmStart : BeamConfig.Beam.WarmStart + actorSystemName: java.lang.String, + agentsim: BeamConfig.Beam.Agentsim, + calibration: BeamConfig.Beam.Calibration, + cluster: BeamConfig.Beam.Cluster, + debug: BeamConfig.Beam.Debug, + exchange: BeamConfig.Beam.Exchange, + experimental: BeamConfig.Beam.Experimental, + input: BeamConfig.Beam.Input, + inputDirectory: java.lang.String, + logger: BeamConfig.Beam.Logger, + metrics: BeamConfig.Beam.Metrics, + output: BeamConfig.Beam.Output, + outputs: BeamConfig.Beam.Outputs, + physsim: BeamConfig.Beam.Physsim, + replanning: BeamConfig.Beam.Replanning, + router: BeamConfig.Beam.Router, + routing: BeamConfig.Beam.Routing, + sim: BeamConfig.Beam.Sim, + spatial: BeamConfig.Beam.Spatial, + urbansim: BeamConfig.Beam.Urbansim, + useLocalWorker: scala.Boolean, + warmStart: BeamConfig.Beam.WarmStart ) + object Beam { + case class Agentsim( - agentSampleSizeAsFractionOfPopulation : scala.Double, - agents : BeamConfig.Beam.Agentsim.Agents, - chargingNetworkManager : BeamConfig.Beam.Agentsim.ChargingNetworkManager, - endTime : java.lang.String, - firstIteration : scala.Int, - fractionOfPlansWithSingleActivity : scala.Double, - h3taz : BeamConfig.Beam.Agentsim.H3taz, - lastIteration : scala.Int, - populationAdjustment : java.lang.String, - randomSeedForPopulationSampling : scala.Option[scala.Int], - scenarios : BeamConfig.Beam.Agentsim.Scenarios, - scheduleMonitorTask : BeamConfig.Beam.Agentsim.ScheduleMonitorTask, - schedulerParallelismWindow : scala.Int, - simulationName : java.lang.String, - snapLocationAndRemoveInvalidInputs : scala.Boolean, - taz : BeamConfig.Beam.Agentsim.Taz, - thresholdForMakingParkingChoiceInMeters : scala.Int, - thresholdForWalkingInMeters : scala.Int, - timeBinSize : scala.Int, - toll : BeamConfig.Beam.Agentsim.Toll, - tuning : BeamConfig.Beam.Agentsim.Tuning + agentSampleSizeAsFractionOfPopulation: scala.Double, + agents: BeamConfig.Beam.Agentsim.Agents, + chargingNetworkManager: BeamConfig.Beam.Agentsim.ChargingNetworkManager, + endTime: java.lang.String, + firstIteration: scala.Int, + fractionOfPlansWithSingleActivity: scala.Double, + h3taz: BeamConfig.Beam.Agentsim.H3taz, + lastIteration: scala.Int, + populationAdjustment: java.lang.String, + randomSeedForPopulationSampling: scala.Option[scala.Int], + scenarios: BeamConfig.Beam.Agentsim.Scenarios, + scheduleMonitorTask: BeamConfig.Beam.Agentsim.ScheduleMonitorTask, + schedulerParallelismWindow: scala.Int, + simulationName: java.lang.String, + snapLocationAndRemoveInvalidInputs: scala.Boolean, + taz: BeamConfig.Beam.Agentsim.Taz, + thresholdForMakingParkingChoiceInMeters: scala.Int, + thresholdForWalkingInMeters: scala.Int, + timeBinSize: scala.Int, + toll: BeamConfig.Beam.Agentsim.Toll, + tuning: BeamConfig.Beam.Agentsim.Tuning ) + object Agentsim { + case class Agents( - activities : BeamConfig.Beam.Agentsim.Agents.Activities, - bodyType : java.lang.String, - freight : BeamConfig.Beam.Agentsim.Agents.Freight, - households : BeamConfig.Beam.Agentsim.Agents.Households, - modalBehaviors : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, - modeIncentive : BeamConfig.Beam.Agentsim.Agents.ModeIncentive, - parking : BeamConfig.Beam.Agentsim.Agents.Parking, - plans : BeamConfig.Beam.Agentsim.Agents.Plans, - population : BeamConfig.Beam.Agentsim.Agents.Population, - ptFare : BeamConfig.Beam.Agentsim.Agents.PtFare, - rideHail : BeamConfig.Beam.Agentsim.Agents.RideHail, - rideHailTransit : BeamConfig.Beam.Agentsim.Agents.RideHailTransit, - tripBehaviors : BeamConfig.Beam.Agentsim.Agents.TripBehaviors, - vehicles : BeamConfig.Beam.Agentsim.Agents.Vehicles + activities: BeamConfig.Beam.Agentsim.Agents.Activities, + bodyType: java.lang.String, + freight: BeamConfig.Beam.Agentsim.Agents.Freight, + households: BeamConfig.Beam.Agentsim.Agents.Households, + modalBehaviors: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors, + modeIncentive: BeamConfig.Beam.Agentsim.Agents.ModeIncentive, + parking: BeamConfig.Beam.Agentsim.Agents.Parking, + plans: BeamConfig.Beam.Agentsim.Agents.Plans, + population: BeamConfig.Beam.Agentsim.Agents.Population, + ptFare: BeamConfig.Beam.Agentsim.Agents.PtFare, + rideHail: BeamConfig.Beam.Agentsim.Agents.RideHail, + rideHailTransit: BeamConfig.Beam.Agentsim.Agents.RideHailTransit, + tripBehaviors: BeamConfig.Beam.Agentsim.Agents.TripBehaviors, + vehicles: BeamConfig.Beam.Agentsim.Agents.Vehicles ) + object Agents { + case class Activities( - activityTypeToFixedDurationMap : scala.Option[scala.List[java.lang.String]] + activityTypeToFixedDurationMap: scala.Option[scala.List[java.lang.String]] ) + object Activities { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Activities = { BeamConfig.Beam.Agentsim.Agents.Activities( - activityTypeToFixedDurationMap = if(c.hasPathOrNull("activityTypeToFixedDurationMap")) scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) else None + activityTypeToFixedDurationMap = + if (c.hasPathOrNull("activityTypeToFixedDurationMap")) + scala.Some($_L$_str(c.getList("activityTypeToFixedDurationMap"))) + else None ) } } - + case class Freight( - carrierParkingFilePath : scala.Option[java.lang.String], - carriersFilePath : java.lang.String, - convertWgs2Utm : scala.Boolean, - enabled : scala.Boolean, - generateFixedActivitiesDurations : scala.Boolean, - name : java.lang.String, - plansFilePath : java.lang.String, - reader : java.lang.String, - replanning : BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, - toursFilePath : java.lang.String + carrierParkingFilePath: scala.Option[java.lang.String], + carriersFilePath: java.lang.String, + convertWgs2Utm: scala.Boolean, + enabled: scala.Boolean, + generateFixedActivitiesDurations: scala.Boolean, + name: java.lang.String, + plansFilePath: java.lang.String, + reader: java.lang.String, + replanning: BeamConfig.Beam.Agentsim.Agents.Freight.Replanning, + toursFilePath: java.lang.String ) + object Freight { + case class Replanning( - departureTime : scala.Int, - disableAfterIteration : scala.Int, - strategy : java.lang.String + departureTime: scala.Int, + disableAfterIteration: scala.Int, + strategy: java.lang.String ) + object Replanning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight.Replanning = { BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( - departureTime = if(c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" + departureTime = if (c.hasPathOrNull("departureTime")) c.getInt("departureTime") else 28800, + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "singleTour" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Freight = { BeamConfig.Beam.Agentsim.Agents.Freight( - carrierParkingFilePath = if(c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, - carriersFilePath = if(c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") else "/test/input/beamville/freight/freight-carriers.csv", - convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - generateFixedActivitiesDurations = c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "Freight", - plansFilePath = if(c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") else "/test/input/beamville/freight/payload-plans.csv", - reader = if(c.hasPathOrNull("reader")) c.getString("reader") else "Generic", - replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - toursFilePath = if(c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") else "/test/input/beamville/freight/freight-tours.csv" + carrierParkingFilePath = + if (c.hasPathOrNull("carrierParkingFilePath")) Some(c.getString("carrierParkingFilePath")) else None, + carriersFilePath = + if (c.hasPathOrNull("carriersFilePath")) c.getString("carriersFilePath") + else "/test/input/beamville/freight/freight-carriers.csv", + convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + generateFixedActivitiesDurations = + c.hasPathOrNull("generateFixedActivitiesDurations") && c.getBoolean("generateFixedActivitiesDurations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "Freight", + plansFilePath = + if (c.hasPathOrNull("plansFilePath")) c.getString("plansFilePath") + else "/test/input/beamville/freight/payload-plans.csv", + reader = if (c.hasPathOrNull("reader")) c.getString("reader") else "Generic", + replanning = BeamConfig.Beam.Agentsim.Agents.Freight.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + toursFilePath = + if (c.hasPathOrNull("toursFilePath")) c.getString("toursFilePath") + else "/test/input/beamville/freight/freight-tours.csv" ) } } - + case class Households( - inputFilePath : java.lang.String, - inputHouseholdAttributesFilePath : java.lang.String + inputFilePath: java.lang.String, + inputHouseholdAttributesFilePath: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Households = { BeamConfig.Beam.Agentsim.Agents.Households( - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "/test/input/beamville/households.xml.gz", - inputHouseholdAttributesFilePath = if(c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") else "/test/input/beamville/householdAttributes.xml.gz" + inputFilePath = + if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") + else "/test/input/beamville/households.xml.gz", + inputHouseholdAttributesFilePath = + if (c.hasPathOrNull("inputHouseholdAttributesFilePath")) c.getString("inputHouseholdAttributesFilePath") + else "/test/input/beamville/householdAttributes.xml.gz" ) } } - + case class ModalBehaviors( - bikeMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier, - defaultValueOfTime : scala.Double, - highTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, - lccm : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, - lowTimeSensitivity : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, - maximumNumberOfReplanningAttempts : scala.Int, - minimumValueOfTime : scala.Double, - modeChoiceClass : java.lang.String, - modeVotMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, - multinomialLogit : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit, - overrideAutomationForVOTT : scala.Boolean, - overrideAutomationLevel : scala.Int, - poolingMultiplier : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, - transitVehicleTypeVOTMultipliers : scala.Option[scala.List[java.lang.String]] + bikeMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier, + defaultValueOfTime: scala.Double, + highTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity, + lccm: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm, + lowTimeSensitivity: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity, + maximumNumberOfReplanningAttempts: scala.Int, + minimumValueOfTime: scala.Double, + modeChoiceClass: java.lang.String, + modeVotMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier, + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit, + overrideAutomationForVOTT: scala.Boolean, + overrideAutomationLevel: scala.Int, + poolingMultiplier: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier, + transitVehicleTypeVOTMultipliers: scala.Option[scala.List[java.lang.String]] ) + object ModalBehaviors { + case class BikeMultiplier( - commute : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute, - noncommute : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute + commute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute, + noncommute: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute ) + object BikeMultiplier { + case class Commute( - ageGT50 : scala.Double, - ageLE50 : scala.Double + ageGT50: scala.Double, + ageLE50: scala.Double ) + object Commute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( - ageGT50 = if(c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, - ageLE50 = if(c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 ) } } - + case class Noncommute( - ageGT50 : scala.Double, - ageLE50 : scala.Double + ageGT50: scala.Double, + ageLE50: scala.Double ) + object Noncommute { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( - ageGT50 = if(c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, - ageLE50 = if(c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 + ageGT50 = if (c.hasPathOrNull("ageGT50")) c.getDouble("ageGT50") else 1.0, + ageLE50 = if (c.hasPathOrNull("ageLE50")) c.getDouble("ageLE50") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( - commute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute(if(c.hasPathOrNull("commute")) c.getConfig("commute") else com.typesafe.config.ConfigFactory.parseString("commute{}")), - noncommute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute(if(c.hasPathOrNull("noncommute")) c.getConfig("noncommute") else com.typesafe.config.ConfigFactory.parseString("noncommute{}")) + commute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Commute( + if (c.hasPathOrNull("commute")) c.getConfig("commute") + else com.typesafe.config.ConfigFactory.parseString("commute{}") + ), + noncommute = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier.Noncommute( + if (c.hasPathOrNull("noncommute")) c.getConfig("noncommute") + else com.typesafe.config.ConfigFactory.parseString("noncommute{}") + ) ) } } - + case class HighTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion ) + object HighTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class Lccm( - filePath : java.lang.String + filePath: java.lang.String ) + object Lccm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/lccm-long.csv" ) } } - + case class LowTimeSensitivity( - highCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, - lowCongestion : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion + highCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion, + lowCongestion: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion ) + object LowTimeSensitivity { + case class HighCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor ) + object HighCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - + case class LowCongestion( - highwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, - nonHighwayFactor : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor + highwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor, + nonHighwayFactor: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor ) + object LowCongestion { + case class HighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object HighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + case class NonHighwayFactor( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object NonHighwayFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( - highwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor(if(c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}")), - nonHighwayFactor = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor(if(c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}")) + highwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.HighwayFactor( + if (c.hasPathOrNull("highwayFactor")) c.getConfig("highwayFactor") + else com.typesafe.config.ConfigFactory.parseString("highwayFactor{}") + ), + nonHighwayFactor = + BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion.NonHighwayFactor( + if (c.hasPathOrNull("nonHighwayFactor")) c.getConfig("nonHighwayFactor") + else com.typesafe.config.ConfigFactory.parseString("nonHighwayFactor{}") + ) ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( - highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion(if(c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") else com.typesafe.config.ConfigFactory.parseString("highCongestion{}")), - lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion(if(c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}")) + highCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.HighCongestion( + if (c.hasPathOrNull("highCongestion")) c.getConfig("highCongestion") + else com.typesafe.config.ConfigFactory.parseString("highCongestion{}") + ), + lowCongestion = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity.LowCongestion( + if (c.hasPathOrNull("lowCongestion")) c.getConfig("lowCongestion") + else com.typesafe.config.ConfigFactory.parseString("lowCongestion{}") + ) ) } } - + case class ModeVotMultiplier( - CAV : scala.Double, - bike : scala.Double, - drive : scala.Double, - rideHail : scala.Double, - rideHailPooled : scala.Double, - rideHailTransit : scala.Double, - transit : scala.Double, - waiting : scala.Double, - walk : scala.Double + CAV: scala.Double, + bike: scala.Double, + drive: scala.Double, + rideHail: scala.Double, + rideHailPooled: scala.Double, + rideHailTransit: scala.Double, + transit: scala.Double, + waiting: scala.Double, + walk: scala.Double ) + object ModeVotMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( - CAV = if(c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, - drive = if(c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, - rideHail = if(c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, - rideHailPooled = if(c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, - rideHailTransit = if(c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, - transit = if(c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, - waiting = if(c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 + CAV = if (c.hasPathOrNull("CAV")) c.getDouble("CAV") else 1.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 1.0, + drive = if (c.hasPathOrNull("drive")) c.getDouble("drive") else 1.0, + rideHail = if (c.hasPathOrNull("rideHail")) c.getDouble("rideHail") else 1.0, + rideHailPooled = if (c.hasPathOrNull("rideHailPooled")) c.getDouble("rideHailPooled") else 1.0, + rideHailTransit = if (c.hasPathOrNull("rideHailTransit")) c.getDouble("rideHailTransit") else 1.0, + transit = if (c.hasPathOrNull("transit")) c.getDouble("transit") else 1.0, + waiting = if (c.hasPathOrNull("waiting")) c.getDouble("waiting") else 1.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 1.0 ) } } - + case class MultinomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params, - utility_scale_factor : scala.Double + params: BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params, + utility_scale_factor: scala.Double ) + object MultinomialLogit { + case class Params( - bike_intercept : scala.Double, - bike_transit_intercept : scala.Double, - car_intercept : scala.Double, - cav_intercept : scala.Double, - drive_transit_intercept : scala.Double, - ride_hail_intercept : scala.Double, - ride_hail_pooled_intercept : scala.Double, - ride_hail_transit_intercept : scala.Double, - transfer : scala.Double, - transit_crowding : scala.Double, - transit_crowding_VOT_multiplier : scala.Double, - transit_crowding_VOT_threshold : scala.Double, - transit_crowding_percentile : scala.Double, - walk_intercept : scala.Double, - walk_transit_intercept : scala.Double + bike_intercept: scala.Double, + bike_transit_intercept: scala.Double, + car_intercept: scala.Double, + cav_intercept: scala.Double, + drive_transit_intercept: scala.Double, + ride_hail_intercept: scala.Double, + ride_hail_pooled_intercept: scala.Double, + ride_hail_transit_intercept: scala.Double, + transfer: scala.Double, + transit_crowding: scala.Double, + transit_crowding_VOT_multiplier: scala.Double, + transit_crowding_VOT_threshold: scala.Double, + transit_crowding_percentile: scala.Double, + walk_intercept: scala.Double, + walk_transit_intercept: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( - bike_intercept = if(c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, - bike_transit_intercept = if(c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, - car_intercept = if(c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, - cav_intercept = if(c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, - drive_transit_intercept = if(c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, - ride_hail_intercept = if(c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, - ride_hail_pooled_intercept = if(c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") else 0.0, - ride_hail_transit_intercept = if(c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") else 0.0, - transfer = if(c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, - transit_crowding = if(c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, - transit_crowding_VOT_multiplier = if(c.hasPathOrNull("transit_crowding_VOT_multiplier")) c.getDouble("transit_crowding_VOT_multiplier") else 0.0, - transit_crowding_VOT_threshold = if(c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") else 0.5, - transit_crowding_percentile = if(c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") else 90.0, - walk_intercept = if(c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, - walk_transit_intercept = if(c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 + bike_intercept = if (c.hasPathOrNull("bike_intercept")) c.getDouble("bike_intercept") else 0.0, + bike_transit_intercept = + if (c.hasPathOrNull("bike_transit_intercept")) c.getDouble("bike_transit_intercept") else 0.0, + car_intercept = if (c.hasPathOrNull("car_intercept")) c.getDouble("car_intercept") else 0.0, + cav_intercept = if (c.hasPathOrNull("cav_intercept")) c.getDouble("cav_intercept") else 0.0, + drive_transit_intercept = + if (c.hasPathOrNull("drive_transit_intercept")) c.getDouble("drive_transit_intercept") else 0.0, + ride_hail_intercept = + if (c.hasPathOrNull("ride_hail_intercept")) c.getDouble("ride_hail_intercept") else 0.0, + ride_hail_pooled_intercept = + if (c.hasPathOrNull("ride_hail_pooled_intercept")) c.getDouble("ride_hail_pooled_intercept") + else 0.0, + ride_hail_transit_intercept = + if (c.hasPathOrNull("ride_hail_transit_intercept")) c.getDouble("ride_hail_transit_intercept") + else 0.0, + transfer = if (c.hasPathOrNull("transfer")) c.getDouble("transfer") else -1.4, + transit_crowding = if (c.hasPathOrNull("transit_crowding")) c.getDouble("transit_crowding") else 0.0, + transit_crowding_VOT_multiplier = + if (c.hasPathOrNull("transit_crowding_VOT_multiplier")) + c.getDouble("transit_crowding_VOT_multiplier") + else 0.0, + transit_crowding_VOT_threshold = + if (c.hasPathOrNull("transit_crowding_VOT_threshold")) c.getDouble("transit_crowding_VOT_threshold") + else 0.5, + transit_crowding_percentile = + if (c.hasPathOrNull("transit_crowding_percentile")) c.getDouble("transit_crowding_percentile") + else 90.0, + walk_intercept = if (c.hasPathOrNull("walk_intercept")) c.getDouble("walk_intercept") else 0.0, + walk_transit_intercept = + if (c.hasPathOrNull("walk_transit_intercept")) c.getDouble("walk_transit_intercept") else 0.0 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")), - utility_scale_factor = if(c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 + params = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ), + utility_scale_factor = + if (c.hasPathOrNull("utility_scale_factor")) c.getDouble("utility_scale_factor") else 1.0 ) } } - + case class PoolingMultiplier( - Level3 : scala.Double, - Level4 : scala.Double, - Level5 : scala.Double, - LevelLE2 : scala.Double + Level3: scala.Double, + Level4: scala.Double, + Level5: scala.Double, + LevelLE2: scala.Double ) + object PoolingMultiplier { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( - Level3 = if(c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, - Level4 = if(c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, - Level5 = if(c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, - LevelLE2 = if(c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 + Level3 = if (c.hasPathOrNull("Level3")) c.getDouble("Level3") else 1.0, + Level4 = if (c.hasPathOrNull("Level4")) c.getDouble("Level4") else 1.0, + Level5 = if (c.hasPathOrNull("Level5")) c.getDouble("Level5") else 1.0, + LevelLE2 = if (c.hasPathOrNull("LevelLE2")) c.getDouble("LevelLE2") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModalBehaviors = { BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( - bikeMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier(if(c.hasPathOrNull("bikeMultiplier")) c.getConfig("bikeMultiplier") else com.typesafe.config.ConfigFactory.parseString("bikeMultiplier{}")), - defaultValueOfTime = if(c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, - highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity(if(c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}")), - lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm(if(c.hasPathOrNull("lccm")) c.getConfig("lccm") else com.typesafe.config.ConfigFactory.parseString("lccm{}")), - lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity(if(c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}")), - maximumNumberOfReplanningAttempts = if(c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") else 3, - minimumValueOfTime = if(c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, - modeChoiceClass = if(c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") else "ModeChoiceMultinomialLogit", - modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier(if(c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}")), - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")), - overrideAutomationForVOTT = c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), - overrideAutomationLevel = if(c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, - poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier(if(c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}")), - transitVehicleTypeVOTMultipliers = if(c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) else None - ) - } - } - + bikeMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.BikeMultiplier( + if (c.hasPathOrNull("bikeMultiplier")) c.getConfig("bikeMultiplier") + else com.typesafe.config.ConfigFactory.parseString("bikeMultiplier{}") + ), + defaultValueOfTime = + if (c.hasPathOrNull("defaultValueOfTime")) c.getDouble("defaultValueOfTime") else 8.0, + highTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.HighTimeSensitivity( + if (c.hasPathOrNull("highTimeSensitivity")) c.getConfig("highTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("highTimeSensitivity{}") + ), + lccm = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.Lccm( + if (c.hasPathOrNull("lccm")) c.getConfig("lccm") + else com.typesafe.config.ConfigFactory.parseString("lccm{}") + ), + lowTimeSensitivity = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.LowTimeSensitivity( + if (c.hasPathOrNull("lowTimeSensitivity")) c.getConfig("lowTimeSensitivity") + else com.typesafe.config.ConfigFactory.parseString("lowTimeSensitivity{}") + ), + maximumNumberOfReplanningAttempts = + if (c.hasPathOrNull("maximumNumberOfReplanningAttempts")) c.getInt("maximumNumberOfReplanningAttempts") + else 3, + minimumValueOfTime = + if (c.hasPathOrNull("minimumValueOfTime")) c.getDouble("minimumValueOfTime") else 7.25, + modeChoiceClass = + if (c.hasPathOrNull("modeChoiceClass")) c.getString("modeChoiceClass") + else "ModeChoiceMultinomialLogit", + modeVotMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.ModeVotMultiplier( + if (c.hasPathOrNull("modeVotMultiplier")) c.getConfig("modeVotMultiplier") + else com.typesafe.config.ConfigFactory.parseString("modeVotMultiplier{}") + ), + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") + ), + overrideAutomationForVOTT = + c.hasPathOrNull("overrideAutomationForVOTT") && c.getBoolean("overrideAutomationForVOTT"), + overrideAutomationLevel = + if (c.hasPathOrNull("overrideAutomationLevel")) c.getInt("overrideAutomationLevel") else 1, + poolingMultiplier = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors.PoolingMultiplier( + if (c.hasPathOrNull("poolingMultiplier")) c.getConfig("poolingMultiplier") + else com.typesafe.config.ConfigFactory.parseString("poolingMultiplier{}") + ), + transitVehicleTypeVOTMultipliers = + if (c.hasPathOrNull("transitVehicleTypeVOTMultipliers")) + scala.Some($_L$_str(c.getList("transitVehicleTypeVOTMultipliers"))) + else None + ) + } + } + case class ModeIncentive( - filePath : java.lang.String + filePath: java.lang.String ) + object ModeIncentive { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.ModeIncentive = { BeamConfig.Beam.Agentsim.Agents.ModeIncentive( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Parking( - fractionOfSameTypeZones : scala.Double, - maxSearchRadius : scala.Double, - minNumberOfSameTypeZones : scala.Int, - minSearchRadius : scala.Double, - multinomialLogit : BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, - rangeAnxietyBuffer : scala.Double, - searchMaxDistanceRelativeToEllipseFoci : scala.Double + fractionOfSameTypeZones: scala.Double, + maxSearchRadius: scala.Double, + minNumberOfSameTypeZones: scala.Int, + minSearchRadius: scala.Double, + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit, + rangeAnxietyBuffer: scala.Double, + searchMaxDistanceRelativeToEllipseFoci: scala.Double ) + object Parking { + case class MultinomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params ) + object MultinomialLogit { + case class Params( - distanceMultiplier : scala.Double, - enrouteDetourMultiplier : scala.Double, - homeActivityPrefersResidentialParkingMultiplier : scala.Double, - parkingPriceMultiplier : scala.Double, - rangeAnxietyMultiplier : scala.Double + distanceMultiplier: scala.Double, + enrouteDetourMultiplier: scala.Double, + homeActivityPrefersResidentialParkingMultiplier: scala.Double, + parkingPriceMultiplier: scala.Double, + rangeAnxietyMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params = { BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( - distanceMultiplier = if(c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, - enrouteDetourMultiplier = if(c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, - homeActivityPrefersResidentialParkingMultiplier = if(c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) c.getDouble("homeActivityPrefersResidentialParkingMultiplier") else 1.0, - parkingPriceMultiplier = if(c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, - rangeAnxietyMultiplier = if(c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 + distanceMultiplier = + if (c.hasPathOrNull("distanceMultiplier")) c.getDouble("distanceMultiplier") else -0.086, + enrouteDetourMultiplier = + if (c.hasPathOrNull("enrouteDetourMultiplier")) c.getDouble("enrouteDetourMultiplier") else 1.0, + homeActivityPrefersResidentialParkingMultiplier = + if (c.hasPathOrNull("homeActivityPrefersResidentialParkingMultiplier")) + c.getDouble("homeActivityPrefersResidentialParkingMultiplier") + else 1.0, + parkingPriceMultiplier = + if (c.hasPathOrNull("parkingPriceMultiplier")) c.getDouble("parkingPriceMultiplier") else -0.005, + rangeAnxietyMultiplier = + if (c.hasPathOrNull("rangeAnxietyMultiplier")) c.getDouble("rangeAnxietyMultiplier") else -0.5 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) + params = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit.Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Parking = { BeamConfig.Beam.Agentsim.Agents.Parking( - fractionOfSameTypeZones = if(c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, - maxSearchRadius = if(c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, - minNumberOfSameTypeZones = if(c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, - minSearchRadius = if(c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")), - rangeAnxietyBuffer = if(c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, - searchMaxDistanceRelativeToEllipseFoci = if(c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) c.getDouble("searchMaxDistanceRelativeToEllipseFoci") else 4.0 + fractionOfSameTypeZones = + if (c.hasPathOrNull("fractionOfSameTypeZones")) c.getDouble("fractionOfSameTypeZones") else 0.5, + maxSearchRadius = if (c.hasPathOrNull("maxSearchRadius")) c.getDouble("maxSearchRadius") else 8046.72, + minNumberOfSameTypeZones = + if (c.hasPathOrNull("minNumberOfSameTypeZones")) c.getInt("minNumberOfSameTypeZones") else 10, + minSearchRadius = if (c.hasPathOrNull("minSearchRadius")) c.getDouble("minSearchRadius") else 250.00, + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.Parking.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") + ), + rangeAnxietyBuffer = + if (c.hasPathOrNull("rangeAnxietyBuffer")) c.getDouble("rangeAnxietyBuffer") else 20000.0, + searchMaxDistanceRelativeToEllipseFoci = + if (c.hasPathOrNull("searchMaxDistanceRelativeToEllipseFoci")) + c.getDouble("searchMaxDistanceRelativeToEllipseFoci") + else 4.0 ) } } - + case class Plans( - inputPersonAttributesFilePath : java.lang.String, - inputPlansFilePath : java.lang.String, - merge : BeamConfig.Beam.Agentsim.Agents.Plans.Merge + inputPersonAttributesFilePath: java.lang.String, + inputPlansFilePath: java.lang.String, + merge: BeamConfig.Beam.Agentsim.Agents.Plans.Merge ) + object Plans { + case class Merge( - fraction : scala.Double + fraction: scala.Double ) + object Merge { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans.Merge = { BeamConfig.Beam.Agentsim.Agents.Plans.Merge( - fraction = if(c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 + fraction = if (c.hasPathOrNull("fraction")) c.getDouble("fraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Plans = { BeamConfig.Beam.Agentsim.Agents.Plans( - inputPersonAttributesFilePath = if(c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") else "/test/input/beamville/populationAttributes.xml.gz", - inputPlansFilePath = if(c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") else "/test/input/beamville/population.xml.gz", - merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge(if(c.hasPathOrNull("merge")) c.getConfig("merge") else com.typesafe.config.ConfigFactory.parseString("merge{}")) + inputPersonAttributesFilePath = + if (c.hasPathOrNull("inputPersonAttributesFilePath")) c.getString("inputPersonAttributesFilePath") + else "/test/input/beamville/populationAttributes.xml.gz", + inputPlansFilePath = + if (c.hasPathOrNull("inputPlansFilePath")) c.getString("inputPlansFilePath") + else "/test/input/beamville/population.xml.gz", + merge = BeamConfig.Beam.Agentsim.Agents.Plans.Merge( + if (c.hasPathOrNull("merge")) c.getConfig("merge") + else com.typesafe.config.ConfigFactory.parseString("merge{}") + ) ) } } - + case class Population( - industryRemovalProbabilty : BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, - useVehicleSampling : scala.Boolean + industryRemovalProbabilty: BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty, + useVehicleSampling: scala.Boolean ) + object Population { + case class IndustryRemovalProbabilty( - enabled : scala.Boolean, - inputFilePath : java.lang.String, - removalStrategy : java.lang.String + enabled: scala.Boolean, + inputFilePath: java.lang.String, + removalStrategy: java.lang.String ) + object IndustryRemovalProbabilty { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty = { BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - inputFilePath = if(c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", - removalStrategy = if(c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + inputFilePath = if (c.hasPathOrNull("inputFilePath")) c.getString("inputFilePath") else "", + removalStrategy = + if (c.hasPathOrNull("removalStrategy")) c.getString("removalStrategy") else "RemovePersonFromScenario" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Population = { BeamConfig.Beam.Agentsim.Agents.Population( - industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty(if(c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}")), - useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") + industryRemovalProbabilty = BeamConfig.Beam.Agentsim.Agents.Population.IndustryRemovalProbabilty( + if (c.hasPathOrNull("industryRemovalProbabilty")) c.getConfig("industryRemovalProbabilty") + else com.typesafe.config.ConfigFactory.parseString("industryRemovalProbabilty{}") + ), + useVehicleSampling = c.hasPathOrNull("useVehicleSampling") && c.getBoolean("useVehicleSampling") ) } } - + case class PtFare( - filePath : java.lang.String + filePath: java.lang.String ) + object PtFare { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.PtFare = { BeamConfig.Beam.Agentsim.Agents.PtFare( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class RideHail( - allocationManager : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, - cav : BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, - charging : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, - defaultBaseCost : scala.Double, - defaultCostPerMile : scala.Double, - defaultCostPerMinute : scala.Double, - human : BeamConfig.Beam.Agentsim.Agents.RideHail.Human, - initialization : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, - iterationStats : BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, - linkFleetStateAcrossIterations : scala.Boolean, - name : java.lang.String, - pooledBaseCost : scala.Double, - pooledCostPerMile : scala.Double, - pooledCostPerMinute : scala.Double, - rangeBufferForDispatchInMeters : scala.Int, - repositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, - rideHailManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, - surgePricing : BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing + allocationManager: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager, + cav: BeamConfig.Beam.Agentsim.Agents.RideHail.Cav, + charging: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging, + defaultBaseCost: scala.Double, + defaultCostPerMile: scala.Double, + defaultCostPerMinute: scala.Double, + human: BeamConfig.Beam.Agentsim.Agents.RideHail.Human, + initialization: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization, + iterationStats: BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats, + linkFleetStateAcrossIterations: scala.Boolean, + name: java.lang.String, + pooledBaseCost: scala.Double, + pooledCostPerMile: scala.Double, + pooledCostPerMinute: scala.Double, + rangeBufferForDispatchInMeters: scala.Int, + repositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager, + rideHailManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager, + surgePricing: BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing ) + object RideHail { + case class AllocationManager( - alonsoMora : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, - matchingAlgorithm : java.lang.String, - maxExcessRideTime : scala.Double, - maxWaitingTimeInSec : scala.Int, - name : java.lang.String, - pooledRideHailIntervalAsMultipleOfSoloRideHail : scala.Int, - repositionLowWaitingTimes : BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, - requestBufferTimeoutInSeconds : scala.Int + alonsoMora: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora, + matchingAlgorithm: java.lang.String, + maxExcessRideTime: scala.Double, + maxWaitingTimeInSec: scala.Int, + name: java.lang.String, + pooledRideHailIntervalAsMultipleOfSoloRideHail: scala.Int, + repositionLowWaitingTimes: BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes, + requestBufferTimeoutInSeconds: scala.Int ) + object AllocationManager { + case class AlonsoMora( - maxRequestsPerVehicle : scala.Int + maxRequestsPerVehicle: scala.Int ) + object AlonsoMora { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( - maxRequestsPerVehicle = if(c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 + maxRequestsPerVehicle = + if (c.hasPathOrNull("maxRequestsPerVehicle")) c.getInt("maxRequestsPerVehicle") else 5 ) } } - + case class RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow : scala.Boolean, - demandWeight : scala.Double, - distanceWeight : scala.Double, - keepMaxTopNScores : scala.Int, - minDemandPercentageInRadius : scala.Double, - minScoreThresholdForRepositioning : scala.Double, - minimumNumberOfIdlingVehiclesThresholdForRepositioning : scala.Int, - percentageOfVehiclesToReposition : scala.Double, - produceDebugImages : scala.Boolean, - repositionCircleRadiusInMeters : scala.Double, - repositioningMethod : java.lang.String, - timeWindowSizeInSecForDecidingAboutRepositioning : scala.Double, - waitingTimeWeight : scala.Double + allowIncreasingRadiusIfDemandInRadiusLow: scala.Boolean, + demandWeight: scala.Double, + distanceWeight: scala.Double, + keepMaxTopNScores: scala.Int, + minDemandPercentageInRadius: scala.Double, + minScoreThresholdForRepositioning: scala.Double, + minimumNumberOfIdlingVehiclesThresholdForRepositioning: scala.Int, + percentageOfVehiclesToReposition: scala.Double, + produceDebugImages: scala.Boolean, + repositionCircleRadiusInMeters: scala.Double, + repositioningMethod: java.lang.String, + timeWindowSizeInSecForDecidingAboutRepositioning: scala.Double, + waitingTimeWeight: scala.Double ) + object RepositionLowWaitingTimes { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( - allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull("allowIncreasingRadiusIfDemandInRadiusLow") || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), - demandWeight = if(c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, - distanceWeight = if(c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, - keepMaxTopNScores = if(c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, - minDemandPercentageInRadius = if(c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") else 0.1, - minScoreThresholdForRepositioning = if(c.hasPathOrNull("minScoreThresholdForRepositioning")) c.getDouble("minScoreThresholdForRepositioning") else 0.1, - minimumNumberOfIdlingVehiclesThresholdForRepositioning = if(c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") else 1, - percentageOfVehiclesToReposition = if(c.hasPathOrNull("percentageOfVehiclesToReposition")) c.getDouble("percentageOfVehiclesToReposition") else 0.01, - produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), - repositionCircleRadiusInMeters = if(c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") else 3000, - repositioningMethod = if(c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", - timeWindowSizeInSecForDecidingAboutRepositioning = if(c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") else 1200, - waitingTimeWeight = if(c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 + allowIncreasingRadiusIfDemandInRadiusLow = !c.hasPathOrNull( + "allowIncreasingRadiusIfDemandInRadiusLow" + ) || c.getBoolean("allowIncreasingRadiusIfDemandInRadiusLow"), + demandWeight = if (c.hasPathOrNull("demandWeight")) c.getDouble("demandWeight") else 4.0, + distanceWeight = if (c.hasPathOrNull("distanceWeight")) c.getDouble("distanceWeight") else 0.01, + keepMaxTopNScores = if (c.hasPathOrNull("keepMaxTopNScores")) c.getInt("keepMaxTopNScores") else 1, + minDemandPercentageInRadius = + if (c.hasPathOrNull("minDemandPercentageInRadius")) c.getDouble("minDemandPercentageInRadius") + else 0.1, + minScoreThresholdForRepositioning = + if (c.hasPathOrNull("minScoreThresholdForRepositioning")) + c.getDouble("minScoreThresholdForRepositioning") + else 0.1, + minimumNumberOfIdlingVehiclesThresholdForRepositioning = + if (c.hasPathOrNull("minimumNumberOfIdlingVehiclesThresholdForRepositioning")) + c.getInt("minimumNumberOfIdlingVehiclesThresholdForRepositioning") + else 1, + percentageOfVehiclesToReposition = + if (c.hasPathOrNull("percentageOfVehiclesToReposition")) + c.getDouble("percentageOfVehiclesToReposition") + else 0.01, + produceDebugImages = !c.hasPathOrNull("produceDebugImages") || c.getBoolean("produceDebugImages"), + repositionCircleRadiusInMeters = + if (c.hasPathOrNull("repositionCircleRadiusInMeters")) c.getDouble("repositionCircleRadiusInMeters") + else 3000, + repositioningMethod = + if (c.hasPathOrNull("repositioningMethod")) c.getString("repositioningMethod") else "TOP_SCORES", + timeWindowSizeInSecForDecidingAboutRepositioning = + if (c.hasPathOrNull("timeWindowSizeInSecForDecidingAboutRepositioning")) + c.getDouble("timeWindowSizeInSecForDecidingAboutRepositioning") + else 1200, + waitingTimeWeight = + if (c.hasPathOrNull("waitingTimeWeight")) c.getDouble("waitingTimeWeight") else 4.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( - alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora(if(c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}")), - matchingAlgorithm = if(c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", - maxExcessRideTime = if(c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, - maxWaitingTimeInSec = if(c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", - pooledRideHailIntervalAsMultipleOfSoloRideHail = if(c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") else 1, - repositionLowWaitingTimes = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes(if(c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}")), - requestBufferTimeoutInSeconds = if(c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 + alonsoMora = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.AlonsoMora( + if (c.hasPathOrNull("alonsoMora")) c.getConfig("alonsoMora") + else com.typesafe.config.ConfigFactory.parseString("alonsoMora{}") + ), + matchingAlgorithm = + if (c.hasPathOrNull("matchingAlgorithm")) c.getString("matchingAlgorithm") + else "ALONSO_MORA_MATCHING_WITH_ASYNC_GREEDY_ASSIGNMENT", + maxExcessRideTime = if (c.hasPathOrNull("maxExcessRideTime")) c.getDouble("maxExcessRideTime") else 0.5, + maxWaitingTimeInSec = + if (c.hasPathOrNull("maxWaitingTimeInSec")) c.getInt("maxWaitingTimeInSec") else 900, + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_MANAGER", + pooledRideHailIntervalAsMultipleOfSoloRideHail = + if (c.hasPathOrNull("pooledRideHailIntervalAsMultipleOfSoloRideHail")) + c.getInt("pooledRideHailIntervalAsMultipleOfSoloRideHail") + else 1, + repositionLowWaitingTimes = + BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager.RepositionLowWaitingTimes( + if (c.hasPathOrNull("repositionLowWaitingTimes")) c.getConfig("repositionLowWaitingTimes") + else com.typesafe.config.ConfigFactory.parseString("repositionLowWaitingTimes{}") + ), + requestBufferTimeoutInSeconds = + if (c.hasPathOrNull("requestBufferTimeoutInSeconds")) c.getInt("requestBufferTimeoutInSeconds") else 0 ) } } - + case class Cav( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int, - valueOfTime : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int, + valueOfTime: scala.Int ) + object Cav { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Cav = { BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 16090, - valueOfTime = if(c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 96540, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 16090, + valueOfTime = if (c.hasPathOrNull("valueOfTime")) c.getInt("valueOfTime") else 1 ) } } - + case class Charging( - vehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + vehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager ) + object Charging { + case class VehicleChargingManager( - defaultVehicleChargingManager : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + defaultVehicleChargingManager: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager ) + object VehicleChargingManager { + case class DefaultVehicleChargingManager( - multinomialLogit : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit ) + object DefaultVehicleChargingManager { + case class MultinomialLogit( - params : BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params + params: BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params ) + object MultinomialLogit { + case class Params( - chargingTimeMultiplier : scala.Double, - drivingTimeMultiplier : scala.Double, - insufficientRangeMultiplier : scala.Double, - queueingTimeMultiplier : scala.Double + chargingTimeMultiplier: scala.Double, + drivingTimeMultiplier: scala.Double, + insufficientRangeMultiplier: scala.Double, + queueingTimeMultiplier: scala.Double ) + object Params { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params( - chargingTimeMultiplier = if(c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") else -0.01666667, - drivingTimeMultiplier = if(c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") else -0.01666667, - insufficientRangeMultiplier = if(c.hasPathOrNull("insufficientRangeMultiplier")) c.getDouble("insufficientRangeMultiplier") else -60.0, - queueingTimeMultiplier = if(c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") else -0.01666667 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit + .Params( + chargingTimeMultiplier = + if (c.hasPathOrNull("chargingTimeMultiplier")) c.getDouble("chargingTimeMultiplier") + else -0.01666667, + drivingTimeMultiplier = + if (c.hasPathOrNull("drivingTimeMultiplier")) c.getDouble("drivingTimeMultiplier") + else -0.01666667, + insufficientRangeMultiplier = + if (c.hasPathOrNull("insufficientRangeMultiplier")) + c.getDouble("insufficientRangeMultiplier") + else -60.0, + queueingTimeMultiplier = + if (c.hasPathOrNull("queueingTimeMultiplier")) c.getDouble("queueingTimeMultiplier") + else -0.01666667 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit( - params = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit.Params(if(c.hasPathOrNull("params")) c.getConfig("params") else com.typesafe.config.ConfigFactory.parseString("params{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MultinomialLogit( + params = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit + .Params( + if (c.hasPathOrNull("params")) c.getConfig("params") + else com.typesafe.config.ConfigFactory.parseString("params{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { - BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager( - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")) - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager = { + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + multinomialLogit = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager + .MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") + ) + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( - defaultVehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager.DefaultVehicleChargingManager(if(c.hasPathOrNull("defaultVehicleChargingManager")) c.getConfig("defaultVehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}")) + defaultVehicleChargingManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager + .DefaultVehicleChargingManager( + if (c.hasPathOrNull("defaultVehicleChargingManager")) + c.getConfig("defaultVehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("defaultVehicleChargingManager{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Charging = { BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( - vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager(if(c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}")) + vehicleChargingManager = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging.VehicleChargingManager( + if (c.hasPathOrNull("vehicleChargingManager")) c.getConfig("vehicleChargingManager") + else com.typesafe.config.ConfigFactory.parseString("vehicleChargingManager{}") + ) ) } } - + case class Human( - noRefuelThresholdInMeters : scala.Int, - refuelRequiredThresholdInMeters : scala.Int + noRefuelThresholdInMeters: scala.Int, + refuelRequiredThresholdInMeters: scala.Int ) + object Human { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Human = { BeamConfig.Beam.Agentsim.Agents.RideHail.Human( - noRefuelThresholdInMeters = if(c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, - refuelRequiredThresholdInMeters = if(c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") else 32180 + noRefuelThresholdInMeters = + if (c.hasPathOrNull("noRefuelThresholdInMeters")) c.getInt("noRefuelThresholdInMeters") else 128720, + refuelRequiredThresholdInMeters = + if (c.hasPathOrNull("refuelRequiredThresholdInMeters")) c.getInt("refuelRequiredThresholdInMeters") + else 32180 ) } } - + case class Initialization( - filePath : java.lang.String, - initType : java.lang.String, - parking : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, - procedural : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural + filePath: java.lang.String, + initType: java.lang.String, + parking: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking, + procedural: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural ) + object Initialization { + case class Parking( - filePath : java.lang.String + filePath: java.lang.String ) + object Parking { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "" + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "" ) } } - + case class Procedural( - fractionOfInitialVehicleFleet : scala.Double, - initialLocation : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, - vehicleTypeId : java.lang.String, - vehicleTypePrefix : java.lang.String + fractionOfInitialVehicleFleet: scala.Double, + initialLocation: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation, + vehicleTypeId: java.lang.String, + vehicleTypePrefix: java.lang.String ) + object Procedural { + case class InitialLocation( - home : BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, - name : java.lang.String + home: BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home, + name: java.lang.String ) + object InitialLocation { + case class Home( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object Home { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 10000 ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( - home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home(if(c.hasPathOrNull("home")) c.getConfig("home") else com.typesafe.config.ConfigFactory.parseString("home{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "HOME" + home = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation.Home( + if (c.hasPathOrNull("home")) c.getConfig("home") + else com.typesafe.config.ConfigFactory.parseString("home{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "HOME" ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 0.1, - initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation(if(c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") else com.typesafe.config.ConfigFactory.parseString("initialLocation{}")), - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", - vehicleTypePrefix = if(c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 0.1, + initialLocation = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural.InitialLocation( + if (c.hasPathOrNull("initialLocation")) c.getConfig("initialLocation") + else com.typesafe.config.ConfigFactory.parseString("initialLocation{}") + ), + vehicleTypeId = if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "Car", + vehicleTypePrefix = + if (c.hasPathOrNull("vehicleTypePrefix")) c.getString("vehicleTypePrefix") else "RH" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization = { BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "", - initType = if(c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", - parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural(if(c.hasPathOrNull("procedural")) c.getConfig("procedural") else com.typesafe.config.ConfigFactory.parseString("procedural{}")) + filePath = if (c.hasPathOrNull("filePath")) c.getString("filePath") else "", + initType = if (c.hasPathOrNull("initType")) c.getString("initType") else "PROCEDURAL", + parking = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + procedural = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization.Procedural( + if (c.hasPathOrNull("procedural")) c.getConfig("procedural") + else com.typesafe.config.ConfigFactory.parseString("procedural{}") + ) ) } } - + case class IterationStats( - timeBinSizeInSec : scala.Double + timeBinSizeInSec: scala.Double ) + object IterationStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats = { BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( - timeBinSizeInSec = if(c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 + timeBinSizeInSec = if (c.hasPathOrNull("timeBinSizeInSec")) c.getDouble("timeBinSizeInSec") else 3600.0 ) } } - + case class RepositioningManager( - demandFollowingRepositioningManager : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, - inverseSquareDistanceRepositioningFactor : BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, - name : java.lang.String, - timeout : scala.Int + demandFollowingRepositioningManager: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager, + inverseSquareDistanceRepositioningFactor: BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor, + name: java.lang.String, + timeout: scala.Int ) + object RepositioningManager { + case class DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider : scala.Double, - horizon : scala.Int, - numberOfClustersForDemand : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDemandForCAVs : scala.Double + fractionOfClosestClustersToConsider: scala.Double, + horizon: scala.Int, + numberOfClustersForDemand: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDemandForCAVs: scala.Double ) + object DemandFollowingRepositioningManager { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( - fractionOfClosestClustersToConsider = if(c.hasPathOrNull("fractionOfClosestClustersToConsider")) c.getDouble("fractionOfClosestClustersToConsider") else 0.2, - horizon = if(c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, - numberOfClustersForDemand = if(c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 1, - sensitivityOfRepositioningToDemandForCAVs = if(c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) c.getDouble("sensitivityOfRepositioningToDemandForCAVs") else 1 + fractionOfClosestClustersToConsider = + if (c.hasPathOrNull("fractionOfClosestClustersToConsider")) + c.getDouble("fractionOfClosestClustersToConsider") + else 0.2, + horizon = if (c.hasPathOrNull("horizon")) c.getInt("horizon") else 1200, + numberOfClustersForDemand = + if (c.hasPathOrNull("numberOfClustersForDemand")) c.getInt("numberOfClustersForDemand") else 30, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 1, + sensitivityOfRepositioningToDemandForCAVs = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemandForCAVs")) + c.getDouble("sensitivityOfRepositioningToDemandForCAVs") + else 1 ) } } - + case class InverseSquareDistanceRepositioningFactor( - predictionHorizon : scala.Int, - sensitivityOfRepositioningToDemand : scala.Double, - sensitivityOfRepositioningToDistance : scala.Double + predictionHorizon: scala.Int, + sensitivityOfRepositioningToDemand: scala.Double, + sensitivityOfRepositioningToDistance: scala.Double ) + object InverseSquareDistanceRepositioningFactor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor( - predictionHorizon = if(c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, - sensitivityOfRepositioningToDemand = if(c.hasPathOrNull("sensitivityOfRepositioningToDemand")) c.getDouble("sensitivityOfRepositioningToDemand") else 0.4, - sensitivityOfRepositioningToDistance = if(c.hasPathOrNull("sensitivityOfRepositioningToDistance")) c.getDouble("sensitivityOfRepositioningToDistance") else 0.9 + predictionHorizon = if (c.hasPathOrNull("predictionHorizon")) c.getInt("predictionHorizon") else 3600, + sensitivityOfRepositioningToDemand = + if (c.hasPathOrNull("sensitivityOfRepositioningToDemand")) + c.getDouble("sensitivityOfRepositioningToDemand") + else 0.4, + sensitivityOfRepositioningToDistance = + if (c.hasPathOrNull("sensitivityOfRepositioningToDistance")) + c.getDouble("sensitivityOfRepositioningToDistance") + else 0.9 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( - demandFollowingRepositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager(if(c.hasPathOrNull("demandFollowingRepositioningManager")) c.getConfig("demandFollowingRepositioningManager") else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}")), - inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.InverseSquareDistanceRepositioningFactor(if(c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) c.getConfig("inverseSquareDistanceRepositioningFactor") else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}")), - name = if(c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", - timeout = if(c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 + demandFollowingRepositioningManager = + BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager.DemandFollowingRepositioningManager( + if (c.hasPathOrNull("demandFollowingRepositioningManager")) + c.getConfig("demandFollowingRepositioningManager") + else com.typesafe.config.ConfigFactory.parseString("demandFollowingRepositioningManager{}") + ), + inverseSquareDistanceRepositioningFactor = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager + .InverseSquareDistanceRepositioningFactor( + if (c.hasPathOrNull("inverseSquareDistanceRepositioningFactor")) + c.getConfig("inverseSquareDistanceRepositioningFactor") + else com.typesafe.config.ConfigFactory.parseString("inverseSquareDistanceRepositioningFactor{}") + ), + name = if (c.hasPathOrNull("name")) c.getString("name") else "DEFAULT_REPOSITIONING_MANAGER", + timeout = if (c.hasPathOrNull("timeout")) c.getInt("timeout") else 0 ) } } - + case class RideHailManager( - radiusInMeters : scala.Double + radiusInMeters: scala.Double ) + object RideHailManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager = { BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( - radiusInMeters = if(c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 + radiusInMeters = if (c.hasPathOrNull("radiusInMeters")) c.getDouble("radiusInMeters") else 5000 ) } } - + case class SurgePricing( - minimumSurgeLevel : scala.Double, - numberOfCategories : scala.Int, - priceAdjustmentStrategy : java.lang.String, - surgeLevelAdaptionStep : scala.Double + minimumSurgeLevel: scala.Double, + numberOfCategories: scala.Int, + priceAdjustmentStrategy: java.lang.String, + surgeLevelAdaptionStep: scala.Double ) + object SurgePricing { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing = { BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( - minimumSurgeLevel = if(c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, - numberOfCategories = if(c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, - priceAdjustmentStrategy = if(c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", - surgeLevelAdaptionStep = if(c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 + minimumSurgeLevel = if (c.hasPathOrNull("minimumSurgeLevel")) c.getDouble("minimumSurgeLevel") else 0.1, + numberOfCategories = if (c.hasPathOrNull("numberOfCategories")) c.getInt("numberOfCategories") else 6, + priceAdjustmentStrategy = + if (c.hasPathOrNull("priceAdjustmentStrategy")) c.getString("priceAdjustmentStrategy") + else "KEEP_PRICE_LEVEL_FIXED_AT_ONE", + surgeLevelAdaptionStep = + if (c.hasPathOrNull("surgeLevelAdaptionStep")) c.getDouble("surgeLevelAdaptionStep") else 0.1 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHail = { BeamConfig.Beam.Agentsim.Agents.RideHail( - allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager(if(c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") else com.typesafe.config.ConfigFactory.parseString("allocationManager{}")), - cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav(if(c.hasPathOrNull("cav")) c.getConfig("cav") else com.typesafe.config.ConfigFactory.parseString("cav{}")), - charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging(if(c.hasPathOrNull("charging")) c.getConfig("charging") else com.typesafe.config.ConfigFactory.parseString("charging{}")), - defaultBaseCost = if(c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, - defaultCostPerMile = if(c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, - defaultCostPerMinute = if(c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, - human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human(if(c.hasPathOrNull("human")) c.getConfig("human") else com.typesafe.config.ConfigFactory.parseString("human{}")), - initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization(if(c.hasPathOrNull("initialization")) c.getConfig("initialization") else com.typesafe.config.ConfigFactory.parseString("initialization{}")), - iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats(if(c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") else com.typesafe.config.ConfigFactory.parseString("iterationStats{}")), - linkFleetStateAcrossIterations = c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), - name = if(c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", - pooledBaseCost = if(c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, - pooledCostPerMile = if(c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, - pooledCostPerMinute = if(c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, - rangeBufferForDispatchInMeters = if(c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") else 10000, - repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager(if(c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}")), - rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager(if(c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}")), - surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing(if(c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") else com.typesafe.config.ConfigFactory.parseString("surgePricing{}")) - ) - } - } - + allocationManager = BeamConfig.Beam.Agentsim.Agents.RideHail.AllocationManager( + if (c.hasPathOrNull("allocationManager")) c.getConfig("allocationManager") + else com.typesafe.config.ConfigFactory.parseString("allocationManager{}") + ), + cav = BeamConfig.Beam.Agentsim.Agents.RideHail.Cav( + if (c.hasPathOrNull("cav")) c.getConfig("cav") + else com.typesafe.config.ConfigFactory.parseString("cav{}") + ), + charging = BeamConfig.Beam.Agentsim.Agents.RideHail.Charging( + if (c.hasPathOrNull("charging")) c.getConfig("charging") + else com.typesafe.config.ConfigFactory.parseString("charging{}") + ), + defaultBaseCost = if (c.hasPathOrNull("defaultBaseCost")) c.getDouble("defaultBaseCost") else 1.8, + defaultCostPerMile = + if (c.hasPathOrNull("defaultCostPerMile")) c.getDouble("defaultCostPerMile") else 0.91, + defaultCostPerMinute = + if (c.hasPathOrNull("defaultCostPerMinute")) c.getDouble("defaultCostPerMinute") else 0.28, + human = BeamConfig.Beam.Agentsim.Agents.RideHail.Human( + if (c.hasPathOrNull("human")) c.getConfig("human") + else com.typesafe.config.ConfigFactory.parseString("human{}") + ), + initialization = BeamConfig.Beam.Agentsim.Agents.RideHail.Initialization( + if (c.hasPathOrNull("initialization")) c.getConfig("initialization") + else com.typesafe.config.ConfigFactory.parseString("initialization{}") + ), + iterationStats = BeamConfig.Beam.Agentsim.Agents.RideHail.IterationStats( + if (c.hasPathOrNull("iterationStats")) c.getConfig("iterationStats") + else com.typesafe.config.ConfigFactory.parseString("iterationStats{}") + ), + linkFleetStateAcrossIterations = + c.hasPathOrNull("linkFleetStateAcrossIterations") && c.getBoolean("linkFleetStateAcrossIterations"), + name = if (c.hasPathOrNull("name")) c.getString("name") else "GlobalRHM", + pooledBaseCost = if (c.hasPathOrNull("pooledBaseCost")) c.getDouble("pooledBaseCost") else 1.89, + pooledCostPerMile = if (c.hasPathOrNull("pooledCostPerMile")) c.getDouble("pooledCostPerMile") else 1.11, + pooledCostPerMinute = + if (c.hasPathOrNull("pooledCostPerMinute")) c.getDouble("pooledCostPerMinute") else 0.07, + rangeBufferForDispatchInMeters = + if (c.hasPathOrNull("rangeBufferForDispatchInMeters")) c.getInt("rangeBufferForDispatchInMeters") + else 10000, + repositioningManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RepositioningManager( + if (c.hasPathOrNull("repositioningManager")) c.getConfig("repositioningManager") + else com.typesafe.config.ConfigFactory.parseString("repositioningManager{}") + ), + rideHailManager = BeamConfig.Beam.Agentsim.Agents.RideHail.RideHailManager( + if (c.hasPathOrNull("rideHailManager")) c.getConfig("rideHailManager") + else com.typesafe.config.ConfigFactory.parseString("rideHailManager{}") + ), + surgePricing = BeamConfig.Beam.Agentsim.Agents.RideHail.SurgePricing( + if (c.hasPathOrNull("surgePricing")) c.getConfig("surgePricing") + else com.typesafe.config.ConfigFactory.parseString("surgePricing{}") + ) + ) + } + } + case class RideHailTransit( - modesToConsider : java.lang.String + modesToConsider: java.lang.String ) + object RideHailTransit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.RideHailTransit = { BeamConfig.Beam.Agentsim.Agents.RideHailTransit( - modesToConsider = if(c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" + modesToConsider = if (c.hasPathOrNull("modesToConsider")) c.getString("modesToConsider") else "MASS" ) } } - + case class TripBehaviors( - carUsage : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, - multinomialLogit : BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit + carUsage: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage, + multinomialLogit: BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit ) + object TripBehaviors { + case class CarUsage( - minDistanceToTrainStop : scala.Double + minDistanceToTrainStop: scala.Double ) + object CarUsage { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( - minDistanceToTrainStop = if(c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 + minDistanceToTrainStop = + if (c.hasPathOrNull("minDistanceToTrainStop")) c.getDouble("minDistanceToTrainStop") else 0.0 ) } } - + case class MultinomialLogit( - activity_file_path : java.lang.String, - additional_trip_utility : scala.Double, - destination_nest_scale_factor : scala.Double, - generate_secondary_activities : scala.Boolean, - intercept_file_path : java.lang.String, - max_destination_choice_set_size : scala.Int, - max_destination_distance_meters : scala.Double, - mode_nest_scale_factor : scala.Double, - trip_nest_scale_factor : scala.Double + activity_file_path: java.lang.String, + additional_trip_utility: scala.Double, + destination_nest_scale_factor: scala.Double, + generate_secondary_activities: scala.Boolean, + intercept_file_path: java.lang.String, + max_destination_choice_set_size: scala.Int, + max_destination_distance_meters: scala.Double, + mode_nest_scale_factor: scala.Double, + trip_nest_scale_factor: scala.Double ) + object MultinomialLogit { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( - activity_file_path = if(c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", - additional_trip_utility = if(c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, - destination_nest_scale_factor = if(c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") else 1.0, - generate_secondary_activities = c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), - intercept_file_path = if(c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", - max_destination_choice_set_size = if(c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") else 20, - max_destination_distance_meters = if(c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") else 32000, - mode_nest_scale_factor = if(c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, - trip_nest_scale_factor = if(c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 + activity_file_path = + if (c.hasPathOrNull("activity_file_path")) c.getString("activity_file_path") else "", + additional_trip_utility = + if (c.hasPathOrNull("additional_trip_utility")) c.getDouble("additional_trip_utility") else 0.0, + destination_nest_scale_factor = + if (c.hasPathOrNull("destination_nest_scale_factor")) c.getDouble("destination_nest_scale_factor") + else 1.0, + generate_secondary_activities = + c.hasPathOrNull("generate_secondary_activities") && c.getBoolean("generate_secondary_activities"), + intercept_file_path = + if (c.hasPathOrNull("intercept_file_path")) c.getString("intercept_file_path") else "", + max_destination_choice_set_size = + if (c.hasPathOrNull("max_destination_choice_set_size")) c.getInt("max_destination_choice_set_size") + else 20, + max_destination_distance_meters = + if (c.hasPathOrNull("max_destination_distance_meters")) c.getDouble("max_destination_distance_meters") + else 32000, + mode_nest_scale_factor = + if (c.hasPathOrNull("mode_nest_scale_factor")) c.getDouble("mode_nest_scale_factor") else 1.0, + trip_nest_scale_factor = + if (c.hasPathOrNull("trip_nest_scale_factor")) c.getDouble("trip_nest_scale_factor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.TripBehaviors = { BeamConfig.Beam.Agentsim.Agents.TripBehaviors( - carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage(if(c.hasPathOrNull("carUsage")) c.getConfig("carUsage") else com.typesafe.config.ConfigFactory.parseString("carUsage{}")), - multinomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit(if(c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}")) + carUsage = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.CarUsage( + if (c.hasPathOrNull("carUsage")) c.getConfig("carUsage") + else com.typesafe.config.ConfigFactory.parseString("carUsage{}") + ), + multinomialLogit = BeamConfig.Beam.Agentsim.Agents.TripBehaviors.MultinomialLogit( + if (c.hasPathOrNull("multinomialLogit")) c.getConfig("multinomialLogit") + else com.typesafe.config.ConfigFactory.parseString("multinomialLogit{}") + ) ) } } - + case class Vehicles( - downsamplingMethod : java.lang.String, - dummySharedBike : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, - dummySharedCar : BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, - enroute : BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, - fractionOfInitialVehicleFleet : scala.Double, - fractionOfPeopleWithBicycle : scala.Double, - fuelTypesFilePath : java.lang.String, - generateEmergencyHouseholdVehicleWhenPlansRequireIt : scala.Boolean, - linkSocAcrossIterations : scala.Boolean, - linkToGradePercentFilePath : java.lang.String, - meanPrivateVehicleStartingSOC : scala.Double, - meanRidehailVehicleStartingSOC : scala.Double, - sharedFleets : scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], - transitVehicleTypesByRouteFile : java.lang.String, - vehicleAdjustmentMethod : java.lang.String, - vehicleTypesFilePath : java.lang.String, - vehiclesFilePath : java.lang.String + downsamplingMethod: java.lang.String, + dummySharedBike: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike, + dummySharedCar: BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar, + enroute: BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute, + fractionOfInitialVehicleFleet: scala.Double, + fractionOfPeopleWithBicycle: scala.Double, + fuelTypesFilePath: java.lang.String, + generateEmergencyHouseholdVehicleWhenPlansRequireIt: scala.Boolean, + linkSocAcrossIterations: scala.Boolean, + linkToGradePercentFilePath: java.lang.String, + meanPrivateVehicleStartingSOC: scala.Double, + meanRidehailVehicleStartingSOC: scala.Double, + sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], + transitVehicleTypesByRouteFile: java.lang.String, + vehicleAdjustmentMethod: java.lang.String, + vehicleTypesFilePath: java.lang.String, + vehiclesFilePath: java.lang.String ) + object Vehicles { + case class DummySharedBike( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedBike { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedBike" ) } } - + case class DummySharedCar( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object DummySharedCar { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar = { BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Enroute( - estimateOfMeanChargingDurationInSecond : scala.Int, - noRefuelAtRemainingDistanceThresholdInMeters : scala.Int, - noRefuelThresholdOffsetInMeters : scala.Double, - remainingDistanceWrtBatteryCapacityThreshold : scala.Int + estimateOfMeanChargingDurationInSecond: scala.Int, + noRefuelAtRemainingDistanceThresholdInMeters: scala.Int, + noRefuelThresholdOffsetInMeters: scala.Double, + remainingDistanceWrtBatteryCapacityThreshold: scala.Int ) + object Enroute { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute = { BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( - estimateOfMeanChargingDurationInSecond = if(c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) c.getInt("estimateOfMeanChargingDurationInSecond") else 1800, - noRefuelAtRemainingDistanceThresholdInMeters = if(c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") else 500, - noRefuelThresholdOffsetInMeters = if(c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") else 32186.9, - remainingDistanceWrtBatteryCapacityThreshold = if(c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) c.getInt("remainingDistanceWrtBatteryCapacityThreshold") else 2 + estimateOfMeanChargingDurationInSecond = + if (c.hasPathOrNull("estimateOfMeanChargingDurationInSecond")) + c.getInt("estimateOfMeanChargingDurationInSecond") + else 1800, + noRefuelAtRemainingDistanceThresholdInMeters = + if (c.hasPathOrNull("noRefuelAtRemainingDistanceThresholdInMeters")) + c.getInt("noRefuelAtRemainingDistanceThresholdInMeters") + else 500, + noRefuelThresholdOffsetInMeters = + if (c.hasPathOrNull("noRefuelThresholdOffsetInMeters")) c.getDouble("noRefuelThresholdOffsetInMeters") + else 32186.9, + remainingDistanceWrtBatteryCapacityThreshold = + if (c.hasPathOrNull("remainingDistanceWrtBatteryCapacityThreshold")) + c.getInt("remainingDistanceWrtBatteryCapacityThreshold") + else 2 ) } } - + case class SharedFleets$Elm( - fixed_non_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving], - fixed_non_reserving_fleet_by_taz : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz], - inexhaustible_reserving : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving], - managerType : java.lang.String, - name : java.lang.String, - parkingFilePath : java.lang.String, - reposition : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] + fixed_non_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving + ], + fixed_non_reserving_fleet_by_taz: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz + ], + inexhaustible_reserving: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving + ], + managerType: java.lang.String, + name: java.lang.String, + parkingFilePath: java.lang.String, + reposition: scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition] ) + object SharedFleets$Elm { + case class FixedNonReserving( - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String ) + object FixedNonReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving( - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class FixedNonReservingFleetByTaz( - fleetSize : scala.Int, - maxWalkingDistance : scala.Int, - vehicleTypeId : java.lang.String, - vehiclesSharePerTAZFromCSV : scala.Option[java.lang.String] + fleetSize: scala.Int, + maxWalkingDistance: scala.Int, + vehicleTypeId: java.lang.String, + vehiclesSharePerTAZFromCSV: scala.Option[java.lang.String] ) + object FixedNonReservingFleetByTaz { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz( - fleetSize = if(c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, - maxWalkingDistance = if(c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", - vehiclesSharePerTAZFromCSV = if(c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) else None + fleetSize = if (c.hasPathOrNull("fleetSize")) c.getInt("fleetSize") else 10, + maxWalkingDistance = + if (c.hasPathOrNull("maxWalkingDistance")) c.getInt("maxWalkingDistance") else 500, + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar", + vehiclesSharePerTAZFromCSV = + if (c.hasPathOrNull("vehiclesSharePerTAZFromCSV")) Some(c.getString("vehiclesSharePerTAZFromCSV")) + else None ) } } - + case class InexhaustibleReserving( - vehicleTypeId : java.lang.String + vehicleTypeId: java.lang.String ) + object InexhaustibleReserving { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving( - vehicleTypeId = if(c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" + vehicleTypeId = + if (c.hasPathOrNull("vehicleTypeId")) c.getString("vehicleTypeId") else "sharedVehicle-sharedCar" ) } } - + case class Reposition( - min_availability_undersupply_algorithm : scala.Option[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm], - name : java.lang.String, - repositionTimeBin : scala.Int, - statTimeBin : scala.Int + min_availability_undersupply_algorithm: scala.Option[ + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm + ], + name: java.lang.String, + repositionTimeBin: scala.Int, + statTimeBin: scala.Int ) + object Reposition { + case class MinAvailabilityUndersupplyAlgorithm( - matchLimit : scala.Int + matchLimit: scala.Int ) + object MinAvailabilityUndersupplyAlgorithm { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { - BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm( - matchLimit = if(c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 - ) + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm = { + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm( + matchLimit = if (c.hasPathOrNull("matchLimit")) c.getInt("matchLimit") else 99999 + ) } } - - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition( - min_availability_undersupply_algorithm = if(c.hasPathOrNull("min-availability-undersupply-algorithm")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition.MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm"))) else None, - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", - repositionTimeBin = if(c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, - statTimeBin = if(c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 + min_availability_undersupply_algorithm = + if (c.hasPathOrNull("min-availability-undersupply-algorithm")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition + .MinAvailabilityUndersupplyAlgorithm(c.getConfig("min-availability-undersupply-algorithm")) + ) + else None, + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-reposition-algorithm", + repositionTimeBin = if (c.hasPathOrNull("repositionTimeBin")) c.getInt("repositionTimeBin") else 3600, + statTimeBin = if (c.hasPathOrNull("statTimeBin")) c.getInt("statTimeBin") else 300 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm = { BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm( - fixed_non_reserving = if(c.hasPathOrNull("fixed-non-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReserving(c.getConfig("fixed-non-reserving"))) else None, - fixed_non_reserving_fleet_by_taz = if(c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz"))) else None, - inexhaustible_reserving = if(c.hasPathOrNull("inexhaustible-reserving")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.InexhaustibleReserving(c.getConfig("inexhaustible-reserving"))) else None, - managerType = if(c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", - name = if(c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - reposition = if(c.hasPathOrNull("reposition")) scala.Some(BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition"))) else None + fixed_non_reserving = + if (c.hasPathOrNull("fixed-non-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReserving(c.getConfig("fixed-non-reserving")) + ) + else None, + fixed_non_reserving_fleet_by_taz = + if (c.hasPathOrNull("fixed-non-reserving-fleet-by-taz")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .FixedNonReservingFleetByTaz(c.getConfig("fixed-non-reserving-fleet-by-taz")) + ) + else None, + inexhaustible_reserving = + if (c.hasPathOrNull("inexhaustible-reserving")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm + .InexhaustibleReserving(c.getConfig("inexhaustible-reserving")) + ) + else None, + managerType = if (c.hasPathOrNull("managerType")) c.getString("managerType") else "fixed-non-reserving", + name = if (c.hasPathOrNull("name")) c.getString("name") else "my-fixed-non-reserving-fleet", + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + reposition = + if (c.hasPathOrNull("reposition")) + scala.Some( + BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm.Reposition(c.getConfig("reposition")) + ) + else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents.Vehicles = { BeamConfig.Beam.Agentsim.Agents.Vehicles( - downsamplingMethod = if(c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") else "SECONDARY_VEHICLES_FIRST", - dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike(if(c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}")), - dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar(if(c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}")), - enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute(if(c.hasPathOrNull("enroute")) c.getConfig("enroute") else com.typesafe.config.ConfigFactory.parseString("enroute{}")), - fractionOfInitialVehicleFleet = if(c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") else 1.0, - fractionOfPeopleWithBicycle = if(c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, - fuelTypesFilePath = if(c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") else "/test/input/beamville/beamFuelTypes.csv", - generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull("generateEmergencyHouseholdVehicleWhenPlansRequireIt") && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), - linkSocAcrossIterations = c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), - linkToGradePercentFilePath = if(c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", - meanPrivateVehicleStartingSOC = if(c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") else 1.0, - meanRidehailVehicleStartingSOC = if(c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, - sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), - transitVehicleTypesByRouteFile = if(c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") else "", - vehicleAdjustmentMethod = if(c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", - vehicleTypesFilePath = if(c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") else "/test/input/beamville/vehicleTypes.csv", - vehiclesFilePath = if(c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") else "/test/input/beamville/vehicles.csv" - ) - } - private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { + downsamplingMethod = + if (c.hasPathOrNull("downsamplingMethod")) c.getString("downsamplingMethod") + else "SECONDARY_VEHICLES_FIRST", + dummySharedBike = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedBike( + if (c.hasPathOrNull("dummySharedBike")) c.getConfig("dummySharedBike") + else com.typesafe.config.ConfigFactory.parseString("dummySharedBike{}") + ), + dummySharedCar = BeamConfig.Beam.Agentsim.Agents.Vehicles.DummySharedCar( + if (c.hasPathOrNull("dummySharedCar")) c.getConfig("dummySharedCar") + else com.typesafe.config.ConfigFactory.parseString("dummySharedCar{}") + ), + enroute = BeamConfig.Beam.Agentsim.Agents.Vehicles.Enroute( + if (c.hasPathOrNull("enroute")) c.getConfig("enroute") + else com.typesafe.config.ConfigFactory.parseString("enroute{}") + ), + fractionOfInitialVehicleFleet = + if (c.hasPathOrNull("fractionOfInitialVehicleFleet")) c.getDouble("fractionOfInitialVehicleFleet") + else 1.0, + fractionOfPeopleWithBicycle = + if (c.hasPathOrNull("fractionOfPeopleWithBicycle")) c.getDouble("fractionOfPeopleWithBicycle") else 1.0, + fuelTypesFilePath = + if (c.hasPathOrNull("fuelTypesFilePath")) c.getString("fuelTypesFilePath") + else "/test/input/beamville/beamFuelTypes.csv", + generateEmergencyHouseholdVehicleWhenPlansRequireIt = c.hasPathOrNull( + "generateEmergencyHouseholdVehicleWhenPlansRequireIt" + ) && c.getBoolean("generateEmergencyHouseholdVehicleWhenPlansRequireIt"), + linkSocAcrossIterations = + c.hasPathOrNull("linkSocAcrossIterations") && c.getBoolean("linkSocAcrossIterations"), + linkToGradePercentFilePath = + if (c.hasPathOrNull("linkToGradePercentFilePath")) c.getString("linkToGradePercentFilePath") else "", + meanPrivateVehicleStartingSOC = + if (c.hasPathOrNull("meanPrivateVehicleStartingSOC")) c.getDouble("meanPrivateVehicleStartingSOC") + else 1.0, + meanRidehailVehicleStartingSOC = + if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") + else 1.0, + sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), + transitVehicleTypesByRouteFile = + if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") + else "", + vehicleAdjustmentMethod = + if (c.hasPathOrNull("vehicleAdjustmentMethod")) c.getString("vehicleAdjustmentMethod") else "UNIFORM", + vehicleTypesFilePath = + if (c.hasPathOrNull("vehicleTypesFilePath")) c.getString("vehicleTypesFilePath") + else "/test/input/beamville/vehicleTypes.csv", + vehiclesFilePath = + if (c.hasPathOrNull("vehiclesFilePath")) c.getString("vehiclesFilePath") + else "/test/input/beamville/vehicles.csv" + ) + } + + private def $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Agentsim.Agents.Vehicles + .SharedFleets$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Agents = { BeamConfig.Beam.Agentsim.Agents( - activities = BeamConfig.Beam.Agentsim.Agents.Activities(if(c.hasPathOrNull("activities")) c.getConfig("activities") else com.typesafe.config.ConfigFactory.parseString("activities{}")), - bodyType = if(c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", - freight = BeamConfig.Beam.Agentsim.Agents.Freight(if(c.hasPathOrNull("freight")) c.getConfig("freight") else com.typesafe.config.ConfigFactory.parseString("freight{}")), - households = BeamConfig.Beam.Agentsim.Agents.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors(if(c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}")), - modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive(if(c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}")), - parking = BeamConfig.Beam.Agentsim.Agents.Parking(if(c.hasPathOrNull("parking")) c.getConfig("parking") else com.typesafe.config.ConfigFactory.parseString("parking{}")), - plans = BeamConfig.Beam.Agentsim.Agents.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - population = BeamConfig.Beam.Agentsim.Agents.Population(if(c.hasPathOrNull("population")) c.getConfig("population") else com.typesafe.config.ConfigFactory.parseString("population{}")), - ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare(if(c.hasPathOrNull("ptFare")) c.getConfig("ptFare") else com.typesafe.config.ConfigFactory.parseString("ptFare{}")), - rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail(if(c.hasPathOrNull("rideHail")) c.getConfig("rideHail") else com.typesafe.config.ConfigFactory.parseString("rideHail{}")), - rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit(if(c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}")), - tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors(if(c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}")), - vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) - ) - } - } - + activities = BeamConfig.Beam.Agentsim.Agents.Activities( + if (c.hasPathOrNull("activities")) c.getConfig("activities") + else com.typesafe.config.ConfigFactory.parseString("activities{}") + ), + bodyType = if (c.hasPathOrNull("bodyType")) c.getString("bodyType") else "BODY-TYPE-DEFAULT", + freight = BeamConfig.Beam.Agentsim.Agents.Freight( + if (c.hasPathOrNull("freight")) c.getConfig("freight") + else com.typesafe.config.ConfigFactory.parseString("freight{}") + ), + households = BeamConfig.Beam.Agentsim.Agents.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + modalBehaviors = BeamConfig.Beam.Agentsim.Agents.ModalBehaviors( + if (c.hasPathOrNull("modalBehaviors")) c.getConfig("modalBehaviors") + else com.typesafe.config.ConfigFactory.parseString("modalBehaviors{}") + ), + modeIncentive = BeamConfig.Beam.Agentsim.Agents.ModeIncentive( + if (c.hasPathOrNull("modeIncentive")) c.getConfig("modeIncentive") + else com.typesafe.config.ConfigFactory.parseString("modeIncentive{}") + ), + parking = BeamConfig.Beam.Agentsim.Agents.Parking( + if (c.hasPathOrNull("parking")) c.getConfig("parking") + else com.typesafe.config.ConfigFactory.parseString("parking{}") + ), + plans = BeamConfig.Beam.Agentsim.Agents.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + population = BeamConfig.Beam.Agentsim.Agents.Population( + if (c.hasPathOrNull("population")) c.getConfig("population") + else com.typesafe.config.ConfigFactory.parseString("population{}") + ), + ptFare = BeamConfig.Beam.Agentsim.Agents.PtFare( + if (c.hasPathOrNull("ptFare")) c.getConfig("ptFare") + else com.typesafe.config.ConfigFactory.parseString("ptFare{}") + ), + rideHail = BeamConfig.Beam.Agentsim.Agents.RideHail( + if (c.hasPathOrNull("rideHail")) c.getConfig("rideHail") + else com.typesafe.config.ConfigFactory.parseString("rideHail{}") + ), + rideHailTransit = BeamConfig.Beam.Agentsim.Agents.RideHailTransit( + if (c.hasPathOrNull("rideHailTransit")) c.getConfig("rideHailTransit") + else com.typesafe.config.ConfigFactory.parseString("rideHailTransit{}") + ), + tripBehaviors = BeamConfig.Beam.Agentsim.Agents.TripBehaviors( + if (c.hasPathOrNull("tripBehaviors")) c.getConfig("tripBehaviors") + else com.typesafe.config.ConfigFactory.parseString("tripBehaviors{}") + ), + vehicles = BeamConfig.Beam.Agentsim.Agents.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) + ) + } + } + case class ChargingNetworkManager( - chargingPointCostScalingFactor : scala.Double, - chargingPointCountScalingFactor : scala.Double, - chargingPointFilePath : java.lang.String, - helics : BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, - scaleUp : BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, - timeStepInSeconds : scala.Int + chargingPointCostScalingFactor: scala.Double, + chargingPointCountScalingFactor: scala.Double, + chargingPointFilePath: java.lang.String, + helics: BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics, + scaleUp: BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp, + timeStepInSeconds: scala.Int ) + object ChargingNetworkManager { + case class Helics( - bufferSize : scala.Int, - connectionEnabled : scala.Boolean, - coreInitString : java.lang.String, - coreType : java.lang.String, - dataInStreamPoint : java.lang.String, - dataOutStreamPoint : java.lang.String, - federateName : java.lang.String, - feedbackEnabled : scala.Boolean, - intLogLevel : scala.Int, - timeDeltaProperty : scala.Double + bufferSize: scala.Int, + connectionEnabled: scala.Boolean, + coreInitString: java.lang.String, + coreType: java.lang.String, + dataInStreamPoint: java.lang.String, + dataOutStreamPoint: java.lang.String, + federateName: java.lang.String, + feedbackEnabled: scala.Boolean, + intLogLevel: scala.Int, + timeDeltaProperty: scala.Double ) + object Helics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( - bufferSize = if(c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, - connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), - coreInitString = if(c.hasPathOrNull("coreInitString")) c.getString("coreInitString") else "--federates=1 --broker_address=tcp://127.0.0.1", - coreType = if(c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", - dataInStreamPoint = if(c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") else "GridFed/PhysicalBounds", - dataOutStreamPoint = if(c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", - federateName = if(c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", - feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), - intLogLevel = if(c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, - timeDeltaProperty = if(c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 + bufferSize = if (c.hasPathOrNull("bufferSize")) c.getInt("bufferSize") else 1000, + connectionEnabled = c.hasPathOrNull("connectionEnabled") && c.getBoolean("connectionEnabled"), + coreInitString = + if (c.hasPathOrNull("coreInitString")) c.getString("coreInitString") + else "--federates=1 --broker_address=tcp://127.0.0.1", + coreType = if (c.hasPathOrNull("coreType")) c.getString("coreType") else "zmq", + dataInStreamPoint = + if (c.hasPathOrNull("dataInStreamPoint")) c.getString("dataInStreamPoint") + else "GridFed/PhysicalBounds", + dataOutStreamPoint = + if (c.hasPathOrNull("dataOutStreamPoint")) c.getString("dataOutStreamPoint") else "PowerDemand", + federateName = if (c.hasPathOrNull("federateName")) c.getString("federateName") else "CNMFederate", + feedbackEnabled = !c.hasPathOrNull("feedbackEnabled") || c.getBoolean("feedbackEnabled"), + intLogLevel = if (c.hasPathOrNull("intLogLevel")) c.getInt("intLogLevel") else 1, + timeDeltaProperty = if (c.hasPathOrNull("timeDeltaProperty")) c.getDouble("timeDeltaProperty") else 1.0 ) } } - + case class ScaleUp( - enabled : scala.Boolean, - expansionFactor_charge_activity : scala.Double, - expansionFactor_home_activity : scala.Double, - expansionFactor_init_activity : scala.Double, - expansionFactor_wherever_activity : scala.Double, - expansionFactor_work_activity : scala.Double + enabled: scala.Boolean, + expansionFactor_charge_activity: scala.Double, + expansionFactor_home_activity: scala.Double, + expansionFactor_init_activity: scala.Double, + expansionFactor_wherever_activity: scala.Double, + expansionFactor_work_activity: scala.Double ) + object ScaleUp { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp = { BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - expansionFactor_charge_activity = if(c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") else 1.0, - expansionFactor_home_activity = if(c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") else 1.0, - expansionFactor_init_activity = if(c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") else 1.0, - expansionFactor_wherever_activity = if(c.hasPathOrNull("expansionFactor_wherever_activity")) c.getDouble("expansionFactor_wherever_activity") else 1.0, - expansionFactor_work_activity = if(c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") else 1.0 + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + expansionFactor_charge_activity = + if (c.hasPathOrNull("expansionFactor_charge_activity")) c.getDouble("expansionFactor_charge_activity") + else 1.0, + expansionFactor_home_activity = + if (c.hasPathOrNull("expansionFactor_home_activity")) c.getDouble("expansionFactor_home_activity") + else 1.0, + expansionFactor_init_activity = + if (c.hasPathOrNull("expansionFactor_init_activity")) c.getDouble("expansionFactor_init_activity") + else 1.0, + expansionFactor_wherever_activity = + if (c.hasPathOrNull("expansionFactor_wherever_activity")) + c.getDouble("expansionFactor_wherever_activity") + else 1.0, + expansionFactor_work_activity = + if (c.hasPathOrNull("expansionFactor_work_activity")) c.getDouble("expansionFactor_work_activity") + else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ChargingNetworkManager = { BeamConfig.Beam.Agentsim.ChargingNetworkManager( - chargingPointCostScalingFactor = if(c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") else 1.0, - chargingPointCountScalingFactor = if(c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") else 1.0, - chargingPointFilePath = if(c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", - helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics(if(c.hasPathOrNull("helics")) c.getConfig("helics") else com.typesafe.config.ConfigFactory.parseString("helics{}")), - scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp(if(c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") else com.typesafe.config.ConfigFactory.parseString("scaleUp{}")), - timeStepInSeconds = if(c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 + chargingPointCostScalingFactor = + if (c.hasPathOrNull("chargingPointCostScalingFactor")) c.getDouble("chargingPointCostScalingFactor") + else 1.0, + chargingPointCountScalingFactor = + if (c.hasPathOrNull("chargingPointCountScalingFactor")) c.getDouble("chargingPointCountScalingFactor") + else 1.0, + chargingPointFilePath = + if (c.hasPathOrNull("chargingPointFilePath")) c.getString("chargingPointFilePath") else "", + helics = BeamConfig.Beam.Agentsim.ChargingNetworkManager.Helics( + if (c.hasPathOrNull("helics")) c.getConfig("helics") + else com.typesafe.config.ConfigFactory.parseString("helics{}") + ), + scaleUp = BeamConfig.Beam.Agentsim.ChargingNetworkManager.ScaleUp( + if (c.hasPathOrNull("scaleUp")) c.getConfig("scaleUp") + else com.typesafe.config.ConfigFactory.parseString("scaleUp{}") + ), + timeStepInSeconds = if (c.hasPathOrNull("timeStepInSeconds")) c.getInt("timeStepInSeconds") else 300 ) } } - + case class H3taz( - lowerBoundResolution : scala.Int, - upperBoundResolution : scala.Int + lowerBoundResolution: scala.Int, + upperBoundResolution: scala.Int ) + object H3taz { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.H3taz = { BeamConfig.Beam.Agentsim.H3taz( - lowerBoundResolution = if(c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, - upperBoundResolution = if(c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 + lowerBoundResolution = if (c.hasPathOrNull("lowerBoundResolution")) c.getInt("lowerBoundResolution") else 6, + upperBoundResolution = if (c.hasPathOrNull("upperBoundResolution")) c.getInt("upperBoundResolution") else 9 ) } } - + case class Scenarios( - frequencyAdjustmentFile : java.lang.String + frequencyAdjustmentFile: java.lang.String ) + object Scenarios { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Scenarios = { BeamConfig.Beam.Agentsim.Scenarios( - frequencyAdjustmentFile = if(c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") else "/test/input/beamville/r5/FrequencyAdjustment.csv" + frequencyAdjustmentFile = + if (c.hasPathOrNull("frequencyAdjustmentFile")) c.getString("frequencyAdjustmentFile") + else "/test/input/beamville/r5/FrequencyAdjustment.csv" ) } } - + case class ScheduleMonitorTask( - initialDelay : scala.Int, - interval : scala.Int + initialDelay: scala.Int, + interval: scala.Int ) + object ScheduleMonitorTask { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.ScheduleMonitorTask = { BeamConfig.Beam.Agentsim.ScheduleMonitorTask( - initialDelay = if(c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, - interval = if(c.hasPathOrNull("interval")) c.getInt("interval") else 30 + initialDelay = if (c.hasPathOrNull("initialDelay")) c.getInt("initialDelay") else 1, + interval = if (c.hasPathOrNull("interval")) c.getInt("interval") else 30 ) } } - + case class Taz( - filePath : java.lang.String, - parkingCostScalingFactor : scala.Double, - parkingFilePath : java.lang.String, - parkingManager : BeamConfig.Beam.Agentsim.Taz.ParkingManager, - parkingStallCountScalingFactor : scala.Double + filePath: java.lang.String, + parkingCostScalingFactor: scala.Double, + parkingFilePath: java.lang.String, + parkingManager: BeamConfig.Beam.Agentsim.Taz.ParkingManager, + parkingStallCountScalingFactor: scala.Double ) + object Taz { + case class ParkingManager( - displayPerformanceTimings : scala.Boolean, - method : java.lang.String, - parallel : BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel + displayPerformanceTimings: scala.Boolean, + method: java.lang.String, + parallel: BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel ) + object ParkingManager { + case class Parallel( - numberOfClusters : scala.Int + numberOfClusters: scala.Int ) + object Parallel { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel = { BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz.ParkingManager = { BeamConfig.Beam.Agentsim.Taz.ParkingManager( - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - method = if(c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", - parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel(if(c.hasPathOrNull("parallel")) c.getConfig("parallel") else com.typesafe.config.ConfigFactory.parseString("parallel{}")) + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + method = if (c.hasPathOrNull("method")) c.getString("method") else "DEFAULT", + parallel = BeamConfig.Beam.Agentsim.Taz.ParkingManager.Parallel( + if (c.hasPathOrNull("parallel")) c.getConfig("parallel") + else com.typesafe.config.ConfigFactory.parseString("parallel{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Taz = { BeamConfig.Beam.Agentsim.Taz( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", - parkingCostScalingFactor = if(c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, - parkingFilePath = if(c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", - parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager(if(c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") else com.typesafe.config.ConfigFactory.parseString("parkingManager{}")), - parkingStallCountScalingFactor = if(c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") else 1.0 + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/taz-centers.csv", + parkingCostScalingFactor = + if (c.hasPathOrNull("parkingCostScalingFactor")) c.getDouble("parkingCostScalingFactor") else 1.0, + parkingFilePath = if (c.hasPathOrNull("parkingFilePath")) c.getString("parkingFilePath") else "", + parkingManager = BeamConfig.Beam.Agentsim.Taz.ParkingManager( + if (c.hasPathOrNull("parkingManager")) c.getConfig("parkingManager") + else com.typesafe.config.ConfigFactory.parseString("parkingManager{}") + ), + parkingStallCountScalingFactor = + if (c.hasPathOrNull("parkingStallCountScalingFactor")) c.getDouble("parkingStallCountScalingFactor") + else 1.0 ) } } - + case class Toll( - filePath : java.lang.String + filePath: java.lang.String ) + object Toll { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Toll = { BeamConfig.Beam.Agentsim.Toll( - filePath = if(c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" + filePath = + if (c.hasPathOrNull("filePath")) c.getString("filePath") else "/test/input/beamville/toll-prices.csv" ) } } - + case class Tuning( - fuelCapacityInJoules : scala.Double, - rideHailPrice : scala.Double, - tollPrice : scala.Double, - transitCapacity : scala.Option[scala.Double], - transitPrice : scala.Double + fuelCapacityInJoules: scala.Double, + rideHailPrice: scala.Double, + tollPrice: scala.Double, + transitCapacity: scala.Option[scala.Double], + transitPrice: scala.Double ) + object Tuning { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim.Tuning = { BeamConfig.Beam.Agentsim.Tuning( - fuelCapacityInJoules = if(c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, - rideHailPrice = if(c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, - tollPrice = if(c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, - transitCapacity = if(c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, - transitPrice = if(c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 + fuelCapacityInJoules = + if (c.hasPathOrNull("fuelCapacityInJoules")) c.getDouble("fuelCapacityInJoules") else 86400000, + rideHailPrice = if (c.hasPathOrNull("rideHailPrice")) c.getDouble("rideHailPrice") else 1.0, + tollPrice = if (c.hasPathOrNull("tollPrice")) c.getDouble("tollPrice") else 1.0, + transitCapacity = if (c.hasPathOrNull("transitCapacity")) Some(c.getDouble("transitCapacity")) else None, + transitPrice = if (c.hasPathOrNull("transitPrice")) c.getDouble("transitPrice") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Agentsim = { BeamConfig.Beam.Agentsim( - agentSampleSizeAsFractionOfPopulation = if(c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) c.getDouble("agentSampleSizeAsFractionOfPopulation") else 1.0, - agents = BeamConfig.Beam.Agentsim.Agents(if(c.hasPathOrNull("agents")) c.getConfig("agents") else com.typesafe.config.ConfigFactory.parseString("agents{}")), - chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager(if(c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}")), - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - fractionOfPlansWithSingleActivity = if(c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") else 0.0, - h3taz = BeamConfig.Beam.Agentsim.H3taz(if(c.hasPathOrNull("h3taz")) c.getConfig("h3taz") else com.typesafe.config.ConfigFactory.parseString("h3taz{}")), - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - populationAdjustment = if(c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", - randomSeedForPopulationSampling = if(c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) else None, - scenarios = BeamConfig.Beam.Agentsim.Scenarios(if(c.hasPathOrNull("scenarios")) c.getConfig("scenarios") else com.typesafe.config.ConfigFactory.parseString("scenarios{}")), - scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask(if(c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}")), - schedulerParallelismWindow = if(c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, - simulationName = if(c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", - snapLocationAndRemoveInvalidInputs = c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), - taz = BeamConfig.Beam.Agentsim.Taz(if(c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}")), - thresholdForMakingParkingChoiceInMeters = if(c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) c.getInt("thresholdForMakingParkingChoiceInMeters") else 100, - thresholdForWalkingInMeters = if(c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, - timeBinSize = if(c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, - toll = BeamConfig.Beam.Agentsim.Toll(if(c.hasPathOrNull("toll")) c.getConfig("toll") else com.typesafe.config.ConfigFactory.parseString("toll{}")), - tuning = BeamConfig.Beam.Agentsim.Tuning(if(c.hasPathOrNull("tuning")) c.getConfig("tuning") else com.typesafe.config.ConfigFactory.parseString("tuning{}")) + agentSampleSizeAsFractionOfPopulation = + if (c.hasPathOrNull("agentSampleSizeAsFractionOfPopulation")) + c.getDouble("agentSampleSizeAsFractionOfPopulation") + else 1.0, + agents = BeamConfig.Beam.Agentsim.Agents( + if (c.hasPathOrNull("agents")) c.getConfig("agents") + else com.typesafe.config.ConfigFactory.parseString("agents{}") + ), + chargingNetworkManager = BeamConfig.Beam.Agentsim.ChargingNetworkManager( + if (c.hasPathOrNull("chargingNetworkManager")) c.getConfig("chargingNetworkManager") + else com.typesafe.config.ConfigFactory.parseString("chargingNetworkManager{}") + ), + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + fractionOfPlansWithSingleActivity = + if (c.hasPathOrNull("fractionOfPlansWithSingleActivity")) c.getDouble("fractionOfPlansWithSingleActivity") + else 0.0, + h3taz = BeamConfig.Beam.Agentsim.H3taz( + if (c.hasPathOrNull("h3taz")) c.getConfig("h3taz") + else com.typesafe.config.ConfigFactory.parseString("h3taz{}") + ), + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + populationAdjustment = + if (c.hasPathOrNull("populationAdjustment")) c.getString("populationAdjustment") else "DEFAULT_ADJUSTMENT", + randomSeedForPopulationSampling = + if (c.hasPathOrNull("randomSeedForPopulationSampling")) Some(c.getInt("randomSeedForPopulationSampling")) + else None, + scenarios = BeamConfig.Beam.Agentsim.Scenarios( + if (c.hasPathOrNull("scenarios")) c.getConfig("scenarios") + else com.typesafe.config.ConfigFactory.parseString("scenarios{}") + ), + scheduleMonitorTask = BeamConfig.Beam.Agentsim.ScheduleMonitorTask( + if (c.hasPathOrNull("scheduleMonitorTask")) c.getConfig("scheduleMonitorTask") + else com.typesafe.config.ConfigFactory.parseString("scheduleMonitorTask{}") + ), + schedulerParallelismWindow = + if (c.hasPathOrNull("schedulerParallelismWindow")) c.getInt("schedulerParallelismWindow") else 30, + simulationName = if (c.hasPathOrNull("simulationName")) c.getString("simulationName") else "beamville", + snapLocationAndRemoveInvalidInputs = + c.hasPathOrNull("snapLocationAndRemoveInvalidInputs") && c.getBoolean("snapLocationAndRemoveInvalidInputs"), + taz = BeamConfig.Beam.Agentsim.Taz( + if (c.hasPathOrNull("taz")) c.getConfig("taz") else com.typesafe.config.ConfigFactory.parseString("taz{}") + ), + thresholdForMakingParkingChoiceInMeters = + if (c.hasPathOrNull("thresholdForMakingParkingChoiceInMeters")) + c.getInt("thresholdForMakingParkingChoiceInMeters") + else 100, + thresholdForWalkingInMeters = + if (c.hasPathOrNull("thresholdForWalkingInMeters")) c.getInt("thresholdForWalkingInMeters") else 100, + timeBinSize = if (c.hasPathOrNull("timeBinSize")) c.getInt("timeBinSize") else 3600, + toll = BeamConfig.Beam.Agentsim.Toll( + if (c.hasPathOrNull("toll")) c.getConfig("toll") + else com.typesafe.config.ConfigFactory.parseString("toll{}") + ), + tuning = BeamConfig.Beam.Agentsim.Tuning( + if (c.hasPathOrNull("tuning")) c.getConfig("tuning") + else com.typesafe.config.ConfigFactory.parseString("tuning{}") + ) ) } } - + case class Calibration( - counts : BeamConfig.Beam.Calibration.Counts, - google : BeamConfig.Beam.Calibration.Google, - meanToCountsWeightRatio : scala.Double, - mode : BeamConfig.Beam.Calibration.Mode, - objectiveFunction : java.lang.String, - roadNetwork : BeamConfig.Beam.Calibration.RoadNetwork, - studyArea : BeamConfig.Beam.Calibration.StudyArea + counts: BeamConfig.Beam.Calibration.Counts, + google: BeamConfig.Beam.Calibration.Google, + meanToCountsWeightRatio: scala.Double, + mode: BeamConfig.Beam.Calibration.Mode, + objectiveFunction: java.lang.String, + roadNetwork: BeamConfig.Beam.Calibration.RoadNetwork, + studyArea: BeamConfig.Beam.Calibration.StudyArea ) + object Calibration { + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Int, - inputCountsFile : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Int, + inputCountsFile: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Counts = { BeamConfig.Beam.Calibration.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 1, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getInt("countsScaleFactor") else 10, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 1 ) } } - + case class Google( - travelTimes : BeamConfig.Beam.Calibration.Google.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.Google.TravelTimes ) + object Google { + case class TravelTimes( - enable : scala.Boolean, - iterationInterval : scala.Int, - minDistanceInMeters : scala.Double, - numDataPointsOver24Hours : scala.Int, - offPeakEnabled : scala.Boolean, - queryDate : java.lang.String, - tolls : scala.Boolean + enable: scala.Boolean, + iterationInterval: scala.Int, + minDistanceInMeters: scala.Double, + numDataPointsOver24Hours: scala.Int, + offPeakEnabled: scala.Boolean, + queryDate: java.lang.String, + tolls: scala.Boolean ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google.TravelTimes = { BeamConfig.Beam.Calibration.Google.TravelTimes( - enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), - iterationInterval = if(c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, - minDistanceInMeters = if(c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, - numDataPointsOver24Hours = if(c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, - offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), - queryDate = if(c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", - tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") + enable = c.hasPathOrNull("enable") && c.getBoolean("enable"), + iterationInterval = if (c.hasPathOrNull("iterationInterval")) c.getInt("iterationInterval") else 5, + minDistanceInMeters = + if (c.hasPathOrNull("minDistanceInMeters")) c.getDouble("minDistanceInMeters") else 5000, + numDataPointsOver24Hours = + if (c.hasPathOrNull("numDataPointsOver24Hours")) c.getInt("numDataPointsOver24Hours") else 100, + offPeakEnabled = c.hasPathOrNull("offPeakEnabled") && c.getBoolean("offPeakEnabled"), + queryDate = if (c.hasPathOrNull("queryDate")) c.getString("queryDate") else "2020-10-14", + tolls = !c.hasPathOrNull("tolls") || c.getBoolean("tolls") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Google = { BeamConfig.Beam.Calibration.Google( - travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.Google.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class Mode( - benchmarkFilePath : java.lang.String + benchmarkFilePath: java.lang.String ) + object Mode { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.Mode = { BeamConfig.Beam.Calibration.Mode( - benchmarkFilePath = if(c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" + benchmarkFilePath = if (c.hasPathOrNull("benchmarkFilePath")) c.getString("benchmarkFilePath") else "" ) } } - + case class RoadNetwork( - travelTimes : BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes + travelTimes: BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes ) + object RoadNetwork { + case class TravelTimes( - zoneBoundariesFilePath : java.lang.String, - zoneODTravelTimesFilePath : java.lang.String + zoneBoundariesFilePath: java.lang.String, + zoneODTravelTimesFilePath: java.lang.String ) + object TravelTimes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes = { BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( - zoneBoundariesFilePath = if(c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", - zoneODTravelTimesFilePath = if(c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" + zoneBoundariesFilePath = + if (c.hasPathOrNull("zoneBoundariesFilePath")) c.getString("zoneBoundariesFilePath") else "", + zoneODTravelTimesFilePath = + if (c.hasPathOrNull("zoneODTravelTimesFilePath")) c.getString("zoneODTravelTimesFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.RoadNetwork = { BeamConfig.Beam.Calibration.RoadNetwork( - travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes(if(c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") else com.typesafe.config.ConfigFactory.parseString("travelTimes{}")) + travelTimes = BeamConfig.Beam.Calibration.RoadNetwork.TravelTimes( + if (c.hasPathOrNull("travelTimes")) c.getConfig("travelTimes") + else com.typesafe.config.ConfigFactory.parseString("travelTimes{}") + ) ) } } - + case class StudyArea( - enabled : scala.Boolean, - lat : scala.Double, - lon : scala.Double, - radius : scala.Double + enabled: scala.Boolean, + lat: scala.Double, + lon: scala.Double, + radius: scala.Double ) + object StudyArea { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration.StudyArea = { BeamConfig.Beam.Calibration.StudyArea( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - lat = if(c.hasPathOrNull("lat")) c.getDouble("lat") else 0, - lon = if(c.hasPathOrNull("lon")) c.getDouble("lon") else 0, - radius = if(c.hasPathOrNull("radius")) c.getDouble("radius") else 0 + lat = if (c.hasPathOrNull("lat")) c.getDouble("lat") else 0, + lon = if (c.hasPathOrNull("lon")) c.getDouble("lon") else 0, + radius = if (c.hasPathOrNull("radius")) c.getDouble("radius") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Calibration = { BeamConfig.Beam.Calibration( - counts = BeamConfig.Beam.Calibration.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - google = BeamConfig.Beam.Calibration.Google(if(c.hasPathOrNull("google")) c.getConfig("google") else com.typesafe.config.ConfigFactory.parseString("google{}")), - meanToCountsWeightRatio = if(c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, - mode = BeamConfig.Beam.Calibration.Mode(if(c.hasPathOrNull("mode")) c.getConfig("mode") else com.typesafe.config.ConfigFactory.parseString("mode{}")), - objectiveFunction = if(c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") else "ModeChoiceObjectiveFunction", - roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork(if(c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}")), - studyArea = BeamConfig.Beam.Calibration.StudyArea(if(c.hasPathOrNull("studyArea")) c.getConfig("studyArea") else com.typesafe.config.ConfigFactory.parseString("studyArea{}")) + counts = BeamConfig.Beam.Calibration.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + google = BeamConfig.Beam.Calibration.Google( + if (c.hasPathOrNull("google")) c.getConfig("google") + else com.typesafe.config.ConfigFactory.parseString("google{}") + ), + meanToCountsWeightRatio = + if (c.hasPathOrNull("meanToCountsWeightRatio")) c.getDouble("meanToCountsWeightRatio") else 0.5, + mode = BeamConfig.Beam.Calibration.Mode( + if (c.hasPathOrNull("mode")) c.getConfig("mode") + else com.typesafe.config.ConfigFactory.parseString("mode{}") + ), + objectiveFunction = + if (c.hasPathOrNull("objectiveFunction")) c.getString("objectiveFunction") + else "ModeChoiceObjectiveFunction", + roadNetwork = BeamConfig.Beam.Calibration.RoadNetwork( + if (c.hasPathOrNull("roadNetwork")) c.getConfig("roadNetwork") + else com.typesafe.config.ConfigFactory.parseString("roadNetwork{}") + ), + studyArea = BeamConfig.Beam.Calibration.StudyArea( + if (c.hasPathOrNull("studyArea")) c.getConfig("studyArea") + else com.typesafe.config.ConfigFactory.parseString("studyArea{}") + ) ) } } - + case class Cluster( - clusterType : scala.Option[java.lang.String], - enabled : scala.Boolean + clusterType: scala.Option[java.lang.String], + enabled: scala.Boolean ) + object Cluster { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Cluster = { BeamConfig.Beam.Cluster( - clusterType = if(c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") + clusterType = if (c.hasPathOrNull("clusterType")) Some(c.getString("clusterType")) else None, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Debug( - actor : BeamConfig.Beam.Debug.Actor, - agentTripScoresInterval : scala.Int, - clearRoutedOutstandingWorkEnabled : scala.Boolean, - debugActorTimerIntervalInSec : scala.Int, - debugEnabled : scala.Boolean, - maxSimulationStepTimeBeforeConsideredStuckMin : scala.Int, - memoryConsumptionDisplayTimeoutInSec : scala.Int, - messageLogging : scala.Boolean, - secondsToWaitToClearRoutedOutstandingWork : scala.Int, - stuckAgentDetection : BeamConfig.Beam.Debug.StuckAgentDetection, - triggerMeasurer : BeamConfig.Beam.Debug.TriggerMeasurer, - vmInformation : BeamConfig.Beam.Debug.VmInformation, - writeModeChoiceAlternatives : scala.Boolean, - writeRealizedModeChoiceFile : scala.Boolean + actor: BeamConfig.Beam.Debug.Actor, + agentTripScoresInterval: scala.Int, + clearRoutedOutstandingWorkEnabled: scala.Boolean, + debugActorTimerIntervalInSec: scala.Int, + debugEnabled: scala.Boolean, + maxSimulationStepTimeBeforeConsideredStuckMin: scala.Int, + memoryConsumptionDisplayTimeoutInSec: scala.Int, + messageLogging: scala.Boolean, + secondsToWaitToClearRoutedOutstandingWork: scala.Int, + stuckAgentDetection: BeamConfig.Beam.Debug.StuckAgentDetection, + triggerMeasurer: BeamConfig.Beam.Debug.TriggerMeasurer, + vmInformation: BeamConfig.Beam.Debug.VmInformation, + writeModeChoiceAlternatives: scala.Boolean, + writeRealizedModeChoiceFile: scala.Boolean ) + object Debug { + case class Actor( - logDepth : scala.Int + logDepth: scala.Int ) + object Actor { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.Actor = { BeamConfig.Beam.Debug.Actor( - logDepth = if(c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 + logDepth = if (c.hasPathOrNull("logDepth")) c.getInt("logDepth") else 0 ) } } - + case class StuckAgentDetection( - checkIntervalMs : scala.Long, - checkMaxNumberOfMessagesEnabled : scala.Boolean, - defaultTimeoutMs : scala.Long, - enabled : scala.Boolean, - overallSimulationTimeoutMs : scala.Long, - thresholds : scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] + checkIntervalMs: scala.Long, + checkMaxNumberOfMessagesEnabled: scala.Boolean, + defaultTimeoutMs: scala.Long, + enabled: scala.Boolean, + overallSimulationTimeoutMs: scala.Long, + thresholds: scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] ) + object StuckAgentDetection { + case class Thresholds$Elm( - actorTypeToMaxNumberOfMessages : BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, - markAsStuckAfterMs : scala.Long, - triggerType : java.lang.String + actorTypeToMaxNumberOfMessages: BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages, + markAsStuckAfterMs: scala.Long, + triggerType: java.lang.String ) + object Thresholds$Elm { + case class ActorTypeToMaxNumberOfMessages( - population : scala.Option[scala.Int], - rideHailAgent : scala.Option[scala.Int], - rideHailManager : scala.Option[scala.Int], - transitDriverAgent : scala.Option[scala.Int] + population: scala.Option[scala.Int], + rideHailAgent: scala.Option[scala.Int], + rideHailManager: scala.Option[scala.Int], + transitDriverAgent: scala.Option[scala.Int] ) + object ActorTypeToMaxNumberOfMessages { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( - population = if(c.hasPathOrNull("population")) Some(c.getInt("population")) else None, - rideHailAgent = if(c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, - rideHailManager = if(c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, - transitDriverAgent = if(c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None + population = if (c.hasPathOrNull("population")) Some(c.getInt("population")) else None, + rideHailAgent = if (c.hasPathOrNull("rideHailAgent")) Some(c.getInt("rideHailAgent")) else None, + rideHailManager = if (c.hasPathOrNull("rideHailManager")) Some(c.getInt("rideHailManager")) else None, + transitDriverAgent = + if (c.hasPathOrNull("transitDriverAgent")) Some(c.getInt("transitDriverAgent")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm = { BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm( - actorTypeToMaxNumberOfMessages = BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages(if(c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}")), - markAsStuckAfterMs = if(c.hasPathOrNull("markAsStuckAfterMs")) c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 20000, - triggerType = if(c.hasPathOrNull("triggerType")) c.getString("triggerType") else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" + actorTypeToMaxNumberOfMessages = + BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm.ActorTypeToMaxNumberOfMessages( + if (c.hasPathOrNull("actorTypeToMaxNumberOfMessages")) c.getConfig("actorTypeToMaxNumberOfMessages") + else com.typesafe.config.ConfigFactory.parseString("actorTypeToMaxNumberOfMessages{}") + ), + markAsStuckAfterMs = + if (c.hasPathOrNull("markAsStuckAfterMs")) + c.getDuration("markAsStuckAfterMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 20000, + triggerType = + if (c.hasPathOrNull("triggerType")) c.getString("triggerType") + else "beam.agentsim.agents.PersonAgent$ActivityStartTrigger" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.StuckAgentDetection = { BeamConfig.Beam.Debug.StuckAgentDetection( - checkIntervalMs = if(c.hasPathOrNull("checkIntervalMs")) c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 200, - checkMaxNumberOfMessagesEnabled = !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), - defaultTimeoutMs = if(c.hasPathOrNull("defaultTimeoutMs")) c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 60000, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - overallSimulationTimeoutMs = if(c.hasPathOrNull("overallSimulationTimeoutMs")) c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) else 100000, - thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) + checkIntervalMs = + if (c.hasPathOrNull("checkIntervalMs")) + c.getDuration("checkIntervalMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 200, + checkMaxNumberOfMessagesEnabled = + !c.hasPathOrNull("checkMaxNumberOfMessagesEnabled") || c.getBoolean("checkMaxNumberOfMessagesEnabled"), + defaultTimeoutMs = + if (c.hasPathOrNull("defaultTimeoutMs")) + c.getDuration("defaultTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 60000, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + overallSimulationTimeoutMs = + if (c.hasPathOrNull("overallSimulationTimeoutMs")) + c.getDuration("overallSimulationTimeoutMs", java.util.concurrent.TimeUnit.MILLISECONDS) + else 100000, + thresholds = $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(c.getList("thresholds")) ) } - private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { + + private def $_LBeamConfig_Beam_Debug_StuckAgentDetection_Thresholds$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.Debug.StuckAgentDetection.Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.Debug.StuckAgentDetection + .Thresholds$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class TriggerMeasurer( - enabled : scala.Boolean, - writeStuckAgentDetectionConfig : scala.Boolean + enabled: scala.Boolean, + writeStuckAgentDetectionConfig: scala.Boolean ) + object TriggerMeasurer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.TriggerMeasurer = { BeamConfig.Beam.Debug.TriggerMeasurer( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - writeStuckAgentDetectionConfig = !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + writeStuckAgentDetectionConfig = + !c.hasPathOrNull("writeStuckAgentDetectionConfig") || c.getBoolean("writeStuckAgentDetectionConfig") ) } } - + case class VmInformation( - createGCClassHistogram : scala.Boolean + createGCClassHistogram: scala.Boolean ) + object VmInformation { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug.VmInformation = { BeamConfig.Beam.Debug.VmInformation( createGCClassHistogram = c.hasPathOrNull("createGCClassHistogram") && c.getBoolean("createGCClassHistogram") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Debug = { BeamConfig.Beam.Debug( - actor = BeamConfig.Beam.Debug.Actor(if(c.hasPathOrNull("actor")) c.getConfig("actor") else com.typesafe.config.ConfigFactory.parseString("actor{}")), - agentTripScoresInterval = if(c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, - clearRoutedOutstandingWorkEnabled = c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), - debugActorTimerIntervalInSec = if(c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, - debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), - maxSimulationStepTimeBeforeConsideredStuckMin = if(c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") else 60, - memoryConsumptionDisplayTimeoutInSec = if(c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) c.getInt("memoryConsumptionDisplayTimeoutInSec") else 0, - messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), - secondsToWaitToClearRoutedOutstandingWork = if(c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) c.getInt("secondsToWaitToClearRoutedOutstandingWork") else 60, - stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection(if(c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}")), - triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer(if(c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}")), - vmInformation = BeamConfig.Beam.Debug.VmInformation(if(c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") else com.typesafe.config.ConfigFactory.parseString("vmInformation{}")), - writeModeChoiceAlternatives = c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), - writeRealizedModeChoiceFile = c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") + actor = BeamConfig.Beam.Debug.Actor( + if (c.hasPathOrNull("actor")) c.getConfig("actor") + else com.typesafe.config.ConfigFactory.parseString("actor{}") + ), + agentTripScoresInterval = + if (c.hasPathOrNull("agentTripScoresInterval")) c.getInt("agentTripScoresInterval") else 0, + clearRoutedOutstandingWorkEnabled = + c.hasPathOrNull("clearRoutedOutstandingWorkEnabled") && c.getBoolean("clearRoutedOutstandingWorkEnabled"), + debugActorTimerIntervalInSec = + if (c.hasPathOrNull("debugActorTimerIntervalInSec")) c.getInt("debugActorTimerIntervalInSec") else 0, + debugEnabled = c.hasPathOrNull("debugEnabled") && c.getBoolean("debugEnabled"), + maxSimulationStepTimeBeforeConsideredStuckMin = + if (c.hasPathOrNull("maxSimulationStepTimeBeforeConsideredStuckMin")) + c.getInt("maxSimulationStepTimeBeforeConsideredStuckMin") + else 60, + memoryConsumptionDisplayTimeoutInSec = + if (c.hasPathOrNull("memoryConsumptionDisplayTimeoutInSec")) + c.getInt("memoryConsumptionDisplayTimeoutInSec") + else 0, + messageLogging = c.hasPathOrNull("messageLogging") && c.getBoolean("messageLogging"), + secondsToWaitToClearRoutedOutstandingWork = + if (c.hasPathOrNull("secondsToWaitToClearRoutedOutstandingWork")) + c.getInt("secondsToWaitToClearRoutedOutstandingWork") + else 60, + stuckAgentDetection = BeamConfig.Beam.Debug.StuckAgentDetection( + if (c.hasPathOrNull("stuckAgentDetection")) c.getConfig("stuckAgentDetection") + else com.typesafe.config.ConfigFactory.parseString("stuckAgentDetection{}") + ), + triggerMeasurer = BeamConfig.Beam.Debug.TriggerMeasurer( + if (c.hasPathOrNull("triggerMeasurer")) c.getConfig("triggerMeasurer") + else com.typesafe.config.ConfigFactory.parseString("triggerMeasurer{}") + ), + vmInformation = BeamConfig.Beam.Debug.VmInformation( + if (c.hasPathOrNull("vmInformation")) c.getConfig("vmInformation") + else com.typesafe.config.ConfigFactory.parseString("vmInformation{}") + ), + writeModeChoiceAlternatives = + c.hasPathOrNull("writeModeChoiceAlternatives") && c.getBoolean("writeModeChoiceAlternatives"), + writeRealizedModeChoiceFile = + c.hasPathOrNull("writeRealizedModeChoiceFile") && c.getBoolean("writeRealizedModeChoiceFile") ) } } - + case class Exchange( - output : BeamConfig.Beam.Exchange.Output, - scenario : BeamConfig.Beam.Exchange.Scenario + output: BeamConfig.Beam.Exchange.Output, + scenario: BeamConfig.Beam.Exchange.Scenario ) + object Exchange { + case class Output( - activitySimSkimsEnabled : scala.Boolean, - geo : BeamConfig.Beam.Exchange.Output.Geo, - sendNonChosenTripsToSkimmer : scala.Boolean + activitySimSkimsEnabled: scala.Boolean, + geo: BeamConfig.Beam.Exchange.Output.Geo, + sendNonChosenTripsToSkimmer: scala.Boolean ) + object Output { + case class Geo( - filePath : scala.Option[java.lang.String] + filePath: scala.Option[java.lang.String] ) + object Geo { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output.Geo = { BeamConfig.Beam.Exchange.Output.Geo( - filePath = if(c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None + filePath = if (c.hasPathOrNull("filePath")) Some(c.getString("filePath")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Output = { BeamConfig.Beam.Exchange.Output( - activitySimSkimsEnabled = c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), - geo = BeamConfig.Beam.Exchange.Output.Geo(if(c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}")), - sendNonChosenTripsToSkimmer = !c.hasPathOrNull("sendNonChosenTripsToSkimmer") || c.getBoolean("sendNonChosenTripsToSkimmer") + activitySimSkimsEnabled = + c.hasPathOrNull("activitySimSkimsEnabled") && c.getBoolean("activitySimSkimsEnabled"), + geo = BeamConfig.Beam.Exchange.Output.Geo( + if (c.hasPathOrNull("geo")) c.getConfig("geo") else com.typesafe.config.ConfigFactory.parseString("geo{}") + ), + sendNonChosenTripsToSkimmer = + !c.hasPathOrNull("sendNonChosenTripsToSkimmer") || c.getBoolean("sendNonChosenTripsToSkimmer") ) } } - + case class Scenario( - convertWgs2Utm : scala.Boolean, - fileFormat : java.lang.String, - folder : java.lang.String, - modeMap : scala.Option[scala.List[java.lang.String]], - source : java.lang.String, - urbansim : BeamConfig.Beam.Exchange.Scenario.Urbansim + convertWgs2Utm: scala.Boolean, + fileFormat: java.lang.String, + folder: java.lang.String, + modeMap: scala.Option[scala.List[java.lang.String]], + source: java.lang.String, + urbansim: BeamConfig.Beam.Exchange.Scenario.Urbansim ) + object Scenario { + case class Urbansim( - activitySimEnabled : scala.Boolean + activitySimEnabled: scala.Boolean ) + object Urbansim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario.Urbansim = { BeamConfig.Beam.Exchange.Scenario.Urbansim( activitySimEnabled = c.hasPathOrNull("activitySimEnabled") && c.getBoolean("activitySimEnabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange.Scenario = { BeamConfig.Beam.Exchange.Scenario( convertWgs2Utm = c.hasPathOrNull("convertWgs2Utm") && c.getBoolean("convertWgs2Utm"), - fileFormat = if(c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", - folder = if(c.hasPathOrNull("folder")) c.getString("folder") else "", - modeMap = if(c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, - source = if(c.hasPathOrNull("source")) c.getString("source") else "Beam", - urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")) + fileFormat = if (c.hasPathOrNull("fileFormat")) c.getString("fileFormat") else "xml", + folder = if (c.hasPathOrNull("folder")) c.getString("folder") else "", + modeMap = if (c.hasPathOrNull("modeMap")) scala.Some($_L$_str(c.getList("modeMap"))) else None, + source = if (c.hasPathOrNull("source")) c.getString("source") else "Beam", + urbansim = BeamConfig.Beam.Exchange.Scenario.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Exchange = { BeamConfig.Beam.Exchange( - output = BeamConfig.Beam.Exchange.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - scenario = BeamConfig.Beam.Exchange.Scenario(if(c.hasPathOrNull("scenario")) c.getConfig("scenario") else com.typesafe.config.ConfigFactory.parseString("scenario{}")) + output = BeamConfig.Beam.Exchange.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + scenario = BeamConfig.Beam.Exchange.Scenario( + if (c.hasPathOrNull("scenario")) c.getConfig("scenario") + else com.typesafe.config.ConfigFactory.parseString("scenario{}") + ) ) } } - + case class Experimental( - optimizer : BeamConfig.Beam.Experimental.Optimizer + optimizer: BeamConfig.Beam.Experimental.Optimizer ) + object Experimental { + case class Optimizer( - enabled : scala.Boolean + enabled: scala.Boolean ) + object Optimizer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental.Optimizer = { BeamConfig.Beam.Experimental.Optimizer( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Experimental = { BeamConfig.Beam.Experimental( - optimizer = BeamConfig.Beam.Experimental.Optimizer(if(c.hasPathOrNull("optimizer")) c.getConfig("optimizer") else com.typesafe.config.ConfigFactory.parseString("optimizer{}")) + optimizer = BeamConfig.Beam.Experimental.Optimizer( + if (c.hasPathOrNull("optimizer")) c.getConfig("optimizer") + else com.typesafe.config.ConfigFactory.parseString("optimizer{}") + ) ) } } - + case class Input( - lastBaseOutputDir : java.lang.String, - simulationPrefix : java.lang.String + lastBaseOutputDir: java.lang.String, + simulationPrefix: java.lang.String ) + object Input { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Input = { BeamConfig.Beam.Input( - lastBaseOutputDir = if(c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", - simulationPrefix = if(c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" + lastBaseOutputDir = if (c.hasPathOrNull("lastBaseOutputDir")) c.getString("lastBaseOutputDir") else "output", + simulationPrefix = if (c.hasPathOrNull("simulationPrefix")) c.getString("simulationPrefix") else "beamville" ) } } - + case class Logger( - keepConsoleAppenderOn : scala.Boolean + keepConsoleAppenderOn: scala.Boolean ) + object Logger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Logger = { BeamConfig.Beam.Logger( keepConsoleAppenderOn = !c.hasPathOrNull("keepConsoleAppenderOn") || c.getBoolean("keepConsoleAppenderOn") ) } } - + case class Metrics( - level : java.lang.String + level: java.lang.String ) + object Metrics { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Metrics = { BeamConfig.Beam.Metrics( - level = if(c.hasPathOrNull("level")) c.getString("level") else "verbose" + level = if (c.hasPathOrNull("level")) c.getString("level") else "verbose" ) } } - + case class Output( - writePlansAndStopSimulation : scala.Boolean + writePlansAndStopSimulation: scala.Boolean ) + object Output { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Output = { BeamConfig.Beam.Output( - writePlansAndStopSimulation = c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") + writePlansAndStopSimulation = + c.hasPathOrNull("writePlansAndStopSimulation") && c.getBoolean("writePlansAndStopSimulation") ) } } - + case class Outputs( - addTimestampToOutputDirectory : scala.Boolean, - baseOutputDirectory : java.lang.String, - collectAndCreateBeamAnalysisAndGraphs : scala.Boolean, - defaultWriteInterval : scala.Int, - displayPerformanceTimings : scala.Boolean, - events : BeamConfig.Beam.Outputs.Events, - generalizedLinkStats : BeamConfig.Beam.Outputs.GeneralizedLinkStats, - generalizedLinkStatsInterval : scala.Int, - matsim : BeamConfig.Beam.Outputs.Matsim, - stats : BeamConfig.Beam.Outputs.Stats, - writeAnalysis : scala.Boolean, - writeEventsInterval : scala.Int, - writeGraphs : scala.Boolean, - writePlansInterval : scala.Int, - writeR5RoutesInterval : scala.Int + addTimestampToOutputDirectory: scala.Boolean, + baseOutputDirectory: java.lang.String, + collectAndCreateBeamAnalysisAndGraphs: scala.Boolean, + defaultWriteInterval: scala.Int, + displayPerformanceTimings: scala.Boolean, + events: BeamConfig.Beam.Outputs.Events, + generalizedLinkStats: BeamConfig.Beam.Outputs.GeneralizedLinkStats, + generalizedLinkStatsInterval: scala.Int, + matsim: BeamConfig.Beam.Outputs.Matsim, + stats: BeamConfig.Beam.Outputs.Stats, + writeAnalysis: scala.Boolean, + writeEventsInterval: scala.Int, + writeGraphs: scala.Boolean, + writePlansInterval: scala.Int, + writeR5RoutesInterval: scala.Int ) + object Outputs { + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Events = { BeamConfig.Beam.Outputs.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,PersonEntersVehicleEvent,PersonLeavesVehicleEvent,ModeChoiceEvent,PathTraversalEvent,ReserveRideHailEvent,ReplanningEvent,RefuelSessionEvent,ChargingPlugInEvent,ChargingPlugOutEvent,ParkingEvent,LeavingParkingEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class GeneralizedLinkStats( - endTime : scala.Int, - startTime : scala.Int + endTime: scala.Int, + startTime: scala.Int ) + object GeneralizedLinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.GeneralizedLinkStats = { BeamConfig.Beam.Outputs.GeneralizedLinkStats( - endTime = if(c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, - startTime = if(c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 + endTime = if (c.hasPathOrNull("endTime")) c.getInt("endTime") else 32400, + startTime = if (c.hasPathOrNull("startTime")) c.getInt("startTime") else 25200 ) } } - + case class Matsim( - deleteITERSFolderFiles : java.lang.String, - deleteRootFolderFiles : java.lang.String + deleteITERSFolderFiles: java.lang.String, + deleteRootFolderFiles: java.lang.String ) + object Matsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Matsim = { BeamConfig.Beam.Outputs.Matsim( - deleteITERSFolderFiles = if(c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", - deleteRootFolderFiles = if(c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" + deleteITERSFolderFiles = + if (c.hasPathOrNull("deleteITERSFolderFiles")) c.getString("deleteITERSFolderFiles") else "", + deleteRootFolderFiles = + if (c.hasPathOrNull("deleteRootFolderFiles")) c.getString("deleteRootFolderFiles") else "" ) } } - + case class Stats( - binSize : scala.Int + binSize: scala.Int ) + object Stats { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs.Stats = { BeamConfig.Beam.Outputs.Stats( - binSize = if(c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 + binSize = if (c.hasPathOrNull("binSize")) c.getInt("binSize") else 3600 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Outputs = { BeamConfig.Beam.Outputs( - addTimestampToOutputDirectory = !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), - baseOutputDirectory = if(c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", - collectAndCreateBeamAnalysisAndGraphs = !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean("collectAndCreateBeamAnalysisAndGraphs"), - defaultWriteInterval = if(c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, - displayPerformanceTimings = c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), - events = BeamConfig.Beam.Outputs.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats(if(c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}")), - generalizedLinkStatsInterval = if(c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, - matsim = BeamConfig.Beam.Outputs.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")), - stats = BeamConfig.Beam.Outputs.Stats(if(c.hasPathOrNull("stats")) c.getConfig("stats") else com.typesafe.config.ConfigFactory.parseString("stats{}")), - writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, - writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeR5RoutesInterval = if(c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 + addTimestampToOutputDirectory = + !c.hasPathOrNull("addTimestampToOutputDirectory") || c.getBoolean("addTimestampToOutputDirectory"), + baseOutputDirectory = + if (c.hasPathOrNull("baseOutputDirectory")) c.getString("baseOutputDirectory") else "output", + collectAndCreateBeamAnalysisAndGraphs = + !c.hasPathOrNull("collectAndCreateBeamAnalysisAndGraphs") || c.getBoolean( + "collectAndCreateBeamAnalysisAndGraphs" + ), + defaultWriteInterval = if (c.hasPathOrNull("defaultWriteInterval")) c.getInt("defaultWriteInterval") else 1, + displayPerformanceTimings = + c.hasPathOrNull("displayPerformanceTimings") && c.getBoolean("displayPerformanceTimings"), + events = BeamConfig.Beam.Outputs.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + generalizedLinkStats = BeamConfig.Beam.Outputs.GeneralizedLinkStats( + if (c.hasPathOrNull("generalizedLinkStats")) c.getConfig("generalizedLinkStats") + else com.typesafe.config.ConfigFactory.parseString("generalizedLinkStats{}") + ), + generalizedLinkStatsInterval = + if (c.hasPathOrNull("generalizedLinkStatsInterval")) c.getInt("generalizedLinkStatsInterval") else 0, + matsim = BeamConfig.Beam.Outputs.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ), + stats = BeamConfig.Beam.Outputs.Stats( + if (c.hasPathOrNull("stats")) c.getConfig("stats") + else com.typesafe.config.ConfigFactory.parseString("stats{}") + ), + writeAnalysis = !c.hasPathOrNull("writeAnalysis") || c.getBoolean("writeAnalysis"), + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 1, + writeGraphs = !c.hasPathOrNull("writeGraphs") || c.getBoolean("writeGraphs"), + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeR5RoutesInterval = if (c.hasPathOrNull("writeR5RoutesInterval")) c.getInt("writeR5RoutesInterval") else 0 ) } } - + case class Physsim( - bprsim : BeamConfig.Beam.Physsim.Bprsim, - cchRoutingAssignment : BeamConfig.Beam.Physsim.CchRoutingAssignment, - duplicatePTE : BeamConfig.Beam.Physsim.DuplicatePTE, - eventManager : BeamConfig.Beam.Physsim.EventManager, - events : BeamConfig.Beam.Physsim.Events, - eventsForFullVersionOfVia : scala.Boolean, - eventsSampling : scala.Double, - flowCapacityFactor : scala.Double, - initializeRouterWithFreeFlowTimes : scala.Boolean, - inputNetworkFilePath : java.lang.String, - jdeqsim : BeamConfig.Beam.Physsim.Jdeqsim, - linkStatsBinSize : scala.Int, - linkStatsWriteInterval : scala.Int, - maxLinkLengthToApplySpeedScalingFactor : scala.Double, - name : java.lang.String, - network : BeamConfig.Beam.Physsim.Network, - overwriteLinkParamPath : java.lang.String, - parbprsim : BeamConfig.Beam.Physsim.Parbprsim, - pickUpDropOffAnalysis : BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, - ptSampleSize : scala.Double, - quick_fix_minCarSpeedInMetersPerSecond : scala.Double, - relaxation : BeamConfig.Beam.Physsim.Relaxation, - skipPhysSim : scala.Boolean, - speedScalingFactor : scala.Double, - storageCapacityFactor : scala.Double, - writeEventsInterval : scala.Int, - writePlansInterval : scala.Int, - writeRouteHistoryInterval : scala.Int + bprsim: BeamConfig.Beam.Physsim.Bprsim, + cchRoutingAssignment: BeamConfig.Beam.Physsim.CchRoutingAssignment, + duplicatePTE: BeamConfig.Beam.Physsim.DuplicatePTE, + eventManager: BeamConfig.Beam.Physsim.EventManager, + events: BeamConfig.Beam.Physsim.Events, + eventsForFullVersionOfVia: scala.Boolean, + eventsSampling: scala.Double, + flowCapacityFactor: scala.Double, + initializeRouterWithFreeFlowTimes: scala.Boolean, + inputNetworkFilePath: java.lang.String, + jdeqsim: BeamConfig.Beam.Physsim.Jdeqsim, + linkStatsBinSize: scala.Int, + linkStatsWriteInterval: scala.Int, + maxLinkLengthToApplySpeedScalingFactor: scala.Double, + name: java.lang.String, + network: BeamConfig.Beam.Physsim.Network, + overwriteLinkParamPath: java.lang.String, + parbprsim: BeamConfig.Beam.Physsim.Parbprsim, + pickUpDropOffAnalysis: BeamConfig.Beam.Physsim.PickUpDropOffAnalysis, + ptSampleSize: scala.Double, + quick_fix_minCarSpeedInMetersPerSecond: scala.Double, + relaxation: BeamConfig.Beam.Physsim.Relaxation, + skipPhysSim: scala.Boolean, + speedScalingFactor: scala.Double, + storageCapacityFactor: scala.Double, + writeEventsInterval: scala.Int, + writePlansInterval: scala.Int, + writeRouteHistoryInterval: scala.Int ) + object Physsim { + case class Bprsim( - inFlowAggregationTimeWindowInSeconds : scala.Int, - minFlowToUseBPRFunction : scala.Int, - travelTimeFunction : java.lang.String + inFlowAggregationTimeWindowInSeconds: scala.Int, + minFlowToUseBPRFunction: scala.Int, + travelTimeFunction: java.lang.String ) + object Bprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Bprsim = { BeamConfig.Beam.Physsim.Bprsim( - inFlowAggregationTimeWindowInSeconds = if(c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) c.getInt("inFlowAggregationTimeWindowInSeconds") else 900, - minFlowToUseBPRFunction = if(c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, - travelTimeFunction = if(c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" + inFlowAggregationTimeWindowInSeconds = + if (c.hasPathOrNull("inFlowAggregationTimeWindowInSeconds")) + c.getInt("inFlowAggregationTimeWindowInSeconds") + else 900, + minFlowToUseBPRFunction = + if (c.hasPathOrNull("minFlowToUseBPRFunction")) c.getInt("minFlowToUseBPRFunction") else 0, + travelTimeFunction = if (c.hasPathOrNull("travelTimeFunction")) c.getString("travelTimeFunction") else "BPR" ) } } - + case class CchRoutingAssignment( - congestionFactor : scala.Double + congestionFactor: scala.Double ) + object CchRoutingAssignment { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.CchRoutingAssignment = { BeamConfig.Beam.Physsim.CchRoutingAssignment( - congestionFactor = if(c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 + congestionFactor = if (c.hasPathOrNull("congestionFactor")) c.getDouble("congestionFactor") else 1.0 ) } } - + case class DuplicatePTE( - departureTimeShiftMax : scala.Int, - departureTimeShiftMin : scala.Int, - fractionOfEventsToDuplicate : scala.Double + departureTimeShiftMax: scala.Int, + departureTimeShiftMin: scala.Int, + fractionOfEventsToDuplicate: scala.Double ) + object DuplicatePTE { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.DuplicatePTE = { BeamConfig.Beam.Physsim.DuplicatePTE( - departureTimeShiftMax = if(c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, - departureTimeShiftMin = if(c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, - fractionOfEventsToDuplicate = if(c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 + departureTimeShiftMax = + if (c.hasPathOrNull("departureTimeShiftMax")) c.getInt("departureTimeShiftMax") else 600, + departureTimeShiftMin = + if (c.hasPathOrNull("departureTimeShiftMin")) c.getInt("departureTimeShiftMin") else -600, + fractionOfEventsToDuplicate = + if (c.hasPathOrNull("fractionOfEventsToDuplicate")) c.getDouble("fractionOfEventsToDuplicate") else 0.0 ) } } - + case class EventManager( - numberOfThreads : scala.Int, - `type` : java.lang.String + numberOfThreads: scala.Int, + `type`: java.lang.String ) + object EventManager { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.EventManager = { BeamConfig.Beam.Physsim.EventManager( - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "Auto" + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "Auto" ) } } - + case class Events( - eventsToWrite : java.lang.String, - fileOutputFormats : java.lang.String + eventsToWrite: java.lang.String, + fileOutputFormats: java.lang.String ) + object Events { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Events = { BeamConfig.Beam.Physsim.Events( - eventsToWrite = if(c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") else "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", - fileOutputFormats = if(c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" + eventsToWrite = + if (c.hasPathOrNull("eventsToWrite")) c.getString("eventsToWrite") + else + "ActivityEndEvent,ActivityStartEvent,LinkEnterEvent,LinkLeaveEvent,PersonArrivalEvent,PersonDepartureEvent,VehicleEntersTrafficEvent,VehicleLeavesTrafficEvent", + fileOutputFormats = if (c.hasPathOrNull("fileOutputFormats")) c.getString("fileOutputFormats") else "csv" ) } } - + case class Jdeqsim( - agentSimPhysSimInterfaceDebugger : BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, - cacc : BeamConfig.Beam.Physsim.Jdeqsim.Cacc + agentSimPhysSimInterfaceDebugger: BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger, + cacc: BeamConfig.Beam.Physsim.Jdeqsim.Cacc ) + object Jdeqsim { + case class AgentSimPhysSimInterfaceDebugger( - enabled : scala.Boolean + enabled: scala.Boolean ) + object AgentSimPhysSimInterfaceDebugger { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger = { BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled") ) } } - + case class Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond : scala.Double, - capacityPlansWriteInterval : scala.Int, - enabled : scala.Boolean, - minRoadCapacity : scala.Int, - minSpeedMetersPerSec : scala.Int, - speedAdjustmentFactor : scala.Double + adjustedMinimumRoadSpeedInMetersPerSecond: scala.Double, + capacityPlansWriteInterval: scala.Int, + enabled: scala.Boolean, + minRoadCapacity: scala.Int, + minSpeedMetersPerSec: scala.Int, + speedAdjustmentFactor: scala.Double ) + object Cacc { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim.Cacc = { BeamConfig.Beam.Physsim.Jdeqsim.Cacc( - adjustedMinimumRoadSpeedInMetersPerSecond = if(c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") else 1.3, - capacityPlansWriteInterval = if(c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - minRoadCapacity = if(c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, - minSpeedMetersPerSec = if(c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, - speedAdjustmentFactor = if(c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 + adjustedMinimumRoadSpeedInMetersPerSecond = + if (c.hasPathOrNull("adjustedMinimumRoadSpeedInMetersPerSecond")) + c.getDouble("adjustedMinimumRoadSpeedInMetersPerSecond") + else 1.3, + capacityPlansWriteInterval = + if (c.hasPathOrNull("capacityPlansWriteInterval")) c.getInt("capacityPlansWriteInterval") else 0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + minRoadCapacity = if (c.hasPathOrNull("minRoadCapacity")) c.getInt("minRoadCapacity") else 2000, + minSpeedMetersPerSec = + if (c.hasPathOrNull("minSpeedMetersPerSec")) c.getInt("minSpeedMetersPerSec") else 20, + speedAdjustmentFactor = + if (c.hasPathOrNull("speedAdjustmentFactor")) c.getDouble("speedAdjustmentFactor") else 1.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Jdeqsim = { BeamConfig.Beam.Physsim.Jdeqsim( - agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger(if(c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}")), - cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc(if(c.hasPathOrNull("cacc")) c.getConfig("cacc") else com.typesafe.config.ConfigFactory.parseString("cacc{}")) + agentSimPhysSimInterfaceDebugger = BeamConfig.Beam.Physsim.Jdeqsim.AgentSimPhysSimInterfaceDebugger( + if (c.hasPathOrNull("agentSimPhysSimInterfaceDebugger")) c.getConfig("agentSimPhysSimInterfaceDebugger") + else com.typesafe.config.ConfigFactory.parseString("agentSimPhysSimInterfaceDebugger{}") + ), + cacc = BeamConfig.Beam.Physsim.Jdeqsim.Cacc( + if (c.hasPathOrNull("cacc")) c.getConfig("cacc") + else com.typesafe.config.ConfigFactory.parseString("cacc{}") + ) ) } } - + case class Network( - maxSpeedInference : BeamConfig.Beam.Physsim.Network.MaxSpeedInference, - overwriteRoadTypeProperties : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties, - removeIslands : scala.Boolean + maxSpeedInference: BeamConfig.Beam.Physsim.Network.MaxSpeedInference, + overwriteRoadTypeProperties: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties, + removeIslands: scala.Boolean ) + object Network { + case class MaxSpeedInference( - enabled : scala.Boolean, - `type` : java.lang.String + enabled: scala.Boolean, + `type`: java.lang.String ) + object MaxSpeedInference { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.MaxSpeedInference = { BeamConfig.Beam.Physsim.Network.MaxSpeedInference( enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "MEAN" + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "MEAN" ) } } - + case class OverwriteRoadTypeProperties( - enabled : scala.Boolean, - livingStreet : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, - minor : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, - motorway : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, - motorwayLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, - primary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, - primaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, - residential : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, - secondary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, - secondaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, - tertiary : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, - tertiaryLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, - trunk : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, - trunkLink : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, - unclassified : BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified + enabled: scala.Boolean, + livingStreet: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet, + minor: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor, + motorway: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway, + motorwayLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink, + primary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary, + primaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink, + residential: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential, + secondary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary, + secondaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink, + tertiary: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary, + tertiaryLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink, + trunk: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk, + trunkLink: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink, + unclassified: BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified ) + object OverwriteRoadTypeProperties { + case class LivingStreet( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object LivingStreet { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Minor( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Minor { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Motorway( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Motorway { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class MotorwayLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object MotorwayLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Primary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Primary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class PrimaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object PrimaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Residential( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Residential { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Secondary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Secondary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class SecondaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object SecondaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Tertiary( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Tertiary { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TertiaryLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TertiaryLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Trunk( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Trunk { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class TrunkLink( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object TrunkLink { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + case class Unclassified( - alpha : scala.Option[scala.Double], - beta : scala.Option[scala.Double], - capacity : scala.Option[scala.Int], - lanes : scala.Option[scala.Int], - speed : scala.Option[scala.Double] + alpha: scala.Option[scala.Double], + beta: scala.Option[scala.Double], + capacity: scala.Option[scala.Int], + lanes: scala.Option[scala.Int], + speed: scala.Option[scala.Double] ) + object Unclassified { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( - alpha = if(c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, - beta = if(c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, - capacity = if(c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, - lanes = if(c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, - speed = if(c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None + alpha = if (c.hasPathOrNull("alpha")) Some(c.getDouble("alpha")) else None, + beta = if (c.hasPathOrNull("beta")) Some(c.getDouble("beta")) else None, + capacity = if (c.hasPathOrNull("capacity")) Some(c.getInt("capacity")) else None, + lanes = if (c.hasPathOrNull("lanes")) Some(c.getInt("lanes")) else None, + speed = if (c.hasPathOrNull("speed")) Some(c.getDouble("speed")) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties = { BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet(if(c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") else com.typesafe.config.ConfigFactory.parseString("livingStreet{}")), - minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor(if(c.hasPathOrNull("minor")) c.getConfig("minor") else com.typesafe.config.ConfigFactory.parseString("minor{}")), - motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway(if(c.hasPathOrNull("motorway")) c.getConfig("motorway") else com.typesafe.config.ConfigFactory.parseString("motorway{}")), - motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink(if(c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}")), - primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary(if(c.hasPathOrNull("primary")) c.getConfig("primary") else com.typesafe.config.ConfigFactory.parseString("primary{}")), - primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink(if(c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") else com.typesafe.config.ConfigFactory.parseString("primaryLink{}")), - residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential(if(c.hasPathOrNull("residential")) c.getConfig("residential") else com.typesafe.config.ConfigFactory.parseString("residential{}")), - secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary(if(c.hasPathOrNull("secondary")) c.getConfig("secondary") else com.typesafe.config.ConfigFactory.parseString("secondary{}")), - secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink(if(c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}")), - tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary(if(c.hasPathOrNull("tertiary")) c.getConfig("tertiary") else com.typesafe.config.ConfigFactory.parseString("tertiary{}")), - tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink(if(c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}")), - trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk(if(c.hasPathOrNull("trunk")) c.getConfig("trunk") else com.typesafe.config.ConfigFactory.parseString("trunk{}")), - trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink(if(c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") else com.typesafe.config.ConfigFactory.parseString("trunkLink{}")), - unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified(if(c.hasPathOrNull("unclassified")) c.getConfig("unclassified") else com.typesafe.config.ConfigFactory.parseString("unclassified{}")) - ) - } - } - + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + livingStreet = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.LivingStreet( + if (c.hasPathOrNull("livingStreet")) c.getConfig("livingStreet") + else com.typesafe.config.ConfigFactory.parseString("livingStreet{}") + ), + minor = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Minor( + if (c.hasPathOrNull("minor")) c.getConfig("minor") + else com.typesafe.config.ConfigFactory.parseString("minor{}") + ), + motorway = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Motorway( + if (c.hasPathOrNull("motorway")) c.getConfig("motorway") + else com.typesafe.config.ConfigFactory.parseString("motorway{}") + ), + motorwayLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.MotorwayLink( + if (c.hasPathOrNull("motorwayLink")) c.getConfig("motorwayLink") + else com.typesafe.config.ConfigFactory.parseString("motorwayLink{}") + ), + primary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Primary( + if (c.hasPathOrNull("primary")) c.getConfig("primary") + else com.typesafe.config.ConfigFactory.parseString("primary{}") + ), + primaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.PrimaryLink( + if (c.hasPathOrNull("primaryLink")) c.getConfig("primaryLink") + else com.typesafe.config.ConfigFactory.parseString("primaryLink{}") + ), + residential = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Residential( + if (c.hasPathOrNull("residential")) c.getConfig("residential") + else com.typesafe.config.ConfigFactory.parseString("residential{}") + ), + secondary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Secondary( + if (c.hasPathOrNull("secondary")) c.getConfig("secondary") + else com.typesafe.config.ConfigFactory.parseString("secondary{}") + ), + secondaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.SecondaryLink( + if (c.hasPathOrNull("secondaryLink")) c.getConfig("secondaryLink") + else com.typesafe.config.ConfigFactory.parseString("secondaryLink{}") + ), + tertiary = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Tertiary( + if (c.hasPathOrNull("tertiary")) c.getConfig("tertiary") + else com.typesafe.config.ConfigFactory.parseString("tertiary{}") + ), + tertiaryLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TertiaryLink( + if (c.hasPathOrNull("tertiaryLink")) c.getConfig("tertiaryLink") + else com.typesafe.config.ConfigFactory.parseString("tertiaryLink{}") + ), + trunk = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Trunk( + if (c.hasPathOrNull("trunk")) c.getConfig("trunk") + else com.typesafe.config.ConfigFactory.parseString("trunk{}") + ), + trunkLink = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.TrunkLink( + if (c.hasPathOrNull("trunkLink")) c.getConfig("trunkLink") + else com.typesafe.config.ConfigFactory.parseString("trunkLink{}") + ), + unclassified = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties.Unclassified( + if (c.hasPathOrNull("unclassified")) c.getConfig("unclassified") + else com.typesafe.config.ConfigFactory.parseString("unclassified{}") + ) + ) + } + } + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Network = { BeamConfig.Beam.Physsim.Network( - maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference(if(c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}")), - overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties(if(c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}")), - removeIslands = !c.hasPathOrNull("removeIslands") || c.getBoolean("removeIslands") + maxSpeedInference = BeamConfig.Beam.Physsim.Network.MaxSpeedInference( + if (c.hasPathOrNull("maxSpeedInference")) c.getConfig("maxSpeedInference") + else com.typesafe.config.ConfigFactory.parseString("maxSpeedInference{}") + ), + overwriteRoadTypeProperties = BeamConfig.Beam.Physsim.Network.OverwriteRoadTypeProperties( + if (c.hasPathOrNull("overwriteRoadTypeProperties")) c.getConfig("overwriteRoadTypeProperties") + else com.typesafe.config.ConfigFactory.parseString("overwriteRoadTypeProperties{}") + ), + removeIslands = !c.hasPathOrNull("removeIslands") || c.getBoolean("removeIslands") ) } } - + case class Parbprsim( - numberOfClusters : scala.Int, - syncInterval : scala.Int + numberOfClusters: scala.Int, + syncInterval: scala.Int ) + object Parbprsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Parbprsim = { BeamConfig.Beam.Physsim.Parbprsim( - numberOfClusters = if(c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, - syncInterval = if(c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 + numberOfClusters = if (c.hasPathOrNull("numberOfClusters")) c.getInt("numberOfClusters") else 8, + syncInterval = if (c.hasPathOrNull("syncInterval")) c.getInt("syncInterval") else 60 ) } } - + case class PickUpDropOffAnalysis( - additionalTravelTimeMultiplier : scala.Double, - enabled : scala.Boolean, - secondsFromPickUpPropOffToAffectTravelTime : scala.Int + additionalTravelTimeMultiplier: scala.Double, + enabled: scala.Boolean, + secondsFromPickUpPropOffToAffectTravelTime: scala.Int ) + object PickUpDropOffAnalysis { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.PickUpDropOffAnalysis = { BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( - additionalTravelTimeMultiplier = if(c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") else 1.0, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - secondsFromPickUpPropOffToAffectTravelTime = if(c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) c.getInt("secondsFromPickUpPropOffToAffectTravelTime") else 600 + additionalTravelTimeMultiplier = + if (c.hasPathOrNull("additionalTravelTimeMultiplier")) c.getDouble("additionalTravelTimeMultiplier") + else 1.0, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + secondsFromPickUpPropOffToAffectTravelTime = + if (c.hasPathOrNull("secondsFromPickUpPropOffToAffectTravelTime")) + c.getInt("secondsFromPickUpPropOffToAffectTravelTime") + else 600 ) } } - + case class Relaxation( - experiment2_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment20, - experiment2_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment21, - experiment3_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment30, - experiment4_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment40, - experiment5_0 : BeamConfig.Beam.Physsim.Relaxation.Experiment50, - experiment5_1 : BeamConfig.Beam.Physsim.Relaxation.Experiment51, - experiment5_2 : BeamConfig.Beam.Physsim.Relaxation.Experiment52, - `type` : java.lang.String + experiment2_0: BeamConfig.Beam.Physsim.Relaxation.Experiment20, + experiment2_1: BeamConfig.Beam.Physsim.Relaxation.Experiment21, + experiment3_0: BeamConfig.Beam.Physsim.Relaxation.Experiment30, + experiment4_0: BeamConfig.Beam.Physsim.Relaxation.Experiment40, + experiment5_0: BeamConfig.Beam.Physsim.Relaxation.Experiment50, + experiment5_1: BeamConfig.Beam.Physsim.Relaxation.Experiment51, + experiment5_2: BeamConfig.Beam.Physsim.Relaxation.Experiment52, + `type`: java.lang.String ) + object Relaxation { + case class Experiment20( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment20 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment20 = { BeamConfig.Beam.Physsim.Relaxation.Experiment20( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment21( - clearModesEveryIteration : scala.Boolean, - clearRoutesEveryIteration : scala.Boolean, - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + clearModesEveryIteration: scala.Boolean, + clearRoutesEveryIteration: scala.Boolean, + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment21 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment21 = { BeamConfig.Beam.Physsim.Relaxation.Experiment21( - clearModesEveryIteration = !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), - clearRoutesEveryIteration = !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + clearModesEveryIteration = + !c.hasPathOrNull("clearModesEveryIteration") || c.getBoolean("clearModesEveryIteration"), + clearRoutesEveryIteration = + !c.hasPathOrNull("clearRoutesEveryIteration") || c.getBoolean("clearRoutesEveryIteration"), + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment30( - fractionOfPopulationToReroute : scala.Double, - internalNumberOfIterations : scala.Int + fractionOfPopulationToReroute: scala.Double, + internalNumberOfIterations: scala.Int ) + object Experiment30 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment30 = { BeamConfig.Beam.Physsim.Relaxation.Experiment30( - fractionOfPopulationToReroute = if(c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") else 0.1, - internalNumberOfIterations = if(c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 + fractionOfPopulationToReroute = + if (c.hasPathOrNull("fractionOfPopulationToReroute")) c.getDouble("fractionOfPopulationToReroute") + else 0.1, + internalNumberOfIterations = + if (c.hasPathOrNull("internalNumberOfIterations")) c.getInt("internalNumberOfIterations") else 15 ) } } - + case class Experiment40( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment40 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment40 = { BeamConfig.Beam.Physsim.Relaxation.Experiment40( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment50( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment50 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment50 = { BeamConfig.Beam.Physsim.Relaxation.Experiment50( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment51( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment51 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment51 = { BeamConfig.Beam.Physsim.Relaxation.Experiment51( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + case class Experiment52( - percentToSimulate : scala.Option[scala.List[scala.Double]] + percentToSimulate: scala.Option[scala.List[scala.Double]] ) + object Experiment52 { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation.Experiment52 = { BeamConfig.Beam.Physsim.Relaxation.Experiment52( - percentToSimulate = if(c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None + percentToSimulate = + if (c.hasPathOrNull("percentToSimulate")) scala.Some($_L$_dbl(c.getList("percentToSimulate"))) else None ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim.Relaxation = { BeamConfig.Beam.Physsim.Relaxation( - experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20(if(c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}")), - experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21(if(c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}")), - experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30(if(c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}")), - experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40(if(c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}")), - experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50(if(c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}")), - experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51(if(c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}")), - experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52(if(c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}")), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "normal" + experiment2_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment20( + if (c.hasPathOrNull("experiment2_0")) c.getConfig("experiment2_0") + else com.typesafe.config.ConfigFactory.parseString("experiment2_0{}") + ), + experiment2_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment21( + if (c.hasPathOrNull("experiment2_1")) c.getConfig("experiment2_1") + else com.typesafe.config.ConfigFactory.parseString("experiment2_1{}") + ), + experiment3_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment30( + if (c.hasPathOrNull("experiment3_0")) c.getConfig("experiment3_0") + else com.typesafe.config.ConfigFactory.parseString("experiment3_0{}") + ), + experiment4_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment40( + if (c.hasPathOrNull("experiment4_0")) c.getConfig("experiment4_0") + else com.typesafe.config.ConfigFactory.parseString("experiment4_0{}") + ), + experiment5_0 = BeamConfig.Beam.Physsim.Relaxation.Experiment50( + if (c.hasPathOrNull("experiment5_0")) c.getConfig("experiment5_0") + else com.typesafe.config.ConfigFactory.parseString("experiment5_0{}") + ), + experiment5_1 = BeamConfig.Beam.Physsim.Relaxation.Experiment51( + if (c.hasPathOrNull("experiment5_1")) c.getConfig("experiment5_1") + else com.typesafe.config.ConfigFactory.parseString("experiment5_1{}") + ), + experiment5_2 = BeamConfig.Beam.Physsim.Relaxation.Experiment52( + if (c.hasPathOrNull("experiment5_2")) c.getConfig("experiment5_2") + else com.typesafe.config.ConfigFactory.parseString("experiment5_2{}") + ), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "normal" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Physsim = { BeamConfig.Beam.Physsim( - bprsim = BeamConfig.Beam.Physsim.Bprsim(if(c.hasPathOrNull("bprsim")) c.getConfig("bprsim") else com.typesafe.config.ConfigFactory.parseString("bprsim{}")), - cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment(if(c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}")), - duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE(if(c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}")), - eventManager = BeamConfig.Beam.Physsim.EventManager(if(c.hasPathOrNull("eventManager")) c.getConfig("eventManager") else com.typesafe.config.ConfigFactory.parseString("eventManager{}")), - events = BeamConfig.Beam.Physsim.Events(if(c.hasPathOrNull("events")) c.getConfig("events") else com.typesafe.config.ConfigFactory.parseString("events{}")), - eventsForFullVersionOfVia = !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), - eventsSampling = if(c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, - flowCapacityFactor = if(c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, - initializeRouterWithFreeFlowTimes = !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), - inputNetworkFilePath = if(c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") else "/test/input/beamville/r5/physsim-network.xml", - jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim(if(c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}")), - linkStatsBinSize = if(c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, - linkStatsWriteInterval = if(c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, - maxLinkLengthToApplySpeedScalingFactor = if(c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) c.getDouble("maxLinkLengthToApplySpeedScalingFactor") else 50.0, - name = if(c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", - network = BeamConfig.Beam.Physsim.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - overwriteLinkParamPath = if(c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", - parbprsim = BeamConfig.Beam.Physsim.Parbprsim(if(c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") else com.typesafe.config.ConfigFactory.parseString("parbprsim{}")), - pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis(if(c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}")), - ptSampleSize = if(c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, - quick_fix_minCarSpeedInMetersPerSecond = if(c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") else 0.5, - relaxation = BeamConfig.Beam.Physsim.Relaxation(if(c.hasPathOrNull("relaxation")) c.getConfig("relaxation") else com.typesafe.config.ConfigFactory.parseString("relaxation{}")), - skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), - speedScalingFactor = if(c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, - storageCapacityFactor = if(c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, - writeEventsInterval = if(c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, - writePlansInterval = if(c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, - writeRouteHistoryInterval = if(c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 + bprsim = BeamConfig.Beam.Physsim.Bprsim( + if (c.hasPathOrNull("bprsim")) c.getConfig("bprsim") + else com.typesafe.config.ConfigFactory.parseString("bprsim{}") + ), + cchRoutingAssignment = BeamConfig.Beam.Physsim.CchRoutingAssignment( + if (c.hasPathOrNull("cchRoutingAssignment")) c.getConfig("cchRoutingAssignment") + else com.typesafe.config.ConfigFactory.parseString("cchRoutingAssignment{}") + ), + duplicatePTE = BeamConfig.Beam.Physsim.DuplicatePTE( + if (c.hasPathOrNull("duplicatePTE")) c.getConfig("duplicatePTE") + else com.typesafe.config.ConfigFactory.parseString("duplicatePTE{}") + ), + eventManager = BeamConfig.Beam.Physsim.EventManager( + if (c.hasPathOrNull("eventManager")) c.getConfig("eventManager") + else com.typesafe.config.ConfigFactory.parseString("eventManager{}") + ), + events = BeamConfig.Beam.Physsim.Events( + if (c.hasPathOrNull("events")) c.getConfig("events") + else com.typesafe.config.ConfigFactory.parseString("events{}") + ), + eventsForFullVersionOfVia = + !c.hasPathOrNull("eventsForFullVersionOfVia") || c.getBoolean("eventsForFullVersionOfVia"), + eventsSampling = if (c.hasPathOrNull("eventsSampling")) c.getDouble("eventsSampling") else 1.0, + flowCapacityFactor = if (c.hasPathOrNull("flowCapacityFactor")) c.getDouble("flowCapacityFactor") else 1.0, + initializeRouterWithFreeFlowTimes = + !c.hasPathOrNull("initializeRouterWithFreeFlowTimes") || c.getBoolean("initializeRouterWithFreeFlowTimes"), + inputNetworkFilePath = + if (c.hasPathOrNull("inputNetworkFilePath")) c.getString("inputNetworkFilePath") + else "/test/input/beamville/r5/physsim-network.xml", + jdeqsim = BeamConfig.Beam.Physsim.Jdeqsim( + if (c.hasPathOrNull("jdeqsim")) c.getConfig("jdeqsim") + else com.typesafe.config.ConfigFactory.parseString("jdeqsim{}") + ), + linkStatsBinSize = if (c.hasPathOrNull("linkStatsBinSize")) c.getInt("linkStatsBinSize") else 3600, + linkStatsWriteInterval = + if (c.hasPathOrNull("linkStatsWriteInterval")) c.getInt("linkStatsWriteInterval") else 0, + maxLinkLengthToApplySpeedScalingFactor = + if (c.hasPathOrNull("maxLinkLengthToApplySpeedScalingFactor")) + c.getDouble("maxLinkLengthToApplySpeedScalingFactor") + else 50.0, + name = if (c.hasPathOrNull("name")) c.getString("name") else "JDEQSim", + network = BeamConfig.Beam.Physsim.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + overwriteLinkParamPath = + if (c.hasPathOrNull("overwriteLinkParamPath")) c.getString("overwriteLinkParamPath") else "", + parbprsim = BeamConfig.Beam.Physsim.Parbprsim( + if (c.hasPathOrNull("parbprsim")) c.getConfig("parbprsim") + else com.typesafe.config.ConfigFactory.parseString("parbprsim{}") + ), + pickUpDropOffAnalysis = BeamConfig.Beam.Physsim.PickUpDropOffAnalysis( + if (c.hasPathOrNull("pickUpDropOffAnalysis")) c.getConfig("pickUpDropOffAnalysis") + else com.typesafe.config.ConfigFactory.parseString("pickUpDropOffAnalysis{}") + ), + ptSampleSize = if (c.hasPathOrNull("ptSampleSize")) c.getDouble("ptSampleSize") else 1.0, + quick_fix_minCarSpeedInMetersPerSecond = + if (c.hasPathOrNull("quick_fix_minCarSpeedInMetersPerSecond")) + c.getDouble("quick_fix_minCarSpeedInMetersPerSecond") + else 0.5, + relaxation = BeamConfig.Beam.Physsim.Relaxation( + if (c.hasPathOrNull("relaxation")) c.getConfig("relaxation") + else com.typesafe.config.ConfigFactory.parseString("relaxation{}") + ), + skipPhysSim = c.hasPathOrNull("skipPhysSim") && c.getBoolean("skipPhysSim"), + speedScalingFactor = if (c.hasPathOrNull("speedScalingFactor")) c.getDouble("speedScalingFactor") else 1.0, + storageCapacityFactor = + if (c.hasPathOrNull("storageCapacityFactor")) c.getDouble("storageCapacityFactor") else 1.0, + writeEventsInterval = if (c.hasPathOrNull("writeEventsInterval")) c.getInt("writeEventsInterval") else 0, + writePlansInterval = if (c.hasPathOrNull("writePlansInterval")) c.getInt("writePlansInterval") else 0, + writeRouteHistoryInterval = + if (c.hasPathOrNull("writeRouteHistoryInterval")) c.getInt("writeRouteHistoryInterval") else 10 ) } } - + case class Replanning( - ModuleProbability_1 : scala.Double, - ModuleProbability_2 : scala.Double, - ModuleProbability_3 : scala.Double, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - clearModes : BeamConfig.Beam.Replanning.ClearModes, - fractionOfIterationsToDisableInnovation : scala.Double, - maxAgentPlanMemorySize : scala.Int + ModuleProbability_1: scala.Double, + ModuleProbability_2: scala.Double, + ModuleProbability_3: scala.Double, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + clearModes: BeamConfig.Beam.Replanning.ClearModes, + fractionOfIterationsToDisableInnovation: scala.Double, + maxAgentPlanMemorySize: scala.Int ) + object Replanning { + case class ClearModes( - iteration : scala.Int, - modes : scala.Option[scala.List[java.lang.String]], - strategy : java.lang.String + iteration: scala.Int, + modes: scala.Option[scala.List[java.lang.String]], + strategy: java.lang.String ) + object ClearModes { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning.ClearModes = { BeamConfig.Beam.Replanning.ClearModes( - iteration = if(c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, - modes = if(c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, - strategy = if(c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" + iteration = if (c.hasPathOrNull("iteration")) c.getInt("iteration") else 0, + modes = if (c.hasPathOrNull("modes")) scala.Some($_L$_str(c.getList("modes"))) else None, + strategy = if (c.hasPathOrNull("strategy")) c.getString("strategy") else "AtBeginningOfIteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Replanning = { BeamConfig.Beam.Replanning( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", - clearModes = BeamConfig.Beam.Replanning.ClearModes(if(c.hasPathOrNull("clearModes")) c.getConfig("clearModes") else com.typesafe.config.ConfigFactory.parseString("clearModes{}")), - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getDouble("fractionOfIterationsToDisableInnovation") else Double.PositiveInfinity, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getDouble("ModuleProbability_1") else 0.8, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getDouble("ModuleProbability_2") else 0.1, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getDouble("ModuleProbability_3") else 0.1, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "SelectExpBeta", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "ClearRoutes", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "ClearModes", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "TimeMutator", + clearModes = BeamConfig.Beam.Replanning.ClearModes( + if (c.hasPathOrNull("clearModes")) c.getConfig("clearModes") + else com.typesafe.config.ConfigFactory.parseString("clearModes{}") + ), + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getDouble("fractionOfIterationsToDisableInnovation") + else Double.PositiveInfinity, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5 ) } } - + case class Router( - skim : BeamConfig.Beam.Router.Skim + skim: BeamConfig.Beam.Router.Skim ) + object Router { + case class Skim( - activity_sim_skimmer : BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, - drive_time_skimmer : BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, - keepKLatestSkims : scala.Int, - origin_destination_skimmer : BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, - taz_skimmer : BeamConfig.Beam.Router.Skim.TazSkimmer, - transit_crowding_skimmer : BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, - writeAggregatedSkimsInterval : scala.Int, - writeSkimsInterval : scala.Int + activity_sim_skimmer: BeamConfig.Beam.Router.Skim.ActivitySimSkimmer, + drive_time_skimmer: BeamConfig.Beam.Router.Skim.DriveTimeSkimmer, + keepKLatestSkims: scala.Int, + origin_destination_skimmer: BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer, + taz_skimmer: BeamConfig.Beam.Router.Skim.TazSkimmer, + transit_crowding_skimmer: BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer, + writeAggregatedSkimsInterval: scala.Int, + writeSkimsInterval: scala.Int ) + object Skim { + case class ActivitySimSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object ActivitySimSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.ActivitySimSkimmer = { BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", - name = if(c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "activitySimODSkims", + name = if (c.hasPathOrNull("name")) c.getString("name") else "activity-sim-skimmer" ) } } - + case class DriveTimeSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object DriveTimeSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.DriveTimeSkimmer = { BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTravelTimeObservedVsSimulated", - name = if(c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") + else "skimsTravelTimeObservedVsSimulated", + name = if (c.hasPathOrNull("name")) c.getString("name") else "drive-time-skimmer" ) } } - + case class OriginDestinationSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String, - poolingTravelTimeOveheadFactor : scala.Double, - writeAllModeSkimsForPeakNonPeakPeriodsInterval : scala.Int, - writeFullSkimsInterval : scala.Int + fileBaseName: java.lang.String, + name: java.lang.String, + poolingTravelTimeOveheadFactor: scala.Double, + writeAllModeSkimsForPeakNonPeakPeriodsInterval: scala.Int, + writeFullSkimsInterval: scala.Int ) + object OriginDestinationSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer = { BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", - name = if(c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", - poolingTravelTimeOveheadFactor = if(c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") else 1.21, - writeAllModeSkimsForPeakNonPeakPeriodsInterval = if(c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") else 0, - writeFullSkimsInterval = if(c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsOD", + name = if (c.hasPathOrNull("name")) c.getString("name") else "od-skimmer", + poolingTravelTimeOveheadFactor = + if (c.hasPathOrNull("poolingTravelTimeOveheadFactor")) c.getDouble("poolingTravelTimeOveheadFactor") + else 1.21, + writeAllModeSkimsForPeakNonPeakPeriodsInterval = + if (c.hasPathOrNull("writeAllModeSkimsForPeakNonPeakPeriodsInterval")) + c.getInt("writeAllModeSkimsForPeakNonPeakPeriodsInterval") + else 0, + writeFullSkimsInterval = + if (c.hasPathOrNull("writeFullSkimsInterval")) c.getInt("writeFullSkimsInterval") else 0 ) } } - + case class TazSkimmer( - fileBaseName : java.lang.String, - geoHierarchy : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + geoHierarchy: java.lang.String, + name: java.lang.String ) + object TazSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TazSkimmer = { BeamConfig.Beam.Router.Skim.TazSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", - geoHierarchy = if(c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", - name = if(c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" + fileBaseName = if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTAZ", + geoHierarchy = if (c.hasPathOrNull("geoHierarchy")) c.getString("geoHierarchy") else "TAZ", + name = if (c.hasPathOrNull("name")) c.getString("name") else "taz-skimmer" ) } } - + case class TransitCrowdingSkimmer( - fileBaseName : java.lang.String, - name : java.lang.String + fileBaseName: java.lang.String, + name: java.lang.String ) + object TransitCrowdingSkimmer { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer = { BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( - fileBaseName = if(c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", - name = if(c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" + fileBaseName = + if (c.hasPathOrNull("fileBaseName")) c.getString("fileBaseName") else "skimsTransitCrowding", + name = if (c.hasPathOrNull("name")) c.getString("name") else "transit-crowding-skimmer" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router.Skim = { BeamConfig.Beam.Router.Skim( - activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer(if(c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}")), - drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer(if(c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}")), - keepKLatestSkims = if(c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, - origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer(if(c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}")), - taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer(if(c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}")), - transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer(if(c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}")), - writeAggregatedSkimsInterval = if(c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, - writeSkimsInterval = if(c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 + activity_sim_skimmer = BeamConfig.Beam.Router.Skim.ActivitySimSkimmer( + if (c.hasPathOrNull("activity-sim-skimmer")) c.getConfig("activity-sim-skimmer") + else com.typesafe.config.ConfigFactory.parseString("activity-sim-skimmer{}") + ), + drive_time_skimmer = BeamConfig.Beam.Router.Skim.DriveTimeSkimmer( + if (c.hasPathOrNull("drive-time-skimmer")) c.getConfig("drive-time-skimmer") + else com.typesafe.config.ConfigFactory.parseString("drive-time-skimmer{}") + ), + keepKLatestSkims = if (c.hasPathOrNull("keepKLatestSkims")) c.getInt("keepKLatestSkims") else 1, + origin_destination_skimmer = BeamConfig.Beam.Router.Skim.OriginDestinationSkimmer( + if (c.hasPathOrNull("origin-destination-skimmer")) c.getConfig("origin-destination-skimmer") + else com.typesafe.config.ConfigFactory.parseString("origin-destination-skimmer{}") + ), + taz_skimmer = BeamConfig.Beam.Router.Skim.TazSkimmer( + if (c.hasPathOrNull("taz-skimmer")) c.getConfig("taz-skimmer") + else com.typesafe.config.ConfigFactory.parseString("taz-skimmer{}") + ), + transit_crowding_skimmer = BeamConfig.Beam.Router.Skim.TransitCrowdingSkimmer( + if (c.hasPathOrNull("transit-crowding-skimmer")) c.getConfig("transit-crowding-skimmer") + else com.typesafe.config.ConfigFactory.parseString("transit-crowding-skimmer{}") + ), + writeAggregatedSkimsInterval = + if (c.hasPathOrNull("writeAggregatedSkimsInterval")) c.getInt("writeAggregatedSkimsInterval") else 0, + writeSkimsInterval = if (c.hasPathOrNull("writeSkimsInterval")) c.getInt("writeSkimsInterval") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Router = { BeamConfig.Beam.Router( - skim = BeamConfig.Beam.Router.Skim(if(c.hasPathOrNull("skim")) c.getConfig("skim") else com.typesafe.config.ConfigFactory.parseString("skim{}")) + skim = BeamConfig.Beam.Router.Skim( + if (c.hasPathOrNull("skim")) c.getConfig("skim") + else com.typesafe.config.ConfigFactory.parseString("skim{}") + ) ) } } - + case class Routing( - baseDate : java.lang.String, - carRouter : java.lang.String, - gh : BeamConfig.Beam.Routing.Gh, - minimumPossibleSkimBasedTravelTimeInS : scala.Int, - overrideNetworkTravelTimesUsingSkims : scala.Boolean, - r5 : BeamConfig.Beam.Routing.R5, - skimTravelTimesScalingFactor : scala.Double, - startingIterationForTravelTimesMSA : scala.Int, - transitOnStreetNetwork : scala.Boolean, - writeRoutingStatistic : scala.Boolean + baseDate: java.lang.String, + carRouter: java.lang.String, + gh: BeamConfig.Beam.Routing.Gh, + minimumPossibleSkimBasedTravelTimeInS: scala.Int, + overrideNetworkTravelTimesUsingSkims: scala.Boolean, + r5: BeamConfig.Beam.Routing.R5, + skimTravelTimesScalingFactor: scala.Double, + startingIterationForTravelTimesMSA: scala.Int, + transitOnStreetNetwork: scala.Boolean, + writeRoutingStatistic: scala.Boolean ) + object Routing { + case class Gh( - useAlternativeRoutes : scala.Boolean + useAlternativeRoutes: scala.Boolean ) + object Gh { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.Gh = { BeamConfig.Beam.Routing.Gh( useAlternativeRoutes = c.hasPathOrNull("useAlternativeRoutes") && c.getBoolean("useAlternativeRoutes") ) } } - + case class R5( - bikeLaneLinkIdsFilePath : java.lang.String, - bikeLaneScaleFactor : scala.Double, - departureWindow : scala.Double, - directory : java.lang.String, - directory2 : scala.Option[java.lang.String], - linkRadiusMeters : scala.Double, - mNetBuilder : BeamConfig.Beam.Routing.R5.MNetBuilder, - maxDistanceLimitByModeInMeters : BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, - numberOfSamples : scala.Int, - osmMapdbFile : java.lang.String, - travelTimeNoiseFraction : scala.Double + bikeLaneLinkIdsFilePath: java.lang.String, + bikeLaneScaleFactor: scala.Double, + departureWindow: scala.Double, + directory: java.lang.String, + directory2: scala.Option[java.lang.String], + linkRadiusMeters: scala.Double, + mNetBuilder: BeamConfig.Beam.Routing.R5.MNetBuilder, + maxDistanceLimitByModeInMeters: BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters, + numberOfSamples: scala.Int, + osmMapdbFile: java.lang.String, + travelTimeNoiseFraction: scala.Double ) + object R5 { + case class MNetBuilder( - fromCRS : java.lang.String, - toCRS : java.lang.String + fromCRS: java.lang.String, + toCRS: java.lang.String ) + object MNetBuilder { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MNetBuilder = { BeamConfig.Beam.Routing.R5.MNetBuilder( - fromCRS = if(c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", - toCRS = if(c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" + fromCRS = if (c.hasPathOrNull("fromCRS")) c.getString("fromCRS") else "EPSG:4326", + toCRS = if (c.hasPathOrNull("toCRS")) c.getString("toCRS") else "EPSG:26910" ) } } - + case class MaxDistanceLimitByModeInMeters( - bike : scala.Int + bike: scala.Int ) + object MaxDistanceLimitByModeInMeters { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters = { BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 40000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 40000 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( - bikeLaneLinkIdsFilePath = if(c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", - bikeLaneScaleFactor = if(c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, - departureWindow = if(c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, - directory = if(c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", - directory2 = if(c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, - linkRadiusMeters = if(c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, - mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder(if(c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}")), - maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters(if(c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}")), - numberOfSamples = if(c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, - osmMapdbFile = if(c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") else "/test/input/beamville/r5/osm.mapdb", - travelTimeNoiseFraction = if(c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 + bikeLaneLinkIdsFilePath = + if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", + bikeLaneScaleFactor = + if (c.hasPathOrNull("bikeLaneScaleFactor")) c.getDouble("bikeLaneScaleFactor") else 1.0, + departureWindow = if (c.hasPathOrNull("departureWindow")) c.getDouble("departureWindow") else 15.0, + directory = if (c.hasPathOrNull("directory")) c.getString("directory") else "/test/input/beamville/r5", + directory2 = if (c.hasPathOrNull("directory2")) Some(c.getString("directory2")) else None, + linkRadiusMeters = if (c.hasPathOrNull("linkRadiusMeters")) c.getDouble("linkRadiusMeters") else 10000.0, + mNetBuilder = BeamConfig.Beam.Routing.R5.MNetBuilder( + if (c.hasPathOrNull("mNetBuilder")) c.getConfig("mNetBuilder") + else com.typesafe.config.ConfigFactory.parseString("mNetBuilder{}") + ), + maxDistanceLimitByModeInMeters = BeamConfig.Beam.Routing.R5.MaxDistanceLimitByModeInMeters( + if (c.hasPathOrNull("maxDistanceLimitByModeInMeters")) c.getConfig("maxDistanceLimitByModeInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxDistanceLimitByModeInMeters{}") + ), + numberOfSamples = if (c.hasPathOrNull("numberOfSamples")) c.getInt("numberOfSamples") else 1, + osmMapdbFile = + if (c.hasPathOrNull("osmMapdbFile")) c.getString("osmMapdbFile") + else "/test/input/beamville/r5/osm.mapdb", + travelTimeNoiseFraction = + if (c.hasPathOrNull("travelTimeNoiseFraction")) c.getDouble("travelTimeNoiseFraction") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing = { BeamConfig.Beam.Routing( - baseDate = if(c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", - carRouter = if(c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", - gh = BeamConfig.Beam.Routing.Gh(if(c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}")), - minimumPossibleSkimBasedTravelTimeInS = if(c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) c.getInt("minimumPossibleSkimBasedTravelTimeInS") else 60, - overrideNetworkTravelTimesUsingSkims = c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean("overrideNetworkTravelTimesUsingSkims"), - r5 = BeamConfig.Beam.Routing.R5(if(c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}")), - skimTravelTimesScalingFactor = if(c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, - startingIterationForTravelTimesMSA = if(c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") else 0, - transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), - writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") + baseDate = if (c.hasPathOrNull("baseDate")) c.getString("baseDate") else "2016-10-17T00:00:00-07:00", + carRouter = if (c.hasPathOrNull("carRouter")) c.getString("carRouter") else "R5", + gh = BeamConfig.Beam.Routing.Gh( + if (c.hasPathOrNull("gh")) c.getConfig("gh") else com.typesafe.config.ConfigFactory.parseString("gh{}") + ), + minimumPossibleSkimBasedTravelTimeInS = + if (c.hasPathOrNull("minimumPossibleSkimBasedTravelTimeInS")) + c.getInt("minimumPossibleSkimBasedTravelTimeInS") + else 60, + overrideNetworkTravelTimesUsingSkims = + c.hasPathOrNull("overrideNetworkTravelTimesUsingSkims") && c.getBoolean( + "overrideNetworkTravelTimesUsingSkims" + ), + r5 = BeamConfig.Beam.Routing.R5( + if (c.hasPathOrNull("r5")) c.getConfig("r5") else com.typesafe.config.ConfigFactory.parseString("r5{}") + ), + skimTravelTimesScalingFactor = + if (c.hasPathOrNull("skimTravelTimesScalingFactor")) c.getDouble("skimTravelTimesScalingFactor") else 0.0, + startingIterationForTravelTimesMSA = + if (c.hasPathOrNull("startingIterationForTravelTimesMSA")) c.getInt("startingIterationForTravelTimesMSA") + else 0, + transitOnStreetNetwork = !c.hasPathOrNull("transitOnStreetNetwork") || c.getBoolean("transitOnStreetNetwork"), + writeRoutingStatistic = c.hasPathOrNull("writeRoutingStatistic") && c.getBoolean("writeRoutingStatistic") ) } } - + case class Sim( - metric : BeamConfig.Beam.Sim.Metric, - termination : BeamConfig.Beam.Sim.Termination + metric: BeamConfig.Beam.Sim.Metric, + termination: BeamConfig.Beam.Sim.Termination ) + object Sim { + case class Metric( - collector : BeamConfig.Beam.Sim.Metric.Collector + collector: BeamConfig.Beam.Sim.Metric.Collector ) + object Metric { + case class Collector( - influxDbSimulationMetricCollector : BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, - metrics : java.lang.String + influxDbSimulationMetricCollector: BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector, + metrics: java.lang.String ) + object Collector { + case class InfluxDbSimulationMetricCollector( - connectionString : java.lang.String, - database : java.lang.String + connectionString: java.lang.String, + database: java.lang.String ) + object InfluxDbSimulationMetricCollector { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector = { BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( - connectionString = if(c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", - database = if(c.hasPathOrNull("database")) c.getString("database") else "beam" + connectionString = + if (c.hasPathOrNull("connectionString")) c.getString("connectionString") else "http://localhost:8086", + database = if (c.hasPathOrNull("database")) c.getString("database") else "beam" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric.Collector = { BeamConfig.Beam.Sim.Metric.Collector( - influxDbSimulationMetricCollector = BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector(if(c.hasPathOrNull("influxDbSimulationMetricCollector")) c.getConfig("influxDbSimulationMetricCollector") else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}")), - metrics = if(c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" + influxDbSimulationMetricCollector = + BeamConfig.Beam.Sim.Metric.Collector.InfluxDbSimulationMetricCollector( + if (c.hasPathOrNull("influxDbSimulationMetricCollector")) + c.getConfig("influxDbSimulationMetricCollector") + else com.typesafe.config.ConfigFactory.parseString("influxDbSimulationMetricCollector{}") + ), + metrics = if (c.hasPathOrNull("metrics")) c.getString("metrics") else "beam-run, beam-iteration" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Metric = { BeamConfig.Beam.Sim.Metric( - collector = BeamConfig.Beam.Sim.Metric.Collector(if(c.hasPathOrNull("collector")) c.getConfig("collector") else com.typesafe.config.ConfigFactory.parseString("collector{}")) + collector = BeamConfig.Beam.Sim.Metric.Collector( + if (c.hasPathOrNull("collector")) c.getConfig("collector") + else com.typesafe.config.ConfigFactory.parseString("collector{}") + ) ) } } - + case class Termination( - criterionName : java.lang.String, - terminateAtRideHailFleetStoredElectricityConvergence : BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence + criterionName: java.lang.String, + terminateAtRideHailFleetStoredElectricityConvergence: BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence ) + object Termination { + case class TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration : scala.Int, - minLastIteration : scala.Int, - relativeTolerance : scala.Double + maxLastIteration: scala.Int, + minLastIteration: scala.Int, + relativeTolerance: scala.Double ) + object TerminateAtRideHailFleetStoredElectricityConvergence { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence = { BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( - maxLastIteration = if(c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, - minLastIteration = if(c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, - relativeTolerance = if(c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 + maxLastIteration = if (c.hasPathOrNull("maxLastIteration")) c.getInt("maxLastIteration") else 0, + minLastIteration = if (c.hasPathOrNull("minLastIteration")) c.getInt("minLastIteration") else 0, + relativeTolerance = if (c.hasPathOrNull("relativeTolerance")) c.getDouble("relativeTolerance") else 0.01 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim.Termination = { BeamConfig.Beam.Sim.Termination( - criterionName = if(c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", - terminateAtRideHailFleetStoredElectricityConvergence = BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence(if(c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") else com.typesafe.config.ConfigFactory.parseString("terminateAtRideHailFleetStoredElectricityConvergence{}")) + criterionName = + if (c.hasPathOrNull("criterionName")) c.getString("criterionName") else "TerminateAtFixedIterationNumber", + terminateAtRideHailFleetStoredElectricityConvergence = + BeamConfig.Beam.Sim.Termination.TerminateAtRideHailFleetStoredElectricityConvergence( + if (c.hasPathOrNull("terminateAtRideHailFleetStoredElectricityConvergence")) + c.getConfig("terminateAtRideHailFleetStoredElectricityConvergence") + else + com.typesafe.config.ConfigFactory + .parseString("terminateAtRideHailFleetStoredElectricityConvergence{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Sim = { BeamConfig.Beam.Sim( - metric = BeamConfig.Beam.Sim.Metric(if(c.hasPathOrNull("metric")) c.getConfig("metric") else com.typesafe.config.ConfigFactory.parseString("metric{}")), - termination = BeamConfig.Beam.Sim.Termination(if(c.hasPathOrNull("termination")) c.getConfig("termination") else com.typesafe.config.ConfigFactory.parseString("termination{}")) + metric = BeamConfig.Beam.Sim.Metric( + if (c.hasPathOrNull("metric")) c.getConfig("metric") + else com.typesafe.config.ConfigFactory.parseString("metric{}") + ), + termination = BeamConfig.Beam.Sim.Termination( + if (c.hasPathOrNull("termination")) c.getConfig("termination") + else com.typesafe.config.ConfigFactory.parseString("termination{}") + ) ) } } - + case class Spatial( - boundingBoxBuffer : scala.Int, - localCRS : java.lang.String + boundingBoxBuffer: scala.Int, + localCRS: java.lang.String ) + object Spatial { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Spatial = { BeamConfig.Beam.Spatial( - boundingBoxBuffer = if(c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, - localCRS = if(c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" + boundingBoxBuffer = if (c.hasPathOrNull("boundingBoxBuffer")) c.getInt("boundingBoxBuffer") else 5000, + localCRS = if (c.hasPathOrNull("localCRS")) c.getString("localCRS") else "epsg:32631" ) } } - + case class Urbansim( - backgroundODSkimsCreator : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, - fractionOfModesToClear : BeamConfig.Beam.Urbansim.FractionOfModesToClear + backgroundODSkimsCreator: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator, + fractionOfModesToClear: BeamConfig.Beam.Urbansim.FractionOfModesToClear ) + object Urbansim { + case class BackgroundODSkimsCreator( - calculationTimeoutHours : scala.Int, - enabled : scala.Boolean, - maxTravelDistanceInMeters : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, - modesToBuild : BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, - numberOfH3Indexes : scala.Int, - peakHours : scala.Option[scala.List[scala.Double]], - routerType : java.lang.String, - skimsGeoType : java.lang.String, - skimsKind : java.lang.String + calculationTimeoutHours: scala.Int, + enabled: scala.Boolean, + maxTravelDistanceInMeters: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters, + modesToBuild: BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild, + numberOfH3Indexes: scala.Int, + peakHours: scala.Option[scala.List[scala.Double]], + routerType: java.lang.String, + skimsGeoType: java.lang.String, + skimsKind: java.lang.String ) + object BackgroundODSkimsCreator { + case class MaxTravelDistanceInMeters( - bike : scala.Int, - walk : scala.Int + bike: scala.Int, + walk: scala.Int ) + object MaxTravelDistanceInMeters { - def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { + + def apply( + c: com.typesafe.config.Config + ): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( - bike = if(c.hasPathOrNull("bike")) c.getInt("bike") else 33000, - walk = if(c.hasPathOrNull("walk")) c.getInt("walk") else 10000 + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 33000, + walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 10000 ) } } - + case class ModesToBuild( - drive : scala.Boolean, - transit : scala.Boolean, - walk : scala.Boolean + drive: scala.Boolean, + transit: scala.Boolean, + walk: scala.Boolean ) + object ModesToBuild { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( - drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), + drive = !c.hasPathOrNull("drive") || c.getBoolean("drive"), transit = !c.hasPathOrNull("transit") || c.getBoolean("transit"), - walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") + walk = !c.hasPathOrNull("walk") || c.getBoolean("walk") ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator = { BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( - calculationTimeoutHours = if(c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, - enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), - maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters(if(c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}")), - modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild(if(c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}")), - numberOfH3Indexes = if(c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, - peakHours = if(c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, - routerType = if(c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", - skimsGeoType = if(c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", - skimsKind = if(c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" + calculationTimeoutHours = + if (c.hasPathOrNull("calculationTimeoutHours")) c.getInt("calculationTimeoutHours") else 6, + enabled = c.hasPathOrNull("enabled") && c.getBoolean("enabled"), + maxTravelDistanceInMeters = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.MaxTravelDistanceInMeters( + if (c.hasPathOrNull("maxTravelDistanceInMeters")) c.getConfig("maxTravelDistanceInMeters") + else com.typesafe.config.ConfigFactory.parseString("maxTravelDistanceInMeters{}") + ), + modesToBuild = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator.ModesToBuild( + if (c.hasPathOrNull("modesToBuild")) c.getConfig("modesToBuild") + else com.typesafe.config.ConfigFactory.parseString("modesToBuild{}") + ), + numberOfH3Indexes = if (c.hasPathOrNull("numberOfH3Indexes")) c.getInt("numberOfH3Indexes") else 1000, + peakHours = if (c.hasPathOrNull("peakHours")) scala.Some($_L$_dbl(c.getList("peakHours"))) else None, + routerType = if (c.hasPathOrNull("routerType")) c.getString("routerType") else "r5", + skimsGeoType = if (c.hasPathOrNull("skimsGeoType")) c.getString("skimsGeoType") else "h3", + skimsKind = if (c.hasPathOrNull("skimsKind")) c.getString("skimsKind") else "od" ) } } - + case class FractionOfModesToClear( - allModes : scala.Double, - bike : scala.Double, - car : scala.Double, - drive_transit : scala.Double, - walk : scala.Double, - walk_transit : scala.Double + allModes: scala.Double, + bike: scala.Double, + car: scala.Double, + drive_transit: scala.Double, + walk: scala.Double, + walk_transit: scala.Double ) + object FractionOfModesToClear { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim.FractionOfModesToClear = { BeamConfig.Beam.Urbansim.FractionOfModesToClear( - allModes = if(c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, - bike = if(c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, - car = if(c.hasPathOrNull("car")) c.getDouble("car") else 0.0, - drive_transit = if(c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, - walk = if(c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, - walk_transit = if(c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 + allModes = if (c.hasPathOrNull("allModes")) c.getDouble("allModes") else 0.0, + bike = if (c.hasPathOrNull("bike")) c.getDouble("bike") else 0.0, + car = if (c.hasPathOrNull("car")) c.getDouble("car") else 0.0, + drive_transit = if (c.hasPathOrNull("drive_transit")) c.getDouble("drive_transit") else 0.0, + walk = if (c.hasPathOrNull("walk")) c.getDouble("walk") else 0.0, + walk_transit = if (c.hasPathOrNull("walk_transit")) c.getDouble("walk_transit") else 0.0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Urbansim = { BeamConfig.Beam.Urbansim( - backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator(if(c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}")), - fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear(if(c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}")) + backgroundODSkimsCreator = BeamConfig.Beam.Urbansim.BackgroundODSkimsCreator( + if (c.hasPathOrNull("backgroundODSkimsCreator")) c.getConfig("backgroundODSkimsCreator") + else com.typesafe.config.ConfigFactory.parseString("backgroundODSkimsCreator{}") + ), + fractionOfModesToClear = BeamConfig.Beam.Urbansim.FractionOfModesToClear( + if (c.hasPathOrNull("fractionOfModesToClear")) c.getConfig("fractionOfModesToClear") + else com.typesafe.config.ConfigFactory.parseString("fractionOfModesToClear{}") + ) ) } } - + case class WarmStart( - path : java.lang.String, - prepareData : scala.Boolean, - samplePopulationIntegerFlag : scala.Int, - skimsFilePaths : scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], - `type` : java.lang.String + path: java.lang.String, + prepareData: scala.Boolean, + samplePopulationIntegerFlag: scala.Int, + skimsFilePaths: scala.Option[scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm]], + `type`: java.lang.String ) + object WarmStart { + case class SkimsFilePaths$Elm( - skimType : java.lang.String, - skimsFilePath : java.lang.String + skimType: java.lang.String, + skimsFilePath: java.lang.String ) + object SkimsFilePaths$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm = { BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm( - skimType = c.getString("skimType"), - skimsFilePath = if(c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" + skimType = c.getString("skimType"), + skimsFilePath = if (c.hasPathOrNull("skimsFilePath")) c.getString("skimsFilePath") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.WarmStart = { BeamConfig.Beam.WarmStart( - path = if(c.hasPathOrNull("path")) c.getString("path") else "", - prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), - samplePopulationIntegerFlag = if(c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, - skimsFilePaths = if(c.hasPathOrNull("skimsFilePaths")) scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) else None, - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "disabled" + path = if (c.hasPathOrNull("path")) c.getString("path") else "", + prepareData = c.hasPathOrNull("prepareData") && c.getBoolean("prepareData"), + samplePopulationIntegerFlag = + if (c.hasPathOrNull("samplePopulationIntegerFlag")) c.getInt("samplePopulationIntegerFlag") else 0, + skimsFilePaths = + if (c.hasPathOrNull("skimsFilePaths")) + scala.Some($_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(c.getList("skimsFilePaths"))) + else None, + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "disabled" ) } - private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { + + private def $_LBeamConfig_Beam_WarmStart_SkimsFilePaths$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Beam.WarmStart.SkimsFilePaths$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Beam = { BeamConfig.Beam( - actorSystemName = if(c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", - agentsim = BeamConfig.Beam.Agentsim(if(c.hasPathOrNull("agentsim")) c.getConfig("agentsim") else com.typesafe.config.ConfigFactory.parseString("agentsim{}")), - calibration = BeamConfig.Beam.Calibration(if(c.hasPathOrNull("calibration")) c.getConfig("calibration") else com.typesafe.config.ConfigFactory.parseString("calibration{}")), - cluster = BeamConfig.Beam.Cluster(if(c.hasPathOrNull("cluster")) c.getConfig("cluster") else com.typesafe.config.ConfigFactory.parseString("cluster{}")), - debug = BeamConfig.Beam.Debug(if(c.hasPathOrNull("debug")) c.getConfig("debug") else com.typesafe.config.ConfigFactory.parseString("debug{}")), - exchange = BeamConfig.Beam.Exchange(if(c.hasPathOrNull("exchange")) c.getConfig("exchange") else com.typesafe.config.ConfigFactory.parseString("exchange{}")), - experimental = BeamConfig.Beam.Experimental(if(c.hasPathOrNull("experimental")) c.getConfig("experimental") else com.typesafe.config.ConfigFactory.parseString("experimental{}")), - input = BeamConfig.Beam.Input(if(c.hasPathOrNull("input")) c.getConfig("input") else com.typesafe.config.ConfigFactory.parseString("input{}")), - inputDirectory = if(c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", - logger = BeamConfig.Beam.Logger(if(c.hasPathOrNull("logger")) c.getConfig("logger") else com.typesafe.config.ConfigFactory.parseString("logger{}")), - metrics = BeamConfig.Beam.Metrics(if(c.hasPathOrNull("metrics")) c.getConfig("metrics") else com.typesafe.config.ConfigFactory.parseString("metrics{}")), - output = BeamConfig.Beam.Output(if(c.hasPathOrNull("output")) c.getConfig("output") else com.typesafe.config.ConfigFactory.parseString("output{}")), - outputs = BeamConfig.Beam.Outputs(if(c.hasPathOrNull("outputs")) c.getConfig("outputs") else com.typesafe.config.ConfigFactory.parseString("outputs{}")), - physsim = BeamConfig.Beam.Physsim(if(c.hasPathOrNull("physsim")) c.getConfig("physsim") else com.typesafe.config.ConfigFactory.parseString("physsim{}")), - replanning = BeamConfig.Beam.Replanning(if(c.hasPathOrNull("replanning")) c.getConfig("replanning") else com.typesafe.config.ConfigFactory.parseString("replanning{}")), - router = BeamConfig.Beam.Router(if(c.hasPathOrNull("router")) c.getConfig("router") else com.typesafe.config.ConfigFactory.parseString("router{}")), - routing = BeamConfig.Beam.Routing(if(c.hasPathOrNull("routing")) c.getConfig("routing") else com.typesafe.config.ConfigFactory.parseString("routing{}")), - sim = BeamConfig.Beam.Sim(if(c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}")), - spatial = BeamConfig.Beam.Spatial(if(c.hasPathOrNull("spatial")) c.getConfig("spatial") else com.typesafe.config.ConfigFactory.parseString("spatial{}")), - urbansim = BeamConfig.Beam.Urbansim(if(c.hasPathOrNull("urbansim")) c.getConfig("urbansim") else com.typesafe.config.ConfigFactory.parseString("urbansim{}")), - useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), - warmStart = BeamConfig.Beam.WarmStart(if(c.hasPathOrNull("warmStart")) c.getConfig("warmStart") else com.typesafe.config.ConfigFactory.parseString("warmStart{}")) + actorSystemName = if (c.hasPathOrNull("actorSystemName")) c.getString("actorSystemName") else "ClusterSystem", + agentsim = BeamConfig.Beam.Agentsim( + if (c.hasPathOrNull("agentsim")) c.getConfig("agentsim") + else com.typesafe.config.ConfigFactory.parseString("agentsim{}") + ), + calibration = BeamConfig.Beam.Calibration( + if (c.hasPathOrNull("calibration")) c.getConfig("calibration") + else com.typesafe.config.ConfigFactory.parseString("calibration{}") + ), + cluster = BeamConfig.Beam.Cluster( + if (c.hasPathOrNull("cluster")) c.getConfig("cluster") + else com.typesafe.config.ConfigFactory.parseString("cluster{}") + ), + debug = BeamConfig.Beam.Debug( + if (c.hasPathOrNull("debug")) c.getConfig("debug") + else com.typesafe.config.ConfigFactory.parseString("debug{}") + ), + exchange = BeamConfig.Beam.Exchange( + if (c.hasPathOrNull("exchange")) c.getConfig("exchange") + else com.typesafe.config.ConfigFactory.parseString("exchange{}") + ), + experimental = BeamConfig.Beam.Experimental( + if (c.hasPathOrNull("experimental")) c.getConfig("experimental") + else com.typesafe.config.ConfigFactory.parseString("experimental{}") + ), + input = BeamConfig.Beam.Input( + if (c.hasPathOrNull("input")) c.getConfig("input") + else com.typesafe.config.ConfigFactory.parseString("input{}") + ), + inputDirectory = + if (c.hasPathOrNull("inputDirectory")) c.getString("inputDirectory") else "/test/input/beamville", + logger = BeamConfig.Beam.Logger( + if (c.hasPathOrNull("logger")) c.getConfig("logger") + else com.typesafe.config.ConfigFactory.parseString("logger{}") + ), + metrics = BeamConfig.Beam.Metrics( + if (c.hasPathOrNull("metrics")) c.getConfig("metrics") + else com.typesafe.config.ConfigFactory.parseString("metrics{}") + ), + output = BeamConfig.Beam.Output( + if (c.hasPathOrNull("output")) c.getConfig("output") + else com.typesafe.config.ConfigFactory.parseString("output{}") + ), + outputs = BeamConfig.Beam.Outputs( + if (c.hasPathOrNull("outputs")) c.getConfig("outputs") + else com.typesafe.config.ConfigFactory.parseString("outputs{}") + ), + physsim = BeamConfig.Beam.Physsim( + if (c.hasPathOrNull("physsim")) c.getConfig("physsim") + else com.typesafe.config.ConfigFactory.parseString("physsim{}") + ), + replanning = BeamConfig.Beam.Replanning( + if (c.hasPathOrNull("replanning")) c.getConfig("replanning") + else com.typesafe.config.ConfigFactory.parseString("replanning{}") + ), + router = BeamConfig.Beam.Router( + if (c.hasPathOrNull("router")) c.getConfig("router") + else com.typesafe.config.ConfigFactory.parseString("router{}") + ), + routing = BeamConfig.Beam.Routing( + if (c.hasPathOrNull("routing")) c.getConfig("routing") + else com.typesafe.config.ConfigFactory.parseString("routing{}") + ), + sim = BeamConfig.Beam.Sim( + if (c.hasPathOrNull("sim")) c.getConfig("sim") else com.typesafe.config.ConfigFactory.parseString("sim{}") + ), + spatial = BeamConfig.Beam.Spatial( + if (c.hasPathOrNull("spatial")) c.getConfig("spatial") + else com.typesafe.config.ConfigFactory.parseString("spatial{}") + ), + urbansim = BeamConfig.Beam.Urbansim( + if (c.hasPathOrNull("urbansim")) c.getConfig("urbansim") + else com.typesafe.config.ConfigFactory.parseString("urbansim{}") + ), + useLocalWorker = !c.hasPathOrNull("useLocalWorker") || c.getBoolean("useLocalWorker"), + warmStart = BeamConfig.Beam.WarmStart( + if (c.hasPathOrNull("warmStart")) c.getConfig("warmStart") + else com.typesafe.config.ConfigFactory.parseString("warmStart{}") + ) ) } } - + case class Matsim( - conversion : BeamConfig.Matsim.Conversion, - modules : BeamConfig.Matsim.Modules + conversion: BeamConfig.Matsim.Conversion, + modules: BeamConfig.Matsim.Modules ) + object Matsim { + case class Conversion( - defaultHouseholdIncome : BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, - generateVehicles : scala.Boolean, - matsimNetworkFile : java.lang.String, - osmFile : java.lang.String, - populationFile : java.lang.String, - scenarioDirectory : java.lang.String, - shapeConfig : BeamConfig.Matsim.Conversion.ShapeConfig, - vehiclesFile : java.lang.String + defaultHouseholdIncome: BeamConfig.Matsim.Conversion.DefaultHouseholdIncome, + generateVehicles: scala.Boolean, + matsimNetworkFile: java.lang.String, + osmFile: java.lang.String, + populationFile: java.lang.String, + scenarioDirectory: java.lang.String, + shapeConfig: BeamConfig.Matsim.Conversion.ShapeConfig, + vehiclesFile: java.lang.String ) + object Conversion { + case class DefaultHouseholdIncome( - currency : java.lang.String, - period : java.lang.String, - value : scala.Int + currency: java.lang.String, + period: java.lang.String, + value: scala.Int ) + object DefaultHouseholdIncome { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.DefaultHouseholdIncome = { BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( - currency = if(c.hasPathOrNull("currency")) c.getString("currency") else "usd", - period = if(c.hasPathOrNull("period")) c.getString("period") else "year", - value = if(c.hasPathOrNull("value")) c.getInt("value") else 50000 + currency = if (c.hasPathOrNull("currency")) c.getString("currency") else "usd", + period = if (c.hasPathOrNull("period")) c.getString("period") else "year", + value = if (c.hasPathOrNull("value")) c.getInt("value") else 50000 ) } } - + case class ShapeConfig( - shapeFile : java.lang.String, - tazIdFieldName : java.lang.String + shapeFile: java.lang.String, + tazIdFieldName: java.lang.String ) + object ShapeConfig { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion.ShapeConfig = { BeamConfig.Matsim.Conversion.ShapeConfig( - shapeFile = if(c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", - tazIdFieldName = if(c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" + shapeFile = if (c.hasPathOrNull("shapeFile")) c.getString("shapeFile") else "tz46_d00.shp", + tazIdFieldName = if (c.hasPathOrNull("tazIdFieldName")) c.getString("tazIdFieldName") else "TZ46_D00_I" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Conversion = { BeamConfig.Matsim.Conversion( - defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome(if(c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}")), - generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), - matsimNetworkFile = if(c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", - osmFile = if(c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", - populationFile = if(c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", - scenarioDirectory = if(c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") else "/path/to/scenario/directory", - shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig(if(c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}")), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" + defaultHouseholdIncome = BeamConfig.Matsim.Conversion.DefaultHouseholdIncome( + if (c.hasPathOrNull("defaultHouseholdIncome")) c.getConfig("defaultHouseholdIncome") + else com.typesafe.config.ConfigFactory.parseString("defaultHouseholdIncome{}") + ), + generateVehicles = !c.hasPathOrNull("generateVehicles") || c.getBoolean("generateVehicles"), + matsimNetworkFile = + if (c.hasPathOrNull("matsimNetworkFile")) c.getString("matsimNetworkFile") else "Siouxfalls_network_PT.xml", + osmFile = if (c.hasPathOrNull("osmFile")) c.getString("osmFile") else "south-dakota-latest.osm.pbf", + populationFile = + if (c.hasPathOrNull("populationFile")) c.getString("populationFile") else "Siouxfalls_population.xml", + scenarioDirectory = + if (c.hasPathOrNull("scenarioDirectory")) c.getString("scenarioDirectory") + else "/path/to/scenario/directory", + shapeConfig = BeamConfig.Matsim.Conversion.ShapeConfig( + if (c.hasPathOrNull("shapeConfig")) c.getConfig("shapeConfig") + else com.typesafe.config.ConfigFactory.parseString("shapeConfig{}") + ), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "Siouxfalls_vehicles.xml" ) } } - + case class Modules( - changeMode : BeamConfig.Matsim.Modules.ChangeMode, - controler : BeamConfig.Matsim.Modules.Controler, - counts : BeamConfig.Matsim.Modules.Counts, - global : BeamConfig.Matsim.Modules.Global, - households : BeamConfig.Matsim.Modules.Households, - linkStats : BeamConfig.Matsim.Modules.LinkStats, - network : BeamConfig.Matsim.Modules.Network, - parallelEventHandling : BeamConfig.Matsim.Modules.ParallelEventHandling, - planCalcScore : BeamConfig.Matsim.Modules.PlanCalcScore, - plans : BeamConfig.Matsim.Modules.Plans, - qsim : BeamConfig.Matsim.Modules.Qsim, - strategy : BeamConfig.Matsim.Modules.Strategy, - transit : BeamConfig.Matsim.Modules.Transit, - vehicles : BeamConfig.Matsim.Modules.Vehicles + changeMode: BeamConfig.Matsim.Modules.ChangeMode, + controler: BeamConfig.Matsim.Modules.Controler, + counts: BeamConfig.Matsim.Modules.Counts, + global: BeamConfig.Matsim.Modules.Global, + households: BeamConfig.Matsim.Modules.Households, + linkStats: BeamConfig.Matsim.Modules.LinkStats, + network: BeamConfig.Matsim.Modules.Network, + parallelEventHandling: BeamConfig.Matsim.Modules.ParallelEventHandling, + planCalcScore: BeamConfig.Matsim.Modules.PlanCalcScore, + plans: BeamConfig.Matsim.Modules.Plans, + qsim: BeamConfig.Matsim.Modules.Qsim, + strategy: BeamConfig.Matsim.Modules.Strategy, + transit: BeamConfig.Matsim.Modules.Transit, + vehicles: BeamConfig.Matsim.Modules.Vehicles ) + object Modules { + case class ChangeMode( - modes : java.lang.String + modes: java.lang.String ) + object ChangeMode { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ChangeMode = { BeamConfig.Matsim.Modules.ChangeMode( - modes = if(c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" + modes = if (c.hasPathOrNull("modes")) c.getString("modes") else "car,pt" ) } } - + case class Controler( - eventsFileFormat : java.lang.String, - firstIteration : scala.Int, - lastIteration : scala.Int, - mobsim : java.lang.String, - outputDirectory : java.lang.String, - overwriteFiles : java.lang.String + eventsFileFormat: java.lang.String, + firstIteration: scala.Int, + lastIteration: scala.Int, + mobsim: java.lang.String, + outputDirectory: java.lang.String, + overwriteFiles: java.lang.String ) + object Controler { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Controler = { BeamConfig.Matsim.Modules.Controler( - eventsFileFormat = if(c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", - firstIteration = if(c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, - lastIteration = if(c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, - mobsim = if(c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", - outputDirectory = if(c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", - overwriteFiles = if(c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" + eventsFileFormat = if (c.hasPathOrNull("eventsFileFormat")) c.getString("eventsFileFormat") else "xml", + firstIteration = if (c.hasPathOrNull("firstIteration")) c.getInt("firstIteration") else 0, + lastIteration = if (c.hasPathOrNull("lastIteration")) c.getInt("lastIteration") else 0, + mobsim = if (c.hasPathOrNull("mobsim")) c.getString("mobsim") else "metasim", + outputDirectory = if (c.hasPathOrNull("outputDirectory")) c.getString("outputDirectory") else "", + overwriteFiles = + if (c.hasPathOrNull("overwriteFiles")) c.getString("overwriteFiles") else "overwriteExistingFiles" ) } } - + case class Counts( - averageCountsOverIterations : scala.Int, - countsScaleFactor : scala.Double, - inputCountsFile : java.lang.String, - outputformat : java.lang.String, - writeCountsInterval : scala.Int + averageCountsOverIterations: scala.Int, + countsScaleFactor: scala.Double, + inputCountsFile: java.lang.String, + outputformat: java.lang.String, + writeCountsInterval: scala.Int ) + object Counts { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Counts = { BeamConfig.Matsim.Modules.Counts( - averageCountsOverIterations = if(c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, - countsScaleFactor = if(c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, - inputCountsFile = if(c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", - outputformat = if(c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", - writeCountsInterval = if(c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 + averageCountsOverIterations = + if (c.hasPathOrNull("averageCountsOverIterations")) c.getInt("averageCountsOverIterations") else 0, + countsScaleFactor = if (c.hasPathOrNull("countsScaleFactor")) c.getDouble("countsScaleFactor") else 10.355, + inputCountsFile = if (c.hasPathOrNull("inputCountsFile")) c.getString("inputCountsFile") else "", + outputformat = if (c.hasPathOrNull("outputformat")) c.getString("outputformat") else "all", + writeCountsInterval = if (c.hasPathOrNull("writeCountsInterval")) c.getInt("writeCountsInterval") else 0 ) } } - + case class Global( - coordinateSystem : java.lang.String, - randomSeed : scala.Int + coordinateSystem: java.lang.String, + randomSeed: scala.Int ) + object Global { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Global = { BeamConfig.Matsim.Modules.Global( - coordinateSystem = if(c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", - randomSeed = if(c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 + coordinateSystem = if (c.hasPathOrNull("coordinateSystem")) c.getString("coordinateSystem") else "Atlantis", + randomSeed = if (c.hasPathOrNull("randomSeed")) c.getInt("randomSeed") else 4711 ) } } - + case class Households( - inputFile : java.lang.String, - inputHouseholdAttributesFile : java.lang.String + inputFile: java.lang.String, + inputHouseholdAttributesFile: java.lang.String ) + object Households { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Households = { BeamConfig.Matsim.Modules.Households( - inputFile = if(c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", - inputHouseholdAttributesFile = if(c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") else "/test/input/beamville/householdAttributes.xml" + inputFile = + if (c.hasPathOrNull("inputFile")) c.getString("inputFile") else "/test/input/beamville/households.xml", + inputHouseholdAttributesFile = + if (c.hasPathOrNull("inputHouseholdAttributesFile")) c.getString("inputHouseholdAttributesFile") + else "/test/input/beamville/householdAttributes.xml" ) } } - + case class LinkStats( - averageLinkStatsOverIterations : scala.Int, - writeLinkStatsInterval : scala.Int + averageLinkStatsOverIterations: scala.Int, + writeLinkStatsInterval: scala.Int ) + object LinkStats { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.LinkStats = { BeamConfig.Matsim.Modules.LinkStats( - averageLinkStatsOverIterations = if(c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, - writeLinkStatsInterval = if(c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 + averageLinkStatsOverIterations = + if (c.hasPathOrNull("averageLinkStatsOverIterations")) c.getInt("averageLinkStatsOverIterations") else 5, + writeLinkStatsInterval = + if (c.hasPathOrNull("writeLinkStatsInterval")) c.getInt("writeLinkStatsInterval") else 10 ) } } - + case class Network( - inputNetworkFile : java.lang.String + inputNetworkFile: java.lang.String ) + object Network { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Network = { BeamConfig.Matsim.Modules.Network( - inputNetworkFile = if(c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") else "/test/input/beamville/r5/physsim-network.xml" + inputNetworkFile = + if (c.hasPathOrNull("inputNetworkFile")) c.getString("inputNetworkFile") + else "/test/input/beamville/r5/physsim-network.xml" ) } } - + case class ParallelEventHandling( - estimatedNumberOfEvents : scala.Int, - numberOfThreads : scala.Int, - oneThreadPerHandler : scala.Boolean, - synchronizeOnSimSteps : scala.Boolean + estimatedNumberOfEvents: scala.Int, + numberOfThreads: scala.Int, + oneThreadPerHandler: scala.Boolean, + synchronizeOnSimSteps: scala.Boolean ) + object ParallelEventHandling { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.ParallelEventHandling = { BeamConfig.Matsim.Modules.ParallelEventHandling( - estimatedNumberOfEvents = if(c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, - numberOfThreads = if(c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, - oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), - synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") + estimatedNumberOfEvents = + if (c.hasPathOrNull("estimatedNumberOfEvents")) c.getInt("estimatedNumberOfEvents") else 1000000000, + numberOfThreads = if (c.hasPathOrNull("numberOfThreads")) c.getInt("numberOfThreads") else 1, + oneThreadPerHandler = c.hasPathOrNull("oneThreadPerHandler") && c.getBoolean("oneThreadPerHandler"), + synchronizeOnSimSteps = c.hasPathOrNull("synchronizeOnSimSteps") && c.getBoolean("synchronizeOnSimSteps") ) } } - + case class PlanCalcScore( - BrainExpBeta : scala.Long, - earlyDeparture : scala.Long, - lateArrival : scala.Long, - learningRate : scala.Long, - parameterset : scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], - performing : scala.Long, - traveling : scala.Long, - waiting : scala.Long, - writeExperiencedPlans : scala.Boolean + BrainExpBeta: scala.Long, + earlyDeparture: scala.Long, + lateArrival: scala.Long, + learningRate: scala.Long, + parameterset: scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm], + performing: scala.Long, + traveling: scala.Long, + waiting: scala.Long, + writeExperiencedPlans: scala.Boolean ) + object PlanCalcScore { + case class Parameterset$Elm( - activityType : java.lang.String, - priority : scala.Int, - scoringThisActivityAtAll : scala.Boolean, - `type` : java.lang.String, - typicalDuration : java.lang.String, - typicalDurationScoreComputation : java.lang.String + activityType: java.lang.String, + priority: scala.Int, + scoringThisActivityAtAll: scala.Boolean, + `type`: java.lang.String, + typicalDuration: java.lang.String, + typicalDurationScoreComputation: java.lang.String ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm = { BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm( - activityType = if(c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", - priority = if(c.hasPathOrNull("priority")) c.getInt("priority") else 1, - scoringThisActivityAtAll = !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "activityParams", - typicalDuration = if(c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", - typicalDurationScoreComputation = if(c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") else "uniform" + activityType = if (c.hasPathOrNull("activityType")) c.getString("activityType") else "Home", + priority = if (c.hasPathOrNull("priority")) c.getInt("priority") else 1, + scoringThisActivityAtAll = + !c.hasPathOrNull("scoringThisActivityAtAll") || c.getBoolean("scoringThisActivityAtAll"), + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "activityParams", + typicalDuration = if (c.hasPathOrNull("typicalDuration")) c.getString("typicalDuration") else "01:00:00", + typicalDurationScoreComputation = + if (c.hasPathOrNull("typicalDurationScoreComputation")) c.getString("typicalDurationScoreComputation") + else "uniform" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.PlanCalcScore = { BeamConfig.Matsim.Modules.PlanCalcScore( - BrainExpBeta = if(c.hasPathOrNull("BrainExpBeta")) c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) else 2, - earlyDeparture = if(c.hasPathOrNull("earlyDeparture")) c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, - lateArrival = if(c.hasPathOrNull("lateArrival")) c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) else -18, - learningRate = if(c.hasPathOrNull("learningRate")) c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) else 1, - parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), - performing = if(c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) else 6, - traveling = if(c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) else -6, - waiting = if(c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) else 0, + BrainExpBeta = + if (c.hasPathOrNull("BrainExpBeta")) + c.getDuration("BrainExpBeta", java.util.concurrent.TimeUnit.MILLISECONDS) + else 2, + earlyDeparture = + if (c.hasPathOrNull("earlyDeparture")) + c.getDuration("earlyDeparture", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, + lateArrival = + if (c.hasPathOrNull("lateArrival")) + c.getDuration("lateArrival", java.util.concurrent.TimeUnit.MILLISECONDS) + else -18, + learningRate = + if (c.hasPathOrNull("learningRate")) + c.getDuration("learningRate", java.util.concurrent.TimeUnit.MILLISECONDS) + else 1, + parameterset = $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(c.getList("parameterset")), + performing = + if (c.hasPathOrNull("performing")) c.getDuration("performing", java.util.concurrent.TimeUnit.MILLISECONDS) + else 6, + traveling = + if (c.hasPathOrNull("traveling")) c.getDuration("traveling", java.util.concurrent.TimeUnit.MILLISECONDS) + else -6, + waiting = + if (c.hasPathOrNull("waiting")) c.getDuration("waiting", java.util.concurrent.TimeUnit.MILLISECONDS) + else 0, writeExperiencedPlans = !c.hasPathOrNull("writeExperiencedPlans") || c.getBoolean("writeExperiencedPlans") ) } - private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { + + private def $_LBeamConfig_Matsim_Modules_PlanCalcScore_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.PlanCalcScore.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.PlanCalcScore + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Plans( - inputPersonAttributesFile : java.lang.String, - inputPlansFile : java.lang.String + inputPersonAttributesFile: java.lang.String, + inputPlansFile: java.lang.String ) + object Plans { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Plans = { BeamConfig.Matsim.Modules.Plans( - inputPersonAttributesFile = if(c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") else "/test/input/beamville/populationAttributes.xml", - inputPlansFile = if(c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") else "/test/input/beamville/population.xml" + inputPersonAttributesFile = + if (c.hasPathOrNull("inputPersonAttributesFile")) c.getString("inputPersonAttributesFile") + else "/test/input/beamville/populationAttributes.xml", + inputPlansFile = + if (c.hasPathOrNull("inputPlansFile")) c.getString("inputPlansFile") + else "/test/input/beamville/population.xml" ) } } - + case class Qsim( - endTime : java.lang.String, - snapshotperiod : java.lang.String, - startTime : java.lang.String + endTime: java.lang.String, + snapshotperiod: java.lang.String, + startTime: java.lang.String ) + object Qsim { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Qsim = { BeamConfig.Matsim.Modules.Qsim( - endTime = if(c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", - snapshotperiod = if(c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", - startTime = if(c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" + endTime = if (c.hasPathOrNull("endTime")) c.getString("endTime") else "30:00:00", + snapshotperiod = if (c.hasPathOrNull("snapshotperiod")) c.getString("snapshotperiod") else "00:00:00", + startTime = if (c.hasPathOrNull("startTime")) c.getString("startTime") else "00:00:00" ) } } - + case class Strategy( - ModuleProbability_1 : scala.Int, - ModuleProbability_2 : scala.Int, - ModuleProbability_3 : scala.Int, - ModuleProbability_4 : scala.Int, - Module_1 : java.lang.String, - Module_2 : java.lang.String, - Module_3 : java.lang.String, - Module_4 : java.lang.String, - fractionOfIterationsToDisableInnovation : scala.Int, - maxAgentPlanMemorySize : scala.Int, - parameterset : scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], - planSelectorForRemoval : java.lang.String + ModuleProbability_1: scala.Int, + ModuleProbability_2: scala.Int, + ModuleProbability_3: scala.Int, + ModuleProbability_4: scala.Int, + Module_1: java.lang.String, + Module_2: java.lang.String, + Module_3: java.lang.String, + Module_4: java.lang.String, + fractionOfIterationsToDisableInnovation: scala.Int, + maxAgentPlanMemorySize: scala.Int, + parameterset: scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm], + planSelectorForRemoval: java.lang.String ) + object Strategy { + case class Parameterset$Elm( - disableAfterIteration : scala.Int, - strategyName : java.lang.String, - `type` : java.lang.String, - weight : scala.Int + disableAfterIteration: scala.Int, + strategyName: java.lang.String, + `type`: java.lang.String, + weight: scala.Int ) + object Parameterset$Elm { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm = { BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm( - disableAfterIteration = if(c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, - strategyName = if(c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", - `type` = if(c.hasPathOrNull("type")) c.getString("type") else "strategysettings", - weight = if(c.hasPathOrNull("weight")) c.getInt("weight") else 0 + disableAfterIteration = + if (c.hasPathOrNull("disableAfterIteration")) c.getInt("disableAfterIteration") else -1, + strategyName = if (c.hasPathOrNull("strategyName")) c.getString("strategyName") else "", + `type` = if (c.hasPathOrNull("type")) c.getString("type") else "strategysettings", + weight = if (c.hasPathOrNull("weight")) c.getInt("weight") else 0 ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Strategy = { BeamConfig.Matsim.Modules.Strategy( - ModuleProbability_1 = if(c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, - ModuleProbability_2 = if(c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, - ModuleProbability_3 = if(c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, - ModuleProbability_4 = if(c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, - Module_1 = if(c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", - Module_2 = if(c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", - Module_3 = if(c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", - Module_4 = if(c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", - fractionOfIterationsToDisableInnovation = if(c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) c.getInt("fractionOfIterationsToDisableInnovation") else 999999, - maxAgentPlanMemorySize = if(c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, - parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), - planSelectorForRemoval = if(c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") else "WorstPlanForRemovalSelector" - ) - } - private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(cl:com.typesafe.config.ConfigList): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { + ModuleProbability_1 = if (c.hasPathOrNull("ModuleProbability_1")) c.getInt("ModuleProbability_1") else 0, + ModuleProbability_2 = if (c.hasPathOrNull("ModuleProbability_2")) c.getInt("ModuleProbability_2") else 0, + ModuleProbability_3 = if (c.hasPathOrNull("ModuleProbability_3")) c.getInt("ModuleProbability_3") else 0, + ModuleProbability_4 = if (c.hasPathOrNull("ModuleProbability_4")) c.getInt("ModuleProbability_4") else 0, + Module_1 = if (c.hasPathOrNull("Module_1")) c.getString("Module_1") else "", + Module_2 = if (c.hasPathOrNull("Module_2")) c.getString("Module_2") else "", + Module_3 = if (c.hasPathOrNull("Module_3")) c.getString("Module_3") else "", + Module_4 = if (c.hasPathOrNull("Module_4")) c.getString("Module_4") else "", + fractionOfIterationsToDisableInnovation = + if (c.hasPathOrNull("fractionOfIterationsToDisableInnovation")) + c.getInt("fractionOfIterationsToDisableInnovation") + else 999999, + maxAgentPlanMemorySize = + if (c.hasPathOrNull("maxAgentPlanMemorySize")) c.getInt("maxAgentPlanMemorySize") else 5, + parameterset = $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm(c.getList("parameterset")), + planSelectorForRemoval = + if (c.hasPathOrNull("planSelectorForRemoval")) c.getString("planSelectorForRemoval") + else "WorstPlanForRemovalSelector" + ) + } + + private def $_LBeamConfig_Matsim_Modules_Strategy_Parameterset$Elm( + cl: com.typesafe.config.ConfigList + ): scala.List[BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm] = { import scala.collection.JavaConverters._ - cl.asScala.map(cv => BeamConfig.Matsim.Modules.Strategy.Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig)).toList + cl.asScala + .map(cv => + BeamConfig.Matsim.Modules.Strategy + .Parameterset$Elm(cv.asInstanceOf[com.typesafe.config.ConfigObject].toConfig) + ) + .toList } } - + case class Transit( - transitModes : java.lang.String, - useTransit : scala.Boolean, - vehiclesFile : java.lang.String + transitModes: java.lang.String, + useTransit: scala.Boolean, + vehiclesFile: java.lang.String ) + object Transit { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Transit = { BeamConfig.Matsim.Modules.Transit( - transitModes = if(c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", - useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + transitModes = if (c.hasPathOrNull("transitModes")) c.getString("transitModes") else "pt", + useTransit = c.hasPathOrNull("useTransit") && c.getBoolean("useTransit"), + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + case class Vehicles( - vehiclesFile : java.lang.String + vehiclesFile: java.lang.String ) + object Vehicles { + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules.Vehicles = { BeamConfig.Matsim.Modules.Vehicles( - vehiclesFile = if(c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" + vehiclesFile = if (c.hasPathOrNull("vehiclesFile")) c.getString("vehiclesFile") else "" ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim.Modules = { BeamConfig.Matsim.Modules( - changeMode = BeamConfig.Matsim.Modules.ChangeMode(if(c.hasPathOrNull("changeMode")) c.getConfig("changeMode") else com.typesafe.config.ConfigFactory.parseString("changeMode{}")), - controler = BeamConfig.Matsim.Modules.Controler(if(c.hasPathOrNull("controler")) c.getConfig("controler") else com.typesafe.config.ConfigFactory.parseString("controler{}")), - counts = BeamConfig.Matsim.Modules.Counts(if(c.hasPathOrNull("counts")) c.getConfig("counts") else com.typesafe.config.ConfigFactory.parseString("counts{}")), - global = BeamConfig.Matsim.Modules.Global(if(c.hasPathOrNull("global")) c.getConfig("global") else com.typesafe.config.ConfigFactory.parseString("global{}")), - households = BeamConfig.Matsim.Modules.Households(if(c.hasPathOrNull("households")) c.getConfig("households") else com.typesafe.config.ConfigFactory.parseString("households{}")), - linkStats = BeamConfig.Matsim.Modules.LinkStats(if(c.hasPathOrNull("linkStats")) c.getConfig("linkStats") else com.typesafe.config.ConfigFactory.parseString("linkStats{}")), - network = BeamConfig.Matsim.Modules.Network(if(c.hasPathOrNull("network")) c.getConfig("network") else com.typesafe.config.ConfigFactory.parseString("network{}")), - parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling(if(c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}")), - planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore(if(c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}")), - plans = BeamConfig.Matsim.Modules.Plans(if(c.hasPathOrNull("plans")) c.getConfig("plans") else com.typesafe.config.ConfigFactory.parseString("plans{}")), - qsim = BeamConfig.Matsim.Modules.Qsim(if(c.hasPathOrNull("qsim")) c.getConfig("qsim") else com.typesafe.config.ConfigFactory.parseString("qsim{}")), - strategy = BeamConfig.Matsim.Modules.Strategy(if(c.hasPathOrNull("strategy")) c.getConfig("strategy") else com.typesafe.config.ConfigFactory.parseString("strategy{}")), - transit = BeamConfig.Matsim.Modules.Transit(if(c.hasPathOrNull("transit")) c.getConfig("transit") else com.typesafe.config.ConfigFactory.parseString("transit{}")), - vehicles = BeamConfig.Matsim.Modules.Vehicles(if(c.hasPathOrNull("vehicles")) c.getConfig("vehicles") else com.typesafe.config.ConfigFactory.parseString("vehicles{}")) + changeMode = BeamConfig.Matsim.Modules.ChangeMode( + if (c.hasPathOrNull("changeMode")) c.getConfig("changeMode") + else com.typesafe.config.ConfigFactory.parseString("changeMode{}") + ), + controler = BeamConfig.Matsim.Modules.Controler( + if (c.hasPathOrNull("controler")) c.getConfig("controler") + else com.typesafe.config.ConfigFactory.parseString("controler{}") + ), + counts = BeamConfig.Matsim.Modules.Counts( + if (c.hasPathOrNull("counts")) c.getConfig("counts") + else com.typesafe.config.ConfigFactory.parseString("counts{}") + ), + global = BeamConfig.Matsim.Modules.Global( + if (c.hasPathOrNull("global")) c.getConfig("global") + else com.typesafe.config.ConfigFactory.parseString("global{}") + ), + households = BeamConfig.Matsim.Modules.Households( + if (c.hasPathOrNull("households")) c.getConfig("households") + else com.typesafe.config.ConfigFactory.parseString("households{}") + ), + linkStats = BeamConfig.Matsim.Modules.LinkStats( + if (c.hasPathOrNull("linkStats")) c.getConfig("linkStats") + else com.typesafe.config.ConfigFactory.parseString("linkStats{}") + ), + network = BeamConfig.Matsim.Modules.Network( + if (c.hasPathOrNull("network")) c.getConfig("network") + else com.typesafe.config.ConfigFactory.parseString("network{}") + ), + parallelEventHandling = BeamConfig.Matsim.Modules.ParallelEventHandling( + if (c.hasPathOrNull("parallelEventHandling")) c.getConfig("parallelEventHandling") + else com.typesafe.config.ConfigFactory.parseString("parallelEventHandling{}") + ), + planCalcScore = BeamConfig.Matsim.Modules.PlanCalcScore( + if (c.hasPathOrNull("planCalcScore")) c.getConfig("planCalcScore") + else com.typesafe.config.ConfigFactory.parseString("planCalcScore{}") + ), + plans = BeamConfig.Matsim.Modules.Plans( + if (c.hasPathOrNull("plans")) c.getConfig("plans") + else com.typesafe.config.ConfigFactory.parseString("plans{}") + ), + qsim = BeamConfig.Matsim.Modules.Qsim( + if (c.hasPathOrNull("qsim")) c.getConfig("qsim") + else com.typesafe.config.ConfigFactory.parseString("qsim{}") + ), + strategy = BeamConfig.Matsim.Modules.Strategy( + if (c.hasPathOrNull("strategy")) c.getConfig("strategy") + else com.typesafe.config.ConfigFactory.parseString("strategy{}") + ), + transit = BeamConfig.Matsim.Modules.Transit( + if (c.hasPathOrNull("transit")) c.getConfig("transit") + else com.typesafe.config.ConfigFactory.parseString("transit{}") + ), + vehicles = BeamConfig.Matsim.Modules.Vehicles( + if (c.hasPathOrNull("vehicles")) c.getConfig("vehicles") + else com.typesafe.config.ConfigFactory.parseString("vehicles{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig.Matsim = { BeamConfig.Matsim( - conversion = BeamConfig.Matsim.Conversion(if(c.hasPathOrNull("conversion")) c.getConfig("conversion") else com.typesafe.config.ConfigFactory.parseString("conversion{}")), - modules = BeamConfig.Matsim.Modules(if(c.hasPathOrNull("modules")) c.getConfig("modules") else com.typesafe.config.ConfigFactory.parseString("modules{}")) + conversion = BeamConfig.Matsim.Conversion( + if (c.hasPathOrNull("conversion")) c.getConfig("conversion") + else com.typesafe.config.ConfigFactory.parseString("conversion{}") + ), + modules = BeamConfig.Matsim.Modules( + if (c.hasPathOrNull("modules")) c.getConfig("modules") + else com.typesafe.config.ConfigFactory.parseString("modules{}") + ) ) } } - + def apply(c: com.typesafe.config.Config): BeamConfig = { BeamConfig( - beam = BeamConfig.Beam(if(c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}")), - matsim = BeamConfig.Matsim(if(c.hasPathOrNull("matsim")) c.getConfig("matsim") else com.typesafe.config.ConfigFactory.parseString("matsim{}")) + beam = BeamConfig.Beam( + if (c.hasPathOrNull("beam")) c.getConfig("beam") else com.typesafe.config.ConfigFactory.parseString("beam{}") + ), + matsim = BeamConfig.Matsim( + if (c.hasPathOrNull("matsim")) c.getConfig("matsim") + else com.typesafe.config.ConfigFactory.parseString("matsim{}") + ) ) } - private def $_L$_dbl(cl:com.typesafe.config.ConfigList): scala.List[scala.Double] = { + private def $_L$_dbl(cl: com.typesafe.config.ConfigList): scala.List[scala.Double] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_dbl(cv)).toList } - private def $_L$_str(cl:com.typesafe.config.ConfigList): scala.List[java.lang.String] = { + + private def $_L$_str(cl: com.typesafe.config.ConfigList): scala.List[java.lang.String] = { import scala.collection.JavaConverters._ cl.asScala.map(cv => $_str(cv)).toList } - private def $_dbl(cv:com.typesafe.config.ConfigValue): scala.Double = { + + private def $_dbl(cv: com.typesafe.config.ConfigValue): scala.Double = { val u: Any = cv.unwrapped - if ((cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || - !u.isInstanceOf[java.lang.Number]) throw $_expE(cv, "double") + if ( + (cv.valueType != com.typesafe.config.ConfigValueType.NUMBER) || + !u.isInstanceOf[java.lang.Number] + ) throw $_expE(cv, "double") u.asInstanceOf[java.lang.Number].doubleValue() } - private def $_expE(cv:com.typesafe.config.ConfigValue, exp:java.lang.String) = { + + private def $_expE(cv: com.typesafe.config.ConfigValue, exp: java.lang.String) = { val u: Any = cv.unwrapped - new java.lang.RuntimeException(cv.origin.lineNumber + + new java.lang.RuntimeException( + cv.origin.lineNumber + ": expecting: " + exp + " got: " + - (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u)) + (if (u.isInstanceOf[java.lang.String]) "\"" + u + "\"" else u) + ) } - private def $_str(cv:com.typesafe.config.ConfigValue) = + + private def $_str(cv: com.typesafe.config.ConfigValue) = java.lang.String.valueOf(cv.unwrapped()) } - From b1d6f5bcff1fe809503ed862241e1336725684c2 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Fri, 29 Jul 2022 16:21:07 -0700 Subject: [PATCH 273/307] record correct (non-generalized) times and costs in asim skims --- .../scala/beam/router/skim/ActivitySimSkimmer.scala | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/scala/beam/router/skim/ActivitySimSkimmer.scala b/src/main/scala/beam/router/skim/ActivitySimSkimmer.scala index 89a628f7a1e..b2e27c35375 100644 --- a/src/main/scala/beam/router/skim/ActivitySimSkimmer.scala +++ b/src/main/scala/beam/router/skim/ActivitySimSkimmer.scala @@ -249,8 +249,7 @@ class ActivitySimSkimmer @Inject() (matsimServices: MatsimServices, beamScenario individualSkims.map(getValue).zip(weights).map(tup => tup._1 * tup._2).sum / sumWeights val weightedDistance = getWeightedSkimsValue(_.distanceInMeters) - val weightedGeneralizedTime = getWeightedSkimsValue(_.generalizedTimeInMinutes) - val weightedGeneralizedCost = getWeightedSkimsValue(_.generalizedCost) + val weightedTotalTime = getWeightedSkimsValue(_.travelTimeInMinutes) val weightedCost = getWeightedSkimsValue(_.cost) val weightedWalkAccessTime = getWeightedSkimsValue(_.walkAccessInMinutes) val weightedWalkEgressTime = getWeightedSkimsValue(_.walkEgressInMinutes) @@ -270,9 +269,9 @@ class ActivitySimSkimmer @Inject() (matsimServices: MatsimServices, beamScenario pathType = pathType, originId = originId, destinationId = destinationId, - weightedGeneralizedTime = weightedGeneralizedTime, + weightedTotalTimeTime = weightedTotalTime, weightedTotalInVehicleTime = weightedTotalInVehicleTime, - weightedGeneralizedCost = weightedGeneralizedCost, + weightedTotalCost = weightedCost, weightedDistance = weightedDistance, weightedWalkAccess = weightedWalkAccessTime, weightedWalkAuxiliary = weightedWalkAuxiliaryTime, @@ -370,9 +369,9 @@ object ActivitySimSkimmer extends LazyLogging { pathType: ActivitySimPathType, originId: String, destinationId: String, - weightedGeneralizedTime: Double, + weightedTotalTimeTime: Double, weightedTotalInVehicleTime: Double, - weightedGeneralizedCost: Double, + weightedTotalCost: Double, weightedDistance: Double, weightedWalkAccess: Double, weightedWalkAuxiliary: Double, From f6ff7dcee65aac255407c4c06b53f40b6f9547ba Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Fri, 29 Jul 2022 17:01:11 -0700 Subject: [PATCH 274/307] record correct (non-generalized) times and costs in asim skims --- src/main/scala/beam/router/skim/ActivitySimSkimmer.scala | 4 ++-- .../scala/beam/router/skim/ActivitySimSkimmerEvent.scala | 9 ++++----- src/main/scala/scripts/BackgroundSkimsCreatorApp.scala | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/scala/beam/router/skim/ActivitySimSkimmer.scala b/src/main/scala/beam/router/skim/ActivitySimSkimmer.scala index b2e27c35375..0fad04f8269 100644 --- a/src/main/scala/beam/router/skim/ActivitySimSkimmer.scala +++ b/src/main/scala/beam/router/skim/ActivitySimSkimmer.scala @@ -269,7 +269,7 @@ class ActivitySimSkimmer @Inject() (matsimServices: MatsimServices, beamScenario pathType = pathType, originId = originId, destinationId = destinationId, - weightedTotalTimeTime = weightedTotalTime, + weightedTotalTime = weightedTotalTime, weightedTotalInVehicleTime = weightedTotalInVehicleTime, weightedTotalCost = weightedCost, weightedDistance = weightedDistance, @@ -369,7 +369,7 @@ object ActivitySimSkimmer extends LazyLogging { pathType: ActivitySimPathType, originId: String, destinationId: String, - weightedTotalTimeTime: Double, + weightedTotalTime: Double, weightedTotalInVehicleTime: Double, weightedTotalCost: Double, weightedDistance: Double, diff --git a/src/main/scala/beam/router/skim/ActivitySimSkimmerEvent.scala b/src/main/scala/beam/router/skim/ActivitySimSkimmerEvent.scala index f5685707fb5..4b05965679f 100644 --- a/src/main/scala/beam/router/skim/ActivitySimSkimmerEvent.scala +++ b/src/main/scala/beam/router/skim/ActivitySimSkimmerEvent.scala @@ -93,8 +93,7 @@ case class ActivitySimSkimmerEvent( energyConsumption: Double ): (ActivitySimSkimmerKey, ActivitySimSkimmerInternal) = { val pathType = ActivitySimPathType.determineTripPathType(trip) - val correctedTrip = ODSkimmerEvent.correctTrip(trip, trip.tripClassifier) - val beamLegs = correctedTrip.beamLegs + val beamLegs = trip.beamLegs val origLeg = beamLegs.head val timeBin = SkimsUtils.timeToBin(origLeg.startTime) val distInMeters = beamLegs.map(_.travelPath.distanceInM).sum @@ -124,12 +123,12 @@ case class ActivitySimSkimmerEvent( val payload = ActivitySimSkimmerInternal( - travelTimeInMinutes = correctedTrip.totalTravelTimeInSecs.toDouble / 60.0, + travelTimeInMinutes = trip.totalTravelTimeInSecs.toDouble / 60.0, generalizedTimeInMinutes = generalizedTimeInHours * 60, generalizedCost = generalizedCost, distanceInMeters = if (distInMeters > 0.0) { distInMeters } else { 1.0 }, - cost = correctedTrip.costEstimate, + cost = trip.costEstimate, energy = energyConsumption, walkAccessInMinutes = walkAccess / 60.0, walkEgressInMinutes = walkEgress / 60.0, @@ -149,7 +148,7 @@ case class ActivitySimSkimmerEvent( object ActivitySimSkimmerEvent { - val carModes: Set[BeamMode] = Set(BeamMode.CAV, BeamMode.CAR) + val carModes: Set[BeamMode] = Set(BeamMode.CAV, BeamMode.CAR, BeamMode.RIDE_HAIL, BeamMode.RIDE_HAIL_POOLED) val transitModes: Set[BeamMode] = (BeamMode.transitModes ++ BeamMode.massTransitModes).toSet val inVehicleModes: Set[BeamMode] = carModes ++ transitModes } diff --git a/src/main/scala/scripts/BackgroundSkimsCreatorApp.scala b/src/main/scala/scripts/BackgroundSkimsCreatorApp.scala index 3c429462128..e423bb5d4c7 100644 --- a/src/main/scala/scripts/BackgroundSkimsCreatorApp.scala +++ b/src/main/scala/scripts/BackgroundSkimsCreatorApp.scala @@ -91,8 +91,8 @@ object BackgroundSkimsCreatorApp extends App with BeamHelper { pathType = ActivitySimPathType.fromString(rec.get("pathType")).getOrElse(ActivitySimPathType.DRV_COM_WLK), originId = rec.get("origin"), destinationId = rec.get("destination"), - weightedGeneralizedTime = rec.get("TIME_minutes").toDouble, - weightedGeneralizedCost = rec.get("VTOLL_FAR").toDouble, + weightedTotalTime = rec.get("TIME_minutes").toDouble, + weightedTotalCost = rec.get("VTOLL_FAR").toDouble, weightedDistance = rec.get("DIST_meters").toDouble, weightedWalkAccess = rec.get("WACC_minutes").toDouble, weightedWalkEgress = rec.get("WEGR_minutes").toDouble, @@ -121,7 +121,7 @@ object BackgroundSkimsCreatorApp extends App with BeamHelper { private def readSkimsCsv(csvPath: String): Vector[ExcerptData] = { val (iter: Iterator[ExcerptData], toClose: Closeable) = - GenericCsvReader.readAs[ExcerptData](csvPath, toCsvSkimRow, _.weightedGeneralizedTime > 0) + GenericCsvReader.readAs[ExcerptData](csvPath, toCsvSkimRow, _.weightedTotalTime > 0) try { iter.toVector } finally { From 8286d9db76fb129f96656b101124245978ec6aff Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 2 Aug 2022 15:55:34 -0700 Subject: [PATCH 275/307] Revert "update warmstart files for sfbay" This reverts commit aaddf222 (failing on gcloud due to bad gzip) --- build.gradle | 2 +- src/main/scala/beam/agentsim/agents/PersonAgent.scala | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e42f1b2c8b3..8c8ef5d126e 100755 --- a/build.gradle +++ b/build.gradle @@ -39,7 +39,7 @@ apply plugin: 'ManifestClasspath' apply plugin: 'scalafmt' group = 'beam' -version = '0.8.6' +version = '0.8.6.13' description = """""" diff --git a/src/main/scala/beam/agentsim/agents/PersonAgent.scala b/src/main/scala/beam/agentsim/agents/PersonAgent.scala index 8cb3af04b35..7105ff8b4b5 100755 --- a/src/main/scala/beam/agentsim/agents/PersonAgent.scala +++ b/src/main/scala/beam/agentsim/agents/PersonAgent.scala @@ -1381,6 +1381,7 @@ class PersonAgent( generateSkimData(tick, uncompletedTrip, failedTrip = true, currentActivityIndex, nextActivity(data)) ) val correctedTrip = correctTripEndTime(data.currentTrip.get, tick, body.id, body.beamVehicleType.id) + generateSkimData(tick, correctedTrip, failedTrip = false, currentActivityIndex, nextActivity(data)) resetFuelConsumed() val activityStartEvent = new ActivityStartEvent( tick, From f675ed4dbe40108b6a549efe09c6597075edbc5b Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 2 Aug 2022 17:51:02 -0700 Subject: [PATCH 276/307] update scripts --- src/main/R/gemini/gemini-infrastructure.R | 19 ++++++++++++++++++- src/main/R/gemini/gemini-main.R | 6 +++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/main/R/gemini/gemini-infrastructure.R b/src/main/R/gemini/gemini-infrastructure.R index 7a8d264a42f..759e306cbcb 100644 --- a/src/main/R/gemini/gemini-infrastructure.R +++ b/src/main/R/gemini/gemini-infrastructure.R @@ -7,7 +7,7 @@ library(dplyr) library(ggplot2) geminiDir <- normalizePath("~/Data/GEMINI") -infraDir <- pp(geminiDir,"/2022-04-28/_models/infrastructure") +infraDir <- pp(geminiDir,"/2022-07-05/_models/infrastructure") infra5aBase <- readCsv(pp(infraDir, "/4a_output_2022_Apr_13_pubClust_withFees_noHousehold.csv")) @@ -131,4 +131,21 @@ nrow(fast_sites[site.xfc == TRUE]) sites[plug.xfc] +#### + +events <- readCsv(pp(geminiDir,"/2022-07-05/events/filtered.0.events.7Advanced.csv.gz")) +events.sim <- readCsv(pp(geminiDir, "/2022-07-05/sim/events.sim.7Advanced.csv.gz")) + +refueling <- events[type == "RefuelSessionEvent"][ + ,.(person,startTime=time-duration,startTime2=time-duration,parkingTaz,chargingPointType, + pricingModel,parkingType,locationX,locationY,vehicle,vehicleType,fuel,duration)][ + ,`:=`(stallLocationX=locationX,stallLocationY=locationY)] + +write.csv( + refueling, + file = pp(geminiDir,"/2022-07-05/_models/chargingEvents.7Advanced.csv"), + row.names=FALSE, + quote=FALSE, + na="0") + diff --git a/src/main/R/gemini/gemini-main.R b/src/main/R/gemini/gemini-main.R index 60f0ab0b1fb..43e78dc6907 100644 --- a/src/main/R/gemini/gemini-main.R +++ b/src/main/R/gemini/gemini-main.R @@ -74,9 +74,9 @@ all.loads <- as.data.table(all.loads[scens, on="code", mult="all"]) # scenarioNames <- c('5b1', '5b2') # scenarioNames <- c('5b3', '5b4', '5b5', '5b6', '5b7') -scenarioNames <- c('BaseXFC', 'HighEV') +scenarioNames <- c('BaseXFC', 'HighEV', 'Advanced') #scenarioBaselineLabel <- 'BaseXFC' -scenarioBaselineLabel <- '5b1' +scenarioBaselineLabel <- 'BaseXFC' #all.loads <- all.loads[!is.na(loadType)] ########################################## # LOADS & ENERGY @@ -219,7 +219,7 @@ p <- all.loads[site=='public'&name%in%scenarioNames][,.(kw=sum(kw)),by=c('loadTy labs(x = "hour", y = "GW", fill="load severity", title="Public Charging") + theme(strip.text = element_text(size=rel(1.2))) + facet_wrap(~factor(name,scenarioNames),ncol = 2) -ggsave(pp(plotsDir,'/public-charging-by-scenario.png'),p,width=8,height=4,units='in') +ggsave(pp(plotsDir,'/public-charging-by-scenario-2.png'),p,width=8,height=4,units='in') ## public daily charging by scenario From 4886ed98399d1d5991dc822c4c359c9cafcd8c2e Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 2 Aug 2022 18:03:23 -0700 Subject: [PATCH 277/307] fmt --- .../scala/beam/agentsim/agents/parking/ChoosesParking.scala | 6 +++++- .../agentsim/infrastructure/ChargingNetworkManager.scala | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index 180f13cec47..d53d1e680c0 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -391,7 +391,11 @@ trait ChoosesParking extends { triggerId, Vector(ScheduleTrigger(StartLegTrigger(nextLeg.startTime, nextLeg), self)) ) - goto(WaitingToDrive) using data + val updatedData = data match { + case data: BasePersonData => data.copy(enrouteData = EnrouteData()) + case _ => data + } + goto(WaitingToDrive) using updatedData } else { val (updatedData, isEnrouting) = data match { case data: BasePersonData if data.enrouteData.isInEnrouteState => diff --git a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala index 175104b9559..dbe83e9a4c5 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ChargingNetworkManager.scala @@ -316,11 +316,11 @@ object ChargingNetworkManager extends LazyLogging { } /** - * @param managerType vehicle manager type + * @param reservedFor ReservedFor * @return */ - def get(managerType: ReservedFor): ChargingNetwork = { - managerType match { + def get(reservedFor: ReservedFor): ChargingNetwork = { + reservedFor.managerType match { case VehicleManager.TypeEnum.RideHail => rideHailNetwork case _ => chargingNetwork } From 73a707d580df4a20da7956e135c5cf2b766722ba Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 2 Aug 2022 18:52:36 -0700 Subject: [PATCH 278/307] fmt --- .../agentsim/infrastructure/parking/PricingModelSpec.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala index c820b489620..077802adb18 100644 --- a/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/parking/PricingModelSpec.scala @@ -18,7 +18,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { PricingModel("flatfee", inputCost.toString) match { case Some(PricingModel.FlatFee(cost)) => cost should equal(inputCost) - PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration, 0.0) should equal( + PricingModel.evaluateParkingTicket(PricingModel.FlatFee(cost), duration) should equal( inputCost ) case _ => fail() @@ -31,7 +31,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { case Some(PricingModel.Block(cost, intervalInSeconds)) => cost should equal(100) intervalInSeconds should equal(PricingModel.DefaultPricingInterval) - PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration, 0.0) should equal( + PricingModel.evaluateParkingTicket(PricingModel.Block(cost, intervalInSeconds), duration) should equal( inputCost * 2 ) case _ => fail() @@ -54,8 +54,7 @@ class PricingModelSpec extends AnyWordSpec with Matchers { inputCost.toDouble * (parkingDuration.toDouble / blockIntervalInSeconds.toDouble) PricingModel.evaluateParkingTicket( PricingModel.Block(cost, intervalInSeconds), - parkingDuration, - 0.0 + parkingDuration ) should equal( expectedTicketPrice ) From e6596d0ccfa4a2974bbe833fd984618d34133a03 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 2 Aug 2022 19:54:22 -0700 Subject: [PATCH 279/307] only CAVs can charge at depot --- .../scala/beam/sim/RideHailFleetInitializer.scala | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/scala/beam/sim/RideHailFleetInitializer.scala b/src/main/scala/beam/sim/RideHailFleetInitializer.scala index 3e3a1bea283..6dab803a045 100644 --- a/src/main/scala/beam/sim/RideHailFleetInitializer.scala +++ b/src/main/scala/beam/sim/RideHailFleetInitializer.scala @@ -34,7 +34,9 @@ object RideHailFleetInitializer extends OutputDataDescriptor with LazyLogging { private[sim] def toRideHailAgentInputData(rec: java.util.Map[String, String]): RideHailAgentInputData = { val id = GenericCsvReader.getIfNotNull(rec, "id") - val rideHailManagerId = GenericCsvReader.getIfNotNull(rec, "rideHailManagerId") + val rideHailManagerIdStr = GenericCsvReader.getIfNotNull(rec, "rideHailManagerId") + val rideHailManagerId = + VehicleManager.createOrGetReservedFor(rideHailManagerIdStr, VehicleManager.TypeEnum.RideHail).managerId val vehicleType = GenericCsvReader.getIfNotNull(rec, "vehicleType") val initialLocationX = GenericCsvReader.getIfNotNull(rec, "initialLocationX").toDouble val initialLocationY = GenericCsvReader.getIfNotNull(rec, "initialLocationY").toDouble @@ -49,8 +51,7 @@ object RideHailFleetInitializer extends OutputDataDescriptor with LazyLogging { RideHailAgentInputData( id = id, - rideHailManagerId = - VehicleManager.createOrGetReservedFor(rideHailManagerId, VehicleManager.TypeEnum.RideHail).managerId, + rideHailManagerId = rideHailManagerId, vehicleType = vehicleType, initialLocationX = initialLocationX, initialLocationY = initialLocationY, @@ -321,7 +322,9 @@ object RideHailFleetInitializer extends OutputDataDescriptor with LazyLogging { beamVehicleId, powertrain, beamVehicleType, - vehicleManagerId = new AtomicReference(rideHailManagerId), + vehicleManagerId = new AtomicReference( + if (beamVehicleType.automationLevel < 5) VehicleManager.AnyManager.managerId else rideHailManagerId + ), randomSeed ) From 9461735ac6c129768a1edae9892746bdbc2bc545 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 2 Aug 2022 20:24:07 -0700 Subject: [PATCH 280/307] replan on the fly when no hh vehicles are available --- src/main/resources/beam-template.conf | 1 + .../agents/modalbehaviors/ChoosesMode.scala | 58 +++++++------------ .../events/resources/AccessRequest.scala | 6 +- .../scala/beam/sim/config/BeamConfig.scala | 4 ++ 4 files changed, 28 insertions(+), 41 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 600099cd137..58552977f3f 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -306,6 +306,7 @@ beam.agentsim.agents.vehicles.linkSocAcrossIterations = "boolean | false" beam.agentsim.agents.vehicles.meanRidehailVehicleStartingSOC = "double | 1.0" beam.agentsim.agents.vehicles.transitVehicleTypesByRouteFile = "" beam.agentsim.agents.vehicles.generateEmergencyHouseholdVehicleWhenPlansRequireIt = "boolean | false" +beam.agentsim.agents.vehicles.replanOnTheFlyWhenHouseholdVehiclesAreNotAvailable = "boolean | false" beam.agentsim.agents.vehicles.enroute.refuelRequiredThresholdOffsetInMeters = 0.0 # 0 miles beam.agentsim.agents.vehicles.enroute.noRefuelThresholdOffsetInMeters = 32186.9 # 20 miles beam.agentsim.agents.vehicles.enroute.noRefuelAtRemainingDistanceThresholdInMeters = 500 # 500 meters diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index 562b5b6d3fe..599ed6464c2 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -14,7 +14,8 @@ import beam.agentsim.agents.vehicles.EnergyEconomyAttributes.Powertrain import beam.agentsim.agents.vehicles.VehicleCategory.VehicleCategory import beam.agentsim.agents.vehicles.VehicleProtocol.StreetVehicle import beam.agentsim.agents.vehicles._ -import beam.agentsim.events.{ModeChoiceEvent, SpaceTime} +import beam.agentsim.events.resources.ReservationErrorCode +import beam.agentsim.events.{ModeChoiceEvent, ReplanningEvent, SpaceTime} import beam.agentsim.infrastructure.{ParkingInquiry, ParkingInquiryResponse, ZonalParkingManager} import beam.agentsim.scheduler.BeamAgentScheduler.{CompletionNotice, ScheduleTrigger} import beam.router.BeamRouter._ @@ -39,7 +40,6 @@ import java.util.concurrent.atomic.AtomicReference import scala.collection.JavaConverters import scala.concurrent.duration._ import scala.concurrent.{ExecutionContext, Future} -import scala.jdk.CollectionConverters.asJavaIterableConverter /** * BEAM @@ -131,33 +131,6 @@ trait ChoosesMode { def bodyVehiclePersonId: PersonIdWithActorRef = PersonIdWithActorRef(id, self) - def currentTourBeamVehicle: Option[BeamVehicle] = { - stateData match { - case data: ChoosesModeData => - data.personData.currentTourPersonalVehicle match { - case Some(personalVehicle) => - Option( - beamVehicles(personalVehicle) - .asInstanceOf[ActualVehicle] - .vehicle - ) - case _ => None - } - case data: BasePersonData => - data.currentTourPersonalVehicle match { - case Some(personalVehicle) => - Option( - beamVehicles(personalVehicle) - .asInstanceOf[ActualVehicle] - .vehicle - ) - case _ => None - } - case _ => - None - } - } - onTransition { case _ -> ChoosingMode => nextStateData match { // If I am already on a tour in a vehicle, only that vehicle is available to me @@ -451,6 +424,7 @@ trait ChoosesMode { var requestId: Option[Int] = None // Form and send requests + var makeCurrentTourModeNone = false // to replan when personal vehicles are not available correctedCurrentTourMode match { case None => if (hasRideHail) { @@ -527,7 +501,22 @@ trait ChoosesMode { case _ => vehicle } }) - makeRequestWith(withTransit = false, vehicles :+ bodyStreetVehicle) + if ( + beamScenario.beamConfig.beam.agentsim.agents.vehicles.replanOnTheFlyWhenHouseholdVehiclesAreNotAvailable && vehicles.isEmpty + ) { + eventsManager.processEvent( + new ReplanningEvent( + departTime, + Id.createPersonId(id), + getReplanningReasonFrom( + choosesModeData.personData, + ReservationErrorCode.HouseholdVehicleNotAvailable.entryName + ) + ) + ) + makeCurrentTourModeNone = true + makeRequestWith(withTransit = true, Vector(bodyStreetVehicle)) + } else makeRequestWith(withTransit = false, vehicles :+ bodyStreetVehicle) responsePlaceholders = makeResponsePlaceholders(withRouting = true) } case Some(mode @ (DRIVE_TRANSIT | BIKE_TRANSIT)) => @@ -586,7 +575,8 @@ trait ChoosesMode { logDebug(m.toString) } val newPersonData = choosesModeData.copy( - personData = choosesModeData.personData.copy(currentTourMode = correctedCurrentTourMode), + personData = choosesModeData.personData + .copy(currentTourMode = if (makeCurrentTourModeNone) None else correctedCurrentTourMode), availablePersonalStreetVehicles = availablePersonalStreetVehicles, allAvailableStreetVehicles = newlyAvailableBeamVehicles, routingResponse = responsePlaceholders.routingResponse, @@ -1003,10 +993,6 @@ trait ChoosesMode { leg.asDriver && leg.beamLeg.mode != BeamMode.WALK } - def isRideHailToTransitResponse(response: RoutingResponse): Boolean = { - response.itineraries.exists(_.vehiclesInTrip.contains(dummyRHVehicle.id)) - } - def shouldAttemptRideHail2Transit( driveTransitTrip: Option[EmbodiedBeamTrip], rideHail2TransitResult: Option[RideHailResponse] @@ -1733,8 +1719,6 @@ object ChoosesMode { ) } - case class LegWithPassengerVehicle(leg: EmbodiedBeamLeg, passengerVehicle: Id[BeamVehicle]) - case class CavTripLegsRequest(person: PersonIdWithActorRef, originActivity: Activity) case class CavTripLegsResponse(cavOpt: Option[BeamVehicle], legs: List[EmbodiedBeamLeg]) diff --git a/src/main/scala/beam/agentsim/events/resources/AccessRequest.scala b/src/main/scala/beam/agentsim/events/resources/AccessRequest.scala index 19dc412a69f..119d373f8de 100755 --- a/src/main/scala/beam/agentsim/events/resources/AccessRequest.scala +++ b/src/main/scala/beam/agentsim/events/resources/AccessRequest.scala @@ -72,10 +72,8 @@ case object ReservationErrorCode extends Enum[ReservationErrorCode] { case object ResourceCapacityExhausted extends ReservationErrorCode - case object ResourceFull extends ReservationErrorCode - - case object VehicleNotUnderControl extends ReservationErrorCode - case object MissedTransitPickup extends ReservationErrorCode + case object HouseholdVehicleNotAvailable extends ReservationErrorCode + } diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index f2f255f4ad3..552236f77b6 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -1631,6 +1631,7 @@ object BeamConfig { linkToGradePercentFilePath: java.lang.String, meanPrivateVehicleStartingSOC: scala.Double, meanRidehailVehicleStartingSOC: scala.Double, + replanOnTheFlyWhenHouseholdVehiclesAreNotAvailable: scala.Boolean, sharedFleets: scala.List[BeamConfig.Beam.Agentsim.Agents.Vehicles.SharedFleets$Elm], transitVehicleTypesByRouteFile: java.lang.String, vehicleAdjustmentMethod: java.lang.String, @@ -1943,6 +1944,9 @@ object BeamConfig { meanRidehailVehicleStartingSOC = if (c.hasPathOrNull("meanRidehailVehicleStartingSOC")) c.getDouble("meanRidehailVehicleStartingSOC") else 1.0, + replanOnTheFlyWhenHouseholdVehiclesAreNotAvailable = c.hasPathOrNull( + "replanOnTheFlyWhenHouseholdVehiclesAreNotAvailable" + ) && c.getBoolean("replanOnTheFlyWhenHouseholdVehiclesAreNotAvailable"), sharedFleets = $_LBeamConfig_Beam_Agentsim_Agents_Vehicles_SharedFleets$Elm(c.getList("sharedFleets")), transitVehicleTypesByRouteFile = if (c.hasPathOrNull("transitVehicleTypesByRouteFile")) c.getString("transitVehicleTypesByRouteFile") From 2f8ee8f6c6b5d115b754fd6a8da6f99b17081312 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Wed, 3 Aug 2022 08:14:37 -0700 Subject: [PATCH 281/307] fix tests --- src/test/scala/beam/router/skim/ActivitySimSkimmerTest.scala | 4 ++-- src/test/scala/scripts/BackgroundSkimsCreatorAppSpec.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/scala/beam/router/skim/ActivitySimSkimmerTest.scala b/src/test/scala/beam/router/skim/ActivitySimSkimmerTest.scala index f47c17c501d..b3f644c7aef 100644 --- a/src/test/scala/beam/router/skim/ActivitySimSkimmerTest.scala +++ b/src/test/scala/beam/router/skim/ActivitySimSkimmerTest.scala @@ -14,9 +14,9 @@ class ActivitySimSkimmerTest extends AnyFlatSpec with Matchers { pathType = ActivitySimPathType.WALK, originId = "origin-1", destinationId = "destination-1", - weightedGeneralizedTime = 1.0, + weightedTotalTime = 1.0, weightedTotalInVehicleTime = 2.0, - weightedGeneralizedCost = 3.0, + weightedTotalCost = 3.0, weightedDistance = 4.0, weightedWalkAccess = 5.0, weightedWalkAuxiliary = 6.0, diff --git a/src/test/scala/scripts/BackgroundSkimsCreatorAppSpec.scala b/src/test/scala/scripts/BackgroundSkimsCreatorAppSpec.scala index 4683c7356cc..bf74242a57d 100644 --- a/src/test/scala/scripts/BackgroundSkimsCreatorAppSpec.scala +++ b/src/test/scala/scripts/BackgroundSkimsCreatorAppSpec.scala @@ -56,7 +56,7 @@ class BackgroundSkimsCreatorAppSpec whenReady(BackgroundSkimsCreatorApp.runWithServices(beamServices, params)) { _ => val csv = GenericCsvReader.readAs[ExcerptData](outputPath.toString, toCsvSkimRow, _ => true)._1.toVector csv.size shouldBe 15 - csv.count(_.weightedGeneralizedTime > 10) shouldBe 10 + csv.count(_.weightedTotalTime > 10) shouldBe 10 } } @@ -64,7 +64,7 @@ class BackgroundSkimsCreatorAppSpec whenReady(BackgroundSkimsCreatorApp.runWithServices(beamServices, params.copy(input = None))) { _ => val csv = GenericCsvReader.readAs[ExcerptData](outputPath.toString, toCsvSkimRow, _ => true)._1.toVector csv.size shouldBe 105 - csv.count(_.weightedGeneralizedTime > 10) shouldBe 65 + csv.count(_.weightedTotalTime > 10) shouldBe 65 } } } From 3ef77287e219a26612388680f914341944817ec9 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Fri, 5 Aug 2022 15:32:11 +0300 Subject: [PATCH 282/307] Update gradle.deploy.properties --- gradle.deploy.properties | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gradle.deploy.properties b/gradle.deploy.properties index 47660d12f59..d644cc5f8be 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -16,7 +16,9 @@ profiler_type=cpumem # Run Jupyter Notebook together with BEAM runJupyter = false -# maxRAM=740g +# budgetOverride=false +# forcedMaxRAM=700 + # storageSize (in GiB) = any number between 64 and 256 storageSize=128 From 56447c1a6572c33f9ff2ccf6d19012b43f62d585 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Fri, 5 Aug 2022 15:33:05 +0300 Subject: [PATCH 283/307] Update gradle.deploy.properties --- gradle.deploy.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.deploy.properties b/gradle.deploy.properties index d644cc5f8be..7560b5ad8f7 100644 --- a/gradle.deploy.properties +++ b/gradle.deploy.properties @@ -57,7 +57,7 @@ deployMode=config executeClass=beam.sim.RunBeam #executeArgs=['--config', 'production/application-sfbay/experimentsFall2018/fall18-calib-run1.conf'] beamBatch=false -shutdownWait=5 +shutdownWait=15 systemProp.org.gradle.internal.http.connectionTimeout=180000 systemProp.org.gradle.internal.http.socketTimeout=180000 From 62ccbf96f685c8746c2508679db1986f1658facf Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Fri, 5 Aug 2022 15:33:43 +0300 Subject: [PATCH 284/307] Update gradle.properties --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 66a9815f542..b731e0bb22c 100755 --- a/gradle.properties +++ b/gradle.properties @@ -16,4 +16,4 @@ defaultExperiments=test/input/beamville/example-calibration/experiment.yml defaultInstanceType=t2.small -org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=1g \ No newline at end of file +org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=1g From 6bf5a0062cb7891a850ac8417f7a2918e78ee425 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Fri, 5 Aug 2022 16:26:15 -0700 Subject: [PATCH 285/307] add new config, add buffer to routing request --- src/main/resources/beam-template.conf | 7 +++ src/main/scala/beam/router/r5/R5Wrapper.scala | 48 ++++++++++++++----- .../scala/beam/sim/config/BeamConfig.scala | 24 ++++++++++ 3 files changed, 66 insertions(+), 13 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 79bed4538b9..6a6fa9e486e 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -908,6 +908,13 @@ beam.routing { linkRadiusMeters = "double | 10000.0" transitAlternativeList = "OPTIMAL" suboptimalMinutes = "int | 0" + # HOW LONG DOES IT TAKE YOU TO PARK YOUR VEHICLE AT THE STATION + accessBufferTimeSeconds { + bike = "int | 60" + bike_rent = "int | 180" + walk = "int | 0" + car = "int | 300" + } } gh { useAlternativeRoutes = "boolean | false" diff --git a/src/main/scala/beam/router/r5/R5Wrapper.scala b/src/main/scala/beam/router/r5/R5Wrapper.scala index 6e21d349b73..0b83c3a7c7b 100644 --- a/src/main/scala/beam/router/r5/R5Wrapper.scala +++ b/src/main/scala/beam/router/r5/R5Wrapper.scala @@ -642,17 +642,29 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo val transitPaths = latency("getpath-transit-time", Metrics.VerboseLevel) { profileRequest.fromTime = request.departureTime - profileRequest.toTime = - request.departureTime + 61 // Important to allow 61 seconds for transit schedules to be considered! - val router = new McRaptorSuboptimalPathProfileRouter( - transportNetwork, - profileRequest, - accessStopsByMode.mapValues(_.stops).asJava, - egressStopsByMode.mapValues(_.stops).asJava, - departureTimeToDominatingList, - null - ) - Try(router.getPaths.asScala).getOrElse(Nil) // Catch IllegalStateException in R5.StatsCalculator + accessStopsByMode.flatMap { case (mode, stopVisitor) => + val modeSpecificBuffer = mode match { + case LegMode.WALK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.walk + case LegMode.BICYCLE => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike + case LegMode.BICYCLE_RENT => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike_rent + case LegMode.CAR_PARK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car + case LegMode.CAR => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car + case _ => 0 + } + profileRequest.toTime = request.departureTime + modeSpecificBuffer + 61 + // Important to allow 61 seconds for transit schedules to be considered! Along with any other buffers + val router = new McRaptorSuboptimalPathProfileRouter( + transportNetwork, + profileRequest, + Map(mode -> stopVisitor.stops).asJava, + egressStopsByMode.mapValues(_.stops).asJava, + departureTimeToDominatingList, + null + ) + Try(router.getPaths.asScala).getOrElse(Nil) + } + + // Catch IllegalStateException in R5.StatsCalculator } for (transitPath <- transitPaths) { @@ -686,15 +698,25 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo val embodiedBeamLegs = mutable.ArrayBuffer.empty[EmbodiedBeamLeg] val access = option.access.get(itinerary.connection.access) val vehicle = bestAccessVehiclesByR5Mode(access.mode) + val transitAccessBuffer = access.mode match { + case LegMode.WALK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.walk + case LegMode.BICYCLE => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike + case LegMode.BICYCLE_RENT => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike_rent + case LegMode.CAR_PARK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car + case LegMode.CAR => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car + case _ => 0 + } maybeWalkToVehicle(vehicle).foreach(walkLeg => { // Glue the walk to vehicle in front of the trip without a gap embodiedBeamLegs += walkLeg - .copy(beamLeg = walkLeg.beamLeg.updateStartTime(tripStartTime - walkLeg.beamLeg.duration)) + .copy(beamLeg = + walkLeg.beamLeg.updateStartTime(tripStartTime - walkLeg.beamLeg.duration - transitAccessBuffer) + ) }) embodiedBeamLegs += buildStreetBasedLegs( access, - tripStartTime, + tripStartTime - transitAccessBuffer, vehicle, unbecomeDriverOnCompletion = access.mode != LegMode.WALK || option.transit == null ) diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index aea74ab6f1e..2ddf71eabff 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -4122,6 +4122,7 @@ object BeamConfig { } case class R5( + accessBufferTimeSeconds: BeamConfig.Beam.Routing.R5.AccessBufferTimeSeconds, bikeLaneLinkIdsFilePath: java.lang.String, bikeLaneScaleFactor: scala.Double, departureWindow: scala.Double, @@ -4139,6 +4140,25 @@ object BeamConfig { object R5 { + case class AccessBufferTimeSeconds( + bike: scala.Int, + bike_rent: scala.Int, + car: scala.Int, + walk: scala.Int + ) + + object AccessBufferTimeSeconds { + + def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5.AccessBufferTimeSeconds = { + BeamConfig.Beam.Routing.R5.AccessBufferTimeSeconds( + bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 60, + bike_rent = if (c.hasPathOrNull("bike_rent")) c.getInt("bike_rent") else 180, + car = if (c.hasPathOrNull("car")) c.getInt("car") else 300, + walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 0 + ) + } + } + case class MNetBuilder( fromCRS: java.lang.String, toCRS: java.lang.String @@ -4169,6 +4189,10 @@ object BeamConfig { def apply(c: com.typesafe.config.Config): BeamConfig.Beam.Routing.R5 = { BeamConfig.Beam.Routing.R5( + accessBufferTimeSeconds = BeamConfig.Beam.Routing.R5.AccessBufferTimeSeconds( + if (c.hasPathOrNull("accessBufferTimeSeconds")) c.getConfig("accessBufferTimeSeconds") + else com.typesafe.config.ConfigFactory.parseString("accessBufferTimeSeconds{}") + ), bikeLaneLinkIdsFilePath = if (c.hasPathOrNull("bikeLaneLinkIdsFilePath")) c.getString("bikeLaneLinkIdsFilePath") else "", bikeLaneScaleFactor = From a9e33f1f8bfe24f9aae4962fd5981dc79558e777 Mon Sep 17 00:00:00 2001 From: GrigoryD Date: Sat, 6 Aug 2022 21:48:30 +0200 Subject: [PATCH 286/307] [issue-3567] improve completion status in runs spreadsheet --- .../python/beam_lambda/lambda_function.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/aws/src/main/python/beam_lambda/lambda_function.py b/aws/src/main/python/beam_lambda/lambda_function.py index 07f7e46d656..16441940e75 100755 --- a/aws/src/main/python/beam_lambda/lambda_function.py +++ b/aws/src/main/python/beam_lambda/lambda_function.py @@ -154,11 +154,27 @@ kill -9 $pid fi path: /home/ubuntu/beam_stuck_guard.sh + - content: | + #!/bin/bash + log_file="$(find /home/ubuntu/git/beam/output -maxdepth 2 -mindepth 2 -type d -print -quit)/beamLog.out" + if [[ ! -f $log_file ]]; then + echo "Unable to start" + exit 0; + fi + last_line=$(tail $log_file -n 1) + if [[ $last_line == *"Exiting BEAM"* ]]; then + echo "Run Completed" + else + echo "Run Failed" + fi + exit 0; + path: /home/ubuntu/check_simulation_result.sh runcmd: - sudo chmod +x /home/ubuntu/install-and-run-helics-scripts.sh - sudo chmod +x /home/ubuntu/write-cpu-ram-usage.sh - sudo chmod +x /home/ubuntu/beam_stuck_guard.sh + - sudo chmod +x /home/ubuntu/check_simulation_result.sh - cd /home/ubuntu - ./write-cpu-ram-usage.sh 20 > cpu_ram_usage.csv & - cd /home/ubuntu/git @@ -290,6 +306,8 @@ - then - s3glip="\\n S3 output url ${s3p#","}" - fi + - cd /home/ubuntu + - final_status=$(./check_simulation_result.sh) - bye_msg=$(printf "Run Completed \\n Run Name** $TITLED** \\n Instance ID %s \\n Instance type **%s** \\n Host name **%s** \\n Web browser ** http://%s:8000 ** \\n Region $REGION \\n Batch $UID \\n Branch **$BRANCH** \\n Commit $COMMIT %s \\n Shutdown in $SHUTDOWN_WAIT minutes" $(ec2metadata --instance-id) $(ec2metadata --instance-type) $(ec2metadata --public-hostname) $(ec2metadata --public-hostname) "$s3glip") - echo "$bye_msg" - stop_json=$(printf "{ @@ -297,7 +315,7 @@ \\"type\\":\\"beam\\", \\"sheet_id\\":\\"$SHEET_ID\\", \\"run\\":{ - \\"status\\":\\"Run Completed\\", + \\"status\\":\\"$final_status\\", \\"name\\":\\"$TITLED\\", \\"instance_id\\":\\"%s\\", \\"instance_type\\":\\"%s\\", From cd3785d480065ee49015185fd10e1b6c42f1e67a Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Mon, 8 Aug 2022 22:21:46 +0300 Subject: [PATCH 287/307] fix for a new method signature --- .../scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index b8c036597be..5b21a3a0eb7 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -1339,6 +1339,7 @@ trait ChoosesMode { possibleTrip, failedTrip = false, personData.currentActivityIndex, + currentActivity(personData), nextActivity(personData) ) case _ => From c28853641989bd349f9dd4b1b66d0e66403e41b1 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Mon, 8 Aug 2022 12:54:19 -0700 Subject: [PATCH 288/307] handle missing lastUsedStall (new error for emergency vehicles for some reason) --- .../beam/agentsim/agents/parking/ChoosesParking.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index b043b848de8..374b57eb503 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -178,7 +178,15 @@ object ChoosesParking { stall case None => // This can now happen if a vehicle was charging and released the stall already - currentBeamVehicle.lastUsedStall.get + currentBeamVehicle.lastUsedStall match { + case Some(stall) => stall + case None => + logger.warn( + s"Trying to release stall when vehicle doesn't have one. Vehicle data: ${currentBeamVehicle.toString}" + ) + ParkingStall.defaultStall(currentBeamVehicle.spaceTime.loc) + } + } val energyCharge: Double = energyChargedMaybe.getOrElse(0.0) val score = calculateScore(stallForLeavingParkingEvent.costInDollars, energyCharge) From ed373cc719a73e281ec7b933a65bffe6dd42977e Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Mon, 8 Aug 2022 13:04:30 -0700 Subject: [PATCH 289/307] include buffer in trip start time as well --- src/main/scala/beam/router/r5/R5Wrapper.scala | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/main/scala/beam/router/r5/R5Wrapper.scala b/src/main/scala/beam/router/r5/R5Wrapper.scala index 0b83c3a7c7b..8f093550734 100644 --- a/src/main/scala/beam/router/r5/R5Wrapper.scala +++ b/src/main/scala/beam/router/r5/R5Wrapper.scala @@ -687,17 +687,7 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo option.itinerary.asScala .map { itinerary => // Using itinerary start as access leg's startTime - val tripStartTime = dates - .toBaseMidnightSeconds( - itinerary.startTime, - transportNetwork.transitLayer.routes.size() == 0 - ) - .toInt - - var arrivalTime: Int = Int.MinValue - val embodiedBeamLegs = mutable.ArrayBuffer.empty[EmbodiedBeamLeg] val access = option.access.get(itinerary.connection.access) - val vehicle = bestAccessVehiclesByR5Mode(access.mode) val transitAccessBuffer = access.mode match { case LegMode.WALK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.walk case LegMode.BICYCLE => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike @@ -706,6 +696,17 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo case LegMode.CAR => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car case _ => 0 } + val tripStartTime = dates + .toBaseMidnightSeconds( + itinerary.startTime, + transportNetwork.transitLayer.routes.size() == 0 + ) + .toInt - transitAccessBuffer + + var arrivalTime: Int = Int.MinValue + val embodiedBeamLegs = mutable.ArrayBuffer.empty[EmbodiedBeamLeg] + val vehicle = bestAccessVehiclesByR5Mode(access.mode) + maybeWalkToVehicle(vehicle).foreach(walkLeg => { // Glue the walk to vehicle in front of the trip without a gap embodiedBeamLegs += walkLeg From 48945ab1a1260f5b69f1c46368a9beb77b0becd6 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 8 Aug 2022 16:49:57 -0700 Subject: [PATCH 290/307] addressing @nikolayilyin comments --- src/main/R/gemini/gemini-processing.R | 47 +++++++++++++------ src/main/python/gemini/events_processing.py | 4 +- src/main/python/gemini/helper.py | 7 --- src/main/resources/beam-template.conf | 2 +- .../household/HouseholdFleetManager.scala | 5 +- .../agents/modalbehaviors/ChoosesMode.scala | 10 ++-- .../agents/parking/ChoosesParking.scala | 1 - .../infrastructure/ScaleUpCharging.scala | 17 ------- 8 files changed, 42 insertions(+), 51 deletions(-) delete mode 100644 src/main/python/gemini/helper.py diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index 8de2f76a164..a7e29707cbf 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -11,6 +11,25 @@ library(ggmap) library(sf) library(stringr) +##### +chargingBehaviorFunc <- function(DT) { + rseSum <- DT[,.(fuel=sum(fuel)),by=.(parkingType,chargingPointType)] + rseSum[,fuelShare:=fuel/sum(fuel)] + #dcfc <- rseSum[chargingPointType=="publicfc(150.0|DC)"]$fuelShare + rseSum[chargingPointType=="publicxfc(250.0|DC)"]$fuelShare + #publicL2 <- rseSum[chargingPointType=="publiclevel2(7.2|AC)"]$fuelShare + #work <- rseSum[chargingPointType=="worklevel2(7.2|AC)"]$fuelShare + #home <- rseSum[chargingPointType=="homelevel1(1.8|AC)"]$fuelShare + rseSum[chargingPointType=="homelevel2(7.2|AC)"]$fuelShare + print("************************") + print(rseSum) + print(paste("Total All (GWH): ", sum(rseSum$fuel)/3.6e+12, sep="")) + totRidehailGWH <- sum(DT[startsWith(vehicle, "rideHail"),]$fuel)/3.6e+12 + print(paste("Total Ridehail (GWH): ", totRidehailGWH, sep="")) + #print(pp("DCFC: ",dcfc," - ",)) + #print(pp("PublicL2: ",publicL2)) + #print(pp("Work: ",work)) + #print(pp("Home: ",home)) +} + workDir <- normalizePath("~/Data/GEMINI") activitySimDir <- normalizePath("~/Data/ACTIVITYSIM") @@ -448,21 +467,7 @@ write.csv( na="") -##### -chargingBehaviorFunc <- function(DT) { - rseSum <- DT[,.(fuel=sum(fuel)),by=.(parkingType,chargingPointType)] - rseSum[,fuelShare:=fuel/sum(fuel)] - #dcfc <- rseSum[chargingPointType=="publicfc(150.0|DC)"]$fuelShare + rseSum[chargingPointType=="publicxfc(250.0|DC)"]$fuelShare - #publicL2 <- rseSum[chargingPointType=="publiclevel2(7.2|AC)"]$fuelShare - #work <- rseSum[chargingPointType=="worklevel2(7.2|AC)"]$fuelShare - #home <- rseSum[chargingPointType=="homelevel1(1.8|AC)"]$fuelShare + rseSum[chargingPointType=="homelevel2(7.2|AC)"]$fuelShare - print("************************") - print(rseSum) - #print(pp("DCFC: ",dcfc," - ",)) - #print(pp("PublicL2: ",publicL2)) - #print(pp("Work: ",work)) - #print(pp("Home: ",home)) -} + events100_SC3 <- "/2021Aug22-Oakland/BATCH3/events/filtered.0.events.SC3.csv.gz" rse100_SC3_a <- readCsv(pp(workDir, events100_SC3)) @@ -1036,3 +1041,15 @@ lognormal <- function(m, v, sample_size) { } +#################### + +events1 <- readCsv(pp(workDir, "/test/events/filtered.0.events.d1.csv.gz")) +events2 <- readCsv(pp(workDir, "/test/events/filtered.0.events.d2.csv.gz")) + +ref1 <- events1[type=="RefuelSessionEvent"] +ref2 <- events2[type=="RefuelSessionEvent"] + +chargingBehaviorFunc(ref1) +chargingBehaviorFunc(ref2) + +events1[startsWith(vehicle,"rideHail"),.N,by=.(vehicleType)] diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index f525f41471a..1ce71bbc030 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -1,8 +1,8 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022-07-05/' -filename = '0.events.7Advanced.csv.gz' +work_directory = '~/Data/GEMINI/test/' +filename = '0.events.d3.csv.gz' # filename = '0.events.40p.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) diff --git a/src/main/python/gemini/helper.py b/src/main/python/gemini/helper.py deleted file mode 100644 index 78ee1545f72..00000000000 --- a/src/main/python/gemini/helper.py +++ /dev/null @@ -1,7 +0,0 @@ -import pandas as pd - -def read_file(filename): - compression = None - if filename.endswith(".gz"): - compression = 'gzip' - return pd.read_csv(filename, sep=",", index_col=None, header=0, compression=compression) \ No newline at end of file diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index 58552977f3f..7b777412355 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -356,7 +356,7 @@ beam.agentsim.agents.vehicles.sharedFleets = [ beam.agentsim.chargingNetworkManager { timeStepInSeconds = "int | 300" maxChargingSessionsInSeconds = "int | 43200" - overnightChargingEnabled = "boolean | false" + overnightChargingEnabled = "boolean | false" # Overnight charging is still a work in progress and might produce unexpected results chargingPointCountScalingFactor = "double | 1.0" chargingPointCostScalingFactor = "double | 1.0" chargingPointFilePath = "" diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala index 6958249a041..c795b42f4ca 100644 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdFleetManager.scala @@ -103,9 +103,8 @@ class HouseholdFleetManager( triggerId = triggerId, searchMode = ParkingSearchMode.Init ) - // TODO Overnight charging is still a work in progress and might produce unexpected results if (vehicle.isEV && beamConfig.beam.agentsim.chargingNetworkManager.overnightChargingEnabled) { - logger.info(s"Overnight charging vehicle $vehicle with state of charge ${vehicle.getStateOfCharge}") + logger.debug(s"Overnight charging vehicle $vehicle with state of charge ${vehicle.getStateOfCharge}") (chargingNetworkManager ? inquiry).mapTo[ParkingInquiryResponse].map(r => (id, r)) } else { logger.debug(s"Overnight parking vehicle $vehicle") @@ -191,7 +190,7 @@ class HouseholdFleetManager( context.stop(self) case Success => case x => - logger.warn(s"No handler for $x") + logger.error(s"No handler for $x") } /** diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index 599ed6464c2..6ef16b920b3 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -424,7 +424,7 @@ trait ChoosesMode { var requestId: Option[Int] = None // Form and send requests - var makeCurrentTourModeNone = false // to replan when personal vehicles are not available + var householdVehiclesWereNotAvailable = false // to replan when personal vehicles are not available correctedCurrentTourMode match { case None => if (hasRideHail) { @@ -514,9 +514,9 @@ trait ChoosesMode { ) ) ) - makeCurrentTourModeNone = true - makeRequestWith(withTransit = true, Vector(bodyStreetVehicle)) - } else makeRequestWith(withTransit = false, vehicles :+ bodyStreetVehicle) + householdVehiclesWereNotAvailable = true + } + makeRequestWith(withTransit = householdVehiclesWereNotAvailable, vehicles :+ bodyStreetVehicle) responsePlaceholders = makeResponsePlaceholders(withRouting = true) } case Some(mode @ (DRIVE_TRANSIT | BIKE_TRANSIT)) => @@ -576,7 +576,7 @@ trait ChoosesMode { } val newPersonData = choosesModeData.copy( personData = choosesModeData.personData - .copy(currentTourMode = if (makeCurrentTourModeNone) None else correctedCurrentTourMode), + .copy(currentTourMode = if (householdVehiclesWereNotAvailable) None else correctedCurrentTourMode), availablePersonalStreetVehicles = availablePersonalStreetVehicles, allAvailableStreetVehicles = newlyAvailableBeamVehicles, routingResponse = responsePlaceholders.routingResponse, diff --git a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala index d53d1e680c0..ec58a0cacde 100755 --- a/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala +++ b/src/main/scala/beam/agentsim/agents/parking/ChoosesParking.scala @@ -265,7 +265,6 @@ trait ChoosesParking extends { remainingTourDistance + conf.refuelRequiredThresholdInMeters, conf.noRefuelThresholdInMeters ) - true } } diff --git a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala index c427f08dc40..3e86907b89a 100644 --- a/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala +++ b/src/main/scala/beam/agentsim/infrastructure/ScaleUpCharging.scala @@ -50,23 +50,6 @@ trait ScaleUpCharging extends { } } -// lazy val nonSampledVehicle: Map[Id[BeamVehicle], BeamVehicle] = { -// val vehicleTypes: Map[Id[BeamVehicleType], BeamVehicleType] = readBeamVehicleTypeFile(beamConfig) -// var (allVehicles, _) = readVehiclesFile( -// beamConfig.beam.agentsim.agents.vehicles.vehiclesFilePath, -// vehicleTypes, -// beamConfig.matsim.modules.global.randomSeed, -// VehicleManager.AnyManager.managerId -// ) -// getBeamServices.matsimServices.getScenario.getHouseholds.getHouseholds -// .values() -// .asScala -// .flatMap(_.getVehicleIds.asScala.map { vehicleId => -// allVehicles = allVehicles - BeamVehicle.createId(vehicleId) -// }) -// allVehicles -// } - private lazy val defaultScaleUpFactor: Double = if (!cnmConfig.scaleUp.enabled) 1.0 else cnmConfig.scaleUp.expansionFactor_wherever_activity From fb03d4dfbbbe4f832cd08e7bcfa19357348da76c Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Mon, 8 Aug 2022 18:23:21 -0700 Subject: [PATCH 291/307] testing a fix --- src/main/python/gemini/events_processing.py | 2 +- .../ridehail/DefaultRideHailDepotParkingManager.scala | 7 +------ .../beam/agentsim/infrastructure/InfrastructureUtils.scala | 3 +-- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 1ce71bbc030..9b17066b4c5 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -2,7 +2,7 @@ import os work_directory = '~/Data/GEMINI/test/' -filename = '0.events.d3.csv.gz' +filename = '0.events.d2.csv.gz' # filename = '0.events.40p.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) diff --git a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala index f4fedc69b0f..348d56be5a4 100644 --- a/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/DefaultRideHailDepotParkingManager.scala @@ -40,7 +40,6 @@ import scala.collection.mutable.ListBuffer * beam.agentsim.agents.rideHail.charging.vehicleChargingManager.defaultVehicleChargingManager.multinomialLogit.params.insufficientRangeMultiplier = "double | -60.0" // 60 minute penalty if out of range */ class DefaultRideHailDepotParkingManager( - vehicleManagerId: Id[VehicleManager], parkingZones: Map[Id[ParkingZoneId], ParkingZone], outputDirectory: OutputDirectoryHierarchy, rideHailConfig: BeamConfig.Beam.Agentsim.Agents.RideHail @@ -121,7 +120,7 @@ class DefaultRideHailDepotParkingManager( ParkingInquiry.init( SpaceTime(locationUtm, tick), "wherever", - VehicleManager.getReservedFor(vehicleManagerId).get, + VehicleManager.getReservedFor(beamVehicle.vehicleManagerId.get).get, Some(beamVehicle), valueOfTime = rideHailConfig.cav.valueOfTime, triggerId = 0 @@ -252,7 +251,6 @@ object DefaultRideHailDepotParkingManager { val outputRidehailParkingFileName = "ridehailParking.csv" def apply( - vehicleManagerId: Id[VehicleManager], parkingZones: Map[Id[ParkingZoneId], ParkingZone], geoQuadTree: QuadTree[TAZ], idToGeoMapping: scala.collection.Map[Id[TAZ], TAZ], @@ -260,7 +258,6 @@ object DefaultRideHailDepotParkingManager { beamServices: BeamServices ): RideHailDepotParkingManager = { new DefaultRideHailDepotParkingManager( - vehicleManagerId, parkingZones, beamServices.matsimServices.getControlerIO, beamServices.beamConfig.beam.agentsim.agents.rideHail @@ -288,13 +285,11 @@ object DefaultRideHailDepotParkingManager { } def init( - vehicleManagerId: Id[VehicleManager], parkingZones: Map[Id[ParkingZoneId], ParkingZone], boundingBox: Envelope, beamServices: BeamServices ): RideHailDepotParkingManager = { DefaultRideHailDepotParkingManager( - vehicleManagerId, parkingZones, beamServices.beamScenario.tazTreeMap.tazQuadTree, beamServices.beamScenario.tazTreeMap.idToTAZMapping, diff --git a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala index c1cafeb8743..ff3a6920a60 100644 --- a/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala +++ b/src/main/scala/beam/agentsim/infrastructure/InfrastructureUtils.scala @@ -97,9 +97,8 @@ object InfrastructureUtils extends LazyLogging { envelopeInUTM, beamServices ), - rideHailChargingStalls.map { case (managerId, chargingZones) => + rideHailChargingStalls.map { case (_, chargingZones) => DefaultRideHailDepotParkingManager.init( - managerId, chargingZones, envelopeInUTM, beamServices From 606165143ae715b0d76a0e831f9166afa8c7e8b1 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Tue, 9 Aug 2022 13:31:06 +0300 Subject: [PATCH 292/307] a fix for a new constructor signature --- .../beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala | 2 +- .../infrastructure/parking/ParkingStallSamplingTestSpec.scala | 3 ++- .../agentsim/infrastructure/power/PowerControllerSpec.scala | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala index d62ccaefff3..d33ab1d030d 100644 --- a/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/ZonalParkingManagerSpec.scala @@ -576,7 +576,7 @@ object ZonalParkingManagerSpec { val quadTree = coords.foldLeft(new QuadTree[TAZ](xMin, yMin, xMax, yMax)) { (tree, tazData) => val (coord, area) = tazData val tazId = Id.create(startAtId + tree.size, classOf[TAZ]) - val taz = new TAZ(tazId, coord, area) + val taz = new TAZ(tazId, coord, area, None) tree.put(coord.getX, coord.getY, taz) tree } diff --git a/src/test/scala/beam/agentsim/infrastructure/parking/ParkingStallSamplingTestSpec.scala b/src/test/scala/beam/agentsim/infrastructure/parking/ParkingStallSamplingTestSpec.scala index 6e4b47b6ab3..928ad335a91 100644 --- a/src/test/scala/beam/agentsim/infrastructure/parking/ParkingStallSamplingTestSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/parking/ParkingStallSamplingTestSpec.scala @@ -138,7 +138,8 @@ object ParkingStallSamplingTestSpec { val taz: TAZ = new TAZ( Id.create("taz", classOf[TAZ]), new Coord(tazX, tazY), - tazArea + tazArea, + None ) val agent: Coord = new Coord(100.0, 100.0) diff --git a/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala b/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala index 0d3a4735a80..689d5c85bfb 100644 --- a/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala +++ b/src/test/scala/beam/agentsim/infrastructure/power/PowerControllerSpec.scala @@ -46,7 +46,7 @@ class PowerControllerSpec extends AnyWordSpecLike with Matchers with BeforeAndAf val beamConfig: BeamConfig = BeamConfig(config) val beamFederateMock: BeamFederate = mock(classOf[BeamFederate]) - val tazFromBeamville: TAZ = new TAZ(Id.create("1", classOf[TAZ]), new Coord(167141.3, 1112.351), 4840000) + val tazFromBeamville: TAZ = new TAZ(Id.create("1", classOf[TAZ]), new Coord(167141.3, 1112.351), 4840000, None) val dummyChargingZone: ParkingZone = ParkingZone.init( None, From 83551ee1a75cefcc1b27178d8de89c3ef3474c43 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 9 Aug 2022 11:57:49 -0700 Subject: [PATCH 293/307] bugfix -- only add buffer for transit trips --- src/main/scala/beam/router/r5/R5Wrapper.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/beam/router/r5/R5Wrapper.scala b/src/main/scala/beam/router/r5/R5Wrapper.scala index 8f093550734..ec50642d878 100644 --- a/src/main/scala/beam/router/r5/R5Wrapper.scala +++ b/src/main/scala/beam/router/r5/R5Wrapper.scala @@ -689,12 +689,12 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo // Using itinerary start as access leg's startTime val access = option.access.get(itinerary.connection.access) val transitAccessBuffer = access.mode match { - case LegMode.WALK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.walk - case LegMode.BICYCLE => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike - case LegMode.BICYCLE_RENT => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike_rent - case LegMode.CAR_PARK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car - case LegMode.CAR => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car - case _ => 0 + case _ if option.transit == null => 0 + case LegMode.WALK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.walk + case LegMode.BICYCLE => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike + case LegMode.BICYCLE_RENT => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike_rent + case LegMode.CAR_PARK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car + case LegMode.CAR => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car } val tripStartTime = dates .toBaseMidnightSeconds( From 1dcb97ef213079f7f1fd88f8b070ad4882b501af Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 9 Aug 2022 16:28:26 -0700 Subject: [PATCH 294/307] fix mistake and fix tests --- src/main/scala/beam/router/r5/R5Wrapper.scala | 6 ++---- .../router/skim/urbansim/BackgroundSkimsCreatorTest.scala | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/scala/beam/router/r5/R5Wrapper.scala b/src/main/scala/beam/router/r5/R5Wrapper.scala index ec50642d878..9c09f59d6d0 100644 --- a/src/main/scala/beam/router/r5/R5Wrapper.scala +++ b/src/main/scala/beam/router/r5/R5Wrapper.scala @@ -710,14 +710,12 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo maybeWalkToVehicle(vehicle).foreach(walkLeg => { // Glue the walk to vehicle in front of the trip without a gap embodiedBeamLegs += walkLeg - .copy(beamLeg = - walkLeg.beamLeg.updateStartTime(tripStartTime - walkLeg.beamLeg.duration - transitAccessBuffer) - ) + .copy(beamLeg = walkLeg.beamLeg.updateStartTime(tripStartTime - walkLeg.beamLeg.duration)) }) embodiedBeamLegs += buildStreetBasedLegs( access, - tripStartTime - transitAccessBuffer, + tripStartTime, vehicle, unbecomeDriverOnCompletion = access.mode != LegMode.WALK || option.transit == null ) diff --git a/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorTest.scala b/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorTest.scala index e981ab9d0d7..bd3ea9f3a09 100644 --- a/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorTest.scala +++ b/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorTest.scala @@ -32,6 +32,7 @@ class BackgroundSkimsCreatorTest extends AnyFlatSpec with Matchers with BeamHelp |beam.agentsim.taz.filePath = test/test-resources/taz-centers.12.csv |beam.urbansim.backgroundODSkimsCreator.maxTravelDistanceInMeters.walk = 1000 |beam.routing.r5.linkRadiusMeters = 10000 + |beam.routing.r5.accessBufferTimeSeconds.car = 120 """.stripMargin ) .withFallback(testConfig("test/input/sf-light/sf-light-1k.conf")) @@ -140,14 +141,14 @@ class BackgroundSkimsCreatorTest extends AnyFlatSpec with Matchers with BeamHelp pathTypeToCount } - pathTypeToSkimsCount(ActivitySimPathType.DRV_HVY_WLK) shouldBe 12 + pathTypeToSkimsCount(ActivitySimPathType.DRV_HVY_WLK) shouldBe 9 pathTypeToSkimsCount(ActivitySimPathType.WLK_LOC_WLK) shouldBe 86 pathTypeToSkimsCount(ActivitySimPathType.DRV_LRF_WLK) shouldBe 19 pathTypeToSkimsCount(ActivitySimPathType.WLK_LRF_WLK) shouldBe 28 pathTypeToSkimsCount(ActivitySimPathType.WLK_HVY_WLK) shouldBe 24 - pathTypeToSkimsCount(ActivitySimPathType.DRV_LOC_WLK) shouldBe 31 + pathTypeToSkimsCount(ActivitySimPathType.DRV_LOC_WLK) shouldBe 34 - skims.keys.size shouldBe (12 + 86 + 19 + 28 + 24 + 31) + skims.keys.size shouldBe (9 + 86 + 19 + 28 + 24 + 34) } "skims creator" should "generate all types of skims" in { From ca2439a07adf539d299d808044d9758ef4c38923 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 9 Aug 2022 16:33:49 -0700 Subject: [PATCH 295/307] fix tests --- .../router/skim/urbansim/BackgroundSkimsCreatorTest.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorTest.scala b/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorTest.scala index bd3ea9f3a09..7e7d384f342 100644 --- a/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorTest.scala +++ b/src/test/scala/beam/router/skim/urbansim/BackgroundSkimsCreatorTest.scala @@ -178,12 +178,12 @@ class BackgroundSkimsCreatorTest extends AnyFlatSpec with Matchers with BeamHelp pathTypeToCount } - pathTypeToSkimsCount(ActivitySimPathType.DRV_HVY_WLK) shouldBe 12 + pathTypeToSkimsCount(ActivitySimPathType.DRV_HVY_WLK) shouldBe 9 pathTypeToSkimsCount(ActivitySimPathType.WLK_LOC_WLK) shouldBe 86 pathTypeToSkimsCount(ActivitySimPathType.DRV_LRF_WLK) shouldBe 19 pathTypeToSkimsCount(ActivitySimPathType.WLK_LRF_WLK) shouldBe 28 pathTypeToSkimsCount(ActivitySimPathType.WLK_HVY_WLK) shouldBe 24 - pathTypeToSkimsCount(ActivitySimPathType.DRV_LOC_WLK) shouldBe 31 + pathTypeToSkimsCount(ActivitySimPathType.DRV_LOC_WLK) shouldBe 34 pathTypeToSkimsCount(ActivitySimPathType.SOV) shouldBe 144 pathTypeToSkimsCount(ActivitySimPathType.WALK) shouldBe 22 // because max walk trip length is 1000 meters @@ -200,6 +200,6 @@ class BackgroundSkimsCreatorTest extends AnyFlatSpec with Matchers with BeamHelp val walkTransitSkims = walkTransitKeys.map(key => key -> skims.get(key)).toMap walkTransitSkims.size shouldBe 86 - skims.keys.size shouldBe (12 + 86 + 19 + 28 + 24 + 31 + 144 + 22) + skims.keys.size shouldBe (9 + 86 + 19 + 28 + 24 + 34 + 144 + 22) } } From 94bc3d111a9b7c959163b746dc27ca2eb669c1b4 Mon Sep 17 00:00:00 2001 From: Zach Needell Date: Tue, 9 Aug 2022 16:51:40 -0700 Subject: [PATCH 296/307] fix tests --- src/main/resources/beam-template.conf | 1 + src/main/scala/beam/router/r5/R5Wrapper.scala | 14 ++++++++------ src/main/scala/beam/sim/config/BeamConfig.scala | 2 ++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/resources/beam-template.conf b/src/main/resources/beam-template.conf index eeae96f95e6..ee08f7446b8 100755 --- a/src/main/resources/beam-template.conf +++ b/src/main/resources/beam-template.conf @@ -915,6 +915,7 @@ beam.routing { bike_rent = "int | 180" walk = "int | 0" car = "int | 300" + ride_hail = "int | 0" } } gh { diff --git a/src/main/scala/beam/router/r5/R5Wrapper.scala b/src/main/scala/beam/router/r5/R5Wrapper.scala index 9c09f59d6d0..3e9459a9aee 100644 --- a/src/main/scala/beam/router/r5/R5Wrapper.scala +++ b/src/main/scala/beam/router/r5/R5Wrapper.scala @@ -689,12 +689,14 @@ class R5Wrapper(workerParams: R5Parameters, travelTime: TravelTime, travelTimeNo // Using itinerary start as access leg's startTime val access = option.access.get(itinerary.connection.access) val transitAccessBuffer = access.mode match { - case _ if option.transit == null => 0 - case LegMode.WALK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.walk - case LegMode.BICYCLE => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike - case LegMode.BICYCLE_RENT => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike_rent - case LegMode.CAR_PARK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car - case LegMode.CAR => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car + case _ if option.transit == null => 0 + case LegMode.WALK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.walk + case LegMode.BICYCLE => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike + case LegMode.BICYCLE_RENT => beamConfig.beam.routing.r5.accessBufferTimeSeconds.bike_rent + case LegMode.CAR_PARK => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car + case LegMode.CAR if mainRouteRideHailTransit => beamConfig.beam.routing.r5.accessBufferTimeSeconds.ride_hail + case LegMode.CAR => beamConfig.beam.routing.r5.accessBufferTimeSeconds.car + case _ => 0 } val tripStartTime = dates .toBaseMidnightSeconds( diff --git a/src/main/scala/beam/sim/config/BeamConfig.scala b/src/main/scala/beam/sim/config/BeamConfig.scala index 61bd1de7126..dcb2e846b3f 100644 --- a/src/main/scala/beam/sim/config/BeamConfig.scala +++ b/src/main/scala/beam/sim/config/BeamConfig.scala @@ -4146,6 +4146,7 @@ object BeamConfig { bike: scala.Int, bike_rent: scala.Int, car: scala.Int, + ride_hail: scala.Int, walk: scala.Int ) @@ -4156,6 +4157,7 @@ object BeamConfig { bike = if (c.hasPathOrNull("bike")) c.getInt("bike") else 60, bike_rent = if (c.hasPathOrNull("bike_rent")) c.getInt("bike_rent") else 180, car = if (c.hasPathOrNull("car")) c.getInt("car") else 300, + ride_hail = if (c.hasPathOrNull("ride_hail")) c.getInt("ride_hail") else 0, walk = if (c.hasPathOrNull("walk")) c.getInt("walk") else 0 ) } From a532f783747e1bd34c859b31c68e9c34c5b7185a Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Tue, 9 Aug 2022 22:45:31 -0700 Subject: [PATCH 297/307] adding isCav to vehicleTypes --- src/main/R/gemini/gemini-processing.R | 9 ++++++++- src/main/python/gemini/events_processing.py | 2 +- src/main/python/gemini/events_processing2.py | 4 ++-- .../agents/household/FastHouseholdCAVScheduling.scala | 2 +- .../agentsim/agents/household/HouseholdActor.scala | 4 ++-- .../agentsim/agents/modalbehaviors/ChoosesMode.scala | 1 + .../beam/agentsim/agents/ridehail/RideHailAgent.scala | 2 +- .../agentsim/agents/ridehail/RideHailManager.scala | 10 +++++----- .../agents/ridehail/RideHailManagerHelper.scala | 2 +- .../DemandFollowingRepositioningManager.scala | 2 +- .../beam/agentsim/agents/vehicles/BeamVehicle.scala | 2 +- .../agentsim/agents/vehicles/BeamVehicleType.scala | 6 +++--- .../scala/beam/analysis/RideHailFleetAnalysis.scala | 2 +- src/main/scala/beam/sim/BeamMobsim.scala | 2 +- src/main/scala/beam/sim/RideHailFleetInitializer.scala | 8 ++++---- test/input/beamville/beam-rh-ecav.conf | 10 ++++++++++ test/input/beamville/rideHailFleet_ecav.csv | 3 +++ test/input/beamville/vehicleTypes_RH_CAV.csv | 3 +++ 18 files changed, 49 insertions(+), 25 deletions(-) create mode 100644 test/input/beamville/beam-rh-ecav.conf create mode 100644 test/input/beamville/rideHailFleet_ecav.csv create mode 100644 test/input/beamville/vehicleTypes_RH_CAV.csv diff --git a/src/main/R/gemini/gemini-processing.R b/src/main/R/gemini/gemini-processing.R index a7e29707cbf..2b956afb02a 100644 --- a/src/main/R/gemini/gemini-processing.R +++ b/src/main/R/gemini/gemini-processing.R @@ -1045,11 +1045,18 @@ lognormal <- function(m, v, sample_size) { events1 <- readCsv(pp(workDir, "/test/events/filtered.0.events.d1.csv.gz")) events2 <- readCsv(pp(workDir, "/test/events/filtered.0.events.d2.csv.gz")) +events3 <- readCsv(pp(workDir, "/test/events/filtered.0.events.d3.csv.gz")) +pt1 <- readCsv(pp(workDir, "/test/events/ptmc.0.events.d1.csv.gz")) ref1 <- events1[type=="RefuelSessionEvent"] ref2 <- events2[type=="RefuelSessionEvent"] +ref3 <- events3[type=="RefuelSessionEvent"] chargingBehaviorFunc(ref1) chargingBehaviorFunc(ref2) +chargingBehaviorFunc(ref3) + + +events3[startsWith(vehicle,"rideHail"),.N,by=.(vehicleType)] + -events1[startsWith(vehicle,"rideHail"),.N,by=.(vehicleType)] diff --git a/src/main/python/gemini/events_processing.py b/src/main/python/gemini/events_processing.py index 9b17066b4c5..1ce71bbc030 100644 --- a/src/main/python/gemini/events_processing.py +++ b/src/main/python/gemini/events_processing.py @@ -2,7 +2,7 @@ import os work_directory = '~/Data/GEMINI/test/' -filename = '0.events.d2.csv.gz' +filename = '0.events.d3.csv.gz' # filename = '0.events.40p.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) diff --git a/src/main/python/gemini/events_processing2.py b/src/main/python/gemini/events_processing2.py index 2888494e12d..41e1338f49d 100644 --- a/src/main/python/gemini/events_processing2.py +++ b/src/main/python/gemini/events_processing2.py @@ -1,8 +1,8 @@ import pandas as pd import os -work_directory = '~/Data/GEMINI/2022-07-05/' -filename = '0.events.5bBase.csv.gz' +work_directory = '~/Data/GEMINI/test/' +filename = '0.events.d1.csv.gz' full_filename = os.path.expanduser(work_directory + "events-raw/" + filename) print("reading " + filename) compression = None diff --git a/src/main/scala/beam/agentsim/agents/household/FastHouseholdCAVScheduling.scala b/src/main/scala/beam/agentsim/agents/household/FastHouseholdCAVScheduling.scala index 24086f7e973..a577dc8ec14 100644 --- a/src/main/scala/beam/agentsim/agents/household/FastHouseholdCAVScheduling.scala +++ b/src/main/scala/beam/agentsim/agents/household/FastHouseholdCAVScheduling.scala @@ -373,7 +373,7 @@ object HouseholdTrips { val householdPlans = household.members .take(limitCavToXPersons) .map(person => BeamPlan(person.getSelectedPlan)) - val cavVehicles = householdVehicles.filter(_.beamVehicleType.automationLevel > 3) + val cavVehicles = householdVehicles.filter(_.beamVehicleType.isCav) val vehicleTypeForSkimmer = cavVehicles.head.beamVehicleType // FIXME I need _one_ vehicleType here, but there could be more.. val (requests, firstPickupOfTheDay, tripTravelTime, totTravelTime) = diff --git a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala index a73fd41b762..a8ad0686018 100755 --- a/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala +++ b/src/main/scala/beam/agentsim/agents/household/HouseholdActor.scala @@ -269,7 +269,7 @@ object HouseholdActor { } // If any of my vehicles are CAVs then go through scheduling process - var cavs = vehicles.values.filter(_.beamVehicleType.automationLevel > 3).toList + var cavs = vehicles.values.filter(_.beamVehicleType.isCav).toList if (cavs.nonEmpty) { val workingPersonsList = @@ -553,7 +553,7 @@ object HouseholdActor { // Pipe my cars through the parking manager // and complete initialization only when I got them all. Future - .sequence(vehicles.filter(_._2.beamVehicleType.automationLevel > 3).values.map { vehicle => + .sequence(vehicles.filter(_._2.beamVehicleType.isCav).values.map { vehicle => vehicle.setManager(Some(self)) for { ParkingInquiryResponse(stall, _, _) <- sendParkingOrChargingInquiry(vehicle, triggerId) diff --git a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala index 85e7ba9110b..e43055d635c 100755 --- a/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala +++ b/src/main/scala/beam/agentsim/agents/modalbehaviors/ChoosesMode.scala @@ -589,6 +589,7 @@ trait ChoosesMode { routingFinished = choosesModeData.routingFinished || responsePlaceholders.routingResponse == RoutingResponse.dummyRoutingResponse ) + householdVehiclesWereNotAvailable = false stay() using newPersonData /* * Receive and store data needed for choice. diff --git a/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala b/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala index a48b5b18584..8b06a2a3f8f 100755 --- a/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/RideHailAgent.scala @@ -1100,7 +1100,7 @@ class RideHailAgent( triggers ) stall.chargingPointType match { - case Some(_) if currentBeamVehicle.isBEV | currentBeamVehicle.isPHEV => + case Some(_) if currentBeamVehicle.isEV => log.debug(s"Refueling sending ChargingPlugRequest for ${vehicle.id} and $triggerId") chargingNetworkManager ! ChargingPlugRequest( tick, diff --git a/src/main/scala/beam/agentsim/agents/ridehail/RideHailManager.scala b/src/main/scala/beam/agentsim/agents/ridehail/RideHailManager.scala index eed2cb24485..18d27d556d8 100755 --- a/src/main/scala/beam/agentsim/agents/ridehail/RideHailManager.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/RideHailManager.scala @@ -872,16 +872,16 @@ class RideHailManager( tick: Int ): RideHailFleetStateEvent = { val cavNonEvs = rideHailAgentLocations.count(rideHail => - rideHail.vehicleType.primaryFuelType != Electricity && rideHail.vehicleType.automationLevel > 3 + rideHail.vehicleType.primaryFuelType != Electricity && rideHail.vehicleType.isCav ) val nonCavNonEvs = rideHailAgentLocations.count(rideHail => - rideHail.vehicleType.primaryFuelType != Electricity && rideHail.vehicleType.automationLevel <= 3 + rideHail.vehicleType.primaryFuelType != Electricity && !rideHail.vehicleType.isCav ) val cavEvs = rideHailAgentLocations.count(rideHail => - rideHail.vehicleType.primaryFuelType == Electricity && rideHail.vehicleType.automationLevel > 3 + rideHail.vehicleType.primaryFuelType == Electricity && rideHail.vehicleType.isCav ) val nonCavEvs = rideHailAgentLocations.count(rideHail => - rideHail.vehicleType.primaryFuelType == Electricity && rideHail.vehicleType.automationLevel <= 3 + rideHail.vehicleType.primaryFuelType == Electricity && !rideHail.vehicleType.isCav ) new RideHailFleetStateEvent(tick, cavEvs, nonCavEvs, cavNonEvs, nonCavNonEvs, vehicleType) } @@ -967,7 +967,7 @@ class RideHailManager( val distanceFare = costPerMile * trip.schedule.keys.map(_.travelPath.distanceInM / 1609).sum val timeFareAdjusted = beamScenario.vehicleTypes.get(rideHailVehicleTypeId) match { - case Some(vehicleType) if vehicleType.automationLevel > 3 => + case Some(vehicleType) if vehicleType.isCav => 0.0 case _ => timeFare diff --git a/src/main/scala/beam/agentsim/agents/ridehail/RideHailManagerHelper.scala b/src/main/scala/beam/agentsim/agents/ridehail/RideHailManagerHelper.scala index 532b9ada26d..2a22d727a95 100644 --- a/src/main/scala/beam/agentsim/agents/ridehail/RideHailManagerHelper.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/RideHailManagerHelper.scala @@ -349,7 +349,7 @@ class RideHailManagerHelper(rideHailManager: RideHailManager, boundingBox: Envel collection.mutable.HashMap( (idleRideHailVehicles.toMap ++ inServiceRideHailVehicles .filter(_._2.currentPassengerSchedule.exists(_.numUniquePassengers == 0)) - .toMap ++ outOfServiceRideHailVehicles.filter(_._2.vehicleType.automationLevel >= 4).toMap) + .toMap ++ outOfServiceRideHailVehicles.filter(_._2.vehicleType.isCav).toMap) .filterNot(elem => rideHailManager.doNotUseInAllocation.contains(elem._1)) .toSeq: _* ) diff --git a/src/main/scala/beam/agentsim/agents/ridehail/repositioningmanager/DemandFollowingRepositioningManager.scala b/src/main/scala/beam/agentsim/agents/ridehail/repositioningmanager/DemandFollowingRepositioningManager.scala index a93b82f08b7..65be20a630f 100644 --- a/src/main/scala/beam/agentsim/agents/ridehail/repositioningmanager/DemandFollowingRepositioningManager.scala +++ b/src/main/scala/beam/agentsim/agents/ridehail/repositioningmanager/DemandFollowingRepositioningManager.scala @@ -138,7 +138,7 @@ class DemandFollowingRepositioningManager(val beamServices: BeamServices, val ri private def shouldReposition(tick: Int, vehicle: RideHailAgentLocation): Boolean = { val currentTimeBin = getTimeBin(tick) val weight = timeBinToActivitiesWeight.getOrElse(currentTimeBin, 0.0) - val scaled = weight * (if (vehicle.vehicleType.automationLevel >= 4) { + val scaled = weight * (if (vehicle.vehicleType.isCav) { sensitivityOfRepositioningToDemandForCAVs } else { sensitivityOfRepositioningToDemand diff --git a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala index 5a74bd53abd..a35186cce44 100755 --- a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala +++ b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicle.scala @@ -397,7 +397,7 @@ class BeamVehicle( def isSharedVehicle: Boolean = beamVehicleType.id.toString.startsWith("sharedVehicle") - def isCAV: Boolean = beamVehicleType.automationLevel >= 4 + def isCAV: Boolean = beamVehicleType.isCav def isBEV: Boolean = beamVehicleType.primaryFuelType == Electricity && beamVehicleType.secondaryFuelType.isEmpty diff --git a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicleType.scala b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicleType.scala index 74e7496dd0e..46fd0d91d07 100755 --- a/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicleType.scala +++ b/src/main/scala/beam/agentsim/agents/vehicles/BeamVehicleType.scala @@ -33,9 +33,9 @@ case class BeamVehicleType( ) { def isSharedVehicle: Boolean = id.toString.startsWith("sharedVehicle") - def isCaccEnabled: Boolean = { - automationLevel >= 3 - } + def isCaccEnabled: Boolean = automationLevel >= 3 + + def isCav: Boolean = automationLevel >= 4 def getTotalRange: Double = { val primaryRange = primaryFuelCapacityInJoule / primaryFuelConsumptionInJoulePerMeter diff --git a/src/main/scala/beam/analysis/RideHailFleetAnalysis.scala b/src/main/scala/beam/analysis/RideHailFleetAnalysis.scala index c09a625bf89..722c1901352 100644 --- a/src/main/scala/beam/analysis/RideHailFleetAnalysis.scala +++ b/src/main/scala/beam/analysis/RideHailFleetAnalysis.scala @@ -101,7 +101,7 @@ class RideHailFleetAnalysisInternal( case pathTraversalEvent: PathTraversalEvent => if (pathTraversalEvent.mode == BeamMode.CAR) { val vehicleTypeId = Id.create(pathTraversalEvent.vehicleType, classOf[BeamVehicleType]) - val isCAV = vehicleTypes(vehicleTypeId).automationLevel > 3 + val isCAV = vehicleTypes(vehicleTypeId).isCav val vehicle = pathTraversalEvent.vehicleId.toString val rideHail = vehicle.contains("rideHail") val ev = pathTraversalEvent.primaryFuelType == "Electricity" diff --git a/src/main/scala/beam/sim/BeamMobsim.scala b/src/main/scala/beam/sim/BeamMobsim.scala index 9bf442e6af5..e7666c90a7a 100755 --- a/src/main/scala/beam/sim/BeamMobsim.scala +++ b/src/main/scala/beam/sim/BeamMobsim.scala @@ -204,7 +204,7 @@ class BeamMobsim @Inject() ( case VehicleCategory.Bike => BeamMode.BIKE }.toList - val cavs = vehicles.filter(_.beamVehicleType.automationLevel > 3).toList + val cavs = vehicles.filter(_.beamVehicleType.isCav).toList val cavModeAvailable: List[BeamMode] = if (cavs.nonEmpty) { diff --git a/src/main/scala/beam/sim/RideHailFleetInitializer.scala b/src/main/scala/beam/sim/RideHailFleetInitializer.scala index 6dab803a045..c9c39b2c442 100644 --- a/src/main/scala/beam/sim/RideHailFleetInitializer.scala +++ b/src/main/scala/beam/sim/RideHailFleetInitializer.scala @@ -318,13 +318,13 @@ object RideHailFleetInitializer extends OutputDataDescriptor with LazyLogging { val powertrain = new Powertrain(beamVehicleType.primaryFuelConsumptionInJoulePerMeter) + val managerIdDependsOnWhetherVehicleIsCav = + if (beamVehicleType.isCav) rideHailManagerId else VehicleManager.AnyManager.managerId val beamVehicle = new BeamVehicle( beamVehicleId, powertrain, beamVehicleType, - vehicleManagerId = new AtomicReference( - if (beamVehicleType.automationLevel < 5) VehicleManager.AnyManager.managerId else rideHailManagerId - ), + vehicleManagerId = new AtomicReference(managerIdDependsOnWhetherVehicleIsCav), randomSeed ) @@ -618,7 +618,7 @@ class ProceduralRideHailFleetInitializer( val meanSoc = beamServices.beamConfig.beam.agentsim.agents.vehicles.meanRidehailVehicleStartingSOC val initialStateOfCharge = BeamVehicle.randomSocFromUniformDistribution(rand, vehicleType, meanSoc) - val (shiftsOpt, shiftEquivalentNumberOfDrivers) = if (vehicleType.automationLevel >= 4) { + val (shiftsOpt, shiftEquivalentNumberOfDrivers) = if (vehicleType.isCav) { (None, 1.0) } else { val shiftDuration = diff --git a/test/input/beamville/beam-rh-ecav.conf b/test/input/beamville/beam-rh-ecav.conf new file mode 100644 index 00000000000..b08bebe6175 --- /dev/null +++ b/test/input/beamville/beam-rh-ecav.conf @@ -0,0 +1,10 @@ +include "beam.conf" + +beam.agentsim.simulationName = "rh-ecav" + +beam.agentsim.firstIteration = 0 +beam.agentsim.lastIteration = 0 + +beam.agentsim.agents.vehicles.vehicleTypesFilePath = ${beam.inputDirectory}"/vehicleTypes_RH_CAV.csv" +beam.agentsim.agents.rideHail.initialization.filePath=${beam.inputDirectory}"/rideHailFleet_ecav.csv" +beam.agentsim.agents.vehicles.meanRidehailVehicleStartingSOC = 0.0 diff --git a/test/input/beamville/rideHailFleet_ecav.csv b/test/input/beamville/rideHailFleet_ecav.csv new file mode 100644 index 00000000000..806194e42a2 --- /dev/null +++ b/test/input/beamville/rideHailFleet_ecav.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4e725a7a616419ed9f451c167011e4bb4437883e77a21bd1ac554ceb0d306983 +size 1210 diff --git a/test/input/beamville/vehicleTypes_RH_CAV.csv b/test/input/beamville/vehicleTypes_RH_CAV.csv new file mode 100644 index 00000000000..aa44329be74 --- /dev/null +++ b/test/input/beamville/vehicleTypes_RH_CAV.csv @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:baceb7ecbb064c5006d05af331b5a3493a9ee82f42be39ca625ff92981241ddf +size 2027 From 761c3506ae1950d2ad083bdb5d3d8c7787e5f9c5 Mon Sep 17 00:00:00 2001 From: Haitam Laarabi <10712736+htmlrb@users.noreply.github.com> Date: Wed, 10 Aug 2022 00:12:05 -0700 Subject: [PATCH 298/307] fix test --- src/test/scala/beam/integration/EnrouteChargingSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/scala/beam/integration/EnrouteChargingSpec.scala b/src/test/scala/beam/integration/EnrouteChargingSpec.scala index d836ed474a7..565a9c39b1d 100644 --- a/src/test/scala/beam/integration/EnrouteChargingSpec.scala +++ b/src/test/scala/beam/integration/EnrouteChargingSpec.scala @@ -106,7 +106,7 @@ class EnrouteChargingSpec extends AnyWordSpecLike with Matchers with BeamHelper val enrouteConfig: Config = ConfigFactory .parseString( s""" - |beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC = 0.5 + |beam.agentsim.agents.vehicles.meanPrivateVehicleStartingSOC = 0.1 """.stripMargin ) .withFallback(defaultConfig) From d61429ba687175b746d90e0f45c2ec4381d90bc6 Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Sat, 13 Aug 2022 14:41:37 +0300 Subject: [PATCH 299/307] in case logger is not initialized yet --- src/main/scala/beam/sim/RunBeam.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/beam/sim/RunBeam.scala b/src/main/scala/beam/sim/RunBeam.scala index 4d23b05d3ea..8a2ff646523 100755 --- a/src/main/scala/beam/sim/RunBeam.scala +++ b/src/main/scala/beam/sim/RunBeam.scala @@ -31,6 +31,7 @@ object RunBeam extends BeamHelper { } catch { case e: Exception => val threadDumpFileName = "thread_dump_from_RunBeam.txt.gz" + println(s"Exception occurred: ${e.toString}") logger.error(s"Exception occurred: {}", e.getMessage) FileUtils.writeToFile(threadDumpFileName, DebugLib.currentThreadsDump().asScala.iterator) logger.info("Thread dump has been saved to the file {}", threadDumpFileName) From 952824fcef29fafcc5365553bb680bb9d658b8b1 Mon Sep 17 00:00:00 2001 From: Alvin Lee Jin Wen Date: Tue, 16 Aug 2022 08:50:20 +0800 Subject: [PATCH 300/307] update config template file path in docs --- docs/developers.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/developers.rst b/docs/developers.rst index 4bf3521dda3..89c02a6bcfa 100755 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -36,7 +36,7 @@ We use `typesafe config `_ for our config Then you can make a copy of the config template under:: - src/main/resources/config-template.conf + src/main/resources/beam-template.conf and start customizing the configurations to your use case. From 43d91dbf1b31d83f69444b2885080f134b5ae3ad Mon Sep 17 00:00:00 2001 From: Nikolay Ilyin Date: Sat, 13 Aug 2022 14:41:37 +0300 Subject: [PATCH 301/307] in case logger is not initialized yet --- src/main/scala/beam/sim/RunBeam.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/beam/sim/RunBeam.scala b/src/main/scala/beam/sim/RunBeam.scala index 4d23b05d3ea..8a2ff646523 100755 --- a/src/main/scala/beam/sim/RunBeam.scala +++ b/src/main/scala/beam/sim/RunBeam.scala @@ -31,6 +31,7 @@ object RunBeam extends BeamHelper { } catch { case e: Exception => val threadDumpFileName = "thread_dump_from_RunBeam.txt.gz" + println(s"Exception occurred: ${e.toString}") logger.error(s"Exception occurred: {}", e.getMessage) FileUtils.writeToFile(threadDumpFileName, DebugLib.currentThreadsDump().asScala.iterator) logger.info("Thread dump has been saved to the file {}", threadDumpFileName) From 6736b08717057eeb6bc2b404ed45f6e33b3b49c0 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Wed, 17 Aug 2022 19:18:36 +0600 Subject: [PATCH 302/307] Add parameters for gradle task to docs --- docs/developers.rst | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/docs/developers.rst b/docs/developers.rst index 89c02a6bcfa..09f746ae3f7 100755 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -205,6 +205,7 @@ The command will start an ec2 instance based on the provided configurations and * **shutdownWait**: As simulation ends, ec2 instance would automatically terminate. In case you want to use the instance, please specify the wait in minutes, default wait is 30 min. * **shutdownBehaviour**: to specify shutdown behaviour after and of simulation. May be `stop` or `terminate`, default is `terminate`. * **runJupyter**: Should it launch Jupyter Notebook along with a simulation, default is `false`. +* **budgetOverride**: Set to `true` to override budget limitations, see `Documentation of AWS budget management` section in `DevOps guide `_, default is `false` There is a default file to specify parameters for task: gradle.deploy.properties_ and it is advised to use it (or custom) file to specify all default values for `deploy` task and not use gradle.properties_ file because latter used as a source of default values for all gradle tasks. @@ -271,10 +272,10 @@ This command will start PILATES simulation on ec2 instance with specified parame * **maxRAM**: to specify MAXRAM environment variable for simulation. * **shutdownWait**: to specify shutdown wait after end of simulation, default is `15`. * **shutdownBehaviour**: to specify shutdown behaviour after and of simulation. May be `stop` or `terminate`, default is `terminate`. -* **storageSize**: to specfy storage size of instance. May be from `64` to `256`. +* **storageSize**: to specify storage size of instance. May be from `64` to `256`. * **region**: to specify region to deploy ec2 instance. May be different from s3 bucket instance. * **dataRegion**: to specify region of s3 buckets. All operations with s3 buckets will be use this region. By default equal to `region`. -* **instanceType**: to specify s2 instance type. +* **instanceType**: to specify ec2 instance type. * **pilatesImageVersion**: to specify pilates image version, default is `latest`. * **pilatesImageName**: to specify full pilates image name, default is `beammodel/pilates`. @@ -344,7 +345,12 @@ There are 3 options to run Jupyter Notebook via Gradle task. ./gradlew jupyterStart -It will be run in the background. To stop it use command:: +There are some additional parameters that can control how Jupyter is started: + +* **jupyterToken**: to specify a custom token for Jupyter, if not set a random UUID will be generated as a token +* **user**: to specify a custom user for running Jupyter in Docker + +Jupyter will be run in the background. To stop it use command:: ./gradlew jupyterStop @@ -352,6 +358,21 @@ It will be run in the background. To stop it use command:: ./gradlew jupyterEC2 +Under the hood it will use `deploy` gradle task which will create a EC2 instance and will run the same `jupyterStart` +Gradle task there without starting the simulation. + +These are parameters for this task, many of them are inherited from `deploy` task: + +* **title**: To specify the custom title for this run, if not set 'jupyter' will be used +* **beamBranch**: To specify the branch for simulation, current source branch will be used as default branch. +* **storageSize**: to specify storage size of instance. May be from `64` to `256`. +* **instanceType**: to specify ec2 instance type. +* **region**: Use this parameter to select the AWS region for the run, all instances would be created in specified region. Default `region` is `us-east-2`. +* **shutdownBehaviour**: to specify shutdown behaviour after and of simulation. May be `stop` or `terminate`, default is `terminate`. +* **shutdownWait**: As simulation ends, ec2 instance would automatically terminate. In case you want to use the instance, please specify the wait in minutes, default wait is 30 min. +* **jupyter_token**: to specify a custom token for Jupyter, if not set a random UUID will be generated as a token +* **budgetOverride**: Set to `true` to override budget limitations, see `Documentation of AWS budget management` section in `DevOps guide `_, default is `false` + 3. Remotely on EC2 together with a simulation. Use `-PrunJupyter=true` option for deploy command. From 5d2c006eb7b9e25da5d51861f7b38b6001e44c08 Mon Sep 17 00:00:00 2001 From: Alvin Lee Jin Wen Date: Fri, 19 Aug 2022 09:31:06 +0800 Subject: [PATCH 303/307] added runtime validation (where household and plans are required in the old format) for legacy-beam-scenario-specific runs, while making these params optional in matsim.conf, so that we can reduce verbosity of config files 1) Scenario 1 - When: beam.conf or other legacy beam config not include household or plans - Expected result: run fails, letting user know what config params is missing. Simulation did not proceed. 2) Scenario 2 - When: urbanism-v2/conf or other new beam config not include household or plans - Expected result: run goes without error, simulation runs smoothly with expected result. --- src/main/scala/beam/sim/BeamHelper.scala | 15 +++-------- .../scala/beam/sim/BeamValidationHelper.scala | 26 +++++++++++++++++++ test/input/beamville/beam-urbansimv2.conf | 8 ------ test/input/common/matsim.conf | 8 +++--- 4 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 src/main/scala/beam/sim/BeamValidationHelper.scala diff --git a/src/main/scala/beam/sim/BeamHelper.scala b/src/main/scala/beam/sim/BeamHelper.scala index 5ff26b68a65..ef25b9d01a4 100755 --- a/src/main/scala/beam/sim/BeamHelper.scala +++ b/src/main/scala/beam/sim/BeamHelper.scala @@ -7,7 +7,7 @@ import beam.agentsim.agents.ridehail.{RideHailIterationHistory, RideHailSurgePri import beam.agentsim.agents.vehicles.VehicleCategory.MediumDutyPassenger import beam.agentsim.agents.vehicles._ import beam.agentsim.events.handling.BeamEventsHandling -import beam.agentsim.infrastructure.taz.{H3TAZ, TAZ, TAZTreeMap} +import beam.agentsim.infrastructure.taz.{H3TAZ, TAZTreeMap} import beam.analysis.ActivityLocationPlotter import beam.analysis.plots.{GraphSurgePricing, RideHailRevenueAnalysis} import beam.matsim.{CustomPlansDumpingImpl, MatsimConfigUpdater} @@ -38,13 +38,7 @@ import beam.utils.scenario.generic.GenericScenarioSource import beam.utils.scenario.matsim.BeamScenarioSource import beam.utils.scenario.urbansim.censusblock.{ScenarioAdjuster, UrbansimReaderV2} import beam.utils.scenario.urbansim.{CsvScenarioReader, ParquetScenarioReader, UrbanSimScenarioSource} -import beam.utils.scenario.{ - BeamScenarioLoader, - InputType, - PreviousRunPlanMerger, - ScenarioLoaderHelper, - UrbanSimScenarioLoader -} +import beam.utils.scenario._ import com.conveyal.r5.streets.StreetLayer import com.conveyal.r5.transit.TransportNetwork import com.fasterxml.jackson.databind.ObjectMapper @@ -55,7 +49,6 @@ import com.google.inject.name.Names import com.typesafe.config.{ConfigFactory, Config => TypesafeConfig} import com.typesafe.scalalogging.LazyLogging import kamon.Kamon -import org.matsim.api.core.v01.network.Link import org.matsim.api.core.v01.population.{Activity, Population} import org.matsim.api.core.v01.{Id, Scenario} import org.matsim.core.api.experimental.events.EventsManager @@ -66,7 +59,6 @@ import org.matsim.core.controler.corelisteners.{ControlerDefaultCoreListenersMod import org.matsim.core.events.ParallelEventsManagerImpl import org.matsim.core.scenario.{MutableScenario, ScenarioBuilder, ScenarioByInstanceModule, ScenarioUtils} import org.matsim.core.trafficmonitoring.TravelTimeCalculator -import org.matsim.core.utils.collections.QuadTree import org.matsim.households.Households import org.matsim.utils.objectattributes.AttributeConverter import org.matsim.vehicles.Vehicle @@ -82,7 +74,7 @@ import scala.concurrent.Await import scala.sys.process.Process import scala.util.{Random, Try} -trait BeamHelper extends LazyLogging { +trait BeamHelper extends LazyLogging with BeamValidationHelper { // Kamon.init() private val originalConfigLocationPath = "originalConfigLocation" @@ -889,6 +881,7 @@ trait BeamHelper extends LazyLogging { } (scenario, beamScenario, plansMerged) } else if (src == "beam") { + ensureRequiredValuesExist(matsimConfig) fileFormat match { case "csv" => val beamScenario = loadScenario(beamConfig, outputDirOpt) diff --git a/src/main/scala/beam/sim/BeamValidationHelper.scala b/src/main/scala/beam/sim/BeamValidationHelper.scala new file mode 100644 index 00000000000..3462b63faf5 --- /dev/null +++ b/src/main/scala/beam/sim/BeamValidationHelper.scala @@ -0,0 +1,26 @@ +package beam.sim + +import org.matsim.core.config.{Config => MatsimConfig} +import com.typesafe.scalalogging.LazyLogging + +trait BeamValidationHelper extends LazyLogging { + + def ensureRequiredValuesExist(matsimConfig: MatsimConfig): Unit = { + logger.info("ensureRequiredValuesExist() entry") + if (Option(matsimConfig.households().getInputFile).forall(_.isEmpty)) { + throw new RuntimeException("No households input file, please specify 'beam.agentsim.agents.households.inputFilePath' in your config file") + } + + if (Option(matsimConfig.households().getInputHouseholdAttributesFile).forall(_.isEmpty)) { + throw new RuntimeException("No households attributes file, please specify 'beam.agentsim.agents.households.inputHouseholdAttributesFilePath' in your config file") + } + + if (Option(matsimConfig.plans().getInputFile).forall(_.isEmpty)) { + throw new RuntimeException("No plans input file, please specify 'beam.agentsim.agents.plans.inputPlansFilePath' in your config file") + } + + if (Option(matsimConfig.plans().getInputPersonAttributeFile).forall(_.isEmpty)) { + throw new RuntimeException("No plans attributes file, please specify 'beam.agentsim.agents.plans.inputPersonAttributesFilePath' in your config file") + } + } +} diff --git a/test/input/beamville/beam-urbansimv2.conf b/test/input/beamville/beam-urbansimv2.conf index b6650697509..839ef066237 100755 --- a/test/input/beamville/beam-urbansimv2.conf +++ b/test/input/beamville/beam-urbansimv2.conf @@ -45,14 +45,6 @@ beam.agentsim.agents.tripBehaviors.multinomialLogit.trip_nest_scale_factor = 1.0 # beam.agentsim.agents.modeIncentive.filePath = ${beam.inputDirectory}"/incentives.csv" # beam.agentsim.agents.ptFare.filePath = ${beam.inputDirectory}"/ptFares.csv" -beam.agentsim.agents.plans { - inputPlansFilePath = ${beam.inputDirectory}"/population.xml" - inputPersonAttributesFilePath = ${beam.inputDirectory}"/populationAttributes.xml" -} -beam.agentsim.agents.households { - inputFilePath = ${beam.inputDirectory}"/households.xml" - inputHouseholdAttributesFilePath = ${beam.inputDirectory}"/householdAttributes.xml" -} # #BeamVehicles Params beam.agentsim.agents.vehicles.linkToGradePercentFilePath = ${beam.inputDirectory}"/linkToGradePercent.csv" beam.agentsim.agents.vehicles.fuelTypesFilePath = ${beam.inputDirectory}"/beamFuelTypes.csv" diff --git a/test/input/common/matsim.conf b/test/input/common/matsim.conf index a1914c6a7a3..780a52338fa 100644 --- a/test/input/common/matsim.conf +++ b/test/input/common/matsim.conf @@ -33,12 +33,12 @@ matsim.modules { inputNetworkFile = ${beam.physsim.inputNetworkFilePath} } plans { - inputPlansFile = ${beam.agentsim.agents.plans.inputPlansFilePath} - inputPersonAttributesFile = ${beam.agentsim.agents.plans.inputPersonAttributesFilePath} + inputPlansFile = ${?beam.agentsim.agents.plans.inputPlansFilePath} + inputPersonAttributesFile = ${?beam.agentsim.agents.plans.inputPersonAttributesFilePath} } households { - inputFile = ${beam.agentsim.agents.households.inputFilePath} - inputHouseholdAttributesFile = ${beam.agentsim.agents.households.inputHouseholdAttributesFilePath} + inputFile = ${?beam.agentsim.agents.households.inputFilePath} + inputHouseholdAttributesFile = ${?beam.agentsim.agents.households.inputHouseholdAttributesFilePath} } strategy { maxAgentPlanMemorySize = ${beam.replanning.maxAgentPlanMemorySize} From 0cfec125acff967f0c4f33ab5c99e55c8665501d Mon Sep 17 00:00:00 2001 From: Alvin Lee Jin Wen Date: Fri, 19 Aug 2022 22:41:32 +0800 Subject: [PATCH 304/307] fix formatter error --- .../scala/beam/sim/BeamValidationHelper.scala | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/scala/beam/sim/BeamValidationHelper.scala b/src/main/scala/beam/sim/BeamValidationHelper.scala index 3462b63faf5..1a6d45bff31 100644 --- a/src/main/scala/beam/sim/BeamValidationHelper.scala +++ b/src/main/scala/beam/sim/BeamValidationHelper.scala @@ -5,22 +5,30 @@ import com.typesafe.scalalogging.LazyLogging trait BeamValidationHelper extends LazyLogging { - def ensureRequiredValuesExist(matsimConfig: MatsimConfig): Unit = { + def ensureRequiredValuesExist(matsimConfig: MatsimConfig): Unit = { logger.info("ensureRequiredValuesExist() entry") if (Option(matsimConfig.households().getInputFile).forall(_.isEmpty)) { - throw new RuntimeException("No households input file, please specify 'beam.agentsim.agents.households.inputFilePath' in your config file") + throw new RuntimeException( + "No households input file, please specify 'beam.agentsim.agents.households.inputFilePath' in your config file" + ) } if (Option(matsimConfig.households().getInputHouseholdAttributesFile).forall(_.isEmpty)) { - throw new RuntimeException("No households attributes file, please specify 'beam.agentsim.agents.households.inputHouseholdAttributesFilePath' in your config file") + throw new RuntimeException( + "No households attributes file, please specify 'beam.agentsim.agents.households.inputHouseholdAttributesFilePath' in your config file" + ) } if (Option(matsimConfig.plans().getInputFile).forall(_.isEmpty)) { - throw new RuntimeException("No plans input file, please specify 'beam.agentsim.agents.plans.inputPlansFilePath' in your config file") + throw new RuntimeException( + "No plans input file, please specify 'beam.agentsim.agents.plans.inputPlansFilePath' in your config file" + ) } if (Option(matsimConfig.plans().getInputPersonAttributeFile).forall(_.isEmpty)) { - throw new RuntimeException("No plans attributes file, please specify 'beam.agentsim.agents.plans.inputPersonAttributesFilePath' in your config file") + throw new RuntimeException( + "No plans attributes file, please specify 'beam.agentsim.agents.plans.inputPersonAttributesFilePath' in your config file" + ) } } } From f08ce161165866b33809ba8af9ffb4262a9eb0c8 Mon Sep 17 00:00:00 2001 From: Alvin Lee Jin Wen Date: Fri, 19 Aug 2022 23:03:43 +0800 Subject: [PATCH 305/307] test! --- src/main/scala/beam/sim/RunBeam.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/beam/sim/RunBeam.scala b/src/main/scala/beam/sim/RunBeam.scala index 8a2ff646523..74522a69a2a 100755 --- a/src/main/scala/beam/sim/RunBeam.scala +++ b/src/main/scala/beam/sim/RunBeam.scala @@ -32,7 +32,7 @@ object RunBeam extends BeamHelper { case e: Exception => val threadDumpFileName = "thread_dump_from_RunBeam.txt.gz" println(s"Exception occurred: ${e.toString}") - logger.error(s"Exception occurred: {}", e.getMessage) + logger.error("Exception occurred:", e) FileUtils.writeToFile(threadDumpFileName, DebugLib.currentThreadsDump().asScala.iterator) logger.info("Thread dump has been saved to the file {}", threadDumpFileName) System.exit(2) From 5fecbdf05de7630e211297faee0bc36766753e3f Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Mon, 22 Aug 2022 15:20:55 +0600 Subject: [PATCH 306/307] Remove obsolete maven repositories Also set mokito version to a fixed one to avoid excessive resolving. --- build.gradle | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index bdc068ab2f4..043eea43513 100755 --- a/build.gradle +++ b/build.gradle @@ -96,7 +96,6 @@ allprojects { // maven { url "http://maven.icm.edu.pl/artifactory/repo/" } // maven { url "https://maven.geotoolkit.org/" } maven { url "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases" } - maven { url "https://central.maven.org/maven2" } maven { url "https://repo.maven.apache.org/maven2" } maven { url "https://repo.matsim.org/repository/matsim" } // Used for graphql-java and matsim.contrib.decongestion specific versions - @@ -110,10 +109,6 @@ allprojects { maven { url "https://people.apache.org/repo/m1-ibiblio-rsync-repository/org.apache.axis2/" } maven { url "https://maven.geo-solutions.it" } mavenLocal() - maven { - url "http://nexus.onebusaway.org/content/groups/public/" - allowInsecureProtocol = true - } maven { url "https://jitpack.io" } } } @@ -215,7 +210,7 @@ dependencies { testImplementation group: 'junit', name: 'junit', version: '4.8' testImplementation group: 'org.mockito', name: 'mockito-inline', version: '2.27.0' - testImplementation group: "org.mockito", name: "mockito-core", version: "2.+" + testImplementation group: "org.mockito", name: "mockito-core", version: "2.28.2" jmhImplementation group: 'org.openjdk.jmh', name: 'jmh-core', version: '1.23' jmhImplementation group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: '1.23' From 8fe948e9773589a8aa4e15f049e376936907cd68 Mon Sep 17 00:00:00 2001 From: Alexander Vykhodtsev Date: Tue, 23 Aug 2022 17:14:08 +0600 Subject: [PATCH 307/307] Fix skimTypes for skimmers --- src/main/scala/beam/router/skim/core/FreightSkimmer.scala | 2 +- src/main/scala/beam/router/skim/core/ParkingSkimmer.scala | 2 +- src/main/scala/beam/router/skim/core/RideHailSkimmer.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/beam/router/skim/core/FreightSkimmer.scala b/src/main/scala/beam/router/skim/core/FreightSkimmer.scala index 941bad2630c..8300f47144c 100644 --- a/src/main/scala/beam/router/skim/core/FreightSkimmer.scala +++ b/src/main/scala/beam/router/skim/core/FreightSkimmer.scala @@ -24,7 +24,7 @@ class FreightSkimmer @Inject() ( override protected val skimFileHeader = "tazId,hour,numberOfLoadings,numberOfUnloadings,costPerMile,walkAccessDistanceInM,parkingCostPerHour,observations,iterations" override protected val skimName: String = FreightSkimmer.name - override protected val skimType: Skims.SkimType.Value = Skims.SkimType.TC_SKIMMER + override protected val skimType: Skims.SkimType.Value = Skims.SkimType.FREIGHT_SKIMMER override protected def fromCsv( line: collection.Map[String, String] diff --git a/src/main/scala/beam/router/skim/core/ParkingSkimmer.scala b/src/main/scala/beam/router/skim/core/ParkingSkimmer.scala index 189327de19d..67313f0723a 100644 --- a/src/main/scala/beam/router/skim/core/ParkingSkimmer.scala +++ b/src/main/scala/beam/router/skim/core/ParkingSkimmer.scala @@ -28,7 +28,7 @@ class ParkingSkimmer @Inject() ( override protected val skimFileHeader = "tazId,hour,chargerType,walkAccessDistanceInM,parkingCostPerHour,observations,iterations" override protected val skimName: String = ParkingSkimmer.name - override protected val skimType: Skims.SkimType.Value = Skims.SkimType.TC_SKIMMER + override protected val skimType: Skims.SkimType.Value = Skims.SkimType.PARKING_SKIMMER override protected def fromCsv( line: collection.Map[String, String] diff --git a/src/main/scala/beam/router/skim/core/RideHailSkimmer.scala b/src/main/scala/beam/router/skim/core/RideHailSkimmer.scala index eb2fb232f6e..0631b37794e 100644 --- a/src/main/scala/beam/router/skim/core/RideHailSkimmer.scala +++ b/src/main/scala/beam/router/skim/core/RideHailSkimmer.scala @@ -26,7 +26,7 @@ class RideHailSkimmer @Inject() ( override protected val skimFileHeader = "tazId,hour,reservationType,waitTime,costPerMile,unmatchedRequestsPercent,observations,iterations" override protected val skimName: String = RideHailSkimmer.name - override protected val skimType: Skims.SkimType.Value = Skims.SkimType.TC_SKIMMER + override protected val skimType: Skims.SkimType.Value = Skims.SkimType.RH_SKIMMER override protected def fromCsv( line: collection.Map[String, String]